diff --git a/src/dxcluster/dxcluster.h b/src/dxcluster/dxcluster.h index 9f00ccdc..7969909d 100644 --- a/src/dxcluster/dxcluster.h +++ b/src/dxcluster/dxcluster.h @@ -31,10 +31,10 @@ email : jaime@robles.es #include #include #include -#include "awards.h" -#include "world.h" -#include "utilities.h" -#include "dataproxy_sqlite.h" +#include "../awards.h" +#include "../world.h" +#include "../utilities.h" +#include "../dataproxy_sqlite.h" class QWidget; class QTcpSocket; diff --git a/src/dxcluster/dxclusterassistant.cpp b/src/dxcluster/dxclusterassistant.cpp index ffa0d655..f15bedd5 100644 --- a/src/dxcluster/dxclusterassistant.cpp +++ b/src/dxcluster/dxclusterassistant.cpp @@ -25,6 +25,48 @@ email : jaime@robles.es *****************************************************************************/ #include "dxclusterassistant.h" -DXClusterAssistant::DXClusterAssistant(QWidget *parent) +DXClusterAssistant::DXClusterAssistant(const QString &_parentFunction, QWidget *parent) : QWidget{parent} -{} +{ +#ifdef QT_DEBUG + //qDebug() << ": " << _parentFunction; +#else +#endif + (void)_parentFunction; + //qDebug() << Q_FUNC_INFO << " - Start: " + _parentFunction; + + tableWidget = new QTableWidget; +} + +DXClusterAssistant::~DXClusterAssistant(){}; + +bool DXClusterAssistant::init() +{ + return createUI(); +} + +bool DXClusterAssistant::createUI() +{ + //qDebug() << Q_FUNC_INFO << " - Start"; + tableWidget->setSortingEnabled (true); + + hv = tableWidget->verticalHeader(); + hv->hide(); + hv->setStretchLastSection(true); + hh = tableWidget->horizontalHeader(); + + QStringList header; + header.clear(); + header << tr("DX") << tr("Freq") << tr("Priority"); // tr("Mode"); + tableWidget->setColumnCount(header.length()); + tableWidget->setHorizontalHeaderLabels(header); + + QGridLayout *mainLayout = new QGridLayout; + mainLayout->addWidget(tableWidget, 3, 0, 1, -1); + + setLayout(mainLayout); + return true; + + //connect(cancelButton, SIGNAL(clicked()), this, SLOT(slotCancelPushButtonClicked() ) ); + //qDebug() << Q_FUNC_INFO << " - END"; +} diff --git a/src/dxcluster/dxclusterassistant.h b/src/dxcluster/dxclusterassistant.h index 4b0b1136..9f565656 100644 --- a/src/dxcluster/dxclusterassistant.h +++ b/src/dxcluster/dxclusterassistant.h @@ -25,15 +25,34 @@ email : jaime@robles.es * along with KLog. If not, see . * * * *****************************************************************************/ -#include + + + +// This widget will show the DX-Cluster assistant +// The class shows an ordered list of available spots that are available now and the +// associated freq/mode. +// Info is coming from the cluster and ordered taking into account dxcc status: +// confirmed/worked/needed/ATNO or even other factors TBD. + +#include +#include "../global.h" class DXClusterAssistant : public QWidget { Q_OBJECT public: - explicit DXClusterAssistant(QWidget *parent = nullptr); - + explicit DXClusterAssistant(const QString &_parentFunction, QWidget *parent = nullptr); + ~DXClusterAssistant(); + bool init(); signals: + +private: + bool createUI(); + + QTableWidget *tableWidget; + QHeaderView *hv, *hh; }; + + #endif // DXCLUSTERASSISTANT_H diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4c7ee5e1..07c693cc 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -201,6 +201,7 @@ MainWindow::MainWindow(const QString &tversion) //qDebug() << Q_FUNC_INFO << ": dxclusterwidget to be created " << QTime::currentTime().toString("hh:mm:ss") ; //dxClusterWidget = new DXClusterWidget(dataProxy, dxclusterServerToConnect , dxclusterServerPort, this); dxClusterWidget = new DXClusterWidget(dataProxy, this); + dxClusterAssistant = new DXClusterAssistant(Q_FUNC_INFO); //qDebug() << Q_FUNC_INFO << ": Awards to be created " << QTime::currentTime().toString("hh:mm:ss") ; awards = new Awards(dataProxy, Q_FUNC_INFO); @@ -888,6 +889,10 @@ void MainWindow::slotShowMap() //mapWindow->addLocators(a, QColor(0, 0, 255, 127)); } +void MainWindow::slotShowDXClusterAssistant() +{ + dxClusterAssistant->show(); +} void MainWindow::setMainWindowTitle() { QString aux = dataProxy->getCommentsFromLog(currentLog); @@ -2574,7 +2579,13 @@ void MainWindow::createMenusCommon() connect(showMapAct, SIGNAL(triggered()), this, SLOT(slotShowMap())); showMapAct->setToolTip(tr("Show the statistics of your radio activity.")); - //qDebug() << "MainWindow::createMenusCommon before" ; + dxClusterAssistantAct = new QAction (tr("DXCluster Assistant"), this); + toolMenu->addAction(dxClusterAssistantAct); + connect(dxClusterAssistantAct, SIGNAL(triggered()), this, SLOT(slotShowDXClusterAssistant())); + dxClusterAssistantAct->setToolTip(tr("Show the statistics of your radio activity.")); + + + //qDebug() << "MainWindow::createMenusCommon before" ; //toolMenu->addSeparator(); //showRotatorAct = new QAction (tr("Rotator"), this); //toolMenu->addAction(showRotatorAct); diff --git a/src/mainwindow.h b/src/mainwindow.h index 4f4258a2..a9c2bc0b 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -43,7 +43,8 @@ #include "fileawardmanager.h" #include "dataproxy_sqlite.h" #include "locator.h" -#include "dxcluster.h" +#include "dxcluster/dxcluster.h" +#include "dxcluster/dxclusterassistant.h" #include "awards.h" #include "inputwidgets/mainwindowsattab.h" #include "inputwidgets/mainwindowmydatatab.h" @@ -303,6 +304,9 @@ private slots: //void slotShowQSOFromDXCCWidget(const int _q); void slotShowQSOsFromDXCCWidget(QList _qsos); + // DXCLUSTER ASSISTANT + void slotShowDXClusterAssistant(); + //UDP Server (WXJT-x) void slotWSJXstatusFromUDPServer(const int _type, const QString &_dxcall, const double _freq, const QString &_mode, const QString &_report, const QString &_de_call, const QString &_de_grid, @@ -563,6 +567,7 @@ private: QAction *qslSentRequestedAct; QAction *qslRecRequestedAct; QAction *showMapAct; + QAction *dxClusterAssistantAct; QStringList bands; QStringList modes; @@ -611,6 +616,8 @@ private: bool dxClusterShowHF, dxClusterShowVHF, dxClusterShowWARC, dxClusterShowWorked, dxClusterShowConfirmed, dxClusterShowAnn, dxClusterShowWWV, dxClusterShowWCY; // + DXClusterAssistant *dxClusterAssistant; + // int infoTimeout; // timeout that temporary info will stay in the infobars QTimer *timer, *timerInfoBars; diff --git a/tests/tst_main/tst_main.pro b/tests/tst_main/tst_main.pro index 2a3dea1b..e8997156 100644 --- a/tests/tst_main/tst_main.pro +++ b/tests/tst_main/tst_main.pro @@ -43,7 +43,8 @@ HEADERS += ../../src/setupdialog.h \ ../../src/database.h \ ../../src/dataproxy_sqlite.h \ ../../src/downloadcty.h \ - ../../src/dxcluster.h \ + ../../src/dxcluster/dxcluster.h \ + ../../src/dxcluster/dxclusterassistant.h \ ../../src/dxccstatuswidget.h \ ../../src/elogqrzlog.h \ ../../src/eqslutilities.h \ diff --git a/tests/tst_mainwindow/tst_mainwindow.cpp b/tests/tst_mainwindow/tst_mainwindow.cpp index 845818ab..897376ce 100644 --- a/tests/tst_mainwindow/tst_mainwindow.cpp +++ b/tests/tst_mainwindow/tst_mainwindow.cpp @@ -40,7 +40,8 @@ #include "../../src/filemanager.h" #include "../../src/fileawardmanager.h" #include "../../src/locator.h" -#include "../../src/dxcluster.h" +#include "../../src/dxcluster/dxcluster.h" +#include "../../src/dxcluster/dxclusterassistant.h" #include "../../src/awards.h" #include "../../src/awarddxmarathon.h" #include "../../src/inputwidgets/mainwindowsattab.h" diff --git a/tests/tst_mainwindow/tst_mainwindow.pro b/tests/tst_mainwindow/tst_mainwindow.pro index 666ee43a..c866b520 100644 --- a/tests/tst_mainwindow/tst_mainwindow.pro +++ b/tests/tst_mainwindow/tst_mainwindow.pro @@ -42,7 +42,8 @@ HEADERS += \ ../../src/filemanager.h \ ../../src/fileawardmanager.h \ ../../src/locator.h \ - ../../src/dxcluster.h \ + ../../src/dxcluster/dxcluster.h \ + ../../src/dxcluster/dxclusterassistant.h \ ../../src/awards.h \ ../../src/awarddxmarathon.h \ ../../src/inputwidgets/mainwindowsattab.h \