This commit is contained in:
Ian Gebbie 2020-02-02 19:13:27 +02:00
parent 880a2f2b89
commit 41aed16567
51 changed files with 1009 additions and 34 deletions

View file

@ -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 <QDebug>
#include <QTextCodec> #include <QTextCodec>
#include <QtMath> #include <QtMath>

View file

@ -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 #ifndef ABSTRACTDATA_H
#define ABSTRACTDATA_H #define ABSTRACTDATA_H

View file

@ -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 <global.h>
#include <cntfilesystemmodel.h> #include <cntfilesystemmodel.h>
#include <QMimeData> #include <QMimeData>
@ -310,6 +327,23 @@ int contentFileSystemModel::writeFile(QFileInfo fileinfo, QByteArray data_in) co
return -1; 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 contentFileSystemModel::getFileType(QFileInfo info) const {
hp_DataStruct filedata; hp_DataStruct filedata;

View file

@ -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 #ifndef CONTENTFILESYSTEMMODEL_H
#define CONTENTFILESYSTEMMODEL_H #define CONTENTFILESYSTEMMODEL_H
#include <QObject> #include <QObject>
@ -29,6 +46,9 @@ public:
QString getFileType(hp_DataType) const; QString getFileType(hp_DataType) const;
AbstractData * readFile(QFileInfo fileinfo) const; AbstractData * readFile(QFileInfo fileinfo) const;
int writeFile(QFileInfo fileinfo, QByteArray data_in) const; int writeFile(QFileInfo fileinfo, QByteArray data_in) const;
void createNewFolder();
void createNewNote();
void createNewProgram();
~contentFileSystemModel(); ~contentFileSystemModel();
private: private:

View file

@ -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 "datamodel.h"
#include <QDebug> #include <QDebug>

View file

@ -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 #ifndef DATAMODEL_H
#define DATAMODEL_H #define DATAMODEL_H

View file

@ -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" #include "errorhandler.h"

View file

@ -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 #ifndef ERRORHANDLER_H
#define ERRORHANDLER_H #define ERRORHANDLER_H

View file

@ -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 "eventthread.h"
#include <mainwindow.h> #include <mainwindow.h>
#include <QDebug> #include <QDebug>

View file

@ -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 #ifndef EVENTTHREAD_H
#define EVENTTHREAD_H #define EVENTTHREAD_H

View file

@ -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 "eventtimer.h"
#include "mainwindow.h" #include "mainwindow.h"

View file

@ -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 #ifndef EVENTTIMER_H
#define EVENTTIMER_H #define EVENTTIMER_H
#include <QThread> #include <QThread>

View file

@ -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 "getnumber.h"
#include "ui_getnumber.h" #include "ui_getnumber.h"
#include <QDebug> #include <QDebug>

View file

@ -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 #ifndef GETNUMBER_H
#define GETNUMBER_H #define GETNUMBER_H

View file

@ -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 #ifndef GLOBAL_H
#define GLOBAL_H #define GLOBAL_H

View file

@ -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 "hp_infodialog.h"
#include "ui_hp_infodialog.h" #include "ui_hp_infodialog.h"
#include <QDebug> #include <QDebug>

View file

@ -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 #ifndef HP_INFODIALOG_H
#define HP_INFODIALOG_H #define HP_INFODIALOG_H

View file

@ -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 "hp_mditexteditor.h"
#include "hptreeitem.h" #include "hptreeitem.h"
#include "hpdata.h" #include "hpdata.h"
@ -10,7 +28,7 @@ hp_mdiTextEdit::hp_mdiTextEdit(QWidget * parent,hpTreeItem * treeItem, AbstractD
setMaximumSize(1000,1000); setMaximumSize(1000,1000);
setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored); setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
qDebug()<<"hp_mdiTextEdit::hp_mdiTextEdit"; qDebug()<<"hp_mdiTextEdit::hp_mdiTextEdit";
hptreeitem=treeItem; hptreeitem=treeItem;
data = calcData; data = calcData;
qDebug()<<data->getName(); qDebug()<<data->getName();
@ -56,13 +74,15 @@ void hp_mdiTextEdit::setup() {
} }
if (data->getType()==HP_PROG) { if (data->getType()==HP_PROG) {
Program *note; Program *prog;
note=static_cast<Program *>(data); prog=static_cast<Program *>(data);
text=note->getProg(); text=prog->getProg();
textEdit->setDocumentTitle(prog->getName());
} }
qDebug()<<text; qDebug()<<text;
textEdit->setPlainText(text); textEdit->setPlainText(text);
} }
else { else {
qDebug()<<"hp_mdiTextEdit::setup - Data Null"; qDebug()<<"hp_mdiTextEdit::setup - Data Null";

View file

@ -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 #ifndef HP_MDITEXTEDITOR_H
#define HP_MDITEXTEDITOR_H #define HP_MDITEXTEDITOR_H

View file

@ -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 "hp_mdivariableedit.h"
#include "hptreeitem.h" #include "hptreeitem.h"

View file

@ -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 #ifndef HP_MDIVARIABLEEDIT_H
#define HP_MDIVARIABLEEDIT_H #define HP_MDIVARIABLEEDIT_H

View file

@ -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 "hp_mdiwindow.h"
#include <QDebug> #include <QDebug>

View file

@ -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 #ifndef HP_MDIWINDOW_H
#define HP_MDIWINDOW_H #define HP_MDIWINDOW_H

View file

@ -2,6 +2,9 @@
<ui version="4.0"> <ui version="4.0">
<class>hp_MdiWindow</class> <class>hp_MdiWindow</class>
<widget class="QMainWindow" name="hp_MdiWindow"> <widget class="QMainWindow" name="hp_MdiWindow">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View file

@ -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 "hp_settingsdlg.h"
#include "ui_hp_settingsdlg.h" #include "ui_hp_settingsdlg.h"

View file

@ -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 #ifndef DLGSETTINGS_H
#define DLGSETTINGS_H #define DLGSETTINGS_H

View file

@ -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 #ifndef HP_TYPEDEF_H
#define HP_TYPEDEF_H #define HP_TYPEDEF_H

View file

@ -91,25 +91,45 @@ void hpCalcData::addData(AbstractData * data) {
lData.append(data); lData.append(data);
} }
void hpCalcData::deleteData(AbstractData *) { void hpCalcData::deleteData(AbstractData * data) {
// lData.erase(); // 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; //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) { QList<AbstractData *>::iterator i;
if (lData.at(i)->equivalent(name,dataType)) AbstractData * ldata;
i = lData.begin();
while (i!= lData.end()) {
ldata=*i;
if (ldata->equivalent(name,dataType)) {
return i; return i;
}
} }
return 0; return nullptr;
} }
//returns position of entry in list or returns 0; //returns position of entry in list or returns 0;
AbstractData * hpCalcData::getData(QString name, hp_DataType dataType) { AbstractData * hpCalcData::getData(QString name, hp_DataType dataType) {
for (int i = 0; i < lData.size(); ++i) { for (int i = 0; i < lData.size(); ++i) {
if (lData.at(i)->equivalent(name,dataType)) { if (lData.at(i)->equivalent(name,dataType)) {

View file

@ -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 #ifndef HPDATA_H
#define HPDATA_H #define HPDATA_H
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include <QList> #include <QList>
#include <iterator>
#include "hpusb.h" #include "hpusb.h"
#include "abstractdata.h" #include "abstractdata.h"
#include "hp_typedef.h" #include "hp_typedef.h"
@ -70,7 +88,7 @@ public:
void refresh(); void refresh();
void addData(AbstractData *); void addData(AbstractData *);
void deleteData(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 * getData(QString name, hp_DataType dataType);
AbstractData * dataAt(int i); AbstractData * dataAt(int i);
int dataCount(); int dataCount();

View file

@ -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 "hptreeitem.h"
#include "global.h" #include "global.h"
#include "hpdata.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) hpTreeItem::hpTreeItem(const QString & name,hpCalcData * hpDataStore,int flag)
:QStandardItem(name) :QStandardItem(name)
@ -66,6 +80,11 @@ hpTreeItem::hpTreeItem(const QString & name,hpCalcData * hpDataStore,int flag)
setGraphicTree(); setGraphicTree();
} }
bool hpTreeItem::dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent) {
qDebug()<<"hpTreeItem::dropMimeData";
}
QStandardItem * hpTreeItem::clone() const { QStandardItem * hpTreeItem::clone() const {
//return new hpTreeItem(QStringLiteral("test"),getDataStore(),0); //return new hpTreeItem(QStringLiteral("test"),getDataStore(),0);
} }
@ -121,7 +140,7 @@ void hpTreeItem::clickAction(QMdiArea * mdiwin) {
if (calc) { if (calc) {
data=calc->getData(getFileName(),HP_COMPLEX); data=calc->getData(getFileName(),HP_COMPLEX);
} }
if (data) { if (data!=nullptr) {
hpvaredit = new hp_mdiVariableEdit(mdiwin,this,calc); hpvaredit = new hp_mdiVariableEdit(mdiwin,this,calc);
} }
} }
@ -132,7 +151,7 @@ void hpTreeItem::clickAction(QMdiArea * mdiwin) {
if (calc) { if (calc) {
data=calc->getData(getFileName(),HP_COMPLEX); data=calc->getData(getFileName(),HP_COMPLEX);
} }
if (data) { if (data!=nullptr) {
hpvaredit = new hp_mdiVariableEdit(mdiwin,this,calc); hpvaredit = new hp_mdiVariableEdit(mdiwin,this,calc);
} }
} }
@ -156,7 +175,7 @@ void hpTreeItem::clickAction(QMdiArea * mdiwin) {
if (calc) { if (calc) {
data=calc->getData(getFileName(),HP_MATRIX); data=calc->getData(getFileName(),HP_MATRIX);
} }
if (data) { if (data!=nullptr) {
hpvaredit = new hp_mdiVariableEdit(mdiwin,this,calc); hpvaredit = new hp_mdiVariableEdit(mdiwin,this,calc);
} }
} }
@ -177,7 +196,7 @@ void hpTreeItem::clickAction(QMdiArea * mdiwin) {
hptextedit=nullptr; hptextedit=nullptr;
if (hptextedit==nullptr) if ((hptextedit==nullptr)&&(data!=nullptr))
hptextedit = new hp_mdiTextEdit(mdiwin,this, data); hptextedit = new hp_mdiTextEdit(mdiwin,this, data);
if (hptextedit!=nullptr) if (hptextedit!=nullptr)
hptextedit ->show(); hptextedit ->show();
@ -188,15 +207,17 @@ void hpTreeItem::clickAction(QMdiArea * mdiwin) {
AbstractData * data =nullptr; AbstractData * data =nullptr;
dataStore = getDataStore(); dataStore = getDataStore();
qDebug()<<"HP_Prog ... click"<<getFileName(); qDebug()<<"HP_Prog ... click"<<getFileName();
if (dataStore) { if (dataStore!=nullptr) {
data=dataStore->getData(getFileName(),getType()); data=dataStore->getData(getFileName(),getType());
qDebug()<<data->getName(); if(data!=nullptr) {
qDebug()<<data->getName();
}
} }
//To fix by having hp_mdi reset //To fix by having hp_mdi reset
hptextedit=nullptr; hptextedit=nullptr;
if (hptextedit==nullptr) { if ((hptextedit==nullptr)&&(data!=nullptr)) {
hptextedit = new hp_mdiTextEdit(mdiwin,this, data); hptextedit = new hp_mdiTextEdit(mdiwin,this, data);
} }
if (hptextedit!=nullptr) if (hptextedit!=nullptr)
@ -208,7 +229,7 @@ void hpTreeItem::clickAction(QMdiArea * mdiwin) {
if (calc) { if (calc) {
data=calc->getData(getFileName(),HP_REAL); data=calc->getData(getFileName(),HP_REAL);
} }
if (data) { if (data!=nullptr) {
hpvaredit = new hp_mdiVariableEdit(mdiwin,this,calc); hpvaredit = new hp_mdiVariableEdit(mdiwin,this,calc);
} }
} }

View file

@ -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 #ifndef HPTREEITEM_H
#define HPTREEITEM_H #define HPTREEITEM_H

17
hpusb.h
View file

@ -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 #ifndef HPUSB_H
#define HPUSB_H #define HPUSB_H

View file

@ -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 "mainwindow.h"
#include <QApplication> #include <QApplication>
#include <QCommandLineParser> #include <QCommandLineParser>

17
main.h
View file

@ -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 #ifndef MAIN_H
#define MAIN_H #define MAIN_H

View file

@ -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 * Copyright (C) 2019 Ian Gebbie
* Code patterns and snippets borrowed from libhpcalcs : * Code patterns and snippets borrowed from libhpcalcs :
* Copyright (C) 1999-2009 Romain Li<EFBFBD>vin * Copyright (C) 1999-2009 Romain Li<EFBFBD>vin
@ -32,6 +32,7 @@
#include <QTextStream> #include <QTextStream>
#include <QTimer> #include <QTimer>
#include <QFileIconProvider> #include <QFileIconProvider>
#include <QToolButton>
#include "global.h" #include "global.h"
#include "hpusb.h" #include "hpusb.h"
@ -85,6 +86,30 @@ MainWindow::MainWindow(QWidget *parent) :
setTreeMenu(); setTreeMenu();
setContentWindow(); 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 //Hack to fix QT resizing bug
resizeDocks({ui->dwCalculator,ui->dwContent},{0,0}, Qt::Horizontal); 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->actionCalculators,SIGNAL(triggered()),this,SLOT(showCalculator()));
connect(ui->actionMessages,SIGNAL(triggered()),this,SLOT(showMessage())); connect(ui->actionMessages,SIGNAL(triggered()),this,SLOT(showMessage()));
connect(ui->actionMonitor,SIGNAL(triggered()),this,SLOT(showMonitor())); 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->tvCalculators,SIGNAL(clicked(QModelIndex)),this,SLOT(clickedCalculator(QModelIndex)));
connect(ui->tvContent,SIGNAL(clicked(QModelIndex)),this,SLOT(clickedContent(QModelIndex))); connect(ui->tvContent,SIGNAL(clicked(QModelIndex)),this,SLOT(clickedContent(QModelIndex)));
connect(ui->actionLog,SIGNAL(triggered()),this,SLOT(createLogWindow())); connect(ui->actionLog,SIGNAL(triggered()),this,SLOT(createLogWindow()));
@ -313,7 +345,12 @@ void MainWindow::selectionChangedSlot(const QItemSelection & /*newSelection*/, c
void MainWindow::clickedCalculator(QModelIndex index) { 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)); hpTreeItem * treeItem = dynamic_cast<hpTreeItem *>(hpTreeModel->itemFromIndex(index));
@ -330,10 +367,40 @@ void MainWindow::clickedCalculator(QModelIndex index) {
} }
//HACK //HACK
lastCalc=item->data(Qt::DisplayRole).toString(); lastCalc=treeItem->data(Qt::DisplayRole).toString();
log(item->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) { void MainWindow::clickedContent(QModelIndex index) {
contentModel.clickAction(getMdi(),index); contentModel.clickAction(getMdi(),index);

View file

@ -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 <QMainWindow>
#include <QItemSelection> #include <QItemSelection>
#include <QModelIndex> #include <QModelIndex>
@ -66,6 +83,13 @@ private slots:
void writeSettings(); void writeSettings();
void readSettings(); void readSettings();
void setTimerStopped(); void setTimerStopped();
void eventSave();
void eventSaveAs();
void eventCreateFolder();
void eventCreateNote();
void eventCreateProgram();
treeModel * getTreeModel(); treeModel * getTreeModel();
void treeMenuAction(bool); void treeMenuAction(bool);

View file

@ -152,6 +152,9 @@
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QTreeView" name="tvCalculators"> <widget class="QTreeView" name="tvCalculators">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -468,6 +471,9 @@
<property name="text"> <property name="text">
<string>CreateNew</string> <string>CreateNew</string>
</property> </property>
<property name="toolTip">
<string>Create New </string>
</property>
</action> </action>
<action name="actionExit"> <action name="actionExit">
<property name="icon"> <property name="icon">
@ -652,6 +658,28 @@
<string>Alt+R</string> <string>Alt+R</string>
</property> </property>
</action> </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> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<resources> <resources>

View file

@ -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 <QDebug>
#include "matrixdata.h" #include "matrixdata.h"

View file

@ -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 #ifndef MATRIXDATA_H
#define MATRIXDATA_H #define MATRIXDATA_H

View file

@ -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 "options.h"
#include "ui_options.h" #include "ui_options.h"
#include "global.h" #include "global.h"

View file

@ -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 #ifndef OPTIONS_H
#define OPTIONS_H #define OPTIONS_H

View file

@ -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 "texteditor.h"
#include <QtWidgets> #include <QtWidgets>
#include <QRect> #include <QRect>
#include <QSettings>
textEditor::textEditor(QWidget *parent) : textEditor::textEditor(QWidget *parent) :
QTextEdit(parent) QTextEdit(parent)
{ {
QSettings appSettings("IRGP","QtHPconnect");
wParent = parent; wParent = parent;
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
isUntitled = true; isUntitled = true;
defaultPath=QDir(appSettings.value("contentPath").toString());
qDebug()<<defaultPath;
} }
void textEditor::newFile() void textEditor::newFile()
@ -58,8 +81,10 @@ bool textEditor::save()
bool textEditor::saveAs() bool textEditor::saveAs()
{ {
QFileInfo fileinfo(defaultPath,curFile);
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
curFile); fileinfo.absoluteFilePath());
if (fileName.isEmpty()) if (fileName.isEmpty())
return false; return false;
@ -68,7 +93,8 @@ bool textEditor::saveAs()
bool textEditor::saveFile(const QString &fileName) bool textEditor::saveFile(const QString &fileName)
{ {
QFile file(fileName); QFileInfo fileinfo(defaultPath,fileName);
QFile file(fileinfo.absoluteFilePath());
if (!file.open(QFile::WriteOnly | QFile::Text)) { if (!file.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(this, tr("MDI"), QMessageBox::warning(this, tr("MDI"),
tr("Cannot write file %1:\n%2.") tr("Cannot write file %1:\n%2.")
@ -108,6 +134,7 @@ bool textEditor::maybeSave()
{ {
if (!document()->isModified()) if (!document()->isModified())
return true; return true;
const QMessageBox::StandardButton ret const QMessageBox::StandardButton ret
= QMessageBox::warning(this, tr("MDI"), = QMessageBox::warning(this, tr("MDI"),
tr("'%1' has been modified.\n" tr("'%1' has been modified.\n"

View file

@ -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 #ifndef TEXTEDITOR_H
#define TEXTEDITOR_H #define TEXTEDITOR_H
#include <QTextEdit> #include <QTextEdit>
#include <QDir>
class textEditor : public QTextEdit class textEditor : public QTextEdit
@ -34,6 +52,7 @@ private:
QString curFile; QString curFile;
bool isUntitled; bool isUntitled;
QDir defaultPath;
}; };
#endif // TEXTEDITOR_H #endif // TEXTEDITOR_H

View file

@ -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 // Model to contain the calculator data structure
// //
@ -91,6 +113,7 @@ hpCalcData * treeModel::getCalculator(QString name){
void treeModel::clickAction(QMdiArea * mdiwin,QModelIndex &index) { void treeModel::clickAction(QMdiArea * mdiwin,QModelIndex &index) {
qDebug()<<"row "<<index.row()<<" column "<<index.column();
return openFile(mdiwin,index); return openFile(mdiwin,index);
} }
@ -125,6 +148,7 @@ void treeModel::renameFile(QModelIndex &index,QString newName) {
hp_DataType type; hp_DataType type;
hpCalcData * hpdata=nullptr; hpCalcData * hpdata=nullptr;
qDebug()<<"row "<<index.row()<<" column "<<index.column();
if (index.isValid()) { if (index.isValid()) {
item = static_cast<hpTreeItem *>(itemFromIndex(index)); item = static_cast<hpTreeItem *>(itemFromIndex(index));
@ -186,12 +210,18 @@ void treeModel::deleteFile( QModelIndex &index) {
// //
//delete hpTreeItem //delete hpTreeItem
// qDebug()<<"row "<<index.row()<<" column "<<index.column();
if (removeRow(index.row(),index.parent()))
{
//qDebug()<<"Deleted";
}
else {
qDebug()<<"Removal failed";
}
//delete Data //delete Data
hpdata->deleteData(adata); hpdata->deleteData(adata);
} }
else { else {
qDebug()<<"Null data"; qDebug()<<"Null data";

View file

@ -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 #ifndef TREEMODEL_H
#define TREEMODEL_H #define TREEMODEL_H

View file

@ -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 "variableview.h"
#include "ui_variableview.h" #include "ui_variableview.h"
#include <QDebug> #include <QDebug>

View file

@ -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 #ifndef VARIABLEVIEW_H
#define VARIABLEVIEW_H #define VARIABLEVIEW_H

View file

@ -15,7 +15,11 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QTableView" name="variableList"/> <widget class="QTableView" name="variableList">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>

View file

@ -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 "global.h"
#include "vartablemodel.h" #include "vartablemodel.h"
#include "abstractdata.h" #include "abstractdata.h"

View file

@ -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 #ifndef VARTABLEMODEL_H
#define VARTABLEMODEL_H #define VARTABLEMODEL_H

View file

@ -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 #ifndef VERSION_H
#define VERSION_H #define VERSION_H