mirror of
https://github.com/ea4k/klog.git
synced 2024-09-21 10:28:06 +00:00
Logview
This commit is contained in:
parent
a52c4f70d1
commit
ce276188cd
@ -4,6 +4,7 @@ TBD - 0.9.2.7
|
||||
- GUI: Simplified the way active bands/modes are selected
|
||||
- GUI: Satellite tab is redesigned.
|
||||
- GUI: Created a widget to manage all "eQSL" simplifying implementation of the main widget.
|
||||
- GUI: Created a widget to manage the Log, simplifying implementation of the main widget.
|
||||
- BugFix: Identification is a band was HF or VHF was not always properly done.
|
||||
- BugFix: Higher bands where not shown to be selected in the preferences.
|
||||
|
||||
|
8
TODO
8
TODO
@ -2,6 +2,12 @@ This is a kind of roadmap for KLog development.
|
||||
It is not fixed... new features may be prioritized or not added without any notice ;-)
|
||||
Feel free to request any roadmap change if you have any suggestion.
|
||||
|
||||
RC-BUGS: The ADIF export is not working!!!
|
||||
As I have changed the supportedcontest table and removed the "0" value for DX logs, I should rebuild that table
|
||||
before releasing to ensure coherence of all the data in the DB
|
||||
|
||||
|
||||
|
||||
TODO: Think if it is possible to create a function in the Widgets(i.e. MainWindowInputQSL) to read the data and
|
||||
enter it in the DB automatically when the user clicks on "enter"
|
||||
It would help to "isolate" it and make it more "independant"
|
||||
@ -11,7 +17,7 @@ TODO: Check if in mainwindow (read formUI and modify the eQSL/LOTW REC/SENT valu
|
||||
|
||||
TODO: If no QSL sen via or rec via are defined, KLog shows as direct? It should be bureau
|
||||
|
||||
RC-BUGS: The ADIF export is not working!!!
|
||||
|
||||
|
||||
|
||||
TODO: Add a cheking to the list of bureaus and propose the bureau for QSL via when there is an existing one and propose direct when no bureau is existing.
|
||||
|
164
database.cpp
164
database.cpp
@ -755,13 +755,13 @@ QString DataBase::getBandNameFromNumber(const int _n)
|
||||
else
|
||||
{
|
||||
//qDebug() << "DataBase::getBandNameFromNumber: " << "-------- END-1" << endl;
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//qDebug() << "DataBase::getBandNameFromNumber: " << "-------- END-2" << endl;
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -801,7 +801,7 @@ QString DataBase::getModeNameFromNumber(const int _n, const bool _tmp)
|
||||
else
|
||||
{
|
||||
//qDebug() << "DataBase::getModeNameFromNumber - Not Valid Mode: " << (query.value(0)).toString() << endl;
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
*/
|
||||
}
|
||||
@ -809,7 +809,7 @@ QString DataBase::getModeNameFromNumber(const int _n, const bool _tmp)
|
||||
{
|
||||
//qDebug() << "DataBase::getModeNameFromNumber - Not Valid record" << endl;
|
||||
//qDebug() << "DataBase::getModeNameFromNumber: ------ END-2" << endl;
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -845,20 +845,20 @@ QString DataBase::getSubModeNameFromNumber(const int _n, const bool _tmp)
|
||||
else
|
||||
{
|
||||
//qDebug() << "DataBase::getSubModeNameFromNumber: NO valid mode - END" << endl;
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//qDebug() << "DataBase::getSubModeNameFromNumber: query not valid - END" << endl;
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//qDebug() << "DataBase::getSubModeNameFromNumber: query not next - END" << endl;
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
@ -866,10 +866,10 @@ QString DataBase::getSubModeNameFromNumber(const int _n, const bool _tmp)
|
||||
else
|
||||
{
|
||||
//qDebug() << "DataBase::getSubModeNameFromNumber: SQL FALSE - END" << endl;
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
//qDebug() << "DataBase::getSubModeNameFromNumber: - END-X" << endl;
|
||||
return "";
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool DataBase::isValidBand (const QString b)
|
||||
@ -1323,8 +1323,42 @@ QString DataBase::getFreqFromBandId(const int _i)
|
||||
}
|
||||
//qDebug() << "DataBase::getFreqFromBandId END-2" << endl;
|
||||
return "-2.0";
|
||||
}
|
||||
|
||||
int DataBase::getLogTypeNumber(const QString _logType)
|
||||
{
|
||||
//qDebug() << "DataBase::getLogTypeNumber: " << QString::number(_logType) << endl;
|
||||
QSqlQuery query;
|
||||
QString queryString = QString("SELECT id FROM supportedcontests WHERE name='%1'").arg(_logType);
|
||||
|
||||
query.exec(queryString);
|
||||
query.next();
|
||||
if ( query.isValid() )
|
||||
{
|
||||
return (query.value(0)).toInt();
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
QString DataBase::getLogTypeName(const int _logType)
|
||||
{
|
||||
//qDebug() << "DataBase::getLogTypeName: " << QString::number(_logType) << endl;
|
||||
QSqlQuery query;
|
||||
QString queryString = QString("SELECT name FROM supportedcontests WHERE id='%1'").arg(_logType);
|
||||
|
||||
query.exec(queryString);
|
||||
query.next();
|
||||
if ( query.isValid() )
|
||||
{
|
||||
return (query.value(0)).toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
bool DataBase::updateToLatest()
|
||||
@ -1335,7 +1369,7 @@ bool DataBase::updateToLatest()
|
||||
*
|
||||
*/
|
||||
//qDebug() << "DataBase::updateToLatest " << endl;
|
||||
return updateTo009();
|
||||
return updateTo010();
|
||||
}
|
||||
|
||||
bool DataBase::updateTo003()
|
||||
@ -1601,7 +1635,22 @@ bool DataBase::recreateContestData()
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DataBase::recreateSupportedContest()
|
||||
{
|
||||
//qDebug() << "DataBase::recreateSupportedContest" << endl;
|
||||
QSqlQuery query;
|
||||
bool sqlOk = false;
|
||||
sqlOk = query.exec("DROP TABLE supportedcontests");
|
||||
if (sqlOk)
|
||||
{
|
||||
if (createTableSupportedContest())
|
||||
{
|
||||
return populateTableSupportedContest();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
bool DataBase::updateLog()
|
||||
@ -1675,6 +1724,16 @@ bool DataBase::createTablePropModes()
|
||||
return query.exec("CREATE TABLE prop_mode_enumeration (id INTEGER PRIMARY KEY AUTOINCREMENT, shortname VARCHAR(8), name VARCHAR(55) )");
|
||||
}
|
||||
|
||||
bool DataBase::createTableSupportedContest()
|
||||
{
|
||||
//qDebug() << "DataBase::createTableSupportedContest" << endl;
|
||||
QSqlQuery query;
|
||||
return query.exec("CREATE TABLE supportedcontests ("
|
||||
"id INTEGER PRIMARY KEY, "
|
||||
"longname VARCHAR,"
|
||||
"name VARCHAR)");
|
||||
|
||||
}
|
||||
|
||||
bool DataBase::createTableContest()
|
||||
{
|
||||
@ -1698,10 +1757,7 @@ bool DataBase::createTableContest()
|
||||
"FOREIGN KEY (catoverlay) REFERENCES contestcatoverlay(id), "
|
||||
"FOREIGN KEY (catmode) REFERENCES contestcatmode(id))");
|
||||
|
||||
query.exec("CREATE TABLE supportedcontests ("
|
||||
"id INTEGER PRIMARY KEY, "
|
||||
"longname VARCHAR,"
|
||||
"name VARCHAR)");
|
||||
createTableSupportedContest();
|
||||
|
||||
query.exec("CREATE TABLE contestcatoperator ("
|
||||
"id INTEGER PRIMARY KEY, "
|
||||
@ -1727,11 +1783,7 @@ bool DataBase::createTableContest()
|
||||
"id INTEGER PRIMARY KEY, "
|
||||
"name VARCHAR)");
|
||||
|
||||
// ADDING ALL THE CATEGORIES OPTIONS
|
||||
|
||||
query.exec("INSERT INTO supportedcontests (id, longname, name) VALUES ('0', 'Normal log', 'DX')");
|
||||
|
||||
// query.exec("INSERT INTO supportedcontests (id, longname, name) VALUES ('1', 'CQ WW DX Contest(SSB)', 'CQ-WW-SSB')");
|
||||
populateTableSupportedContest();
|
||||
|
||||
query.exec("INSERT INTO contestcatoperator (id, name) VALUES ('0', 'N/A')");
|
||||
query.exec("INSERT INTO contestcatoperator (id, name) VALUES ('1', 'Single-Operator')");
|
||||
@ -1767,6 +1819,16 @@ bool DataBase::createTableContest()
|
||||
|
||||
}
|
||||
|
||||
bool DataBase::populateTableSupportedContest()
|
||||
{
|
||||
// ADDING ALL THE CATEGORIES OPTIONS
|
||||
QSqlQuery query;
|
||||
return query.exec("INSERT INTO supportedcontests (longname, name) VALUES ('Normal log', 'DX')");
|
||||
|
||||
// query.exec("INSERT INTO supportedcontests (id, longname, name) VALUES ('1', 'CQ WW DX Contest(SSB)', 'CQ-WW-SSB')");
|
||||
//return true;
|
||||
}
|
||||
|
||||
bool DataBase::createTableMode(const bool NoTmp)
|
||||
{ // NoTmp = false => TMP data table to operate and be deleted afterwards
|
||||
|
||||
@ -2421,7 +2483,8 @@ bool DataBase::updateTableLog(const int _v)
|
||||
QString queryString;
|
||||
switch (_v)
|
||||
{
|
||||
case 6: // If 6, we copy in logtemp the full data coming from the old log. This way, the structure of the log table is updated without any data loss.
|
||||
case 6: // If 6, we copy in logtemp the full data coming from the old log. This way, the structure of
|
||||
// the log table is updated without any data loss.
|
||||
queryString = QString ("INSERT INTO logtemp (qso_date, time_on, call, rst_sent, rst_rcvd, bandid, modeid, srx, stx, points, multiplier, cqz, ituz, dxcc, address, age, cnty, comment, a_index, ant_az, ant_el, ant_path, arrl_sect, band_rx, checkcontest, class, contacted_op, contest_id, country, credit_submitted, credit_granted, distance, email, eq_call, eqsl_qslrdate, eqsl_qslsdate, eqsl_qsl_rcvd, eqsl_qsl_sent, force_init, freq, freq_rx, gridsquare, iota, iota_island_id, k_index, lat, lon, lotw_qslrdate, lotw_qslsdate, lotw_qsl_rcvd, lotw_qsl_sent, max_bursts, ms_shower, my_city, my_cnty, my_country, my_cq_zone, my_gridsquare, my_iota, my_iota_island_id, my_lat, my_lon, my_name, my_rig, my_sig, my_sig_info, my_state, my_street, name, notes, nr_bursts, nr_pings, operator, owner_callsign, pfx, precedence, prop_mode, public_key, qslmsg, qslrdate, qslsdate, qsl_rcvd, qsl_sent, qsl_rcvd_via, qsl_sent_via, qsl_via, qso_complete, qso_random, qth, rx_pwr, sat_mode, sat_name, sfi, sig, sig_info, srx_string, stx_string, state, station_callsign, swl, ten_ten, tx_pwr, web, qso_date_off, time_off, transmiterid, marked, lognumber) SELECT qso_date, time_on, call, rst_sent, rst_rcvd, bandid, modeid, srx, stx, points, multiplier, cqz, ituz, dxcc, address, age, cnty, comment, a_index, ant_az, ant_el, ant_path, arrl_sect, band_rx, checkcontest, class, contacted_op, contest_id, country, credit_submitted, credit_granted, distance, email, eq_call, eqsl_qslrdate, eqsl_qslsdate, eqsl_qsl_rcvd, eqsl_qsl_sent, force_init, freq, freq_rx, gridsquare, iota, iota_island_id, k_index, lat, lon, lotw_qslrdate, lotw_qslsdate, lotw_qsl_rcvd, lotw_qsl_sent, max_bursts, ms_shower, my_city, my_cnty, my_country, my_cq_zone, my_gridsquare, my_iota, my_iota_island_id, my_lat, my_lon, my_name, my_rig, my_sig, my_sig_info, my_state, my_street, name, notes, nr_bursts, nr_pings, operator, owner_callsign, pfx, precedence, prop_mode, public_key, qslmsg, qslrdate, qslsdate, qsl_rcvd, qsl_sent, qsl_rcvd_via, qsl_sent_via, qsl_via, qso_complete, qso_random, qth, rx_pwr, sat_mode, sat_name, sfi, sig, sig_info, srx_string, stx_string, state, station_callsign, swl, ten_ten, tx_pwr, web, qso_date_off, time_off, transmiterid, marked, lognumber FROM log");
|
||||
break;
|
||||
default:
|
||||
@ -2669,7 +2732,7 @@ bool DataBase::updateModeIdFromSubModeId()
|
||||
{
|
||||
while (query.next())
|
||||
{
|
||||
modetxt = "";
|
||||
modetxt = QString();
|
||||
modeFound = -1;
|
||||
|
||||
if (query.isValid())
|
||||
@ -2835,7 +2898,7 @@ bool DataBase::updateBandIdTableLogToNewOnes()
|
||||
{
|
||||
while (query.next() && (!cancel) )
|
||||
{
|
||||
bandtxt = "";
|
||||
bandtxt = QString();
|
||||
bandFound = -1;
|
||||
|
||||
if (query.isValid())
|
||||
@ -3029,7 +3092,7 @@ bool DataBase::updateBandIdTableAward(const int _db)
|
||||
{
|
||||
while (query.next() && (!cancel) )
|
||||
{
|
||||
bandtxt = "";
|
||||
bandtxt = QString();
|
||||
bandFound = -1;
|
||||
|
||||
if (query.isValid())
|
||||
@ -3220,7 +3283,7 @@ bool DataBase::updateModeIdTableAward(const int _db)
|
||||
{
|
||||
while (query.next() && (!cancel) )
|
||||
{
|
||||
bandtxt = "";
|
||||
bandtxt = QString();
|
||||
bandFound = -1;
|
||||
|
||||
if (query.isValid())
|
||||
@ -3390,7 +3453,7 @@ bool DataBase::updateModeIdTableLogToNewOnes()
|
||||
{
|
||||
while (query.next() && (!cancel) )
|
||||
{
|
||||
bandtxt = "";
|
||||
bandtxt = QString();
|
||||
bandFound = -1;
|
||||
|
||||
if (query.isValid())
|
||||
@ -3644,7 +3707,6 @@ bool DataBase::updateTo009()
|
||||
IAmIn009 = false;
|
||||
}
|
||||
|
||||
|
||||
while (!IAmIn009 && !ErrorUpdating)
|
||||
{
|
||||
while (!IAmIn008 && !ErrorUpdating)
|
||||
@ -3670,9 +3732,6 @@ bool DataBase::updateTo009()
|
||||
}
|
||||
//DO ALL THE TASKS TO BE IN 0.009 from 0.008 HERE and set ErrorUpdating if it is not possible.
|
||||
|
||||
|
||||
|
||||
|
||||
if (createTableSatellites(true))
|
||||
{
|
||||
//qDebug() << "DataBase::updateTo009: - createTableSatellites OK" << endl;
|
||||
@ -3699,7 +3758,6 @@ bool DataBase::updateTo009()
|
||||
ErrorUpdating = true;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
//qDebug() << "DataBase::updateTo009: - isonames NOT updated" << endl;
|
||||
@ -3731,6 +3789,52 @@ bool DataBase::updateTo009()
|
||||
return IAmIn009;
|
||||
}
|
||||
|
||||
|
||||
bool DataBase::updateTo010()
|
||||
{ // Updates the DB to 010
|
||||
// Updates DB and recreates the supportedcontest table
|
||||
/*
|
||||
* This function should be used as a template to create the all the update functions implementing the needed changes
|
||||
* in the dB to update from one version to the following one.
|
||||
*
|
||||
* // dbVersion shows the DB version that is being deployed
|
||||
* // latestReaded shows the DB version that is currently deployed.
|
||||
*i.e.:
|
||||
* QString stringQuery = QString ("ALTER TABLE award_enumeration ADD COLUMN dxcc INTEGER;");
|
||||
*
|
||||
*/
|
||||
//qDebug() << "DataBase::updateTo003" << endl;
|
||||
bool IAmIn010 = false;
|
||||
bool IAmIn009 = false;
|
||||
bool ErrorUpdating = false;
|
||||
|
||||
if (latestReaded >= 0.010)
|
||||
{
|
||||
//IAmIn010 = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IAmIn010 = false;
|
||||
}
|
||||
|
||||
while (!IAmIn010 && !ErrorUpdating)
|
||||
{
|
||||
while (!IAmIn009 && !ErrorUpdating)
|
||||
{
|
||||
IAmIn009 = true;
|
||||
}
|
||||
if (ErrorUpdating)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//DO ALL THE TASKS TO BE IN 0.010 from 0.009 HERE and set ErrorUpdating if it is not possible.
|
||||
|
||||
IAmIn010 = recreateSupportedContest();
|
||||
}
|
||||
return IAmIn010;
|
||||
}
|
||||
|
||||
bool DataBase::updateTheModeTableAndSyncLog()
|
||||
{
|
||||
//qDebug() << "DataBase::updateTheModeTableAndSyncLog" << endl;
|
||||
|
12
database.h
12
database.h
@ -39,9 +39,8 @@
|
||||
|
||||
class QSqlRelationalTableModel;
|
||||
|
||||
// Last db update 0.0.6
|
||||
// Previous db update 0.0.7
|
||||
const float DBVersionf = 0.009;
|
||||
// Previous db update 0.009
|
||||
const float DBVersionf = 0.010;
|
||||
|
||||
class DataBase
|
||||
{
|
||||
@ -78,6 +77,9 @@ public:
|
||||
|
||||
QString getFreqFromBandId(const int _i);
|
||||
|
||||
int getLogTypeNumber(const QString _logType);
|
||||
QString getLogTypeName(const int _logType);
|
||||
|
||||
bool unMarkAllQSO();
|
||||
bool updateIfNeeded();
|
||||
void compress();
|
||||
@ -97,6 +99,7 @@ private:
|
||||
bool updateTo007();
|
||||
bool updateTo008();
|
||||
bool updateTo009(); // Updates DB and add the Satellite tables
|
||||
bool updateTo010(); // Updates DB and recreates the supportedcontest table
|
||||
bool updateTableLog(const int _v);
|
||||
|
||||
bool createTheBandQuickReference();
|
||||
@ -124,9 +127,12 @@ private:
|
||||
bool populateTableSatellites(const bool NoTmp);
|
||||
|
||||
bool recreateContestData();
|
||||
bool recreateSupportedContest();
|
||||
bool createTableContest();
|
||||
bool createTableSupportedContest();
|
||||
bool populateContestData();
|
||||
bool populatePropagationModes();
|
||||
bool populateTableSupportedContest();
|
||||
|
||||
bool howManyQSOsInLog(const int i);
|
||||
void showError();
|
||||
|
@ -405,6 +405,21 @@ QStringList DataProxy::getDataFromContestType(const int _n)
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
int DataProxy::getLogTypeNumber(const QString _logType)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
QString DataProxy::getLogTypeName(const int _logType)
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
int DataProxy::getLogTypeOfUserLog(const int _logN)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
int DataProxy::getHowManyQSOInLog(const int _log)
|
||||
{
|
||||
return 0;
|
||||
|
@ -136,6 +136,9 @@ public:
|
||||
virtual QStringList getContestOverlays();
|
||||
virtual int getContestTypeN(const int _co, const int _catop, const int _catas, const int _catpo, const int _catba, const int _catov, const int _catmo);
|
||||
virtual QStringList getDataFromContestType(const int _n);
|
||||
virtual int getLogTypeNumber(const QString _logType); // Returns the number of the type of log name
|
||||
virtual QString getLogTypeName(const int _logType); // Returns the name of the type of log number
|
||||
virtual int getLogTypeOfUserLog(const int _logN); // Returns the type of log of a specific log
|
||||
|
||||
virtual QStringList getBandNames();
|
||||
virtual QStringList getPropModeList();
|
||||
|
@ -2301,6 +2301,39 @@ QStringList DataProxy_SQLite::getDataFromContestType(const int _n)
|
||||
}
|
||||
}
|
||||
|
||||
int DataProxy_SQLite::getLogTypeNumber(const QString _logType)
|
||||
{
|
||||
return db->getLogTypeNumber(_logType);
|
||||
}
|
||||
|
||||
QString DataProxy_SQLite::getLogTypeName(const int _logType)
|
||||
{
|
||||
return db->getLogTypeName(_logType);
|
||||
}
|
||||
|
||||
int DataProxy_SQLite::getLogTypeOfUserLog(const int _logN)
|
||||
{
|
||||
QSqlQuery query;
|
||||
QString aux;
|
||||
aux = QString("SELECT logtypen FROM logs WHERE id='%1'").arg(_logN);
|
||||
if (query.exec(aux))
|
||||
{
|
||||
query.next();
|
||||
if (query.isValid())
|
||||
{
|
||||
return (query.value(0)).toInt();
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int DataProxy_SQLite::getHowManyQSOInLog(const int _log)
|
||||
{
|
||||
|
@ -136,6 +136,9 @@ public:
|
||||
QStringList getContestOverlays();
|
||||
int getContestTypeN(const int _co, const int _catop, const int _catas, const int _catpo, const int _catba, const int _catov, const int _catmo);
|
||||
QStringList getDataFromContestType(const int _n);
|
||||
int getLogTypeNumber(const QString _logType);
|
||||
QString getLogTypeName(const int _logType);
|
||||
int getLogTypeOfUserLog(const int _logN);
|
||||
|
||||
QStringList getBandNames();
|
||||
QStringList getPropModeList();
|
||||
|
6
klog.pro
6
klog.pro
@ -69,7 +69,8 @@ HEADERS += setupdialog.h \
|
||||
mainwindowinputothers.h \
|
||||
mainwindowinputeqsl.h \
|
||||
mainwindowinputqsl.h \
|
||||
setuppagebandmode.h
|
||||
setuppagebandmode.h \
|
||||
logmodel.h
|
||||
SOURCES += main.cpp \
|
||||
aboutdialog.cpp \
|
||||
setupdialog.cpp \
|
||||
@ -108,7 +109,8 @@ SOURCES += main.cpp \
|
||||
mainwindowinputothers.cpp \
|
||||
mainwindowinputeqsl.cpp \
|
||||
mainwindowinputqsl.cpp \
|
||||
setuppagebandmode.cpp
|
||||
setuppagebandmode.cpp \
|
||||
logmodel.cpp
|
||||
|
||||
OTHER_FILES += \
|
||||
README-DEVEL \
|
||||
|
124
logmodel.cpp
Normal file
124
logmodel.cpp
Normal file
@ -0,0 +1,124 @@
|
||||
#include "logmodel.h"
|
||||
|
||||
LogModel::LogModel(QObject *parent):QSqlRelationalTableModel(parent)
|
||||
{
|
||||
qDebug() << "LogModel::LogModel: " << endl;
|
||||
//logModel = new QSqlRelationalTableModel(this);
|
||||
dataProxy = new DataProxy_SQLite();
|
||||
setTable("log");
|
||||
|
||||
}
|
||||
|
||||
|
||||
void LogModel::createlogModel(const int _i)
|
||||
{
|
||||
/*
|
||||
Log_Id = 0,
|
||||
Log_Name = 1,
|
||||
Log_BandId = 2,
|
||||
Log_ModeId = 3,
|
||||
Log_DateId = 4,
|
||||
Log_TimeId = 5
|
||||
|
||||
setRelation ( int column, const QSqlRelation & relation )
|
||||
|
||||
model->setTable("employee");
|
||||
model->setRelation(2, QSqlRelation("city", "id", "name"));
|
||||
|
||||
The setRelation() call specifies that column 2 in table employee
|
||||
is a foreign key that maps with field id of table city, and that
|
||||
the view should present the city's name field to the user.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
This should be coherent with the logview
|
||||
*/
|
||||
|
||||
//qDebug() << "LogModel::createlogModel: " << QString::number(_i) << endl;
|
||||
|
||||
int contestMode = dataProxy->getLogTypeOfUserLog(_i);
|
||||
//qDebug() << "LogModel::createlogModel - contestMode: " << QString::number(contestMode) << endl;
|
||||
|
||||
QString stringQuery = QString("lognumber='%1'").arg(_i);
|
||||
QSqlQuery query(stringQuery);
|
||||
setFilter(stringQuery);
|
||||
|
||||
|
||||
if (contestMode== dataProxy->getLogTypeNumber("DX"))
|
||||
{
|
||||
setColumnsToDX();
|
||||
}
|
||||
else if (contestMode == dataProxy->getLogTypeNumber("CQ_WW_SSB"))
|
||||
{
|
||||
|
||||
}
|
||||
else if (contestMode == dataProxy->getLogTypeNumber("CQ_WW_CW"))
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
setColumnsToDX();
|
||||
}
|
||||
|
||||
|
||||
select();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void LogModel::setColumnsToDX()
|
||||
{
|
||||
//qDebug() << "LogModel::setColumnsToDX" << endl;
|
||||
|
||||
QSqlQuery q;
|
||||
QString stringQuery = QString("SELECT * from log LIMIT 1");
|
||||
QSqlRecord rec; // = q.record();
|
||||
|
||||
int nameCol;
|
||||
|
||||
q.exec(stringQuery);
|
||||
q.next();
|
||||
rec = q.record(); // Number of columns
|
||||
|
||||
//qDebug() << "LogModel::createlogModel - columns: " << QString::number(rec.count()) << endl;
|
||||
|
||||
|
||||
|
||||
nameCol = rec.indexOf("bandid");
|
||||
setRelation(nameCol, QSqlRelation("band", "id", "name"));
|
||||
|
||||
nameCol = rec.indexOf("modeid");
|
||||
//setRelation(nameCol, QSqlRelation("mode", "id", "name"));
|
||||
setRelation(nameCol, QSqlRelation("mode", "id", "submode"));
|
||||
|
||||
nameCol = rec.indexOf("id");
|
||||
setSort(nameCol, Qt::AscendingOrder);
|
||||
|
||||
nameCol = rec.indexOf("qso_date");
|
||||
setHeaderData(nameCol, Qt::Horizontal, tr("Date"));
|
||||
|
||||
nameCol = rec.indexOf("time_on");
|
||||
setHeaderData(nameCol, Qt::Horizontal, tr("Time"));
|
||||
|
||||
nameCol = rec.indexOf("call");
|
||||
setHeaderData(nameCol, Qt::Horizontal,tr("QRZ"));
|
||||
|
||||
nameCol = rec.indexOf("bandid");
|
||||
setHeaderData(nameCol, Qt::Horizontal, tr("Band"));
|
||||
|
||||
nameCol = rec.indexOf("modeid");
|
||||
setHeaderData(nameCol, Qt::Horizontal, tr("Mode"));
|
||||
|
||||
nameCol = rec.indexOf("rst_sent");
|
||||
setHeaderData(nameCol, Qt::Horizontal, tr("RSTtx"));
|
||||
|
||||
nameCol = rec.indexOf("rst_rcvd");
|
||||
setHeaderData(nameCol, Qt::Horizontal, tr("RSTrx"));
|
||||
|
||||
nameCol = rec.indexOf("comment");
|
||||
setHeaderData(nameCol, Qt::Horizontal, tr("Comment"));
|
||||
}
|
||||
|
||||
|
62
logmodel.h
Normal file
62
logmodel.h
Normal file
@ -0,0 +1,62 @@
|
||||
#ifndef LOGMODEL_H
|
||||
#define LOGMODEL_H
|
||||
/***************************************************************************
|
||||
logmodel.h - description
|
||||
-------------------
|
||||
begin : june 2017
|
||||
copyright : (C) 2017 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 <QDebug>
|
||||
#include <QSqlRelationalTableModel>
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlRecord>
|
||||
#include "dataproxy.h"
|
||||
#include "dataproxy_sqlite.h"
|
||||
|
||||
|
||||
class LogModel : public QSqlRelationalTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
LogModel(QObject *parent);
|
||||
void createlogModel(const int _i);
|
||||
|
||||
private:
|
||||
void setColumnsToDX();
|
||||
//QSqlRelationalTableModel *logModel;
|
||||
DataProxy *dataProxy;
|
||||
};
|
||||
|
||||
#endif // LOGMODEL_H
|
||||
|
||||
|
||||
/*
|
||||
class MyModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MyModel(QObject *parent);
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const ;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
};
|
||||
*/
|
@ -27,16 +27,17 @@
|
||||
#include "logwindow.h"
|
||||
|
||||
|
||||
LogWindow::LogWindow(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
LogWindow::LogWindow(QWidget *parent) : QTableView(parent)
|
||||
{
|
||||
//qDebug() << "LogWindow::LogWindow: " << endl;
|
||||
//logModel = new QSqlRelationalTableModel(this);
|
||||
logView = new QTableView;
|
||||
//logView = new QTableView;
|
||||
|
||||
dataProxy = new DataProxy_SQLite();
|
||||
|
||||
createUI();
|
||||
setDefaultData();
|
||||
|
||||
|
||||
}
|
||||
|
||||
LogWindow::~LogWindow()
|
||||
@ -47,24 +48,93 @@ LogWindow::~LogWindow()
|
||||
|
||||
void LogWindow::clear()
|
||||
{
|
||||
|
||||
//qDebug() << "LogWindow::clear " << endl;
|
||||
}
|
||||
|
||||
void LogWindow::createUI()
|
||||
{
|
||||
logView->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
logView->setSortingEnabled(true);
|
||||
//logView->setCurrentIndex(logModel->index(0, 0));
|
||||
//qDebug() << "LogWindow::createUI" << endl;
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
setSortingEnabled(true);
|
||||
|
||||
|
||||
//QVBoxLayout *layout = new QVBoxLayout;
|
||||
//layout->addWidget(logView);
|
||||
|
||||
//setLayout(layout);
|
||||
}
|
||||
|
||||
void LogWindow::setDefaultData()
|
||||
{
|
||||
|
||||
|
||||
//qDebug() << "LogWindow::setDefaultData" << endl;
|
||||
}
|
||||
|
||||
void LogWindow::createLogModel()
|
||||
|
||||
void LogWindow::createlogPanel(const int _contestID)
|
||||
{
|
||||
//qDebug() << "LogWindow::createlogPanel: " << QString::number(_contestID) << endl;
|
||||
|
||||
int contestMode = dataProxy->getLogTypeOfUserLog(_contestID);
|
||||
|
||||
if (contestMode == dataProxy->getLogTypeNumber("DX"))
|
||||
{
|
||||
//qDebug() << "LogWindow::createlogPanel: DX" << endl;
|
||||
setColumnsToDX();
|
||||
}
|
||||
else if (contestMode == dataProxy->getLogTypeNumber("CQ_WW_SSB"))
|
||||
{
|
||||
|
||||
}
|
||||
else if (contestMode == dataProxy->getLogTypeNumber("CQ_WW_CW"))
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//qDebug() << "LogWindow::createlogPanel: Default" << endl;
|
||||
setColumnsToDX();
|
||||
}
|
||||
|
||||
setItemDelegate(new QSqlRelationalDelegate(this));
|
||||
setSelectionMode( QAbstractItemView::SingleSelection);
|
||||
setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
resizeColumnsToContents();
|
||||
horizontalHeader()->setStretchLastSection(true);
|
||||
|
||||
}
|
||||
|
||||
void LogWindow::setColumnsToDX()
|
||||
{
|
||||
//qDebug() << "LogWindow::setColumnsToDX" << endl;
|
||||
QString stringQuery;
|
||||
stringQuery = QString("SELECT * FROM log LIMIT 1");
|
||||
QSqlQuery query;
|
||||
query.exec(stringQuery);
|
||||
QSqlRecord rec;
|
||||
rec = query.record(); // Number of columns
|
||||
int columns = rec.count();
|
||||
|
||||
|
||||
for (int i=0; i < columns; i++)
|
||||
{
|
||||
setColumnHidden(i, true);
|
||||
}
|
||||
|
||||
columns = rec.indexOf("qso_date");
|
||||
setColumnHidden(columns, false);
|
||||
columns = rec.indexOf("time_on");
|
||||
setColumnHidden(columns, false);
|
||||
columns = rec.indexOf("call");
|
||||
setColumnHidden(columns, false);
|
||||
columns = rec.indexOf("rst_sent");
|
||||
setColumnHidden(columns, false);
|
||||
columns = rec.indexOf("rst_rcvd");
|
||||
setColumnHidden(columns, false);
|
||||
columns = rec.indexOf("bandid");
|
||||
setColumnHidden(columns, false);
|
||||
columns = rec.indexOf("modeid");
|
||||
setColumnHidden(columns, false);
|
||||
columns = rec.indexOf("comment");
|
||||
setColumnHidden(columns, false);
|
||||
}
|
||||
|
19
logwindow.h
19
logwindow.h
@ -27,32 +27,39 @@
|
||||
* *
|
||||
*****************************************************************************/
|
||||
|
||||
//#include <QtWidgets>
|
||||
#include <QtWidgets>
|
||||
#include <QWidget>
|
||||
#include <QSqlRelationalTableModel>
|
||||
//#include <QSqlRelationalTableModel>
|
||||
#include <QTableView>
|
||||
#include <QAction>
|
||||
#include <QSqlQuery>
|
||||
#include <QSqlRecord>
|
||||
#include <QSqlRelationalDelegate>
|
||||
#include "dataproxy.h"
|
||||
#include "dataproxy_sqlite.h"
|
||||
|
||||
|
||||
|
||||
class LogWindow : public QWidget
|
||||
class LogWindow : public QTableView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LogWindow(QWidget *parent = 0);
|
||||
~LogWindow();
|
||||
|
||||
void createlogPanel(const int _contestID);
|
||||
void clear();
|
||||
|
||||
private:
|
||||
void createUI();
|
||||
void setDefaultData();
|
||||
void setColumnsToDX();
|
||||
|
||||
void createLogModel();
|
||||
|
||||
//void createLogModel();
|
||||
DataProxy *dataProxy;
|
||||
//QSqlRelationalTableModel *logModel;
|
||||
QTableView *logView;
|
||||
QLabel *logLabel;
|
||||
|
||||
};
|
||||
|
||||
|
123
mainwindow.cpp
123
mainwindow.cpp
@ -51,13 +51,14 @@ MainWindow::MainWindow(const QString _kontestDir, const QString tversion)
|
||||
// <ui>
|
||||
doc = new QTextDocument;
|
||||
util = new Utilities;
|
||||
logModel = new LogModel(this);
|
||||
|
||||
needToEnd = false;
|
||||
cleaning = false;
|
||||
qrzAutoChanging = false;
|
||||
dxclusterServerToConnect = "dxfun.com";
|
||||
dxclusterServerPort = 8000;
|
||||
contestMode = NoContest;
|
||||
contestMode = DX;
|
||||
|
||||
defaultADIFLogFile = "klog.adi";
|
||||
softwareVersion = tversion;
|
||||
@ -153,11 +154,15 @@ MainWindow::MainWindow(const QString _kontestDir, const QString tversion)
|
||||
|
||||
dxccStatusWidget = new DXCCStatusWidget();
|
||||
|
||||
logModel = new QSqlRelationalTableModel(this);
|
||||
//logModel = new QSqlRelationalTableModel(this);
|
||||
|
||||
//logView = new QTableView;
|
||||
//logView->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
//logView->setSortingEnabled(true);
|
||||
|
||||
logModel = new LogModel(this);
|
||||
logWindow = new LogWindow(this);
|
||||
|
||||
logView = new QTableView;
|
||||
logView->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
logView->setSortingEnabled(true);
|
||||
//qDebug() << "MainWindow::MainWindow: 0009" << endl;
|
||||
|
||||
//helpHelpDialog = new HelpHelpDialog(softwareVersion);
|
||||
@ -352,7 +357,7 @@ MainWindow::MainWindow(const QString _kontestDir, const QString tversion)
|
||||
distShortLabel = new QLabel;
|
||||
gradLongLabel = new QLabel;
|
||||
distLongLabel = new QLabel;
|
||||
logPanel = new QWidget;
|
||||
//logPanel = new QWidget;
|
||||
loggWinAct = new QAction(tr("&Log Window"), this);
|
||||
scoreeWinAct = new QAction(tr("&Score Window"), this);
|
||||
|
||||
@ -495,10 +500,21 @@ MainWindow::MainWindow(const QString _kontestDir, const QString tversion)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
//qDebug() << "MainWindow::MainWindow: UI to be created" << endl;
|
||||
//qDebug() << "MainWindow::MainWindow: UI to be created" << endl;
|
||||
//createlogModel(currentLog);
|
||||
|
||||
//qDebug() << "MainWindow::MainWindow: logmodel to be created-1" << endl;
|
||||
logModel->createlogModel(currentLog);
|
||||
|
||||
logWindow->setModel(logModel);
|
||||
logWindow->setCurrentIndex(logModel->index(0, 0));
|
||||
|
||||
logWindow->createlogPanel(currentLog);
|
||||
|
||||
createUI();
|
||||
//qDebug() << "MainWindow::MainWindow: logmodel to be created" << endl;
|
||||
createlogModel(currentLog);
|
||||
|
||||
|
||||
|
||||
createSearchResultsPanel();
|
||||
loggWinAct->setShortcut(Qt::CTRL + Qt::Key_L);
|
||||
@ -514,7 +530,8 @@ MainWindow::MainWindow(const QString _kontestDir, const QString tversion)
|
||||
createScorePanel();
|
||||
|
||||
setWindowTitle(tr("KLog"));
|
||||
logView->setCurrentIndex(logModel->index(0, 0));
|
||||
//logView->setCurrentIndex(logModel->index(0, 0));
|
||||
logWindow->setCurrentIndex(logModel->index(0, 0));
|
||||
//searchResultsTreeWidget->setCurrentIndex(logModel->index(0, 0));
|
||||
|
||||
//qDebug() << "MainWindow::MainWindow: 16" << endl;
|
||||
@ -574,7 +591,6 @@ MainWindow::MainWindow(const QString _kontestDir, const QString tversion)
|
||||
|
||||
|
||||
slotClearButtonClicked();
|
||||
//logModel->select();
|
||||
|
||||
upAndRunning = true;
|
||||
|
||||
@ -867,6 +883,7 @@ void MainWindow::slotQRZReturnPressed()
|
||||
}
|
||||
|
||||
|
||||
//logModel->select();
|
||||
logModel->select();
|
||||
dxccStatusWidget->refresh();
|
||||
|
||||
@ -2255,11 +2272,14 @@ WHERE [condition];
|
||||
return stringQuery;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void MainWindow::createlogPanel()
|
||||
{
|
||||
|
||||
// //qDebug() << "MainWindow::createlogPanel: " << endl;
|
||||
logView->setModel(logModel);
|
||||
|
||||
|
||||
QString stringQuery;
|
||||
stringQuery = QString("SELECT * FROM log LIMIT 1");
|
||||
|
||||
@ -2348,7 +2368,7 @@ void MainWindow::createlogPanel()
|
||||
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
||||
void MainWindow::createSearchResultsPanel()
|
||||
{
|
||||
@ -2413,10 +2433,10 @@ void MainWindow::createScorePanel()
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void MainWindow::createlogModel(const int _i)
|
||||
{
|
||||
/*
|
||||
|
||||
Log_Id = 0,
|
||||
Log_Name = 1,
|
||||
Log_BandId = 2,
|
||||
@ -2435,8 +2455,8 @@ the view should present the city's name field to the user.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
//qDebug() << "MainWindow::createlogModel: " << QString::number(_i) << endl;
|
||||
/*
|
||||
qDebug() << "MainWindow::createlogModel: " << QString::number(_i) << endl;
|
||||
QSqlQuery q;
|
||||
QString stringQuery = QString("SELECT * from log LIMIT 1");
|
||||
QSqlRecord rec; // = q.record();
|
||||
@ -2446,12 +2466,13 @@ the view should present the city's name field to the user.
|
||||
q.exec(stringQuery);
|
||||
q.next();
|
||||
rec = q.record(); // Number of columns
|
||||
//qDebug() << "MainWindow::createlogModel - columns: " << QString::number(rec.count()) << endl;
|
||||
qDebug() << "MainWindow::createlogModel - columns: " << QString::number(rec.count()) << endl;
|
||||
|
||||
logModel = new QSqlRelationalTableModel(this);
|
||||
|
||||
|
||||
stringQuery = QString("lognumber='%1'").arg(_i);
|
||||
//qDebug() << "MainWindow::createlogModel - filter: " << stringQuery << endl;
|
||||
qDebug() << "MainWindow::createlogModel - filter: " << stringQuery << endl;
|
||||
QSqlQuery query(stringQuery);
|
||||
logModel->setTable("log");
|
||||
logModel->setFilter(stringQuery);
|
||||
@ -2505,12 +2526,13 @@ the view should present the city's name field to the user.
|
||||
}
|
||||
|
||||
|
||||
logModel->select();
|
||||
logModel->select();
|
||||
createlogPanel();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
||||
void MainWindow::createUICQWW()
|
||||
{
|
||||
@ -2692,8 +2714,8 @@ void MainWindow::createActionsCommon(){
|
||||
connect(clearButton, SIGNAL(clicked()), this, SLOT(slotClearButtonClicked() ) );
|
||||
|
||||
//LOG VIEW
|
||||
connect(logView, SIGNAL(customContextMenuRequested( const QPoint& ) ), this, SLOT(slotRighButtonFromLog( const QPoint& ) ) );
|
||||
connect(logView, SIGNAL(doubleClicked ( const QModelIndex& ) ), this, SLOT(slotDoubleClickLog( const QModelIndex& ) ) );
|
||||
connect(logWindow, SIGNAL(customContextMenuRequested( const QPoint& ) ), this, SLOT(slotRighButtonFromLog( const QPoint& ) ) );
|
||||
connect(logWindow, SIGNAL(doubleClicked ( const QModelIndex& ) ), this, SLOT(slotDoubleClickLog( const QModelIndex& ) ) );
|
||||
|
||||
|
||||
// SEARCH BOX VIEW
|
||||
@ -3579,10 +3601,7 @@ void MainWindow::slotClearButtonClicked()
|
||||
qsoMultiplier = 0;
|
||||
clublogAnswer = -1;
|
||||
clublogPrevQSO.clear();
|
||||
//Logview
|
||||
//bandOld.clear();
|
||||
//modeOld.clear();
|
||||
//Logview
|
||||
|
||||
|
||||
switch (contestMode) {
|
||||
|
||||
@ -4010,16 +4029,17 @@ void MainWindow::slotLogWinShow()
|
||||
{
|
||||
//qDebug() << "MainWindow::slotLogWinShow: " << endl;
|
||||
|
||||
if (!(logPanel->isVisible()) )
|
||||
if (!(logWindow->isVisible()) )
|
||||
{
|
||||
logWinAct->setChecked ( true );
|
||||
logPanel->show();
|
||||
logWindow->show();
|
||||
|
||||
}else
|
||||
{
|
||||
logWinAct->setChecked ( false );
|
||||
logPanel->hide();
|
||||
logWindow->hide();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::slotScoreWinShow()
|
||||
@ -4056,15 +4076,14 @@ void MainWindow::slotSetup(const int _page)
|
||||
readConfigData();
|
||||
}
|
||||
|
||||
createlogModel(currentLog);
|
||||
//createlogModel(currentLog);
|
||||
qDebug() << "MainWindow::MainWindow: logmodel to be created-2" << endl;
|
||||
logModel->createlogModel(currentLog);
|
||||
logWindow->setModel(logModel);
|
||||
logWindow->setCurrentIndex(logModel->index(0, 0));
|
||||
logWindow->createlogPanel(currentLog);
|
||||
|
||||
|
||||
if (configured)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
defineStationCallsign();
|
||||
|
||||
@ -4082,6 +4101,7 @@ void MainWindow::openFile()
|
||||
return;
|
||||
}
|
||||
|
||||
//logModel->select();
|
||||
logModel->select();
|
||||
|
||||
}
|
||||
@ -4189,6 +4209,7 @@ void MainWindow::newFile()
|
||||
multipliers = 0;
|
||||
qsoPoints = 0;
|
||||
qsoMultiplier = 0;
|
||||
//logModel->select();
|
||||
logModel->select();
|
||||
slotClearButtonClicked();
|
||||
searchResultsTreeWidget->clear();
|
||||
@ -4253,6 +4274,7 @@ void MainWindow::slotDoubleClickLog(const QModelIndex & index)
|
||||
// QSqlQuery query;
|
||||
//QString queryString;
|
||||
int row = index.row();
|
||||
//qsoToEdit((logModel->index(row, 0)).data(0).toInt());
|
||||
qsoToEdit((logModel->index(row, 0)).data(0).toInt());
|
||||
/*
|
||||
// bandOld = (logModel->index(row, 6)).data(0).toString();
|
||||
@ -4431,11 +4453,12 @@ void MainWindow::righButtonSearchMenu(const int trow)
|
||||
void MainWindow::slotRighButtonFromLog(const QPoint& pos)
|
||||
{
|
||||
//qDebug() << "MainWindow::slotshowRighButtonFromLog" << endl;
|
||||
int row = (logView->indexAt(pos)).row();
|
||||
int row = (logWindow->indexAt(pos)).row();
|
||||
showMenuRightButtonFromLogCreateActions();
|
||||
righButtonFromLogMenu(row);
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::righButtonFromLogMenu(const int trow)
|
||||
{
|
||||
//qDebug() << "MainWindow::slotshowRighButtonFromLogMenu: " << QString::number(trow) << endl;
|
||||
@ -4678,7 +4701,7 @@ void MainWindow::slotQSLSentViaDirectFromSearch()
|
||||
void MainWindow::slotQSLSentViaBureauFromLog()
|
||||
{
|
||||
//qDebug() << "MainWindow::slotQSLSentViaBureauFromLog: " << (qslSentViaBureauFromLogAct->data()).toString() << " - Id = " << QString::number( ((logModel->index( ( (qslSentViaBureauFromLogAct->data()).toInt() ) , 0)).data(0).toInt()) ) << endl;
|
||||
int _qsoId = ((logModel->index( ( (qslSentViaBureauFromLogAct->data()).toInt() ) , 0)).data(0).toInt());
|
||||
int _qsoId = ((logModel->index( ( (qslSentViaBureauFromLogAct->data()).toInt() ) , 0)).data(0).toInt());
|
||||
qslSentViaBureau(_qsoId);
|
||||
|
||||
}
|
||||
@ -4821,6 +4844,7 @@ void MainWindow::qslRecViaBureau(const int _qsoId)
|
||||
dataProxy->qslRecViaBureau(_qsoId, (dateTime->currentDateTime()).toString("yyyy/MM/dd"), false);
|
||||
awards->setAwards(_qsoId); //Update the DXCC award status
|
||||
|
||||
//logModel->select();
|
||||
logModel->select();
|
||||
showAwards();
|
||||
|
||||
@ -4845,6 +4869,7 @@ void MainWindow::qslRecViaBureauMarkReq(const int _qsoId)
|
||||
dataProxy->qslRecViaBureau(_qsoId, (dateTime->currentDateTime()).toString("yyyy/MM/dd"), true);
|
||||
awards->setAwards(_qsoId); //Update the DXCC award status
|
||||
|
||||
//logModel->select();
|
||||
logModel->select();
|
||||
showAwards();
|
||||
|
||||
@ -4880,7 +4905,6 @@ void MainWindow::slotQSOToEditFromLog()
|
||||
{
|
||||
//qDebug() << "slotQSOToEditFromLog: " << (qsoToEditFromLogAct->data()).toString() << endl;
|
||||
|
||||
|
||||
qsoToEdit((logModel->index((qsoToEditFromLogAct->data()).toInt(), 0)).data(0).toInt());
|
||||
|
||||
}
|
||||
@ -4917,6 +4941,7 @@ void MainWindow::slotQsoDeleteFromLog()
|
||||
elogClublog->deleteQSO(dataProxy->getClubLogRealTimeFromId(QSOid));
|
||||
//qDebug() << "MainWindow::slotQsoDeleteFromLog (id): -2"<< endl;
|
||||
logModel->removeRow((delQSOFromLogAct->data()).toInt());
|
||||
logModel->select();
|
||||
|
||||
|
||||
//qDebug() << "MainWindow::slotQsoDeleteFromLog (id):-3 " << endl;
|
||||
@ -4964,6 +4989,7 @@ void MainWindow::slotQsoDeleteFromSearch()
|
||||
{
|
||||
|
||||
|
||||
//logModel->select();
|
||||
logModel->select();
|
||||
if(qslingNeeded)
|
||||
{
|
||||
@ -5213,7 +5239,7 @@ bool MainWindow::processConfigLine(const QString _line){
|
||||
} else if (value=="CQ-WPX-RTTY"){
|
||||
contestMode = CQ_WPX_RTTY;
|
||||
} else{
|
||||
contestMode = NoContest;
|
||||
contestMode = DX;
|
||||
}
|
||||
|
||||
}else if (field=="MODES"){
|
||||
@ -6358,20 +6384,26 @@ int rowSpan, int columnSpan, Qt::Alignment alignment = 0 )
|
||||
QWidget *dxClusterTabWidget = new QWidget;
|
||||
|
||||
|
||||
QHBoxLayout *logTabWidgetLayout = new QHBoxLayout;
|
||||
//QHBoxLayout *logTabWidgetLayout = new QHBoxLayout;
|
||||
QHBoxLayout *dxClusterTabWidgetLayout = new QHBoxLayout;
|
||||
|
||||
logTabWidgetLayout->addWidget(logView);//
|
||||
logTabWidget->setLayout(logTabWidgetLayout);
|
||||
|
||||
//logTabWidgetLayout->addWidget(logView);//
|
||||
//logTabWidget->setLayout(logTabWidgetLayout);
|
||||
|
||||
dxClusterTabWidgetLayout->addWidget(dxClusterWidget);
|
||||
dxClusterTabWidget->setLayout(dxClusterTabWidgetLayout);
|
||||
|
||||
QWidget *logWTabWidget = new QWidget;
|
||||
QHBoxLayout *logWTabWidgetLayout = new QHBoxLayout;
|
||||
logWTabWidgetLayout->addWidget(logWindow);
|
||||
logWTabWidget->setLayout(logWTabWidgetLayout);
|
||||
|
||||
|
||||
dxBottonTab->addTab(logTabWidget, tr("Log"));
|
||||
dxBottonTab->addTab(logWTabWidget, tr("Log"));
|
||||
//dxBottonTab->addTab(logTabWidget, tr("Log-old"));
|
||||
dxBottonTab->addTab(dxClusterTabWidget, tr("DX-Cluster"));
|
||||
dxBottonTab->addTab(dxccStatusWidget, tr("DXCC"));
|
||||
//dxBottonTab->addTab(logWindow, tr("Log"));
|
||||
|
||||
|
||||
QVBoxLayout *dxUpRightLayout = new QVBoxLayout;
|
||||
@ -6770,6 +6802,7 @@ void MainWindow::slotADIFImport(){
|
||||
//qDebug() << "MainWindow::slotADIFImport -1" << endl;
|
||||
filemanager->adifReadLog(fileName, currentLog);
|
||||
//qDebug() << "MainWindow::slotADIFImport -2" << endl;
|
||||
//logModel->select();
|
||||
logModel->select();
|
||||
//qDebug() << "MainWindow::slotADIFImport -3" << endl;
|
||||
checkIfNewBandOrMode();
|
||||
|
16
mainwindow.h
16
mainwindow.h
@ -58,6 +58,8 @@
|
||||
#include "downloadcty.h"
|
||||
#include "dxccstatuswidget.h"
|
||||
#include "softwareupdate.h"
|
||||
#include "logmodel.h"
|
||||
#include "logwindow.h"
|
||||
|
||||
class QTimer;
|
||||
class QDateTime;
|
||||
@ -100,6 +102,7 @@ enum
|
||||
|
||||
enum
|
||||
{
|
||||
DX = 0,
|
||||
NoContest = 0,
|
||||
CQ_WW_SSB = 1,
|
||||
CQ_WW_CW = 2,
|
||||
@ -279,8 +282,8 @@ private:
|
||||
void createActionsCommon();
|
||||
void createActionsCQWW();
|
||||
void createActionsDX();
|
||||
void createlogPanel();
|
||||
void createlogModel(const int _i);
|
||||
//void createlogPanel();
|
||||
//void createlogModel(const int _i);
|
||||
|
||||
void createScorePanel();
|
||||
void createSearchResultsPanel();
|
||||
@ -386,15 +389,18 @@ private:
|
||||
//QLabel distLongLabelN;
|
||||
|
||||
DXCCStatusWidget *dxccStatusWidget;
|
||||
QSqlRelationalTableModel *logModel;
|
||||
QWidget *logPanel;
|
||||
QTableView *logView;
|
||||
//QSqlRelationalTableModel *logModel;
|
||||
//QWidget *logPanel;
|
||||
//QTableView *logView;
|
||||
QTreeWidget *searchResultsTreeWidget;
|
||||
QLabel *logLabel;
|
||||
|
||||
QWidget *scoreWindow; //, dxWindow;
|
||||
QTextEdit *scoreTextEdit;
|
||||
|
||||
LogModel *logModel;
|
||||
LogWindow *logWindow;
|
||||
|
||||
// <UI>
|
||||
QGroupBox *gridGroupBox, *qrzgroupBox, *searchgroupBox;
|
||||
QFrame *dxUpLeftInputFrame;//, *dxUpRightOutputFrame;
|
||||
|
@ -53,6 +53,8 @@ public:
|
||||
|
||||
int getNormalizedDXCCValue(const int _dxcc);
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // UTILITIES_H
|
||||
|
Loading…
Reference in New Issue
Block a user