mirror of
https://github.com/Indy970/QtHPConnect
synced 2024-12-26 21:59:23 +01:00
Update
This commit is contained in:
parent
880a2f2b89
commit
41aed16567
51 changed files with 1009 additions and 34 deletions
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <QDebug>
|
||||
#include <QTextCodec>
|
||||
#include <QtMath>
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ABSTRACTDATA_H
|
||||
#define ABSTRACTDATA_H
|
||||
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <global.h>
|
||||
#include <cntfilesystemmodel.h>
|
||||
#include <QMimeData>
|
||||
|
@ -310,6 +327,23 @@ int contentFileSystemModel::writeFile(QFileInfo fileinfo, QByteArray data_in) co
|
|||
return -1;
|
||||
}
|
||||
|
||||
void contentFileSystemModel::createNewFolder() {
|
||||
|
||||
qDebug()<<"Create new folder pressed";
|
||||
return;
|
||||
}
|
||||
|
||||
void contentFileSystemModel::createNewProgram() {
|
||||
|
||||
qDebug()<<"Create new program pressed";
|
||||
return;
|
||||
}
|
||||
|
||||
void contentFileSystemModel::createNewNote() {
|
||||
|
||||
qDebug()<<"Create new note pressed";
|
||||
return;
|
||||
}
|
||||
|
||||
hp_DataStruct contentFileSystemModel::getFileType(QFileInfo info) const {
|
||||
hp_DataStruct filedata;
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONTENTFILESYSTEMMODEL_H
|
||||
#define CONTENTFILESYSTEMMODEL_H
|
||||
#include <QObject>
|
||||
|
@ -29,6 +46,9 @@ public:
|
|||
QString getFileType(hp_DataType) const;
|
||||
AbstractData * readFile(QFileInfo fileinfo) const;
|
||||
int writeFile(QFileInfo fileinfo, QByteArray data_in) const;
|
||||
void createNewFolder();
|
||||
void createNewNote();
|
||||
void createNewProgram();
|
||||
~contentFileSystemModel();
|
||||
|
||||
private:
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "datamodel.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
|
17
datamodel.h
17
datamodel.h
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef DATAMODEL_H
|
||||
#define DATAMODEL_H
|
||||
|
||||
|
|
|
@ -1,6 +1,19 @@
|
|||
//
|
||||
// Error Handler
|
||||
//
|
||||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "errorhandler.h"
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef ERRORHANDLER_H
|
||||
#define ERRORHANDLER_H
|
||||
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "eventthread.h"
|
||||
#include <mainwindow.h>
|
||||
#include <QDebug>
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef EVENTTHREAD_H
|
||||
#define EVENTTHREAD_H
|
||||
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "eventtimer.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
|
|
17
eventtimer.h
17
eventtimer.h
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef EVENTTIMER_H
|
||||
#define EVENTTIMER_H
|
||||
#include <QThread>
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "getnumber.h"
|
||||
#include "ui_getnumber.h"
|
||||
#include <QDebug>
|
||||
|
|
17
getnumber.h
17
getnumber.h
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GETNUMBER_H
|
||||
#define GETNUMBER_H
|
||||
|
||||
|
|
17
global.h
17
global.h
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GLOBAL_H
|
||||
#define GLOBAL_H
|
||||
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "hp_infodialog.h"
|
||||
#include "ui_hp_infodialog.h"
|
||||
#include <QDebug>
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef HP_INFODIALOG_H
|
||||
#define HP_INFODIALOG_H
|
||||
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "hp_mditexteditor.h"
|
||||
#include "hptreeitem.h"
|
||||
#include "hpdata.h"
|
||||
|
@ -10,7 +28,7 @@ hp_mdiTextEdit::hp_mdiTextEdit(QWidget * parent,hpTreeItem * treeItem, AbstractD
|
|||
setMaximumSize(1000,1000);
|
||||
setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
|
||||
|
||||
qDebug()<<"hp_mdiTextEdit::hp_mdiTextEdit";
|
||||
qDebug()<<"hp_mdiTextEdit::hp_mdiTextEdit";
|
||||
hptreeitem=treeItem;
|
||||
data = calcData;
|
||||
qDebug()<<data->getName();
|
||||
|
@ -56,13 +74,15 @@ void hp_mdiTextEdit::setup() {
|
|||
}
|
||||
|
||||
if (data->getType()==HP_PROG) {
|
||||
Program *note;
|
||||
note=static_cast<Program *>(data);
|
||||
text=note->getProg();
|
||||
Program *prog;
|
||||
prog=static_cast<Program *>(data);
|
||||
text=prog->getProg();
|
||||
textEdit->setDocumentTitle(prog->getName());
|
||||
}
|
||||
qDebug()<<text;
|
||||
|
||||
textEdit->setPlainText(text);
|
||||
|
||||
}
|
||||
else {
|
||||
qDebug()<<"hp_mdiTextEdit::setup - Data Null";
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef HP_MDITEXTEDITOR_H
|
||||
#define HP_MDITEXTEDITOR_H
|
||||
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "hp_mdivariableedit.h"
|
||||
#include "hptreeitem.h"
|
||||
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef HP_MDIVARIABLEEDIT_H
|
||||
#define HP_MDIVARIABLEEDIT_H
|
||||
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "hp_mdiwindow.h"
|
||||
#include <QDebug>
|
||||
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef HP_MDIWINDOW_H
|
||||
#define HP_MDIWINDOW_H
|
||||
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
<ui version="4.0">
|
||||
<class>hp_MdiWindow</class>
|
||||
<widget class="QMainWindow" name="hp_MdiWindow">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "hp_settingsdlg.h"
|
||||
#include "ui_hp_settingsdlg.h"
|
||||
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef DLGSETTINGS_H
|
||||
#define DLGSETTINGS_H
|
||||
|
||||
|
|
17
hp_typedef.h
17
hp_typedef.h
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef HP_TYPEDEF_H
|
||||
#define HP_TYPEDEF_H
|
||||
|
||||
|
|
32
hpdata.cpp
32
hpdata.cpp
|
@ -91,25 +91,45 @@ void hpCalcData::addData(AbstractData * data) {
|
|||
lData.append(data);
|
||||
}
|
||||
|
||||
void hpCalcData::deleteData(AbstractData *) {
|
||||
void hpCalcData::deleteData(AbstractData * data) {
|
||||
// lData.erase();
|
||||
qDebug()<<"hpCalcData::deleteData - functionality requierd";
|
||||
if (data!=nullptr) {
|
||||
QString name=data->getName();
|
||||
hp_DataType type=data->getType();
|
||||
QList<AbstractData *>::iterator i;
|
||||
i=findData(name,type);
|
||||
|
||||
lData.erase(i);
|
||||
delete data;
|
||||
qDebug()<<"hpCalcData::deleteData - Object Deleted";
|
||||
}
|
||||
else {
|
||||
qDebug()<<"hpCalcData::deleteData - Object not deleted";
|
||||
}
|
||||
}
|
||||
|
||||
//returns position of entry in list or returns 0;
|
||||
int hpCalcData::findData(QString name, hp_DataType dataType) {
|
||||
QList<AbstractData *>::iterator hpCalcData::findData(QString name, hp_DataType dataType) {
|
||||
|
||||
for (int i = 0; i < lData.size(); ++i) {
|
||||
if (lData.at(i)->equivalent(name,dataType))
|
||||
QList<AbstractData *>::iterator i;
|
||||
AbstractData * ldata;
|
||||
|
||||
i = lData.begin();
|
||||
while (i!= lData.end()) {
|
||||
ldata=*i;
|
||||
if (ldata->equivalent(name,dataType)) {
|
||||
return i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//returns position of entry in list or returns 0;
|
||||
AbstractData * hpCalcData::getData(QString name, hp_DataType dataType) {
|
||||
|
||||
|
||||
for (int i = 0; i < lData.size(); ++i) {
|
||||
if (lData.at(i)->equivalent(name,dataType)) {
|
||||
|
||||
|
|
20
hpdata.h
20
hpdata.h
|
@ -1,9 +1,27 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef HPDATA_H
|
||||
#define HPDATA_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include <iterator>
|
||||
#include "hpusb.h"
|
||||
#include "abstractdata.h"
|
||||
#include "hp_typedef.h"
|
||||
|
@ -70,7 +88,7 @@ public:
|
|||
void refresh();
|
||||
void addData(AbstractData *);
|
||||
void deleteData(AbstractData *);
|
||||
int findData(QString name, hp_DataType dataType);
|
||||
QList<AbstractData *>::iterator findData(QString name, hp_DataType dataType);
|
||||
AbstractData * getData(QString name, hp_DataType dataType);
|
||||
AbstractData * dataAt(int i);
|
||||
int dataCount();
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "hptreeitem.h"
|
||||
#include "global.h"
|
||||
#include "hpdata.h"
|
||||
|
@ -46,10 +63,7 @@ hpTreeItem::hpTreeItem()
|
|||
}
|
||||
|
||||
|
||||
bool hpTreeItem::dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent) {
|
||||
|
||||
qDebug()<<"hpTreeItem::dropMimeData";
|
||||
}
|
||||
|
||||
hpTreeItem::hpTreeItem(const QString & name,hpCalcData * hpDataStore,int flag)
|
||||
:QStandardItem(name)
|
||||
|
@ -66,6 +80,11 @@ hpTreeItem::hpTreeItem(const QString & name,hpCalcData * hpDataStore,int flag)
|
|||
setGraphicTree();
|
||||
}
|
||||
|
||||
bool hpTreeItem::dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent) {
|
||||
|
||||
qDebug()<<"hpTreeItem::dropMimeData";
|
||||
}
|
||||
|
||||
QStandardItem * hpTreeItem::clone() const {
|
||||
//return new hpTreeItem(QStringLiteral("test"),getDataStore(),0);
|
||||
}
|
||||
|
@ -121,7 +140,7 @@ void hpTreeItem::clickAction(QMdiArea * mdiwin) {
|
|||
if (calc) {
|
||||
data=calc->getData(getFileName(),HP_COMPLEX);
|
||||
}
|
||||
if (data) {
|
||||
if (data!=nullptr) {
|
||||
hpvaredit = new hp_mdiVariableEdit(mdiwin,this,calc);
|
||||
}
|
||||
}
|
||||
|
@ -132,7 +151,7 @@ void hpTreeItem::clickAction(QMdiArea * mdiwin) {
|
|||
if (calc) {
|
||||
data=calc->getData(getFileName(),HP_COMPLEX);
|
||||
}
|
||||
if (data) {
|
||||
if (data!=nullptr) {
|
||||
hpvaredit = new hp_mdiVariableEdit(mdiwin,this,calc);
|
||||
}
|
||||
}
|
||||
|
@ -156,7 +175,7 @@ void hpTreeItem::clickAction(QMdiArea * mdiwin) {
|
|||
if (calc) {
|
||||
data=calc->getData(getFileName(),HP_MATRIX);
|
||||
}
|
||||
if (data) {
|
||||
if (data!=nullptr) {
|
||||
hpvaredit = new hp_mdiVariableEdit(mdiwin,this,calc);
|
||||
}
|
||||
}
|
||||
|
@ -177,7 +196,7 @@ void hpTreeItem::clickAction(QMdiArea * mdiwin) {
|
|||
hptextedit=nullptr;
|
||||
|
||||
|
||||
if (hptextedit==nullptr)
|
||||
if ((hptextedit==nullptr)&&(data!=nullptr))
|
||||
hptextedit = new hp_mdiTextEdit(mdiwin,this, data);
|
||||
if (hptextedit!=nullptr)
|
||||
hptextedit ->show();
|
||||
|
@ -188,15 +207,17 @@ void hpTreeItem::clickAction(QMdiArea * mdiwin) {
|
|||
AbstractData * data =nullptr;
|
||||
dataStore = getDataStore();
|
||||
qDebug()<<"HP_Prog ... click"<<getFileName();
|
||||
if (dataStore) {
|
||||
if (dataStore!=nullptr) {
|
||||
data=dataStore->getData(getFileName(),getType());
|
||||
qDebug()<<data->getName();
|
||||
if(data!=nullptr) {
|
||||
qDebug()<<data->getName();
|
||||
}
|
||||
}
|
||||
|
||||
//To fix by having hp_mdi reset
|
||||
hptextedit=nullptr;
|
||||
|
||||
if (hptextedit==nullptr) {
|
||||
if ((hptextedit==nullptr)&&(data!=nullptr)) {
|
||||
hptextedit = new hp_mdiTextEdit(mdiwin,this, data);
|
||||
}
|
||||
if (hptextedit!=nullptr)
|
||||
|
@ -208,7 +229,7 @@ void hpTreeItem::clickAction(QMdiArea * mdiwin) {
|
|||
if (calc) {
|
||||
data=calc->getData(getFileName(),HP_REAL);
|
||||
}
|
||||
if (data) {
|
||||
if (data!=nullptr) {
|
||||
hpvaredit = new hp_mdiVariableEdit(mdiwin,this,calc);
|
||||
}
|
||||
}
|
||||
|
|
17
hptreeitem.h
17
hptreeitem.h
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef HPTREEITEM_H
|
||||
#define HPTREEITEM_H
|
||||
|
||||
|
|
17
hpusb.h
17
hpusb.h
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef HPUSB_H
|
||||
#define HPUSB_H
|
||||
|
||||
|
|
17
main.cpp
17
main.cpp
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
|
|
17
main.h
17
main.h
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef MAIN_H
|
||||
#define MAIN_H
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* QtHP Connect: hand-helds support interface.
|
||||
* QtHP Connect: hand-helds support interface. (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (C) 2019 Ian Gebbie
|
||||
* Code patterns and snippets borrowed from libhpcalcs :
|
||||
* Copyright (C) 1999-2009 Romain Li<EFBFBD>vin
|
||||
|
@ -32,6 +32,7 @@
|
|||
#include <QTextStream>
|
||||
#include <QTimer>
|
||||
#include <QFileIconProvider>
|
||||
#include <QToolButton>
|
||||
|
||||
#include "global.h"
|
||||
#include "hpusb.h"
|
||||
|
@ -85,6 +86,30 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
setTreeMenu();
|
||||
setContentWindow();
|
||||
|
||||
|
||||
//create some sub menus
|
||||
|
||||
QToolButton *createNewButton=
|
||||
dynamic_cast<QToolButton*>(ui->toolBar->widgetForAction(ui->actionCreateNew));
|
||||
createNewButton->setPopupMode(QToolButton::InstantPopup);
|
||||
QMenu *createMenu=new QMenu(createNewButton);
|
||||
|
||||
QIcon folder(":/icons/new_folder_16x16.png");
|
||||
QAction * actionNewFolder= new QAction(folder,"Folder",this);
|
||||
|
||||
QIcon note(":/icons/note_16x16.png");
|
||||
QAction * actionNewNote= new QAction(note,"Note",this);
|
||||
|
||||
QIcon program(":/icons/program_16x16.png");
|
||||
QAction * actionNewProgram= new QAction(program,"Program",this);
|
||||
|
||||
createMenu->addAction(actionNewFolder);
|
||||
createMenu->addAction(actionNewNote);
|
||||
createMenu->addAction(actionNewProgram);
|
||||
|
||||
createNewButton->setMenu(createMenu);
|
||||
|
||||
|
||||
//Hack to fix QT resizing bug
|
||||
resizeDocks({ui->dwCalculator,ui->dwContent},{0,0}, Qt::Horizontal);
|
||||
|
||||
|
@ -107,6 +132,13 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
connect(ui->actionCalculators,SIGNAL(triggered()),this,SLOT(showCalculator()));
|
||||
connect(ui->actionMessages,SIGNAL(triggered()),this,SLOT(showMessage()));
|
||||
connect(ui->actionMonitor,SIGNAL(triggered()),this,SLOT(showMonitor()));
|
||||
|
||||
connect(ui->actionSave,SIGNAL(triggered()),this,SLOT(eventSave()));
|
||||
connect(ui->actionSave_All,SIGNAL(triggered()),this,SLOT(eventSaveAs()));
|
||||
connect(actionNewFolder,SIGNAL(triggered()),this,SLOT(eventCreateFolder()));
|
||||
connect(actionNewNote,SIGNAL(triggered()),this,SLOT(eventCreateNote()));
|
||||
connect(actionNewProgram,SIGNAL(triggered()),this,SLOT(eventCreateProgram()));
|
||||
|
||||
connect(ui->tvCalculators,SIGNAL(clicked(QModelIndex)),this,SLOT(clickedCalculator(QModelIndex)));
|
||||
connect(ui->tvContent,SIGNAL(clicked(QModelIndex)),this,SLOT(clickedContent(QModelIndex)));
|
||||
connect(ui->actionLog,SIGNAL(triggered()),this,SLOT(createLogWindow()));
|
||||
|
@ -313,7 +345,12 @@ void MainWindow::selectionChangedSlot(const QItemSelection & /*newSelection*/, c
|
|||
|
||||
void MainWindow::clickedCalculator(QModelIndex index) {
|
||||
|
||||
QStandardItem * item = hpTreeModel->itemFromIndex(index);
|
||||
// QStandardItem * item = hpTreeModel->itemFromIndex(index);
|
||||
|
||||
if (hpTreeModel!=nullptr) {
|
||||
hpTreeModel->clickAction(getMdi(),index);
|
||||
}
|
||||
/*
|
||||
|
||||
hpTreeItem * treeItem = dynamic_cast<hpTreeItem *>(hpTreeModel->itemFromIndex(index));
|
||||
|
||||
|
@ -330,10 +367,40 @@ void MainWindow::clickedCalculator(QModelIndex index) {
|
|||
}
|
||||
|
||||
//HACK
|
||||
lastCalc=item->data(Qt::DisplayRole).toString();
|
||||
log(item->data(Qt::DisplayRole).toString());
|
||||
lastCalc=treeItem->data(Qt::DisplayRole).toString();
|
||||
log(treeItem->data(Qt::DisplayRole).toString());
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::eventSave() {
|
||||
|
||||
qDebug()<<"Save Pressed";
|
||||
}
|
||||
|
||||
void MainWindow::eventSaveAs() {
|
||||
|
||||
qDebug()<<"Save As Pressed";
|
||||
}
|
||||
|
||||
void MainWindow::eventCreateFolder() {
|
||||
|
||||
return contentModel.createNewFolder();
|
||||
}
|
||||
|
||||
void MainWindow::eventCreateNote() {
|
||||
|
||||
qDebug()<<"Create new note pressed";
|
||||
}
|
||||
|
||||
void MainWindow::eventCreateProgram() {
|
||||
|
||||
qDebug()<<"Create new program pressed";
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::clickedContent(QModelIndex index) {
|
||||
|
||||
contentModel.clickAction(getMdi(),index);
|
||||
|
|
24
mainwindow.h
24
mainwindow.h
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QItemSelection>
|
||||
#include <QModelIndex>
|
||||
|
@ -66,6 +83,13 @@ private slots:
|
|||
void writeSettings();
|
||||
void readSettings();
|
||||
void setTimerStopped();
|
||||
|
||||
void eventSave();
|
||||
void eventSaveAs();
|
||||
void eventCreateFolder();
|
||||
void eventCreateNote();
|
||||
void eventCreateProgram();
|
||||
|
||||
treeModel * getTreeModel();
|
||||
|
||||
void treeMenuAction(bool);
|
||||
|
|
|
@ -152,6 +152,9 @@
|
|||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QTreeView" name="tvCalculators">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
|
@ -468,6 +471,9 @@
|
|||
<property name="text">
|
||||
<string>CreateNew</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create New </string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExit">
|
||||
<property name="icon">
|
||||
|
@ -652,6 +658,28 @@
|
|||
<string>Alt+R</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNewFolder">
|
||||
<property name="icon">
|
||||
<iconset resource="qthpconnect.qrc">
|
||||
<normaloff>:/icons/new_folder_16x16.png</normaloff>:/icons/new_folder_16x16.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Folder</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create a New Folder</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNew_Note">
|
||||
<property name="text">
|
||||
<string>New Note</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionNew_Program">
|
||||
<property name="text">
|
||||
<string>New Program</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
|
|
|
@ -1,3 +1,23 @@
|
|||
/*
|
||||
* QtHP Connect: hand-helds support interface.
|
||||
* Copyright (C) 2019 Ian Gebbie
|
||||
* Code patterns and snippets borrowed from libhpcalcs :
|
||||
* Copyright (C) 1999-2009 Romain Li<EFBFBD>vin
|
||||
* Copyright (C) 2009-2013 Lionel Debroux
|
||||
* Copyright (C) 1999-2013 libti* contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <QDebug>
|
||||
#include "matrixdata.h"
|
||||
|
||||
|
|
17
matrixdata.h
17
matrixdata.h
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef MATRIXDATA_H
|
||||
#define MATRIXDATA_H
|
||||
|
||||
|
|
20
options.cpp
20
options.cpp
|
@ -1,3 +1,23 @@
|
|||
/*
|
||||
* QtHP Connect: hand-helds support interface.
|
||||
* Copyright (C) 2019 Ian Gebbie
|
||||
* Code patterns and snippets borrowed from libhpcalcs :
|
||||
* Copyright (C) 1999-2009 Romain Li<EFBFBD>vin
|
||||
* Copyright (C) 2009-2013 Lionel Debroux
|
||||
* Copyright (C) 1999-2013 libti* contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "options.h"
|
||||
#include "ui_options.h"
|
||||
#include "global.h"
|
||||
|
|
17
options.h
17
options.h
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPTIONS_H
|
||||
#define OPTIONS_H
|
||||
|
||||
|
|
|
@ -1,14 +1,37 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "texteditor.h"
|
||||
#include <QtWidgets>
|
||||
#include <QRect>
|
||||
#include <QSettings>
|
||||
|
||||
textEditor::textEditor(QWidget *parent) :
|
||||
QTextEdit(parent)
|
||||
{
|
||||
QSettings appSettings("IRGP","QtHPconnect");
|
||||
wParent = parent;
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
|
||||
isUntitled = true;
|
||||
|
||||
defaultPath=QDir(appSettings.value("contentPath").toString());
|
||||
qDebug()<<defaultPath;
|
||||
}
|
||||
|
||||
void textEditor::newFile()
|
||||
|
@ -58,8 +81,10 @@ bool textEditor::save()
|
|||
|
||||
bool textEditor::saveAs()
|
||||
{
|
||||
QFileInfo fileinfo(defaultPath,curFile);
|
||||
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
|
||||
curFile);
|
||||
fileinfo.absoluteFilePath());
|
||||
if (fileName.isEmpty())
|
||||
return false;
|
||||
|
||||
|
@ -68,7 +93,8 @@ bool textEditor::saveAs()
|
|||
|
||||
bool textEditor::saveFile(const QString &fileName)
|
||||
{
|
||||
QFile file(fileName);
|
||||
QFileInfo fileinfo(defaultPath,fileName);
|
||||
QFile file(fileinfo.absoluteFilePath());
|
||||
if (!file.open(QFile::WriteOnly | QFile::Text)) {
|
||||
QMessageBox::warning(this, tr("MDI"),
|
||||
tr("Cannot write file %1:\n%2.")
|
||||
|
@ -108,6 +134,7 @@ bool textEditor::maybeSave()
|
|||
{
|
||||
if (!document()->isModified())
|
||||
return true;
|
||||
|
||||
const QMessageBox::StandardButton ret
|
||||
= QMessageBox::warning(this, tr("MDI"),
|
||||
tr("'%1' has been modified.\n"
|
||||
|
|
19
texteditor.h
19
texteditor.h
|
@ -1,7 +1,25 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef TEXTEDITOR_H
|
||||
#define TEXTEDITOR_H
|
||||
|
||||
#include <QTextEdit>
|
||||
#include <QDir>
|
||||
|
||||
|
||||
class textEditor : public QTextEdit
|
||||
|
@ -34,6 +52,7 @@ private:
|
|||
|
||||
QString curFile;
|
||||
bool isUntitled;
|
||||
QDir defaultPath;
|
||||
};
|
||||
|
||||
#endif // TEXTEDITOR_H
|
||||
|
|
|
@ -1,3 +1,25 @@
|
|||
/*
|
||||
* QtHP Connect: hand-helds support interface.
|
||||
* Copyright (C) 2019 Ian Gebbie
|
||||
* Code patterns and snippets borrowed from libhpcalcs :
|
||||
* Copyright (C) 1999-2009 Romain Li<EFBFBD>vin
|
||||
* Copyright (C) 2009-2013 Lionel Debroux
|
||||
* Copyright (C) 1999-2013 libti* contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Model to contain the calculator data structure
|
||||
//
|
||||
|
@ -91,6 +113,7 @@ hpCalcData * treeModel::getCalculator(QString name){
|
|||
|
||||
void treeModel::clickAction(QMdiArea * mdiwin,QModelIndex &index) {
|
||||
|
||||
qDebug()<<"row "<<index.row()<<" column "<<index.column();
|
||||
return openFile(mdiwin,index);
|
||||
}
|
||||
|
||||
|
@ -125,6 +148,7 @@ void treeModel::renameFile(QModelIndex &index,QString newName) {
|
|||
hp_DataType type;
|
||||
hpCalcData * hpdata=nullptr;
|
||||
|
||||
qDebug()<<"row "<<index.row()<<" column "<<index.column();
|
||||
if (index.isValid()) {
|
||||
item = static_cast<hpTreeItem *>(itemFromIndex(index));
|
||||
|
||||
|
@ -186,12 +210,18 @@ void treeModel::deleteFile( QModelIndex &index) {
|
|||
|
||||
//
|
||||
//delete hpTreeItem
|
||||
// qDebug()<<"row "<<index.row()<<" column "<<index.column();
|
||||
if (removeRow(index.row(),index.parent()))
|
||||
{
|
||||
//qDebug()<<"Deleted";
|
||||
}
|
||||
else {
|
||||
qDebug()<<"Removal failed";
|
||||
}
|
||||
|
||||
//delete Data
|
||||
hpdata->deleteData(adata);
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
qDebug()<<"Null data";
|
||||
|
|
17
treemodel.h
17
treemodel.h
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef TREEMODEL_H
|
||||
#define TREEMODEL_H
|
||||
|
||||
|
|
|
@ -1,3 +1,24 @@
|
|||
/*
|
||||
* QtHP Connect: hand-helds support interface.
|
||||
* Copyright (C) 2019 Ian Gebbie
|
||||
* Code patterns and snippets borrowed from libhpcalcs :
|
||||
* Copyright (C) 1999-2009 Romain Li<EFBFBD>vin
|
||||
* Copyright (C) 2009-2013 Lionel Debroux
|
||||
* Copyright (C) 1999-2013 libti* contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "variableview.h"
|
||||
#include "ui_variableview.h"
|
||||
#include <QDebug>
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef VARIABLEVIEW_H
|
||||
#define VARIABLEVIEW_H
|
||||
|
||||
|
|
|
@ -15,7 +15,11 @@
|
|||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTableView" name="variableList"/>
|
||||
<widget class="QTableView" name="variableList">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
|
@ -1,3 +1,24 @@
|
|||
/*
|
||||
* QtHP Connect: hand-helds support interface.
|
||||
* Copyright (C) 2019 Ian Gebbie
|
||||
* Code patterns and snippets borrowed from libhpcalcs :
|
||||
* Copyright (C) 1999-2009 Romain Li<EFBFBD>vin
|
||||
* Copyright (C) 2009-2013 Lionel Debroux
|
||||
* Copyright (C) 1999-2013 libti* contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "global.h"
|
||||
#include "vartablemodel.h"
|
||||
#include "abstractdata.h"
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef VARTABLEMODEL_H
|
||||
#define VARTABLEMODEL_H
|
||||
|
||||
|
|
17
version.h
17
version.h
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of the QtHPConnect distribution (https://github.com/Indy970/QtHPConnect.git).
|
||||
* Copyright (c) 2020 Ian Gebbie.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 or later.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef VERSION_H
|
||||
#define VERSION_H
|
||||
|
||||
|
|
Loading…
Reference in a new issue