1 #ifndef DXCCSTATUSWIDGET_H
2 #define DXCCSTATUSWIDGET_H
3 /***************************************************************************
4                           dxccstatuswidget.h  -  description
5                              -------------------
6     begin                : feb 2016
7     copyright            : (C) 2016 by Jaime Robles
8     email                : jaime@robles.es
9  ***************************************************************************/
10 
11 /*****************************************************************************
12  * This file is part of KLog.                                                *
13  *                                                                           *
14  *    KLog is free software: you can redistribute it and/or modify           *
15  *    it under the terms of the GNU General Public License as published by   *
16  *    the Free Software Foundation, either version 3 of the License, or      *
17  *    (at your option) any later version.                                    *
18  *                                                                           *
19  *    KLog is distributed in the hope that it will be useful,                *
20  *    but WITHOUT ANY WARRANTY; without even the implied warranty of         *
21  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
22  *    GNU General Public License for more details.                           *
23  *                                                                           *
24  *    You should have received a copy of the GNU General Public License      *
25  *    along with KLog.  If not, see <https://www.gnu.org/licenses/>.         *
26  *                                                                           *
27  *****************************************************************************/
28 #include <QWidget>
29 #include <QtWidgets>
30 #include <QString>
31 //#include <QTableView>
32 #include "awards.h"
33 #include "world.h"
34 #include "dataproxy_sqlite.h"
35 #include "locator.h"
36 #include "klogdefinitions.h"
37 
38 
39 //TODO: Creating the widget to show the DXCC status
40 
41 class DXCCStatusWidget : public QWidget
42 {
43     Q_OBJECT
44 public:
45     explicit DXCCStatusWidget(DataProxy_SQLite *dp, const QString &_parentFunction, QWidget *parent = nullptr);
46     ~DXCCStatusWidget();
47 
48     void update();
49     //void awardsUpdated();
50     void setBands(const QString &_callingFunc, const QStringList &_ent, const bool _creating = false); // Receives the list of bandIDs
51     void setCurrentLog(const int _logN);
52     void setMyLocator(const QString &_loc);
53     void refresh();
54 
55 signals:
56     //void showQso(const int _qsoid); // identified QSO double clicking on DXCC
57     void showQsos(QList<int> _qsos);
58     void fillInQSOSignal();
59     void debugLog (QString _func, QString _msg, DebugLogLevel _level);
60     //void updateAwards();
61 
62 public slots:
63     //void slotSearchLineEditTextChanged();
64     void slotRefreshButtonClicked();
65 
66 private slots:
67     //void slotRightButton(const QPoint& pos);
68     //void slotWikipedia();
69     void slotItemEntered(QTableWidgetItem  * item );
70     void slotItemDoubleClicked(QTableWidgetItem  * item );
71 
72 
73 private:
74     void createUI();
75     void setDefaultBands();
76     void addEntity(const QList<int> &_ent); // DXCC id, bandid, bandid, ...
77     void addEntity2(const QStringList &_ent); // DXCC id, bandid, bandid, ...
78 //    void showMenuRightButtonFromLogCreateActions();
79 //    void righButtonFromLogMenu(const int trow);
80 
81 
82     QTableWidget *dxccView;
83     Awards *awards;
84     World *world;
85     DataProxy_SQLite *dataProxy;
86     Locator *locator;
87 
88     QHeaderView *hv, *hh;
89     //QLineEdit *searchLineEdit;
90     QPushButton *refreshButton;
91     //QCheckBox *showAllLogsButton;
92 
93 
94     int numberOfColumns; // Columns will be number Of Bands + 2 (Id + Name)
95     QStringList bandNames, validBands;
96     int logNumber, tempLog; // log in use in the log / log to be used in the widget
97     QString loc; // The locator of the user.
98 
99     QAction *showDXCCWikipediaAct;
100     int currentLog;
101 
102 };
103 
104 #endif // DXCCSTATUSWIDGET_H
105