klog/setuppagelogs.h

140 lines
4.9 KiB
C
Raw Normal View History

2015-01-14 18:51:30 +00:00
#ifndef SETUPPAGELOGS_H
#define SETUPPAGELOGS_H
/***************************************************************************
setuppagelogs.h - description
-------------------
begin : feb 2012
copyright : (C) 2012 by Jaime Robles
email : jaime@robles.es
***************************************************************************/
/*****************************************************************************
* This file is part of KLog. *
* *
* KLog 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. *
* *
* KLog 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 KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
//#include <QtWidgets>
2015-11-06 19:47:52 +00:00
#include <QtWidgets>
2015-01-14 18:51:30 +00:00
#include <QtSql>
2015-08-17 15:54:45 +00:00
#include "dataproxy.h"
#include "dataproxy_sqlite.h"
2015-02-14 19:51:20 +00:00
#include "setuppagelogsnew.h"
2015-01-14 18:51:30 +00:00
2015-01-14 18:51:30 +00:00
const int CONTEST_DX = 0;
const int CONTEST_CQ_WW_SSB = 1;
const int CONTEST_CQ_WW_CW = 2;
const int CONTEST_CQ_WPX_SSB = 3;
const int CONTEST_CQ_WPX_CW = 4;
class SetupPageLogs : public QWidget {
Q_OBJECT
public:
SetupPageLogs(QWidget *parent=0);
~SetupPageLogs();
2015-03-01 19:32:29 +00:00
int getSelectedLog();
void setSelectedLog(const int _i);
2016-08-12 15:31:07 +00:00
void createNewLog();
2017-05-06 17:27:18 +00:00
void setDefaultStationCallsign (const QString _p);
void setDefaultOperators(const QString _p);
2015-01-14 18:51:30 +00:00
/*
QString getBands(); // 10m, 12m, 15m
QString getModes(); //ssb, CW
void setActiveBands(QStringList q);
void setActiveModes(QStringList q);
*/
private slots:
/*
void slotBandActiveItemDoubleClicked ( QListWidgetItem * item );
void slotBandNotActiveItemDoubleClicked ( QListWidgetItem * item );
void slotBandSelButtonClicked( );
void slotBandUnSelButtonClicked( );
void slotModeSelButtonClicked( );
void slotModeUnSelButtonClicked( );
*/
void slotNewButtonClicked();
void slotEditButtonClicked();
void slotRemoveButtonClicked();
2015-02-15 20:07:35 +00:00
void slotAnalyzeNewLogData(const QStringList _qs);
void slotLogSelected(const QModelIndex & index);
void slotLogDoubleClicked(const QModelIndex & index);
void slotLogsCancelled(const bool _q);
2015-01-14 18:51:30 +00:00
//void slotCreateLog();
//
2015-02-15 20:07:35 +00:00
signals:
//void exitSignal(const int status); // 1 = OK, -1 = NOK, 2 = Cancel clicked
2016-08-16 15:21:15 +00:00
void newLogData(const QStringList _qs); // Station QRZ + Operators to be shown in the main tab
2015-01-14 18:51:30 +00:00
private:
//void createActions();
2015-02-17 19:44:44 +00:00
QStringList readLogs();
2015-01-14 18:51:30 +00:00
void createLogsPanel();
void createLogsModel();
void createActions();
2015-08-17 15:54:45 +00:00
//bool addNewLog(const QStringList _qs);
2015-02-17 19:44:44 +00:00
void updateSelectedLogs();
void readSelectedLog(const int _i);
void showError(const QString _errorC);
2015-01-14 18:51:30 +00:00
/* Wizard to create a new log*/
2015-02-14 19:51:20 +00:00
//QWizardPage *createLogTypePage();
//QWizard *newLogWizard; // Wizard to create a new log
2015-01-14 18:51:30 +00:00
/*^Wizard to create a new log^*/
QSqlRelationalTableModel *logsModel;
QWidget *logsPanel;
QTableView *logsView;
QAbstractButton *finishButton;
//QWidget *logsWidget;
//QTreeWidget *logsQTreeWidget;
//QListWidget *bandsNotActiveListWidget, *bandsActiveListWidget;
//QListWidget *modesNotActiveListWidget, *modesActiveListWidget;
//QStringList bands, modes;
QPushButton *newLogPushButton, *editPushButton, *removePushButton;
//*loadAllPushButton, *loadSelectedPushButton, *clearPushButton,;
int lastLog;
QString currentLogComment;
QString currentStationCallSign;
2015-02-17 19:44:44 +00:00
QComboBox *currentLogs;
QStringList logsAvailable;
2015-01-14 18:51:30 +00:00
2015-02-15 20:07:35 +00:00
SetupPageLogsNew *newLog;
2015-01-14 18:51:30 +00:00
QString stationCallsign, operators, comment, dateString, typeContest;
int contestCatMode, contestCatOperators, contestCatAssisted, contestCatPower, contestCatBands, contestBands, typeContestN;
2015-01-14 18:51:30 +00:00
2015-08-17 15:54:45 +00:00
DataProxy *dataProxy;
int selectedLog;
2017-05-06 17:27:18 +00:00
QString defaultStationCallSign, defaultOperators;
2015-01-14 18:51:30 +00:00
};
#endif // SETUPPAGELOGS_H