This commit is contained in:
jaime 2020-05-01 13:49:55 +00:00
parent 17f91d3e6b
commit 4eb9f4d70e
170 changed files with 19862 additions and 35746 deletions

View File

@ -1,5 +1,5 @@
Jaime Robles, EA4K - (2002-today)
Akihiro Koda, JL3OXR - (2016, 2020)
Akihiro Koda, JL3OXR - (2016-2017)
Andrew Goldie, ZL2ACG - (2009-2010)
Translators:

View File

@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
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 <https://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/philosophy/why-not-lgpl.html>.
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -1,54 +1,5 @@
May 2020 - 1.1
- Improvement: Search widget has been improved.
- Improvement: Callsigns are always checked to be a good callsign before they are saved to the log, imported and exported to ADIF.
- Improvement: Removed some death code.
- Improvement: If TX Freq & RX Freq are the same, only TX Freq is exported.
- Improvement: New functions to check calls when importing ADIF logs.
- Improvement: Improved how CTY.CSV (country files) is working.
- UI: Widget to show the QSOs to be exported to ADIF & LoTW.
- UI: Widget to show the QSOs updated from ADIF & LoTW.
- UI: Clear the UI also clears the status of a DXCC in the Band status widget.
- UI: Added a checkbox to easily enable/disable the real time in the QSO entry box.
- UI: Passwords are now hidden in the UI when entered.
- BugFix: Only QSOs are now updated when data is uploaded from LoTW.
- BugFix: DXCC & WAZ information was updated twice when removing a QSO.
- BugFix: DXCC & WAZ count.
- BugFix: Fixed one SQL query on satellite.
- Bugfix: Fixed the print function. (JL3OXR).
- Translations: Catalan (TNX Txema), Spanish (EA4K).
April 2020 - 1.0.1
- BugFix: UTC time was not properly managed, specially in the date.
March 2020 - 1.0
- UI: Removed the first column inthe DXCC widget to make it more user friendly.
- UI: Created a widget to manage the Main QSO entry to make KLog more modular.
- UI: eQSL & LoTW are marked as queued to be sent by default if the user activates it in the setup.
- UI: Added the title to some QMessage boxes that were missing.
- UI: Improved the usability of creating new logs or editing existing logs in the setup.
- New feature: Integrate TQSL to upload QSOs to LoTW directly from KLog.
- New feature: You can check a call in QRZ.com by right-clicking in the call from the log.
- New feature: You can check a call in DXHeat.com by right-clicking in the call from the log.
- New feature: It is now possible to save in a file all the DX-Cluster activity.
- Improvement: Added https to the cty.dat download.
- Improvement: Added the https to download.klog.xyz
- Improvement: Propagation modes are now sorted in the Propagation mode combobox.
- Improvement: Four new tips added.
- Improvement: eQSL & LoTW dates are updated always that are modified to any status.
- Improvement: If a QSO does not have a freq, a default freq based on the band is assigned if edited.
- Improvement: Removed some deprecated functions.
- Improvement: Improved the way KLog checks for a wrong call (IARU rules applied).
- Improvement: Improved the way KLog checks for a wrong IOTA reference.
- Removed the functionality to sort the log based on Date & Time columns.
- Removed one console message about a duplicated database connection.
- Bugfix: It was not possible to include new dxcluster servers in the setup.
- Bugfix: The default value of RST in some digital modes using SNR were not properly shown.
- Bugfix: In translated instances of KLog, Propagation mode was sometimes not properly saved when no propagation mode eas selected.
- BugFix: Locator in SAT widget was not always not correctly evaluated as correct.
- Updated translations: Catalan (TNX Txema), Croatian (TNX M0NKC), Finnish (TNX Kristjan), Spanish (EA4K).
February 2020 - 0.9.9.1
- BugFix: Bands & modes where sometimes duplicated in the combobox (TNX G4MKT).
- BugFix: Bands & Modes where sometimes duplicated in the combobox (TNX G4MKT).
January 2020 - 0.9.9
- UI: Created a widget to manage the Awards to make KLog more modular.
@ -585,7 +536,7 @@ The information comming from all the appearances of a call in the log is grouped
- New feature: KLog ask the user for a comment when Importing a TLF log (for example
to note that those QSO are from an specific contest or whatever).
- Bug fixed: When selecting a DX-Spot from the DX-Cluster it did not overwrote the name.
- Bug fixed: When writing the log, there was an space missing before the <EOR>.
- Bug fixed: When writting the log, there was an space missing before the <EOR>.
It is just a "cosmetic" fix, not a real bug.
- Bug fixed: The same with the QSL card status.
- Bug fixed: KLog now recognises all the prefix that appears in cty.dat file with

593
KLog.pro
View File

@ -1,302 +1,291 @@
CONFIG += app_bundle
CONFIG += static
CONFIG -=depend_includepath
#CONFIG += release
TEMPLATE = app
VERSION = 1.1
DEFINES += APP_VERSION="$$VERSION"
APP_NAME = KLog
DEFINES += APP_NAME="$$APP_NAME"
APP_UNIX_NAME = klog
DEFINES += APP_UNIX_NAME="$$APP_UNIX_NAME"
message(Building $${APP_NAME} $${VERSION})
message(Qt $$[QT_VERSION] in $$[QT_INSTALL_PREFIX])
#DEFINES *= QT_NO_DEBUG_OUTPUT
DEFINES *= QT_USE_QSTRINGBUILDER
DEFINES *= QT_STRICT_ITERATORS
TARGET = $${APP_UNIX_NAME}
QT += core \
gui \
sql \
network \
serialport \
printsupport \
charts \
widgets
greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4)
{
macx:QMAKE_LFLAGS += -Wl,-rpath,@executable_path/../Frameworks
}
HEADERS += setupdialog.h \
aboutdialog.h \
awardswidget.h \
lotwutilities.h \
mainqsoentrywidget.h \
mainwindow.h \
pstrotatorsupport.h \
widgets/adiflotwexportwidget.h \
widgets/showadifimportwidget.h \
world.h \
logwindow.h \
filemanager.h \
database.h \
locator.h \
dxcluster.h \
awards.h \
startwizard.h \
downloadcty.h \
dataproxy_sqlite.h \
mainwindowsattab.h \
awarddxmarathon.h \
elogclublog.h \
softwareupdate.h \
softwareupdatedialog.h \
utilities.h \
dxccstatuswidget.h \
mainwindowmydatatab.h \
mainwindowinputcomment.h \
mainwindowinputothers.h \
mainwindowinputeqsl.h \
mainwindowinputqsl.h \
logmodel.h \
searchwidget.h \
infowidget.h \
showerrordialog.h \
udpserver.h \
statisticswidget.h \
charts/barchartstats.h \
updatesatsdata.h \
hamlibclass.h \
tipsdialog.h \
worldmapwidget.h \
widgets/rotator.h \
widgets/rotatorcontrol.h \
setuppages/setuppageinterfaceswindows.h \
setuppages/setuppagelotw.h \
setuppages/setuppagemisc.h \
setuppages/setuppageuserdata.h \
setuppages/setuppagedxcluster.h \
setuppages/setuppagecolors.h \
setuppages/setuppagelogs.h \
setuppages/setuppageworldeditor.h \
setuppages/setuppagesats.h \
setuppages/setuppagesatsnew.h \
setuppages/setuppagehamlib.h \
setuppages/setuppagelogsnew.h \
setuppages/setuppageclublog.h \
setuppages/setuppagebandmode.h \
setuppages/setupentitydialog.h \
setuppages/setuppageudp.h \
charts/statsgeneralchartwidget.h \
charts/statsqsosperyearbarchartwidget.h \
charts/statsentitiesperyearbarchartwidget.h \
charts/statscqzperyearbarchartwidget.h \
charts/statsqsosperbandbarchartwidget.h \
charts/statsqsospermodebarchartwidget.h \
charts/statsqsosperdxccbarchartwidget.h \
charts/statsqsospercontinentbarchartwidget.h \
charts/statsqsosperhourbarchartwidget.h \
charts/statsqsospermonthbarchartwidget.h \
charts/statsworkedconfirmedpiechartwidget.h \
charts/statsworkedsentpiechartwidget.h \
charts/statssentconfirmedpiechartwidget.h
message(Sources)
SOURCES += main.cpp \
aboutdialog.cpp \
awardswidget.cpp \
lotwutilities.cpp \
mainqsoentrywidget.cpp \
mainwindow.cpp \
pstrotatorsupport.cpp \
setupdialog.cpp \
widgets/adiflotwexportwidget.cpp \
widgets/rotator.cpp \
widgets/rotatorcontrol.cpp \
widgets/showadifimportwidget.cpp \
world.cpp \
logwindow.cpp \
filemanager.cpp \
database.cpp \
dataproxy_sqlite.cpp \
downloadcty.cpp \
dxcluster.cpp \
locator.cpp \
awards.cpp \
setuppages/setuppageinterfaceswindows.cpp \
setuppages/setuppagelotw.cpp \
setuppages/setuppagemisc.cpp \
setuppages/setuppageuserdata.cpp \
setuppages/setuppagedxcluster.cpp \
setuppages/setuppagecolors.cpp \
setuppages/setuppagelogs.cpp \
setuppages/setuppageworldeditor.cpp \
setuppages/setuppagelogsnew.cpp \
setuppages/setuppageclublog.cpp \
setuppages/setuppagebandmode.cpp \
setuppages/setuppageudp.cpp \
setuppages/setuppagesats.cpp \
setuppages/setuppagesatsnew.cpp \
setuppages/setuppagehamlib.cpp \
setuppages/setupentitydialog.cpp \
startwizard.cpp \
mainwindowsattab.cpp \
awarddxmarathon.cpp \
elogclublog.cpp \
softwareupdate.cpp \
softwareupdatedialog.cpp \
utilities.cpp \
dxccstatuswidget.cpp \
mainwindowmydatatab.cpp \
mainwindowinputcomment.cpp \
mainwindowinputothers.cpp \
mainwindowinputeqsl.cpp \
mainwindowinputqsl.cpp \
logmodel.cpp \
searchwidget.cpp \
infowidget.cpp \
showerrordialog.cpp \
udpserver.cpp \
statisticswidget.cpp \
charts/barchartstats.cpp \
updatesatsdata.cpp \
charts/statsgeneralchartwidget.cpp \
charts/statsqsosperyearbarchartwidget.cpp \
charts/statsentitiesperyearbarchartwidget.cpp \
charts/statscqzperyearbarchartwidget.cpp \
charts/statsqsospermodebarchartwidget.cpp \
charts/statsqsosperdxccbarchartwidget.cpp \
charts/statsqsospercontinentbarchartwidget.cpp \
charts/statsqsosperhourbarchartwidget.cpp \
charts/statsqsospermonthbarchartwidget.cpp \
charts/statsworkedconfirmedpiechartwidget.cpp \
charts/statsworkedsentpiechartwidget.cpp \
charts/statssentconfirmedpiechartwidget.cpp \
charts/statsqsosperbandbarchartwidget.cpp \
hamlibclass.cpp \
tipsdialog.cpp \
worldmapwidget.cpp
message (Other files)
OTHER_FILES += \
README-DEVEL \
TODO \
tips-for-devel.txt \
INSTALL.txt \
INSTALL-linux \
INSTALL-win.txt \
Changelog \
INSTALL-osx.txt \
NEWS \
klog.1 \
COPYING \
AUTHORS \
README
message (More...)
RESOURCES += klog.qrc
DESTDIR = build/target/
OBJECTS_DIR = build/obj/
MOC_DIR = build/moc/
RCC_DIR = build/rcc/
#D_OBJECTS = $(SRC:%.cpp=build/obj/%.o)
#R_OBJECTS = $(SRC:%.cpp=build/obj/%.o)
# Tell Qt Linguist that we use UTF-8 strings in our sources
CODECFORTR = UTF-8
CODECFORSRC = UTF-8
#include(translations/translations.pri)
message (Translations)
TRANSLATIONS = translations/klog_es.ts \
translations/klog_ca.ts \
translations/klog_da.ts \
translations/klog_de.ts \
translations/klog_fi.ts \
translations/klog_fr.ts \
translations/klog_hr.ts \
translations/klog_it.ts \
translations/klog_pl.ts \
translations/klog_ja.ts
message(End of translations...)
isEmpty(QMAKE_LRELEASE) {
win32|os2:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
unix {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt5 }
} else {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
}
}
updateqm.input = TRANSLATIONS
updateqm.output = $$DESTDIR/translations/${QMAKE_FILE_BASE}.qm
updateqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm $$DESTDIR/translations/${QMAKE_FILE_BASE}.qm
updateqm.CONFIG += no_link target_predeps
QMAKE_EXTRA_COMPILERS += updateqm
# deploy
DISTFILES += Changelog COPYING
unix:!mac {
DEFINES += APP_LINUX
CONFIG += c++11
# Translations should be copied in /usr/share/klog/translations
# https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
# QT += dbus
isEmpty(PREFIX):PREFIX = /usr
BINDIR = $$PREFIX/bin
DATADIR = $$PREFIX/share
PKGDATADIR = $$DATADIR/klog
INSTALLS += target
target.path = $$BINDIR
# DEFINES += DATADIR=\\\"$$DATADIR\\\" \
# PKGDATADIR=\\\"$$PKGDATADIR\\\"
# translations.path = /usr/share/klog/translations
translations.path = $$PKGDATADIR/translations
# translations.files += build/target/translations/*
translations.files += $$DESTDIR/translations/*
#INSTALLS += translations
datafiles.path = $$PKGDATADIR
datafiles.files = $$DISTFILES
INSTALLS += translations
INSTALLS += datafiles
LIBS += -lhamlib
}
macx: {
ICON = klog.icns
TARGET = KLog
CONFIG += c++11
INCLUDEPATH +=../hamlib/include/
LIBS += -L"../hamlib/lib" -lhamlib
}
win32: {
RC_ICONS = klog.ico
TARGET = klog
QMAKE_TARGET_COMPANY = EA4K
QMAKE_TARGET_DESCRIPTION = Hamradio logging
LIBS += -L"$$PWD/../libs/hamlib-w32-3.3/lib/gcc" -lhamlib
INCLUDEPATH += "$$PWD/../libs/hamlib-w32-3.3/include/"
}
else:
{
TARGET = klog
}
CONFIG += app_bundle
CONFIG += static
#CONFIG += release
TEMPLATE = app
VERSION = 0.9.9
DEFINES += APP_VERSION="$$VERSION"
APP_NAME = KLog
DEFINES += APP_NAME="$$APP_NAME"
APP_UNIX_NAME = klog
DEFINES += APP_UNIX_NAME="$$APP_UNIX_NAME"
message(Building $${APP_NAME} $${VERSION})
message(Qt $$[QT_VERSION] in $$[QT_INSTALL_PREFIX])
#DEFINES *= QT_NO_DEBUG_OUTPUT
DEFINES *= QT_USE_QSTRINGBUILDER
DEFINES *= QT_STRICT_ITERATORS
TARGET = $${APP_UNIX_NAME}
QT += core \
gui \
sql \
network \
serialport \
widgets
greaterThan(QT_MAJOR_VERSION, 4) {
QT += printsupport
QT += widgets \
charts
}
greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4) {
macx:QMAKE_LFLAGS += -Wl,-rpath,@executable_path/../Frameworks
}
HEADERS += setupdialog.h \
aboutdialog.h \
awardswidget.h \
logviewsortfilterproxymodel.h \
mainwindow.h \
world.h \
logwindow.h \
filemanager.h \
database.h \
setuppagemisc.h \
locator.h \
dxcluster.h \
awards.h \
setuppageuserdata.h \
setuppagedxcluster.h \
setuppagecolors.h \
setuppagelogs.h \
setuppageworldeditor.h \
setupentitydialog.h \
startwizard.h \
downloadcty.h \
dataproxy_sqlite.h \
mainwindowsattab.h \
awarddxmarathon.h \
setuppagelogsnew.h \
setuppageclublog.h \
elogclublog.h \
softwareupdate.h \
softwareupdatedialog.h \
utilities.h \
dxccstatuswidget.h \
mainwindowmydatatab.h \
mainwindowinputcomment.h \
mainwindowinputothers.h \
mainwindowinputeqsl.h \
mainwindowinputqsl.h \
setuppagebandmode.h \
logmodel.h \
searchwidget.h \
infowidget.h \
showerrordialog.h \
udpserver.h \
setuppageudp.h \
statisticswidget.h \
charts/barchartstats.h \
updatesatsdata.h \
charts/statsgeneralchartwidget.h \
charts/statsqsosperyearbarchartwidget.h \
charts/statsentitiesperyearbarchartwidget.h \
charts/statscqzperyearbarchartwidget.h \
charts/statsqsosperbandbarchartwidget.h \
charts/statsqsospermodebarchartwidget.h \
charts/statsqsosperdxccbarchartwidget.h \
charts/statsqsospercontinentbarchartwidget.h \
charts/statsqsosperhourbarchartwidget.h \
charts/statsqsospermonthbarchartwidget.h \
charts/statsworkedconfirmedpiechartwidget.h \
charts/statsworkedsentpiechartwidget.h \
charts/statssentconfirmedpiechartwidget.h \
setuppagesats.h \
setuppagesatsnew.h \
setuppagehamlib.h \
hamlibclass.h \
tipsdialog.h \
worldmapwidget.h
message(Sources)
SOURCES += main.cpp \
aboutdialog.cpp \
awardswidget.cpp \
logviewsortfilterproxymodel.cpp \
mainwindow.cpp \
setupdialog.cpp \
world.cpp \
logwindow.cpp \
filemanager.cpp \
database.cpp \
dataproxy_sqlite.cpp \
downloadcty.cpp \
dxcluster.cpp \
setuppagemisc.cpp \
locator.cpp \
awards.cpp \
setuppageuserdata.cpp \
setuppagedxcluster.cpp \
setuppagecolors.cpp \
setuppagelogs.cpp \
setuppageworldeditor.cpp \
setupentitydialog.cpp \
startwizard.cpp \
mainwindowsattab.cpp \
awarddxmarathon.cpp \
setuppagelogsnew.cpp \
setuppageclublog.cpp \
elogclublog.cpp \
softwareupdate.cpp \
softwareupdatedialog.cpp \
utilities.cpp \
dxccstatuswidget.cpp \
mainwindowmydatatab.cpp \
mainwindowinputcomment.cpp \
mainwindowinputothers.cpp \
mainwindowinputeqsl.cpp \
mainwindowinputqsl.cpp \
setuppagebandmode.cpp \
logmodel.cpp \
searchwidget.cpp \
infowidget.cpp \
showerrordialog.cpp \
udpserver.cpp \
setuppageudp.cpp \
statisticswidget.cpp \
charts/barchartstats.cpp \
updatesatsdata.cpp \
charts/statsgeneralchartwidget.cpp \
charts/statsqsosperyearbarchartwidget.cpp \
charts/statsentitiesperyearbarchartwidget.cpp \
charts/statscqzperyearbarchartwidget.cpp \
charts/statsqsospermodebarchartwidget.cpp \
charts/statsqsosperdxccbarchartwidget.cpp \
charts/statsqsospercontinentbarchartwidget.cpp \
charts/statsqsosperhourbarchartwidget.cpp \
charts/statsqsospermonthbarchartwidget.cpp \
charts/statsworkedconfirmedpiechartwidget.cpp \
charts/statsworkedsentpiechartwidget.cpp \
charts/statssentconfirmedpiechartwidget.cpp \
charts/statsqsosperbandbarchartwidget.cpp \
setuppagesats.cpp \
setuppagesatsnew.cpp \
setuppagehamlib.cpp \
hamlibclass.cpp \
tipsdialog.cpp \
worldmapwidget.cpp
message (Other files)
OTHER_FILES += \
README-DEVEL \
TODO \
tips-for-devel.txt \
INSTALL.txt \
INSTALL-linux \
INSTALL-win.txt \
Changelog \
INSTALL-osx.txt \
NEWS \
klog.1 \
COPYING \
AUTHORS \
README
message (More...)
RESOURCES += klog.qrc
DESTDIR = build/target/
OBJECTS_DIR = build/obj/
MOC_DIR = build/moc/
RCC_DIR = build/rcc/
#D_OBJECTS = $(SRC:%.cpp=build/obj/%.o)
#R_OBJECTS = $(SRC:%.cpp=build/obj/%.o)
# Tell Qt Linguist that we use UTF-8 strings in our sources
CODECFORTR = UTF-8
CODECFORSRC = UTF-8
#include(translations/translations.pri)
message (Translations)
TRANSLATIONS = translations/klog_es.ts \
translations/klog_ca.ts \
translations/klog_da.ts \
translations/klog_de.ts \
translations/klog_fi.ts \
translations/klog_fr.ts \
translations/klog_hr.ts \
translations/klog_it.ts \
translations/klog_pl.ts \
translations/klog_ja.ts
message(End of translations...)
isEmpty(QMAKE_LRELEASE) {
win32|os2:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
unix {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt5 }
} else {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
}
}
updateqm.input = TRANSLATIONS
updateqm.output = $$DESTDIR/translations/${QMAKE_FILE_BASE}.qm
updateqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm $$DESTDIR/translations/${QMAKE_FILE_BASE}.qm
updateqm.CONFIG += no_link target_predeps
QMAKE_EXTRA_COMPILERS += updateqm
# deploy
DISTFILES += Changelog COPYING
unix:!mac {
DEFINES += APP_LINUX
CONFIG += c++11
# Translations should be copied in /usr/share/klog/translations
# https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
# QT += dbus
isEmpty(PREFIX):PREFIX = /usr
BINDIR = $$PREFIX/bin
DATADIR = $$PREFIX/share
PKGDATADIR = $$DATADIR/klog
INSTALLS += target
target.path = $$BINDIR
# DEFINES += DATADIR=\\\"$$DATADIR\\\" \
# PKGDATADIR=\\\"$$PKGDATADIR\\\"
# translations.path = /usr/share/klog/translations
translations.path = $$PKGDATADIR/translations
# translations.files += build/target/translations/*
translations.files += $$DESTDIR/translations/*
#INSTALLS += translations
datafiles.path = $$PKGDATADIR
datafiles.files = $$DISTFILES
INSTALLS += translations
INSTALLS += datafiles
LIBS += -lhamlib
}
macx: {
ICON = klog.icns
TARGET = KLog
CONFIG += c++11
INCLUDEPATH +=../hamlib/include/
LIBS += -L"../hamlib/lib" -lhamlib
}
win32: {
RC_ICONS = klog.ico
TARGET = klog
QMAKE_TARGET_COMPANY = EA4K
QMAKE_TARGET_DESCRIPTION = Hamradio logging
LIBS += -L"C:/radio/hamlib-w32-3.3/lib/gcc" -lhamlib
INCLUDEPATH += "C:/radio/hamlib-w32-3.3/include/"
}
else:
{
TARGET = klog
}

4
NEWS
View File

@ -1,2 +1,2 @@
Look at https://www.klog.xyz for NEWS of KLog.
You can also check the Changelog file for the latest updates in the software.
Look at http://www.klog.xyz for NEWS of KLog.
You can also check the Changelog file for the latest updates in the software.

View File

@ -9,7 +9,7 @@
AboutDialog::AboutDialog(const QString &tversion, QWidget *parent)
: QDialog(parent)
{
//qDebug() << "AboutDialog::AboutDialog" << endl;
//qDebug() << "AboutDialog::AboutDialog" << endl;
QPixmap pixmap(":/img/klog_256x256.png");
@ -24,13 +24,13 @@ AboutDialog::AboutDialog(const QString &tversion, QWidget *parent)
const QString description = "<center><h2>KLog " + tversion + "</h2><h4> " +tr("By") +
" <a href=\"https://www.qrz.com/db/ea4k\">EA4K</a> - 2002-2020</h4></center><br>" +
tr("KLog is a free logbook for hamradio operators.") +"<br><br><b>" +
tr("Please be aware that this is a development release and it may contain many bugs.<br>Backup your data before using this software!") +
tr("Please know that this is an BETA release and it may contain many bugs.<br>Backup your data before using this software!") +
"</b><br><br>" +
tr("Since 0.6.2, KLog has been fully rewritten to provide a cross-platform application that runs on all major operating systems (Linux, macOS and Windows) and to support new functionality.") +
tr("KLog has been fully rewritten from the 0.6.2 to be able to provide a cross-platform application that runs in the main operating systems (Linux, macOS & Windows) and provide new functionalities that KLog was not providing.") +
"<br><br>" +
tr("Please provide your review in KLog's eHam review page:") +
"<bR>" +
"<a href=https://www.eham.net/reviews/detail/3118>https://www.eham.net/reviews/detail/3118</a><br><br>" +
"<a href=http://www.eham.net/reviews/detail/3118>http://www.eham.net/reviews/detail/3118</a><br><br>" +
tr("Find more information and the latest release at") + "<br><a href=https://www.klog.xyz>https://www.klog.xyz</a><br><br>" +
tr("Author") + ": <a href=https://jaime.robles.es/klog>Jaime Robles</a>, <a href=\"https://www.qrz.com/db/ea4k\">EA4K</a><br><a href=mailto:jaime@robles.es>jaime@robles.es</a>";
@ -89,7 +89,7 @@ AboutDialog::AboutDialog(const QString &tversion, QWidget *parent)
translatorsLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
QString privacy = "<center><h2>" + tr("Privacy advisory") + "</h2></h4></center><br>" +
tr("KLog developers have included a feature that reports some user data to the KLog server with the sole purpose of identifying the number of installed versions, to focus development in one direction or another taking into account users' needs.") +
tr("KLog developers have included a feature that reports some user data to the KLog server with the sole purpose of identifying the number of installed versions, to focus development in one direction or another taking into account user's needs.") +
"<br><br>" + tr("At present, the data that is provided is the following:") +
"<ul><li>" + tr("Callsign") + "</li><li>" + tr("KLog version") + "</li><li>" + tr("Operating system") + "</li></ul><br><br><b>" +
tr("Be aware that you can enable/disable this feature from the Misc tab in the Setup page.") + "</b>";
@ -141,7 +141,7 @@ AboutDialog::AboutDialog(const QString &tversion, QWidget *parent)
setLayout(layout);
//qDebug() << "AboutDialog::AboutDialog - END" << endl;
//qDebug() << "AboutDialog::AboutDialog - END" << endl;
}
AboutDialog::~AboutDialog()

View File

@ -23,7 +23,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

View File

@ -20,7 +20,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include "awarddxmarathon.h"
@ -28,33 +28,33 @@
DXMarathon::DXMarathon(DataProxy_SQLite *dp)
{
//qDebug() << "DXMarathon::DXMarathon" << endl;
//qDebug() << "DXMarathon::DXMarathon" << endl;
dataProxy = dp;
//qDebug() << "DXMarathon::DXMarathon - END" << endl;
//qDebug() << "DXMarathon::DXMarathon - END" << endl;
}
int DXMarathon::getDXMarathonQSO(const int _year, const int _logNumber)
{
//qDebug() << "DXMarathon::getDXMarathonQSO: " << QString::number(_year) << endl;
//qDebug() << "DXMarathon::getDXMarathonQSO: " << QString::number(_year) << endl;
return dataProxy->getQSOonYear(_year, _logNumber);
}
int DXMarathon::getDXMarathonDXCC(const int _year, const int _logNumber)
{
//qDebug() << "DXMarathon::getDXMarathonDXCC: " << QString::number(_year) << endl;
//qDebug() << "DXMarathon::getDXMarathonDXCC: " << QString::number(_year) << endl;
return dataProxy->getDXCConYear(_year, _logNumber);
}
int DXMarathon::getDXMarathonCQ(const int _year, const int _logNumber)
{
//qDebug() << "DXMarathon::getDXMarathonCQ: " << QString::number(_year) << endl;
//qDebug() << "DXMarathon::getDXMarathonCQ: " << QString::number(_year) << endl;
return dataProxy->getCQzonYear(_year, _logNumber);
}
int DXMarathon::getDXMarathonScore(const int _year, const int _logNumber)
{
//qDebug() << "DXMarathon::getDXMarathonScore: " << QString::number(_year) << endl;
//qDebug() << "DXMarathon::getDXMarathonScore: " << QString::number(_year) << endl;
return ( getDXMarathonDXCC(_year, _logNumber) + getDXMarathonCQ(_year, _logNumber));

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -30,14 +30,14 @@
Awards::Awards(DataProxy_SQLite *dp, const QString &_parentFunction)
{
//qDebug() << "Awards::Awards- from: " << _parentFunction << endl;
//qDebug() << "Awards::Awards- from: " << _parentFunction << endl;
dataProxy = dp;
//QSqlDatabase db = QSqlDatabase::database("QSQLITE");
world = new World(dataProxy, Q_FUNC_INFO);
//qDebug() << "Awards::Awards - Before DXMarathon" << endl;
//qDebug() << "Awards::Awards - Before DXMarathon" << endl;
dxMarathon = new DXMarathon(dataProxy);
//qDebug() << "Awards::Awards - After DXMarathon" << endl;
//qDebug() << "Awards::Awards - After DXMarathon" << endl;
util = new Utilities();
//world->create();
/*
@ -61,26 +61,26 @@ Awards::Awards(DataProxy_SQLite *dp, const QString &_parentFunction)
wazWorked.clear();
wazConfirmed.clear();
manageModes = false;
//qDebug() << "Awards::Awards - END" << endl;
//qDebug() << "Awards::Awards - END" << endl;
}
Awards::~Awards() {}
void Awards::setAwardDXCC(const int _qsoId)
{
//qDebug() << "Awards::setAwardDXCC: _qsoId: " << QString::number(_qsoId) << endl;
//qDebug() << "Awards::setAwardDXCC: _qsoId: " << QString::number(_qsoId) << endl;
dataProxy->setDXCCAwardStatus(_qsoId);
}
void Awards::setAwardWAZ(const int _qsoId)
{
//qDebug() << "Awards::setAwardWAZ: _qsoId: " << QString::number(_qsoId) << endl;
//qDebug() << "Awards::setAwardWAZ: _qsoId: " << QString::number(_qsoId) << endl;
dataProxy->setWAZAwardStatus(_qsoId);
}
QString Awards::getQSOofAward (const int _enti, const int _bandid)
{// Returns the QRZ that granted that status in the DXCC
//qDebug() << "Awards::getQSOofAward: " << QString::number(_enti) << "/" << QString::number(_bandid) << endl;
//qDebug() << "Awards::getQSOofAward: " << QString::number(_enti) << "/" << QString::number(_bandid) << endl;
QSqlQuery query;
QString stringQuery = QString();
bool sqlOK = false;
@ -89,7 +89,7 @@ QString Awards::getQSOofAward (const int _enti, const int _bandid)
stringQuery = QString("SELECT call, qso_date, time_on from log where id=(SELECT qsoid from awarddxcc where dxcc='%1' and band='%2')").arg(_enti).arg(_bandid);
sqlOK = query.exec(stringQuery);
//qDebug() << "Awards::getQSOofAward: stringQuery: " << stringQuery << endl;
//qDebug() << "Awards::getQSOofAward: stringQuery: " << stringQuery << endl;
if (sqlOK)
{
query.next();
@ -98,13 +98,13 @@ QString Awards::getQSOofAward (const int _enti, const int _bandid)
answer = query.value(0).toString() + " / " + query.value(1).toString() + " / " + query.value(2).toString();
query.finish();
//qDebug() << "Awards::getQSOofAward: answer: " << answer << endl;
//qDebug() << "Awards::getQSOofAward: answer: " << answer << endl;
return answer;
}
else
{
query.finish();
//qDebug() << "Awards::getQSOofAward: 0" << endl;
//qDebug() << "Awards::getQSOofAward: 0" << endl;
return QString();
}
}
@ -112,7 +112,7 @@ QString Awards::getQSOofAward (const int _enti, const int _bandid)
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
//qDebug() << "Awards::getQSOofAward: Query error" << endl;
//qDebug() << "Awards::getQSOofAward: Query error" << endl;
return QString();
}
@ -120,7 +120,7 @@ QString Awards::getQSOofAward (const int _enti, const int _bandid)
int Awards::getQSOIdofAward (const int _enti, const int _bandid)
{// Returns the QSOid that granted that status in the DXCC
//qDebug() << "Awards::getQSOIdofAward: " << QString::number(_enti) << "/" << QString::number(_bandid) << endl;
//qDebug() << "Awards::getQSOIdofAward: " << QString::number(_enti) << "/" << QString::number(_bandid) << endl;
QSqlQuery query;
QString stringQuery = QString();
bool sqlOK = false;
@ -129,14 +129,14 @@ int Awards::getQSOIdofAward (const int _enti, const int _bandid)
stringQuery = QString("SELECT qsoid from awarddxcc where dxcc='%1' and band='%2'").arg(_enti).arg(_bandid);
sqlOK = query.exec(stringQuery);
//qDebug() << "Awards::getQSOIdofAward: stringQuery: " << stringQuery << endl;
//qDebug() << "Awards::getQSOIdofAward: stringQuery: " << stringQuery << endl;
if (sqlOK)
{
query.next();
if (query.isValid())
{
answer = query.value(0).toInt();
//qDebug() << "Awards::getQSOIdofAward: answer: " << QString::number(answer) << endl;
//qDebug() << "Awards::getQSOIdofAward: answer: " << QString::number(answer) << endl;
query.finish();
if (answer>=1)
{
@ -151,7 +151,7 @@ int Awards::getQSOIdofAward (const int _enti, const int _bandid)
else
{
query.finish();
//qDebug() << "Awards::getQSOIdofAward: 0" << endl;
//qDebug() << "Awards::getQSOIdofAward: 0" << endl;
return -2;
}
}
@ -159,7 +159,7 @@ int Awards::getQSOIdofAward (const int _enti, const int _bandid)
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
//qDebug() << "Awards::getQSOIdofAward: Query error" << endl;
//qDebug() << "Awards::getQSOIdofAward: Query error" << endl;
return -3;
}
@ -167,23 +167,15 @@ int Awards::getQSOIdofAward (const int _enti, const int _bandid)
int Awards::getDXCCWorked(const int _logNumber)
{
//qDebug() << "Awards::getDXCCWorked (logNumber): " << QString::number(_logNumber) << endl;
//qDebug() << "Awards::getDXCCWorked (logNumber): " << QString::number(_logNumber) << endl;
QSqlQuery query;
QString stringQuery;
bool sqlOK;
if (dataProxy->doesThisLogExist(_logNumber))
{
stringQuery = QString("SELECT COUNT (DISTINCT dxcc) FROM log WHERE dxcc>'0' AND lognumber='%1'").arg(_logNumber);
}
else
{
stringQuery = QString("SELECT COUNT (DISTINCT dxcc) FROM log WHERE dxcc>'0'");
}
stringQuery = QString("SELECT COUNT (DISTINCT dxcc) FROM log where lognumber='%1'").arg(_logNumber);
sqlOK = query.exec(stringQuery);
//qDebug() << "Awards::getDXCCWorked: stringQuery: " << stringQuery << endl;
//qDebug() << "Awards::getDXCCWorked: stringQuery: " << stringQuery << endl;
if (sqlOK)
{
query.next();
@ -191,12 +183,12 @@ int Awards::getDXCCWorked(const int _logNumber)
{
int v = (query.value(0)).toInt();
query.finish();
//qDebug() << "Awards::getDXCCWorked: " << QString::number((query.value(0)).toInt()) << endl;
//qDebug() << "Awards::getDXCCWorked: " << QString::number((query.value(0)).toInt()) << endl;
return v;
}
else
{
//qDebug() << "Awards::getDXCCWorked: 0" << endl;
//qDebug() << "Awards::getDXCCWorked: 0" << endl;
return 0;
}
}
@ -204,7 +196,7 @@ int Awards::getDXCCWorked(const int _logNumber)
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
//qDebug() << "Awards::getDXCCWorked: Query error" << endl;
//qDebug() << "Awards::getDXCCWorked: Query error" << endl;
return 0;
}
}
@ -215,15 +207,7 @@ int Awards::getDXCCConfirmed(const int _logNumber)
QSqlQuery query;
QString stringQuery;
bool sqlOK;
if (dataProxy->doesThisLogExist(_logNumber))
{
stringQuery = QString("SELECT COUNT (DISTINCT dxcc) FROM log where qsl_rcvd='Y' AND dxcc!='' AND dxcc >'0' AND lognumber='%1'").arg(_logNumber);
}
else
{
stringQuery = QString("SELECT COUNT (DISTINCT dxcc) FROM log where qsl_rcvd='Y' AND dxcc!='' AND dxcc >'0'");
}
stringQuery = QString("SELECT COUNT (DISTINCT dxcc) FROM log where qsl_rcvd='Y' AND lognumber='%1'").arg(_logNumber);
sqlOK = query.exec(stringQuery);
//qDebug() << "Awards::getDXCCWorked: stringQuery: " << stringQuery << endl;
@ -239,7 +223,7 @@ int Awards::getDXCCConfirmed(const int _logNumber)
}
else
{
//qDebug() << "Awards::getDXCCConfirmed: 0" << endl;
//qDebug() << "Awards::getDXCCConfirmed: 0" << endl;
return 0;
}
@ -257,18 +241,12 @@ int Awards::getDXCCConfirmed(const int _logNumber)
int Awards::getWAZWorked(const int _logNumber)
{
//qDebug() << "Awards::getWAZWorked (logNumber): " << QString::number(_logNumber) << endl;
//qDebug() << "Awards::getWAZWorked (logNumber): " << QString::number(_logNumber) << endl;
QSqlQuery query;
QString stringQuery;
if (dataProxy->doesThisLogExist(_logNumber))
{
stringQuery = QString("SELECT COUNT (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND cqz>'0' AND cqz<'41' AND lognumber='%1')").arg(_logNumber);
}
else
{
stringQuery = QString("SELECT COUNT (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND cqz>'0' AND cqz<'41')");
}
//stringQuery = QString("SELECT count (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND qsl_rcvd='Y' AND lognumber='%1')").arg(_logNumber);
stringQuery = QString("SELECT count (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND lognumber='%1')").arg(_logNumber);
//stringQuery = QString("SELECT count (cqz) from (SELECT DISTINCT cqz FROM awardwaz WHERE lognumber='%1' AND cqz <> '')").arg(_logNumber);
bool sqlOK = query.exec(stringQuery);
if (sqlOK)
{
@ -296,22 +274,13 @@ int Awards::getWAZWorked(const int _logNumber)
int Awards::getWAZConfirmed(const int _logNumber)
{
//qDebug() << "Awards::getWAZConfirmed (logNumber): " << QString::number(_logNumber) << endl;
//qDebug() << "Awards::getWAZConfirmed (logNumber): " << QString::number(_logNumber) << endl;
QSqlQuery query;
QString stringQuery;
//Usar la siguiente para el confirmed
if (dataProxy->doesThisLogExist(_logNumber))
{
stringQuery = QString("SELECT COUNT (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND cqz>'0' AND cqz<'41' AND qsl_rcvd='Y' AND lognumber='%1')").arg(_logNumber);
}
else
{
stringQuery = QString("SELECT COUNT (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND cqz>'0' AND cqz<'41' AND qsl_rcvd='Y')");
}
stringQuery = QString("SELECT count (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND qsl_rcvd='Y' AND lognumber='%1')").arg(_logNumber);
//stringQuery = QString("SELECT COUNT (cqz) FROM (SELECT DISTINCT cqz FROM awardwaz WHERE lognumber='%1' AND confirmed='1' AND cqz <> '')").arg(_logNumber);
bool sqlOK = query.exec(stringQuery);
if (sqlOK)
{
@ -354,7 +323,7 @@ bool Awards::isThisSpotConfirmed(const QStringList &_qs)
int Awards::getDXStatus (const QStringList &_qs)
{
//qDebug() << "Awards::getDXStatus: Entity: " << _qs.at(0) << "/ Band: " << _qs.at(1) << "/ Mode: " << _qs.at(2) << "/ Log: " << _qs.at(3) << endl;
//qDebug() << "Awards::getDXStatus: Entity: " << _qs.at(0) << "/ Band: " << _qs.at(1) << "/ Mode: " << _qs.at(2) << "/ Log: " << _qs.at(3) << endl;
// Receives: QStringList _qs;
//_qs << Entity << BandId << << ModeId << lognumber;
@ -396,7 +365,7 @@ int Awards::getDXStatus (const QStringList &_qs)
if (_qs.length() != 4 )
{
//qDebug() << "Awards::getDXStatus: Length != 4, return -1" << endl;
//qDebug() << "Awards::getDXStatus: Length != 4, return -1" << endl;
return -1;
}
@ -407,10 +376,10 @@ int Awards::getDXStatus (const QStringList &_qs)
int _logNumber = _qs.at(3).toInt();
int dxccEntity = (_qs.at(0)).toInt();
//int dxccEntity = world->getQRZARRLId(_qs.at(0) );
//qDebug() << "Awards::getDXStatus: dxccEntity: " << QString::number(dxccEntity) << endl;
//qDebug() << "Awards::getDXStatus: dxccEntity: " << QString::number(dxccEntity) << endl;
if (dxccEntity<=0)
{
//qDebug() << "Awards::getDXStatus: dxccEntity <= 0, return -1" << endl;
//qDebug() << "Awards::getDXStatus: dxccEntity <= 0, return -1" << endl;
return -1;
}
@ -421,7 +390,7 @@ int Awards::getDXStatus (const QStringList &_qs)
if ( (_mode==-1) || (manageModes==false))
{
checkingMode = false;
//qDebug() << "Awards::getDXStatus: checkingMode = FALSE" << endl;
//qDebug() << "Awards::getDXStatus: checkingMode = FALSE" << endl;
}
// dxccStatusMode(const int _ent, const int _mode, const int _logNumber) //-1 error / 0 Not worked / 1 worked / 2 confirmed
@ -438,13 +407,13 @@ int Awards::getDXStatus (const QStringList &_qs)
checkingMode = false;
}
//qDebug() << "Awards::getDXStatus: wb=" << QString::number(wb) << " - wm=" << QString::number(wm) << endl;
//qDebug() << "Awards::getDXStatus: dxccStatus: " << QString::number(dxccStatus(dxccEntity, _logNumber)) << endl;
//qDebug() << "Awards::getDXStatus: wb=" << QString::number(wb) << " - wm=" << QString::number(wm) << endl;
//qDebug() << "Awards::getDXStatus: dxccStatus: " << QString::number(dxccStatus(dxccEntity, _logNumber)) << endl;
switch(dxccStatus(dxccEntity, _logNumber))
{
case 0:
//qDebug() << "Awards::getDXStatus: return 0" << endl;
//qDebug() << "Awards::getDXStatus: return 0" << endl;
return 0; // ATNO
//break;
case 1: // Worked, not confirmed
@ -455,18 +424,18 @@ int Awards::getDXStatus (const QStringList &_qs)
{
if (wm==1)
{
//qDebug() << "Awards::getDXStatus: return 4" << endl;
//qDebug() << "Awards::getDXStatus: return 4" << endl;
return 4;
}
else
{
//qDebug() << "Awards::getDXStatus: return 1" << endl;
//qDebug() << "Awards::getDXStatus: return 1" << endl;
return 1;
}
}
else
{
//qDebug() << "Awards::getDXStatus: return 4 nc" << endl;
//qDebug() << "Awards::getDXStatus: return 4 nc" << endl;
return 4;
}
case 1: // Worked in this band
@ -474,23 +443,23 @@ int Awards::getDXStatus (const QStringList &_qs)
{
if (wm==1)
{
//qDebug() << "Awards::getDXStatus: return 3" << endl;
//qDebug() << "Awards::getDXStatus: return 3" << endl;
return 3;
}
else
{
//qDebug() << "Awards::getDXStatus: return 2" << endl;
//qDebug() << "Awards::getDXStatus: return 2" << endl;
return 2;
}
}
else
{
//qDebug() << "Awards::getDXStatus: return 3 nc" << endl;
//qDebug() << "Awards::getDXStatus: return 3 nc" << endl;
return 3;
}
default: // ERROR
//qDebug() << "Awards::getDXStatus: default return -1 - 1" << endl;
//qDebug() << "Awards::getDXStatus: default return -1 - 1" << endl;
return -1;
}
case 2: // Confirmed
@ -500,23 +469,23 @@ int Awards::getDXStatus (const QStringList &_qs)
{
if (wm==2)
{
//qDebug() << "Awards::getDXStatus: return 13" << endl;
//qDebug() << "Awards::getDXStatus: return 13" << endl;
return 13;
}
else if (wm==1)
{
//qDebug() << "Awards::getDXStatus: return 12" << endl;
//qDebug() << "Awards::getDXStatus: return 12" << endl;
return 12;
}
else
{
//qDebug() << "Awards::getDXStatus: return 11" << endl;
//qDebug() << "Awards::getDXStatus: return 11" << endl;
return 11;
}
}
else
{
//qDebug() << "Awards::getDXStatus: return 13 nc" << endl;
//qDebug() << "Awards::getDXStatus: return 13 nc" << endl;
return 13;
}
@ -529,12 +498,12 @@ int Awards::getDXStatus (const QStringList &_qs)
{
if (wm==1)
{
//qDebug() << "Awards::getDXStatus: return 8" << endl;
//qDebug() << "Awards::getDXStatus: return 8" << endl;
return 8;
}
else
{
//qDebug() << "Awards::getDXStatus: return 6" << endl;
//qDebug() << "Awards::getDXStatus: return 6" << endl;
return 6;
}
}
@ -542,12 +511,12 @@ int Awards::getDXStatus (const QStringList &_qs)
{
if (wm==1)
{
//qDebug() << "Awards::getDXStatus: return 7" << endl;
//qDebug() << "Awards::getDXStatus: return 7" << endl;
return 7;
}
else
{
//qDebug() << "Awards::getDXStatus: return 5" << endl;
//qDebug() << "Awards::getDXStatus: return 5" << endl;
return 5;
}
}
@ -557,44 +526,44 @@ int Awards::getDXStatus (const QStringList &_qs)
{
if (wb==0)
{
//qDebug() << "Awards::getDXStatus: return 7 nc" << endl;
//qDebug() << "Awards::getDXStatus: return 7 nc" << endl;
return 7;
}
else
{
//qDebug() << "Awards::getDXStatus: return 8 nc" << endl;
//qDebug() << "Awards::getDXStatus: return 8 nc" << endl;
return 8;
}
}
}
else
{
//qDebug() << "Awards::getDXStatus: return -1 - 2" << endl;
//qDebug() << "Awards::getDXStatus: return -1 - 2" << endl;
return -1;
}
default:
//qDebug() << "Awards::getDXStatus: return -1 default2" << endl;
//qDebug() << "Awards::getDXStatus: return -1 default2" << endl;
return -1;
} // END OF SWITCH
//qDebug() << "Awards::getDXStatus: END, return -1" << endl;
//return -1;
//qDebug() << "Awards::getDXStatus: END, return -1" << endl;
return -1;
}
int Awards::dxccStatusBandMode(const int _ent, const int _band, const int _mode, const int _logNumber, bool _checkingMode)
{//-1 error / 0 Not worked / 1 worked / 2 confirmed
//qDebug() << "Awards::dxccStatusBandMode: " << QString::number(_ent) << "/" << QString::number(_band) << "/" << QString::number(_mode) << endl;
//qDebug() << "Awards::dxccStatusBandMode: " << QString::number(_ent) << "/" << QString::number(_band) << "/" << QString::number(_mode) << endl;
QSqlQuery query = QSqlQuery();
QString queryString = QString();
if (_checkingMode)
{
//qDebug() << "Awards::dxccStatusBandMode: Checking Mode TRUE" << endl;
//qDebug() << "Awards::dxccStatusBandMode: Checking Mode TRUE" << endl;
queryString = QString("SELECT confirmed FROM awarddxcc WHERE dxcc='%1' AND band='%2' AND mode='%3' AND lognumber='%4' ").arg(QString::number(_ent)).arg(QString::number(_band)).arg(QString::number(_mode)).arg(QString::number(_logNumber));
}
else
{
//qDebug() << "Awards::dxccStatusBandMode: Checking Mode FALSE" << endl;
//qDebug() << "Awards::dxccStatusBandMode: Checking Mode FALSE" << endl;
queryString = QString("SELECT confirmed FROM awarddxcc WHERE dxcc='%1' AND band='%2' AND lognumber='%3' ").arg(QString::number(_ent)).arg(QString::number(_band)).arg(QString::number(_logNumber));
}
@ -608,13 +577,13 @@ int Awards::dxccStatusBandMode(const int _ent, const int _band, const int _mode,
{
if(query.value(0).toString() == "1")
{
//qDebug() << "Awards::dxccStatusBandMode: return - 2" << endl;
//qDebug() << "Awards::dxccStatusBandMode: return - 2" << endl;
query.finish();
return 2;
}
else if(query.value(0).toString() == "0")
{
//qDebug() << "Awards::dxccStatusBandMode: return - 1" << endl;
//qDebug() << "Awards::dxccStatusBandMode: return - 1" << endl;
if (status < 1)
{
status = 1;
@ -627,19 +596,19 @@ int Awards::dxccStatusBandMode(const int _ent, const int _band, const int _mode,
}
else
{ // The query fails...
//qDebug() << "Awards::dxccStatusBandMode: return - -1" << endl;
//qDebug() << "Awards::dxccStatusBandMode: return - -1" << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return -1;
}
//qDebug() << "Awards::dxccStatusBandMode: return - 0-4" << endl;
//qDebug() << "Awards::dxccStatusBandMode: return - 0-4" << endl;
return status;
}
int Awards::dxccStatus(const int _ent, const int _logNumber)
{//-1 error / 0 Not worked / 1 worked / 2 confirmed
//qDebug() << "Awards::dxccStatus: " << QString::number(_ent) << endl;
//qDebug() << "Awards::dxccStatus: " << QString::number(_ent) << endl;
QSqlQuery query = QSqlQuery();
QString queryString = QString();
int worked = 0;
@ -648,24 +617,24 @@ int Awards::dxccStatus(const int _ent, const int _logNumber)
if (query.exec(queryString))
{
//qDebug() << "Awards::dxccStatus: query exec OK: " << query.lastQuery() << endl;
//qDebug() << "Awards::dxccStatus: query exec OK: " << query.lastQuery() << endl;
while (query.next())
{
//qDebug() << "Awards::dxccStatus: query VALUE: " << (query.value(0)).toString() << endl;
//qDebug() << "Awards::dxccStatus: query VALUE: " << (query.value(0)).toString() << endl;
if ( query.isValid() )
{
//qDebug() << "Awards::dxccStatus: query valid OK" << endl;
//qDebug() << "Awards::dxccStatus: query valid OK" << endl;
if((query.value(0)).toString() == "1")
{
//qDebug() << "Awards::dxccStatus: value = 1 - return 2" << endl;
//qDebug() << "Awards::dxccStatus: value = 1 - return 2" << endl;
query.finish();
return 2;
}
else if((query.value(0)).toString() == "0")
{
//qDebug() << "Awards::dxccStatus: value = 0 - worked 1" << endl;
//qDebug() << "Awards::dxccStatus: value = 0 - worked 1" << endl;
if (worked <1)
{
worked = 1;
@ -673,21 +642,21 @@ int Awards::dxccStatus(const int _ent, const int _logNumber)
}
}
}
//qDebug() << "Awards::dxccStatus: return "<< QString::number(worked) << endl;
//qDebug() << "Awards::dxccStatus: return "<< QString::number(worked) << endl;
query.finish();
//qDebug() << "Awards::dxccStatus: END: " << QString::number(worked) << endl;
//qDebug() << "Awards::dxccStatus: END: " << QString::number(worked) << endl;
return worked;
}
else
{ // The query fails...
//qDebug() << "Awards::dxccStatus: return -1" << endl;
//qDebug() << "Awards::dxccStatus: return -1" << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return -1;
}
//qDebug() << "Awards::dxccStatus: return 0" << endl;
//return worked;
//qDebug() << "Awards::dxccStatus: return 0" << endl;
return worked;
}
@ -697,12 +666,12 @@ QColor Awards::getQRZDXStatusColor(const QStringList &_qs)
//qs << Entity << spotBand << "-1" << QString::number(currentLog) ;
//qDebug() << "Awards::getQRZDXStatusColor qs.length: " << QString::number(_qs.length()) << endl;
//qDebug() << "Awards::getQRZDXStatusColor qs.length: " << QString::number(_qs.length()) << endl;
//From Search QSO to QSL: q << _call << bandid << _mode << QString::number(currentLog);
//qDebug() << "Awards::getQRZDXStatusColor: " << _qs.at(0) << "/" << _qs.at(1) << "/" << _qs.at(2) << _qs.at(3) << endl;
//qDebug() << "Awards::getQRZDXStatusColor: " << _qs.at(0) << "/" << _qs.at(1) << "/" << _qs.at(2) << _qs.at(3) << endl;
// Receives: QStringList _qs;
//_qs << Entity << BandID << ModeId << lognumber;
@ -717,8 +686,8 @@ QColor Awards::getQRZDXStatusColor(const QStringList &_qs)
int status = getDXStatus(_qs);
//qDebug() << "Awards::getQRZDXStatusColor: status: " << QString::number(status) << "/" << getDXStatusString(status) << endl;
//qDebug() << "Awards::getQRZDXStatusColor: status: " << QString::number(status) << endl;
//qDebug() << "Awards::getQRZDXStatusColor: status: " << QString::number(status) << "/" << getDXStatusString(status) << endl;
//qDebug() << "Awards::getQRZDXStatusColor: status: " << QString::number(status) << endl;
switch (status) {
case 0:
@ -763,7 +732,7 @@ QColor Awards::getQRZDXStatusColor(const QStringList &_qs)
case 13:
returnedColor = confirmedColor;
break;
//break;
break;
default:
returnedColor = defaultColor;
break;
@ -775,7 +744,7 @@ QColor Awards::getQRZDXStatusColor(const QStringList &_qs)
QString Awards::getDXStatusString (const int &_status)
{
//qDebug() << "Awards::getDXStatusString: " << QString::number(_status) << endl;
//qDebug() << "Awards::getDXStatusString: " << QString::number(_status) << endl;
QString message = QString();
@ -825,7 +794,7 @@ QString Awards::getDXStatusString (const int &_status)
case 13:
message = QObject::tr("Confirmed");
break;
//break;
break;
default:
message = QObject::tr("Not identified");
break;
@ -837,7 +806,7 @@ return message;
QString Awards::getDXCCStatusBand(const int _dxcc, const int _band, const int _logNumber)
{
// Returns -, W or C (Not worked, worked, Confirmed)
//qDebug() << "Awards::getDXCCStatusBand: log received: " << QString::number(_logNumber) << endl;
//qDebug() << "Awards::getDXCCStatusBand: log received: " << QString::number(_logNumber) << endl;
QString stringQuery;
if (_logNumber<0)
{
@ -897,7 +866,7 @@ QString Awards::checkIfValidIOTA(const QString &_tiota)
Returns a valid format IOTA if possible and "" in other cases.
************************************/
//qDebug() << "Awards::checkIfValidIOTA: " << _tiota << endl;
//qDebug() << "Awards::checkIfValidIOTA: " << _tiota << endl;
//bool _valid = false;
QString _continent;
QString _number;
@ -905,37 +874,16 @@ Returns a valid format IOTA if possible and "" in other cases.
if (_tiota.count("-") == 1)
{
QStringList _values = _tiota.split("-", QString::SkipEmptyParts);
if (_values.size() != 2)
{
return "";
}
if (dataProxy->isValidContinentShortName(_values.at(0)))
{
_continent = _values.at(0);
}
else
{
return "";
}
if ((_values.at(1)).toInt() > 0)
{
_number = _values.at(1);
}
else
{
return "";
}
_continent = _values.at(0);
_number = _values.at(1);
}
else
{
return "";
}
//qDebug() << "Awards::checkIfValidIOTA (cont) " << _continent << endl;
//qDebug() << "Awards::checkIfValidIOTA (numb): " << _number << endl;
//qDebug() << "Awards::checkIfValidIOTA (cont) " << _continent << endl;
//qDebug() << "Awards::checkIfValidIOTA (numb): " << _number << endl;
// Check if continent is valid
@ -969,7 +917,7 @@ Returns a valid format IOTA if possible and "" in other cases.
{
return QString();
}
//return QString();
return QString();
/*
QString stringQuery = QString("SELECT id FROM continent WHERE shortname ='%1'").arg(_continent);
@ -1014,7 +962,7 @@ Returns a valid format IOTA if possible and "" in other cases.
void Awards::setColors (const QString &_newOne, const QString &_needed, const QString &_worked, const QString &_confirmed, const QString &_default)
//void Awards::setColors (const QString &_newOne, const QString &_needed, const QString &_worked, const QString &_confirmed, const QString &_default)
{
//qDebug() << "Awards::setColors: " << _newOne << "/" << _needed << "/" << _worked << "/" << _confirmed << "/" << _default << endl;
//qDebug() << "Awards::setColors: " << _newOne << "/" << _needed << "/" << _worked << "/" << _confirmed << "/" << _default << endl;
defaultColor = QColor(_default.toUpper());
neededColor = QColor(_needed.toUpper());
@ -1061,7 +1009,7 @@ void Awards::setColors (const QString &_newOne, const QString &_needed, const QS
}
else
{
//qDebug() << "Awards::setColors: Worked NOT VALID" << endl;
//qDebug() << "Awards::setColors: Worked NOT VALID" << endl;
}
}
@ -1078,17 +1026,17 @@ void Awards::recalculateAwards()
Should go in a transaction
*/
//qDebug() << "Awards::recalculateAwards" << endl;
//qDebug() << "Awards::recalculateAwards" << endl;
dataProxy->updateAwardDXCC();
emit awardDXCCUpdated();
dataProxy->updateAwardWAZ();
//qDebug() << "Awards::recalculateAwards - END" << endl;
//qDebug() << "Awards::recalculateAwards - END" << endl;
}
int Awards::getQSOsInLog(const int _logNumber)
{
//qDebug() << "Awards::getQSOsInLog: " << QString::number(_logNumber) << endl;
//qDebug() << "Awards::getQSOsInLog: " << QString::number(_logNumber) << endl;
QSqlQuery query;
QString queryString;
int v;
@ -1121,7 +1069,7 @@ int Awards::getQSOsInLog(const int _logNumber)
/*
void Awards::setAwards(const int _dxcc, const int _waz, const int _band, const int _mode, const int _workedOrConfirmed, const int _logNumber, const int _qsoId)
{
//qDebug() << "Awards::setAwards: " << QString::number(_dxcc) << endl;
//qDebug() << "Awards::setAwards: " << QString::number(_dxcc) << endl;
//_workedOrConfirmed = -1 Remove this pair
//_workedOrConfirmed = 0 Set as Worked
@ -1145,14 +1093,14 @@ void Awards::setAwards(const int _dxcc, const int _waz, const int _band, const i
void Awards::setAwards(const int _qsoId)
{
//qDebug() << "Awards::setAwards: _qsoId: " << QString::number(_qsoId) << endl;
//qDebug() << "Awards::setAwards: _qsoId: " << QString::number(_qsoId) << endl;
dataProxy->setDXCCAwardStatus(_qsoId);
dataProxy->setWAZAwardStatus(_qsoId);
}
/*
int Awards::setAwardDXCCst(const int _dxcc, const int _band, const int _mode, const bool _confirmed, const int _logNumber, const int _qsoId)
{
//qDebug() << "Awards::setAwardDXCCst-0: " << QString::number(_dxcc) << "/" << QString::number(_band) << "/" << QString::number(_mode) << "/" << QString::number(_logNumber) << "/" << QString::number(_qsoId) << endl;
//qDebug() << "Awards::setAwardDXCCst-0: " << QString::number(_dxcc) << "/" << QString::number(_band) << "/" << QString::number(_mode) << "/" << QString::number(_logNumber) << "/" << QString::number(_qsoId) << endl;
int nameCol=-1;
QString _refid = QString();
@ -1162,7 +1110,7 @@ int Awards::setAwardDXCCst(const int _dxcc, const int _band, const int _mode, co
//TODO: Fix the way we check for data validity for this function
if (!( (_dxcc>=0) && (_band >=0) && (_mode>=0) && (_logNumber>=0) && (_qsoId >=0) ))
{
//qDebug() << "Awards::setAwardDXCCst: Not valid data received!" << endl;
//qDebug() << "Awards::setAwardDXCCst: Not valid data received!" << endl;
return -1;
}
int _iconfirmed;
@ -1176,7 +1124,7 @@ int Awards::setAwardDXCCst(const int _dxcc, const int _band, const int _mode, co
_iconfirmed = 0;
}
//qDebug() << "Awards::setAwardDXCCst: _qsoId: " << QString::number(_qsoId) << "/" << QString::number(_iconfirmed) << endl;
//qDebug() << "Awards::setAwardDXCCst: _qsoId: " << QString::number(_qsoId) << "/" << QString::number(_iconfirmed) << endl;
QString stringQuery = QString();
QSqlQuery query;
bool sqlOK = false;
@ -1188,21 +1136,21 @@ int Awards::setAwardDXCCst(const int _dxcc, const int _band, const int _mode, co
sqlOK = query.exec(stringQuery);
if (sqlOK)
{
//qDebug() << "Awards::setAwardDXCCst-1:" << endl;
//qDebug() << "Awards::setAwardDXCCst-1:" << endl;
query.next();
QSqlRecord rec = query.record();
if (query.isValid())
{// We have some data, we need to UPDATE - We are only confirming!
//qDebug() << "Awards::setAwardDXCCst: We have some data, we neer to update" << endl;
//qDebug() << "Awards::setAwardDXCCst: We have some data, we neer to update" << endl;
nameCol = rec.indexOf("id");
_refid = query.value(nameCol).toString();
stringQuery = QString("UPDATE awarddxcc SET confirmed='1', qsoid='%1' WHERE id='%2'").arg(_qsoId).arg(_refid);
//qDebug() << "Awards::setAwardDXCCst: (UPDATE): " << stringQuery << endl;
//qDebug() << "Awards::setAwardDXCCst: (UPDATE): " << stringQuery << endl;
if (sqlOK)
{ // Set of data updated
//qDebug() << "Awards::setAwardDXCCst: Data updated!" << endl;
//qDebug() << "Awards::setAwardDXCCst: Data updated!" << endl;
query.finish();
return 1;
}
@ -1220,12 +1168,12 @@ int Awards::setAwardDXCCst(const int _dxcc, const int _band, const int _mode, co
{ // We don't have this set, we need to INSERT
stringQuery = QString("INSERT INTO awarddxcc (dxcc, band, mode, confirmed, lognumber, qsoid) values('%1','%2','%3','%4','%5','%6')").arg(_dxcc).arg(_band).arg(_mode).arg(_iconfirmed).arg(_logNumber).arg(_qsoId);
sqlOK = query.exec(stringQuery);
//qDebug() << "Awards::setAwardDXCCst: We don't have data... so we INSERT" << endl;
//qDebug() << "Awards::setAwardDXCCst: (INSERT): " << stringQuery << endl;
//qDebug() << "Awards::setAwardDXCCst: We don't have data... so we INSERT" << endl;
//qDebug() << "Awards::setAwardDXCCst: (INSERT): " << stringQuery << endl;
if (sqlOK)
{ // Set of data included
query.finish();
//qDebug() << "Awards::setAwardDXCCst: Data inserted!" << endl;
//qDebug() << "Awards::setAwardDXCCst: Data inserted!" << endl;
}
else
{ // Something failed. Trace it!
@ -1257,7 +1205,7 @@ int Awards::setAwardDXCCst(const int _dxcc, const int _band, const int _mode, co
/*
int Awards::setAwardWAZst(const int _cqz, const int _band, const int _mode, const bool _confirmed, const int _logNumber, const int _qsoId)
{
//qDebug() << "Awards::setAwardWAZst(CQZ/BAND/MODE/WORKED/log/qsoid): " << QString::number(_cqz) << "/" << QString::number(_band) << "/" << QString::number(_mode) << "/" << QString::number(_logNumber) << "/" << QString::number(_qsoId) << endl;
//qDebug() << "Awards::setAwardWAZst(CQZ/BAND/MODE/WORKED/log/qsoid): " << QString::number(_cqz) << "/" << QString::number(_band) << "/" << QString::number(_mode) << "/" << QString::number(_logNumber) << "/" << QString::number(_qsoId) << endl;
// _confirmed == false QSO is just worked
@ -1268,7 +1216,7 @@ int Awards::setAwardWAZst(const int _cqz, const int _band, const int _mode, cons
//TODO: Fix the way we check for data validity for this function
if (!( (_cqz>=0) && (_band >=0) && (_mode>=0) && (_logNumber>=0) && (_qsoId >=0) ))
{
//qDebug() << "Awards::setAwardWAZst: some data was NOK" << endl;
//qDebug() << "Awards::setAwardWAZst: some data was NOK" << endl;
return -1;
}
int _iconfirmed;
@ -1295,26 +1243,26 @@ int Awards::setAwardWAZst(const int _cqz, const int _band, const int _mode, cons
if ((sqlOK) && (!_confirmed)) // First time a DXCC/Band/mode is worked
{
//qDebug() << "Awards::setAwardWAZst: _qsoId: " << QString::number(_qsoId) << "- 1" << endl;
//qDebug() << "Awards::setAwardWAZst: _qsoId: " << QString::number(_qsoId) << "- 1" << endl;
query.finish();
return 1;
}
else if ((sqlOK) && (_confirmed)) // First time a CQZ/Band/Mode is confirmed
{
//qDebug() << "Awards::setAwardWAZst: _qsoId: " << QString::number(_qsoId) << "- 2" << endl;
//qDebug() << "Awards::setAwardWAZst: _qsoId: " << QString::number(_qsoId) << "- 2" << endl;
query.finish();
return 2;
}
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
//qDebug() << "Awards::setAwardWAZst: _qsoId: " << QString::number(_qsoId) << "- sqlOK ERROR: " << endl;
//qDebug() << "Awards::setAwardWAZst: _qsoId: " << QString::number(_qsoId) << "- sqlOK ERROR: " << endl;
//errorCode = query.lastError().number();
query.finish();
//qDebug() << "Awards::setAwardWAZst: LastQuery: " << query.lastQuery() << endl;
//qDebug() << "Awards::setAwardWAZst: LastError-data: " << query.lastError().databaseText() << endl;
//qDebug() << "Awards::setAwardWAZst: LastError-driver: " << query.lastError().driverText() << endl;
//qDebug() << "Awards::setAwardWAZst: LastError-n: " << QString::number(query.lastError().number() ) << endl;
//qDebug() << "Awards::setAwardWAZst: LastQuery: " << query.lastQuery() << endl;
//qDebug() << "Awards::setAwardWAZst: LastError-data: " << query.lastError().databaseText() << endl;
//qDebug() << "Awards::setAwardWAZst: LastError-driver: " << query.lastError().driverText() << endl;
//qDebug() << "Awards::setAwardWAZst: LastError-n: " << QString::number(query.lastError().number() ) << endl;
}
@ -1326,7 +1274,7 @@ int Awards::setAwardWAZst(const int _cqz, const int _band, const int _mode, cons
/*
int Awards::setAwardDXCCConfirmed(const int _band, const int _mode, const int _dxcc, const int _newQSOid) // Changes the status of a DXCC from worked to confirmed
{
//qDebug() << "Awards::setAwardDXCCConfirmed: " << QString::number(_band) << "/" << QString::number(_mode) << "/" << QString::number(_dxcc)<< "/" << QString::number(_newQSOid)<< endl;
//qDebug() << "Awards::setAwardDXCCConfirmed: " << QString::number(_band) << "/" << QString::number(_mode) << "/" << QString::number(_dxcc)<< "/" << QString::number(_newQSOid)<< endl;
QString stringQuery;
@ -1360,10 +1308,10 @@ int Awards::setAwardDXCCConfirmed(const int _band, const int _mode, const int _d
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
errorCode = query.lastError().number();
query.finish();
//qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastQuery: " << query.lastQuery() << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastError-data: " << query.lastError().databaseText() << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastError-driver: " << query.lastError().driverText() << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastError-n: " << QString::number(query.lastError().number() ) << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastQuery: " << query.lastQuery() << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastError-data: " << query.lastError().databaseText() << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastError-driver: " << query.lastError().driverText() << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastError-n: " << QString::number(query.lastError().number() ) << endl;
return errorCode;
}
@ -1371,14 +1319,14 @@ int Awards::setAwardDXCCConfirmed(const int _band, const int _mode, const int _d
else
{
// Not valid record
//qDebug() << "Awards::setAwardDXCCConfirmed: Not valid record" << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed: Not valid record" << endl;
return -3;
}
}
else
{
// Not next record
//qDebug() << "Awards::setAwardDXCCConfirmed: Not next record" << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed: Not next record" << endl;
return -2;
}
}
@ -1387,10 +1335,10 @@ int Awards::setAwardDXCCConfirmed(const int _band, const int _mode, const int _d
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
errorCode = query.lastError().number();
query.finish();
//qDebug() << "Awards::setAwardDXCCConfirmed: LastQuery: " << query.lastQuery() << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed: LastError-data: " << query.lastError().databaseText() << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed: LastError-driver: " << query.lastError().driverText() << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed: LastError-n: " << QString::number(query.lastError().number() ) << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed: LastQuery: " << query.lastQuery() << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed: LastError-data: " << query.lastError().databaseText() << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed: LastError-driver: " << query.lastError().driverText() << endl;
//qDebug() << "Awards::setAwardDXCCConfirmed: LastError-n: " << QString::number(query.lastError().number() ) << endl;
return errorCode;
}
@ -1401,7 +1349,7 @@ int Awards::setAwardDXCCConfirmed(const int _band, const int _mode, const int _d
int Awards::setDXCCToQSO(const int _dxcc, const int _qsoid) // Defines the DXCC in a QSO
{
//qDebug() << "Awards::setDXCCToQSO: " << QString::number(_dxcc) << "/" << QString::number(_qsoid) << endl;
//qDebug() << "Awards::setDXCCToQSO: " << QString::number(_dxcc) << "/" << QString::number(_qsoid) << endl;
int errorCode = -1;
QString queryString = QString("UPDATE log SET dxcc='%1' WHERE id='%2'").arg(_dxcc).arg(_qsoid);
QSqlQuery query = QSqlQuery();
@ -1414,20 +1362,20 @@ int Awards::setDXCCToQSO(const int _dxcc, const int _qsoid) // Defines the DXCC
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
//qDebug() << "Awards::setDXCCToQSO: DXCC Updated in Log but failed...." << endl;
//qDebug() << "Awards::setDXCCToQSO: DXCC Updated in Log but failed...." << endl;
errorCode = query.lastError().number();
query.finish();
//qDebug() << "Awards::setDXCCToQSO: LastQuery: " << query.lastQuery() << endl;
//qDebug() << "Awards::setDXCCToQSO: LastError-data: " << query.lastError().databaseText() << endl;
//qDebug() << "Awards::setDXCCToQSO: LastError-driver: " << query.lastError().driverText() << endl;
//qDebug() << "Awards::setDXCCToQSO: LastError-n: " << QString::number(query.lastError().number() ) << endl;
//qDebug() << "Awards::setDXCCToQSO: LastQuery: " << query.lastQuery() << endl;
//qDebug() << "Awards::setDXCCToQSO: LastError-data: " << query.lastError().databaseText() << endl;
//qDebug() << "Awards::setDXCCToQSO: LastError-driver: " << query.lastError().driverText() << endl;
//qDebug() << "Awards::setDXCCToQSO: LastError-n: " << QString::number(query.lastError().number() ) << endl;
return errorCode;
}
}
int Awards::setCQToQSO(const int _cqz, const int _qsoid) // Defines the CQ in a QSO
{
//qDebug() << "Awards::setCQToQSO: " << QString::number(_cqz) << "/" << QString::number(_qsoid) << endl;
//qDebug() << "Awards::setCQToQSO: " << QString::number(_cqz) << "/" << QString::number(_qsoid) << endl;
int errorCode = -1;
QString queryString = QString("UPDATE log SET cqz='%1' WHERE id='%2'").arg(_cqz).arg(_qsoid);
QSqlQuery query = QSqlQuery();
@ -1440,13 +1388,13 @@ int Awards::setCQToQSO(const int _cqz, const int _qsoid) // Defines the CQ in a
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
//qDebug() << "Awards::setCQToQSO: DXCC Updated in Log but failed...." << endl;
//qDebug() << "Awards::setCQToQSO: DXCC Updated in Log but failed...." << endl;
errorCode = query.lastError().number();
query.finish();
//qDebug() << "Awards::setCQToQSO: LastQuery: " << query.lastQuery() << endl;
//qDebug() << "Awards::setCQToQSO: LastError-data: " << query.lastError().databaseText() << endl;
//qDebug() << "Awards::setCQToQSO: LastError-driver: " << query.lastError().driverText() << endl;
//qDebug() << "Awards::setCQToQSO: LastError-n: " << QString::number(query.lastError().number() ) << endl;
//qDebug() << "Awards::setCQToQSO: LastQuery: " << query.lastQuery() << endl;
//qDebug() << "Awards::setCQToQSO: LastError-data: " << query.lastError().databaseText() << endl;
//qDebug() << "Awards::setCQToQSO: LastError-driver: " << query.lastError().driverText() << endl;
//qDebug() << "Awards::setCQToQSO: LastError-n: " << QString::number(query.lastError().number() ) << endl;
return errorCode;
}
}
@ -1460,27 +1408,27 @@ bool Awards::getIsDXCCConfirmed(const int _dxcc, const int _logNumber)
int Awards::getDXMarathonQSO(const int _year, const int _logNumber)
{
//qDebug() << "Awards::getDXMarathonQSO: " << QString::number(_year) << endl;
//qDebug() << "Awards::getDXMarathonQSO: " << QString::number(_year) << endl;
return dxMarathon->getDXMarathonQSO(_year, _logNumber);
}
int Awards::getDXMarathonDXCC(const int _year, const int _logNumber)
{
//qDebug() << "Awards::getDXMarathonDXCC: " << QString::number(_year) << endl;
//qDebug() << "Awards::getDXMarathonDXCC: " << QString::number(_year) << endl;
return dxMarathon->getDXMarathonDXCC(_year, _logNumber);
}
int Awards::getDXMarathonCQ(const int _year, const int _logNumber)
{
//qDebug() << "Awards::getDXMarathonCQ: " << QString::number(_year) << endl;
//qDebug() << "Awards::getDXMarathonCQ: " << QString::number(_year) << endl;
return dxMarathon->getDXMarathonCQ(_year, _logNumber);
}
int Awards::getDXMarathonScore(const int _year, const int _logNumber)
{
//qDebug() << "Awards::getDXMarathonScore: " << QString::number(_year) << endl;
//qDebug() << "Awards::getDXMarathonScore: " << QString::number(_year) << endl;
return dxMarathon->getDXMarathonScore(_year, _logNumber);
@ -1494,7 +1442,7 @@ bool Awards::isDXMarathonNeed(const int _dxcc, const int _cq, const int _year, c
int Awards::dxccStatusBand(const int _ent, const int _band, const int _logNumber) //-1 error / 0 Not worked / 1 worked / 2 confirmed
{
//-1 error / 0 Not worked / 1 worked / 2 confirmed
//qDebug() << "Awards::dxccStatusBand: " << QString::number(_ent) << "/" << QString::number(_band) << endl;
//qDebug() << "Awards::dxccStatusBand: " << QString::number(_ent) << "/" << QString::number(_band) << endl;
QSqlQuery query = QSqlQuery();
QString queryString = QString();
@ -1532,14 +1480,14 @@ int Awards::dxccStatusBand(const int _ent, const int _band, const int _logNumber
return -1;
}
//qDebug() << "Awards::dxccStatusBand: return - 0.3" << endl;
//qDebug() << "Awards::dxccStatusBand: return - 0.3" << endl;
return status; // if arrives to here decision => not worked
}
int Awards::dxccStatusMode(const int _ent, const int _mode, const int _logNumber) //-1 error / 0 Not worked / 1 worked / 2 confirmed
{
//-1 error / 0 Not worked / 1 worked / 2 confirmed
//qDebug() << "Awards::dxccStatusMode: " << QString::number(_ent) << "/" << QString::number(_mode) << endl;
//qDebug() << "Awards::dxccStatusMode: " << QString::number(_ent) << "/" << QString::number(_mode) << endl;
QSqlQuery query = QSqlQuery();
QString queryString = QString();

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

View File

@ -3,7 +3,7 @@
AwardsWidget::AwardsWidget(DataProxy_SQLite *dp, QWidget *parent) :
QWidget(parent)
{
//qDebug() << "AwardsWidget::AwardsWidget" << endl;
//qDebug() << "AwardsWidget::AwardsWidget" << endl;
manageDXMarathon = false;
logSeverity = 7; //7 Debug /0=emergency or no debug
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
@ -38,7 +38,7 @@ AwardsWidget::AwardsWidget(DataProxy_SQLite *dp, QWidget *parent) :
clear();
createUI();
emit debugLog (Q_FUNC_INFO, "End", logSeverity);
//qDebug() << "AwardsWidget::AwardsWidget - END" << endl;
//qDebug() << "AwardsWidget::AwardsWidget - END" << endl;
}
AwardsWidget::~AwardsWidget()
@ -49,7 +49,7 @@ AwardsWidget::~AwardsWidget()
void AwardsWidget::clear()
{
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
//qDebug() << "AwardsWidget::clear" << endl;
//qDebug() << "AwardsWidget::clear" << endl;
/*
searchBoxLineEdit->clear();
searchResultsTreeWidget->clear();
@ -58,14 +58,14 @@ void AwardsWidget::clear()
*/
emit debugLog (Q_FUNC_INFO, "End", logSeverity);
//qDebug() << "AwardsWidget::clear-END" << endl;
//qDebug() << "AwardsWidget::clear-END" << endl;
}
void AwardsWidget::createUI()
{
//searchBoxClearButton->setToolTip(tr("Clear the searches."));
//qDebug() << "AwardsWidget::createUI" << endl;
//qDebug() << "AwardsWidget::createUI" << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
recalculateAwardsButton = new QPushButton(tr("Recalculate"), this);
@ -105,7 +105,7 @@ void AwardsWidget::createUI()
#ifdef Q_OS_WIN
//qDebug() << "AwardsWidget::createUIDX - WINDOWS DETECTED!" << endl;
//qDebug() << "AwardsWidget::createUIDX - WINDOWS DETECTED!" << endl;
qsoNLabelN->setFrameShadow(QFrame::Raised);
qsoNLabelN->setFrameStyle(QFrame::StyledPanel);
@ -136,7 +136,7 @@ void AwardsWidget::createUI()
#else
//qDebug() << "AwardsWidget::createUIDX - NO WINDOWS DETECTED!" << endl;
//qDebug() << "AwardsWidget::createUIDX - NO WINDOWS DETECTED!" << endl;
//localLabelN->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
qsoNLabelN->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
@ -154,12 +154,12 @@ void AwardsWidget::createUI()
#endif
//qDebug() << "AwardsWidget::createUI-125" << endl;
//qDebug() << "AwardsWidget::createUI-125" << endl;
//reconfigureyearlyUI(manageyearly);
yearlyScoreLabelN->setText(tr("Score"));
yearlyLabelN->setText(tr("Annual"));
//qDebug() << "AwardsWidget::createUI-135" << endl;
//qDebug() << "AwardsWidget::createUI-135" << endl;
QGridLayout *yearlyDLayout = new QGridLayout;
yearlyDLayout->addWidget(yearlyQSOsLabelN, 0, 0);
@ -169,51 +169,51 @@ void AwardsWidget::createUI()
yearlyDLayout->addWidget(yearlyDXCCQLCDNumber, 1, 1);
yearlyDLayout->addWidget(yearlyCQQLCDNumber, 1, 2);
//qDebug() << "AwardsWidget::createUI-145" << endl;
//qDebug() << "AwardsWidget::createUI-145" << endl;
QVBoxLayout *yearlyTLayout = new QVBoxLayout;
yearlyTLayout->addWidget(yearlyLabelN);
yearlyTLayout->addWidget(operatingYearsComboBox);
//qDebug() << "AwardsWidget::createUI-150" << endl;
//qDebug() << "AwardsWidget::createUI-150" << endl;
QGridLayout *dxUpRightAwardsTabLayout = new QGridLayout;
//qDebug() << "AwardsWidget::createUI-151" << endl;
//qDebug() << "AwardsWidget::createUI-151" << endl;
dxUpRightAwardsTabLayout->addWidget(awardLabelN, 0, 0);
//qDebug() << "AwardsWidget::createUI-152" << endl;
//qDebug() << "AwardsWidget::createUI-152" << endl;
dxUpRightAwardsTabLayout->addWidget(workedLabelN, 0, 1);
//qDebug() << "AwardsWidget::createUI-153" << endl;
//qDebug() << "AwardsWidget::createUI-153" << endl;
dxUpRightAwardsTabLayout->addWidget(confirmedLabelN, 0, 2);
//qDebug() << "AwardsWidget::createUI-154" << endl;
//qDebug() << "AwardsWidget::createUI-154" << endl;
dxUpRightAwardsTabLayout->addWidget(dxccLabelN, 1, 0);
//qDebug() << "AwardsWidget::createUI-155" << endl;
//qDebug() << "AwardsWidget::createUI-155" << endl;
dxUpRightAwardsTabLayout->addWidget(dxccWorkedQLCDNumber, 1, 1);
//qDebug() << "AwardsWidget::createUI-156" << endl;
//qDebug() << "AwardsWidget::createUI-156" << endl;
dxUpRightAwardsTabLayout->addWidget(dxccConfirmedQLCDNumber, 1, 2);
//qDebug() << "AwardsWidget::createUI-157" << endl;
//qDebug() << "AwardsWidget::createUI-157" << endl;
dxUpRightAwardsTabLayout->addWidget(wazLabelN, 2, 0);
//qDebug() << "AwardsWidget::createUI-158" << endl;
//qDebug() << "AwardsWidget::createUI-158" << endl;
dxUpRightAwardsTabLayout->addWidget(wazWorkedQLCDNumber, 2, 1);
//qDebug() << "AwardsWidget::createUI-159" << endl;
//qDebug() << "AwardsWidget::createUI-159" << endl;
dxUpRightAwardsTabLayout->addWidget(wazConfirmedQLCDNumber, 2, 2);
//qDebug() << "AwardsWidget::createUI-160" << endl;
//qDebug() << "AwardsWidget::createUI-160" << endl;
//dxUpRightAwardsTabLayout->addWidget(localLabelN, 3, 0);
//qDebug() << "AwardsWidget::createUI-161" << endl;
//qDebug() << "AwardsWidget::createUI-161" << endl;
//dxUpRightAwardsTabLayout->addWidget(localWorkedQLCDNumber, 3, 1);
//qDebug() << "AwardsWidget::createUI-162" << endl;
//qDebug() << "AwardsWidget::createUI-162" << endl;
//dxUpRightAwardsTabLayout->addWidget(localConfirmedQLCDNumber, 3, 2);
//qDebug() << "AwardsWidget::createUI-163" << endl;
//qDebug() << "AwardsWidget::createUI-163" << endl;
dxUpRightAwardsTabLayout->addWidget(qsoNLabelN, 4, 0);
//qDebug() << "AwardsWidget::createUI-164" << endl;
//qDebug() << "AwardsWidget::createUI-164" << endl;
dxUpRightAwardsTabLayout->addWidget(qsoWorkedQLCDNumber, 4, 1);
//qDebug() << "AwardsWidget::createUI-165" << endl;
//qDebug() << "AwardsWidget::createUI-165" << endl;
dxUpRightAwardsTabLayout->addWidget(qsoConfirmedQLCDNumber, 4, 2);
//qDebug() << "AwardsWidget::createUI-166" << endl;
//qDebug() << "AwardsWidget::createUI-166" << endl;
dxUpRightAwardsTabLayout->addLayout(yearlyTLayout, 5, 0);
//qDebug() << "AwardsWidget::createUI-167" << endl;
//qDebug() << "AwardsWidget::createUI-167" << endl;
dxUpRightAwardsTabLayout->addLayout(yearlyDLayout, 5, 1, 1, -1);
//qDebug() << "AwardsWidget::createUI-168" << endl;
//qDebug() << "AwardsWidget::createUI-168" << endl;
dxUpRightAwardsTabLayout->addWidget(recalculateAwardsButton, 6, 1);
//qDebug() << "AwardsWidget::createUI-200" << endl;
//qDebug() << "AwardsWidget::createUI-200" << endl;
setLayout(dxUpRightAwardsTabLayout);
//connect(dataProxy, SIGNAL(qsoFound(QStringList)), this, SLOT(slotQsoFound(QStringList)) );
@ -225,7 +225,7 @@ void AwardsWidget::createUI()
connect(recalculateAwardsButton, SIGNAL(clicked()), this, SLOT(slotRecalculateAwardsButtonClicked() ) );
emit debugLog (Q_FUNC_INFO, "End", logSeverity);
//qDebug() << "AwardsWidget::createUI-END" << endl;
//qDebug() << "AwardsWidget::createUI-END" << endl;
}
void AwardsWidget::setManageDXMarathon(const bool _dx)
@ -239,7 +239,7 @@ void AwardsWidget::setManageDXMarathon(const bool _dx)
/*
void AwardsWidget::slotSearchClearButtonClicked()
{
//qDebug() << "SearchWidget::slotSearchClearButtonClicked: " << endl;
//qDebug() << "SearchWidget::slotSearchClearButtonClicked: " << endl;
searchResultsTreeWidget->clear();
searchBoxLineEdit->clear();
searchSelectAllClicked = false;
@ -259,10 +259,10 @@ void AwardsWidget::setToolTips()
qsoConfirmedQLCDNumber->setToolTip(tr("Number of confirmed QSOs."));
qsoWorkedQLCDNumber->setToolTip(tr("Number of worked QSOs."));
yearlyQSOLCDNumber->setToolTip(tr("Number of QSOs worked in the selected year."));
yearlyDXCCQLCDNumber->setToolTip(tr("Number of DXCCs worked in the selected year."));
yearlyCQQLCDNumber->setToolTip(tr("Number of CQ Zones worked in the selected year."));
yearlyScoreQLCDNumber->setToolTip(tr("Score for the DXMarathon in the selected year."));
yearlyQSOLCDNumber->setToolTip(tr("Number of QSOs worked on the selected year."));
yearlyDXCCQLCDNumber->setToolTip(tr("Number of DXCC worked on the selected year."));
yearlyCQQLCDNumber->setToolTip(tr("Number of CQ Zones worked on the selected year."));
yearlyScoreQLCDNumber->setToolTip(tr("Score for the DXMarathon on the selected year."));
operatingYearsComboBox->setToolTip(tr("Select the year you want to check."));
emit debugLog (Q_FUNC_INFO, "End", logSeverity);
@ -287,7 +287,7 @@ void AwardsWidget::slotOperatingYearComboBoxChanged()
void AwardsWidget::showAwards()
{ // Updates and show all the award status tab.
//qDebug() << "AwardsWidget::showAwards" << endl;
//qDebug() << "AwardsWidget::showAwards" << endl;
/*
WAZ
Local
@ -336,26 +336,26 @@ void AwardsWidget::showAwards()
showDXMarathon(selectedYear);
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
//qDebug() << "AwardsWidget::showAwards - END" << endl;
//qDebug() << "AwardsWidget::showAwards - END" << endl;
}
void AwardsWidget::showDXMarathon(const int _year)
{
//qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: Year: " << QString::number(_year) << endl;
//qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: Year: " << QString::number(_year) << endl;
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
int i = 0;
i = awards->getDXMarathonQSO(_year, currentLog);
//qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: QSO: " << QString::number(i) << endl;
//qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: QSO: " << QString::number(i) << endl;
yearlyQSOLCDNumber->display(i);
i = awards->getDXMarathonDXCC(_year, currentLog);
//qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: DXCC: " << QString::number(i) << endl;
//qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: DXCC: " << QString::number(i) << endl;
yearlyDXCCQLCDNumber->display(i);
i = awards->getDXMarathonCQ(_year, currentLog);
yearlyCQQLCDNumber->display(i);
//qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: CQ: " << QString::number(i) << endl;
//qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: CQ: " << QString::number(i) << endl;
if (manageDXMarathon)
{
@ -367,7 +367,7 @@ void AwardsWidget::showDXMarathon(const int _year)
}
yearlyScoreQLCDNumber->display(i);
emit debugLog(Q_FUNC_INFO, "End", logSeverity);
//qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: Score: " << QString::number(i) << endl;
//qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: Score: " << QString::number(i) << endl;
}
void AwardsWidget::reconfigureDXMarathonUI(const bool _dxM)
@ -452,27 +452,27 @@ void AwardsWidget::fillOperatingYears()
if (dataProxy->getLastQSOid()<=1)
{
//qDebug() << "AwardsWidget::AwardsWidget: 18.4" << endl;
//qDebug() << "AwardsWidget::AwardsWidget: 18.4" << endl;
operatingYearsComboBox->addItem(QString::number(selectedYear));
}
else
{
//qDebug() << "AwardsWidget::AwardsWidget: 18.5 - currentLog: " << QString::number(currentLog) << endl;
//qDebug() << "AwardsWidget::AwardsWidget: 18.5 - currentLog: " << QString::number(currentLog) << endl;
operatingYearsComboBox->addItems(dataProxy->getOperatingYears(currentLog));
//qDebug() << "AwardsWidget::AwardsWidget: 18.5.1 - currentLog: " << QString::number(currentLog) << endl;
//qDebug() << "AwardsWidget::AwardsWidget: 18.5.1 - currentLog: " << QString::number(currentLog) << endl;
QStringList a;
a.clear();
a << dataProxy->getOperatingYears(currentLog);
//qDebug() << "AwardsWidget::AwardsWidget: 18.5.1.1 - currentLog: " << QString::number(currentLog) << endl;
//qDebug() << "AwardsWidget::AwardsWidget: 18.5.1.1 - currentLog: " << QString::number(currentLog) << endl;
if (!a.isEmpty())
{
//qDebug() << "AwardsWidget::AwardsWidget: 18.5.1.2 - currentLog: " << QString::number(currentLog) << endl;
//qDebug() << "AwardsWidget::AwardsWidget: 18.5.1.2 - currentLog: " << QString::number(currentLog) << endl;
operatingYearsComboBox->setCurrentIndex(operatingYearsComboBox->findText(a.last(), Qt::MatchCaseSensitive));
//qDebug() << "AwardsWidget::AwardsWidget: 18.5.1.3 - currentLog: " << QString::number(currentLog) << endl;
//qDebug() << "AwardsWidget::AwardsWidget: 18.5.1.3 - currentLog: " << QString::number(currentLog) << endl;
}
//qDebug() << "AwardsWidget::AwardsWidget: 18.5.2" << endl;
//qDebug() << "AwardsWidget::AwardsWidget: 18.5.2" << endl;
}
emit debugLog(Q_FUNC_INFO, "End", logSeverity);
}

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
//

View File

@ -1,4 +1,4 @@
#include "charts/barchartstats.h"
#include "barchartstats.h"
/***************************************************************************
barchartstats.cpp - description
-------------------
@ -21,7 +21,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -56,7 +56,7 @@ BarChartStats::~BarChartStats(){}
void BarChartStats::clear()
{
//qDebug() << "BarChartStats::clear()" << endl;
//qDebug() << "BarChartStats::clear()" << endl;
//cleanLayout();
prepareChart(1);
}
@ -113,7 +113,7 @@ void BarChartStats::prepareChart(const int _selection, const int _log)
case 4:
{
//cleanLayout();
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-4: per band " << endl;
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-4: per band " << endl;
genchart = new StatsQSOsPerBandBarChartWidget(dataProxy, nullptr);
mLayout->addWidget(genchart);
}
@ -121,7 +121,7 @@ void BarChartStats::prepareChart(const int _selection, const int _log)
case 5:
{
//cleanLayout();
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-5: per modes " << endl;
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-5: per modes " << endl;
genchart = new StatsQSOsPerModeBarChartWidget(dataProxy, nullptr);
mLayout->addWidget(genchart);
@ -130,14 +130,14 @@ void BarChartStats::prepareChart(const int _selection, const int _log)
case 6:
{
//cleanLayout();
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-6: per dxcc " << endl;
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-6: per dxcc " << endl;
genchart = new StatsQSOsPerDXCCBarChartWidget(dataProxy, nullptr);
mLayout->addWidget(genchart);
}
break;
case 7:
{ // How many QSO per Continent
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/Continent " << endl;
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/Continent " << endl;
//cleanLayout();
genchart = new StatsQSOsPerContinentBarChartWidget(dataProxy, nullptr);
mLayout->addWidget(genchart);
@ -145,7 +145,7 @@ void BarChartStats::prepareChart(const int _selection, const int _log)
break;
case 8:
{
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour " << endl;
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour " << endl;
//cleanLayout();
genchart = new StatsQSOsPerHourBarChartWidget(dataProxy, nullptr);
mLayout->addWidget(genchart);

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include <QObject>

View File

@ -1,17 +1,15 @@
#include "charts/statscqzperyearbarchartwidget.h"
#include "statscqzperyearbarchartwidget.h"
StatsCQZPerYearBarChartWidget::StatsCQZPerYearBarChartWidget(){}
StatsCQZPerYearBarChartWidget::StatsCQZPerYearBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
//qDebug() << "StatsCQZPerYearBarChartWidget::StatsCQZPerYearBarChartWidget" << endl;
//qDebug() << "StatsCQZPerYearBarChartWidget::StatsCQZPerYearBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
chartView = new QChartView(chart);
//chart->setTheme(QChart::ChartThemeQt);
//chart->setTheme(QChart::ChartThemeBlueCerulean);
createUI();
prepareChart();
@ -32,9 +30,9 @@ void StatsCQZPerYearBarChartWidget::createUI()
void StatsCQZPerYearBarChartWidget::prepareChart()
{
QString categoriesTitle;
QString categoriesElem;
QStringList categories;
QString x_axisTitle;
QString x_axisElem;
QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
@ -42,51 +40,49 @@ void StatsCQZPerYearBarChartWidget::prepareChart()
int numberPerX = 0;
chart->removeAllSeries();
categories.clear();
x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("CQ Zones per year"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
//qDebug() << "StatsCQZPerYearBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
categories.append(dataProxy->getOperatingYears(-1));
categoriesElem = tr("CQ zones");
categoriesTitle = tr("CQ zones per year");
//qDebug() << "StatsCQZPerYearBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
x_axis.append(dataProxy->getOperatingYears(-1));
x_axisElem = tr("CQ zones");
x_axisTitle = tr("CQ zones per year");
aux.clear();
for (int i = 0; i < categories.count();i++ )
for (int i = 0; i < x_axis.count();i++ )
{
numberPerX = dataProxy->getCQzonYear((categories.at(i)).toInt(), -1);
//numberPerX = dataProxy->getQSOonYear((categories.at(i)).toInt(), -1);
//qDebug() << categories.at(i) + "-" + QString::number(numberPerX) << endl;
numberPerX = dataProxy->getCQzonYear((x_axis.at(i)).toInt(), -1);
//numberPerX = dataProxy->getQSOonYear((x_axis.at(i)).toInt(), -1);
//qDebug() << x_axis.at(i) + "-" + QString::number(numberPerX) << endl;
*set0 << numberPerX;
//qDebug() << "StatsCQZPerYearBarChartWidget::prepareChart QSOs: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
//qDebug() << "StatsCQZPerYearBarChartWidget::prepareChart QSOs: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
aux = tr("Reading data ...") + "\n" + tr("Years: %1/%2").arg(QString::number(i)).arg(QString::number(categories.count()));
aux = tr("Reading data ...") + "\n" + tr("Years: %1/%2").arg(QString::number(i)).arg(QString::number(x_axis.count()));
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
i = categories.count();
i = x_axis.count();
}
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
set0->setLabel(categoriesElem);
set0->setLabel(x_axisElem);
chart->addSeries(series);
chart->setTitle(categoriesTitle);
chart->setTitle(x_axisTitle);
axis->append(categories);
//chart->createDefaultAxes();
//series->attachAxis(axis);
chart->addAxis(axis, Qt::AlignBottom);
//chart->setAxisX(axis, series);
axis->append(x_axis);
chart->createDefaultAxes();
chart->setAxisX(axis, series);
}

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

View File

@ -1,11 +1,11 @@
#include "charts/statsentitiesperyearbarchartwidget.h"
#include "statsentitiesperyearbarchartwidget.h"
StatsEntitiesPerYearBarChartWidget::StatsEntitiesPerYearBarChartWidget(){}
StatsEntitiesPerYearBarChartWidget::StatsEntitiesPerYearBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
//qDebug() << "StatsEntitiesPerYearBarChartWidget::StatsEntitiesPerYearBarChartWidget" << endl;
//qDebug() << "StatsEntitiesPerYearBarChartWidget::StatsEntitiesPerYearBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@ -30,60 +30,56 @@ void StatsEntitiesPerYearBarChartWidget::createUI()
void StatsEntitiesPerYearBarChartWidget::prepareChart()
{
QString categoriesTitle;
QString categoriesElem;
QStringList categories;
QString x_axisTitle;
QString x_axisElem;
QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
categoriesTitle = QString();
categoriesElem = QString();
categories.clear();
x_axisTitle = QString();
x_axisElem = QString();
x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("Chart title"));
//*set0->remove(0, set0->count()-1);
//qreal sum = 0;
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
//qDebug() << "StatsEntitiesPerYearBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
//qDebug() << "BarChartStats::prepareChart: SelectedGrapth-2: DXCC " << endl;
categories.append(dataProxy->getOperatingYears(-1));
categoriesElem = tr("DXCC Entities");
categoriesTitle = tr("DXCC Entities per year");
//qDebug() << "StatsEntitiesPerYearBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
//qDebug() << "BarChartStats::prepareChart: SelectedGrapth-2: DXCC " << endl;
x_axis.append(dataProxy->getOperatingYears(-1));
x_axisElem = tr("DXCC Entities");
x_axisTitle = tr("DXCC Entities per year");
aux.clear();
for (int i = 0; i < categories.count();i++ )
for (int i = 0; i < x_axis.count();i++ )
{
numberPerX = dataProxy->getDXCConYear((categories.at(i)).toInt(), -1);
numberPerX = dataProxy->getDXCConYear((x_axis.at(i)).toInt(), -1);
*set0 << numberPerX;
numberPerX = 0;
aux = tr("Reading data ...") + "\n" + tr("Entities: ") + QString::number(i) + "/" + QString::number(categories.count());
aux = tr("Reading data ...") + "\n" + tr("Entities: ") + QString::number(i) + "/" + QString::number(x_axis.count());
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
i = categories.count();
i = x_axis.count();
}
//qDebug() << "BarChartStats::prepareChart DXCCs: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
//qDebug() << "BarChartStats::prepareChart DXCCs: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
}
series->append(set0);
set0->setLabel(categoriesElem);
set0->setLabel(x_axisElem);
chart->addSeries(series);
chart->setTitle(categoriesTitle);
axis->append(categories);
//chart->createDefaultAxes();
//series->attachAxis(axis);
chart->addAxis(axis, Qt::AlignBottom);
// chart->setAxisX(axis, series);
chart->setTitle(x_axisTitle);
axis->append(x_axis);
chart->createDefaultAxes();
chart->setAxisX(axis, series);
}

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

View File

@ -1,14 +1,14 @@
#include "charts/statsgeneralchartwidget.h"
#include "statsgeneralchartwidget.h"
StatsGeneralChartWidget::StatsGeneralChartWidget()
{
//qDebug() << "StatsGeneralChartWidget::StatsGeneralChartWidget" << endl;
//qDebug() << "StatsGeneralChartWidget::StatsGeneralChartWidget" << endl;
}
StatsGeneralChartWidget::StatsGeneralChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
//qDebug() << "StatsGeneralChartWidget::StatsGeneralChartWidget" << endl;
//qDebug() << "StatsGeneralChartWidget::StatsGeneralChartWidget" << endl;
}

View File

@ -1,11 +1,11 @@
#include "charts/statsqsosperbandbarchartwidget.h"
#include "statsqsosperbandbarchartwidget.h"
StatsQSOsPerBandBarChartWidget::StatsQSOsPerBandBarChartWidget(){}
StatsQSOsPerBandBarChartWidget::StatsQSOsPerBandBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
//qDebug() << "StatsQSOsPerBandBarChartWidget::StatsQSOsPerBandBarChartWidget" << endl;
//qDebug() << "StatsQSOsPerBandBarChartWidget::StatsQSOsPerBandBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@ -30,62 +30,59 @@ void StatsQSOsPerBandBarChartWidget::createUI()
void StatsQSOsPerBandBarChartWidget::prepareChart()
{
QString categoriesTitle;
QString categoriesElem;
QStringList categories;
QString x_axisTitle;
QString x_axisElem;
QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
categoriesTitle = QString();
categoriesElem = QString();
categories.clear();
x_axisTitle = QString();
x_axisElem = QString();
x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("QSOs per band"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
//qDebug() << "StatsQSOsPerBandBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
categories.append(dataProxy->getBandsInLog(-1));
categoriesElem = tr("Bands");
categoriesTitle = tr("QSOs per band distribution");
//qDebug() << "StatsQSOsPerBandBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
x_axis.append(dataProxy->getBandsInLog(-1));
x_axisElem = tr("Bands");
x_axisTitle = tr("QSO per band distribution");
aux.clear();
for (int i = 0; i < categories.count();i++ )
for (int i = 0; i < x_axis.count();i++ )
{
numberPerX = dataProxy->getQSOsInBand((categories.at(i)), -1);
//qDebug() << categories.at(i) + "-" + QString::number(numberPerX) << endl;
numberPerX = dataProxy->getQSOsInBand((x_axis.at(i)), -1);
//qDebug() << x_axis.at(i) + "-" + QString::number(numberPerX) << endl;
*set0 << numberPerX;
numberPerX = 0;
//qDebug() << "StatsQSOsPerBandBarChartWidget::prepareChart QSOs: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
aux = tr("Reading data ...") + "\n" + tr("Bands: ") + QString::number(i) + "/" + QString::number(categories.count());
//aux = tr("Reading data ...") + "\n" + tr("Bands: %1/%2").arg(QString::number(i)).arg(QString::number(categories.count()));
//qDebug() << "StatsQSOsPerBandBarChartWidget::prepareChart QSOs: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
aux = tr("Reading data ...") + "\n" + tr("Bands: ") + QString::number(i) + "/" + QString::number(x_axis.count());
//aux = tr("Reading data ...") + "\n" + tr("Bands: %1/%2").arg(QString::number(i)).arg(QString::number(x_axis.count()));
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
i = categories.count();
i = x_axis.count();
}
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
set0->setLabel(categoriesElem);
set0->setLabel(x_axisElem);
chart->addSeries(series);
chart->setTitle(categoriesTitle);
chart->setTitle(x_axisTitle);
axis->append(categories);
//chart->createDefaultAxes();
//series->attachAxis(axis);
chart->addAxis(axis, Qt::AlignBottom);
//chart->setAxisX(axis, series);
axis->append(x_axis);
chart->createDefaultAxes();
chart->setAxisX(axis, series);
}

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

49
charts/statsqsospercontinentbarchartwidget.cpp Executable file → Normal file
View File

@ -1,11 +1,11 @@
#include "charts/statsqsospercontinentbarchartwidget.h"
#include "statsqsospercontinentbarchartwidget.h"
StatsQSOsPerContinentBarChartWidget::StatsQSOsPerContinentBarChartWidget(){}
StatsQSOsPerContinentBarChartWidget::StatsQSOsPerContinentBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
//qDebug() << "StatsQSOsPerContinentBarChartWidget::StatsQSOsPerContinentBarChartWidget" << endl;
//qDebug() << "StatsQSOsPerContinentBarChartWidget::StatsQSOsPerContinentBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@ -30,25 +30,25 @@ void StatsQSOsPerContinentBarChartWidget::createUI()
void StatsQSOsPerContinentBarChartWidget::prepareChart()
{
QString categoriesTitle;
QString categoriesElem;
QStringList categories;
QString x_axisTitle;
QString x_axisElem;
QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
categoriesTitle = QString();
categoriesElem = QString();
categories.clear();
x_axisTitle = QString();
x_axisElem = QString();
x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("QSOs per continent"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
@ -56,40 +56,37 @@ void StatsQSOsPerContinentBarChartWidget::prepareChart()
continents.clear();
continents << dataProxy->getContinentShortNames();
categories.append(continents);
categoriesElem = tr("Continents");
categoriesTitle = tr("QSOs per continent");
x_axis.append(continents);
x_axisElem = tr("Continents");
x_axisTitle = tr("QSOs per continent");
aux.clear();
for (int i = 0; i < categories.count(); i++ )
for (int i = 0; i < x_axis.count(); i++ )
{
numberPerX = dataProxy->getQSOsWithContinent(categories.at(i), -1);
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour: " << categories.at(i) << " - " << QString::number(numberPerX) << endl;
numberPerX = dataProxy->getQSOsWithContinent(x_axis.at(i), -1);
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour: " << x_axis.at(i) << " - " << QString::number(numberPerX) << endl;
*set0 << numberPerX;
numberPerX = 0;
aux = tr("Reading data ...") + "\n" + tr("Hours: ") + QString::number(i) + "/" + QString::number(categories.count());
aux = tr("Reading data ...") + "\n" + tr("Hours: ") + QString::number(i) + "/" + QString::number(x_axis.count());
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
i = categories.count();
i = x_axis.count();
}
//qDebug() << "BarChartStats::prepareChart CQz: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
//qDebug() << "BarChartStats::prepareChart CQz: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
set0->setLabel(categoriesElem);
set0->setLabel(x_axisElem);
chart->addSeries(series);
chart->setTitle(categoriesTitle);
chart->setTitle(x_axisTitle);
axis->append(categories);
//chart->createDefaultAxes();
//series->attachAxis(axis);
chart->addAxis(axis, Qt::AlignBottom);
//chart->setAxisX(axis, series);
axis->append(x_axis);
chart->createDefaultAxes();
chart->setAxisX(axis, series);
}

2
charts/statsqsospercontinentbarchartwidget.h Executable file → Normal file
View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

53
charts/statsqsosperdxccbarchartwidget.cpp Executable file → Normal file
View File

@ -1,11 +1,11 @@
#include "charts/statsqsosperdxccbarchartwidget.h"
#include "statsqsosperdxccbarchartwidget.h"
StatsQSOsPerDXCCBarChartWidget::StatsQSOsPerDXCCBarChartWidget(){}
StatsQSOsPerDXCCBarChartWidget::StatsQSOsPerDXCCBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
//qDebug() << "StatsQSOsPerDXCCBarChartWidget::StatsQSOsPerDXCCBarChartWidget" << endl;
//qDebug() << "StatsQSOsPerDXCCBarChartWidget::StatsQSOsPerDXCCBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@ -30,25 +30,25 @@ void StatsQSOsPerDXCCBarChartWidget::createUI()
void StatsQSOsPerDXCCBarChartWidget::prepareChart()
{
QString categoriesTitle;
QString categoriesElem;
QStringList categories;
QString x_axisTitle;
QString x_axisElem;
QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
categoriesTitle = QString();
categoriesElem = QString();
categories.clear();
x_axisTitle = QString();
x_axisElem = QString();
x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("QSOs per DXCC"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
aux = tr("Reading data...") ;
progress.setLabelText(aux);
@ -58,7 +58,7 @@ void StatsQSOsPerDXCCBarChartWidget::prepareChart()
entities.clear();
entities << dataProxy->getEntitiesIds();
//qDebug() << "StatsQSOsPerDXCCBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
//qDebug() << "StatsQSOsPerDXCCBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
QMap<int, int> map; // key,value = number of QSO, dxcc
int qsos = -1;
@ -70,11 +70,11 @@ void StatsQSOsPerDXCCBarChartWidget::prepareChart()
qsos = dataProxy->getQSOsWithDXCC((entities.at(i)).toInt(), -1);
if (qsos>0)
{
//qDebug() << "Checking: " << dataProxy->getEntityNameFromId((entities.at(i)).toInt()) << " - " << entities.at(i) << " - QSOs: " << QString::number(qsos) ;
//qDebug() << "Checking: " << dataProxy->getEntityNameFromId((entities.at(i)).toInt()) << " - " << entities.at(i) << " - QSOs: " << QString::number(qsos) ;
if (map.size()<10)
{
//qDebug() << "Inserting: " << dataProxy->getEntityNameFromId((entities.at(i)).toInt()) << " - " << entities.at(i) << " - QSOs: " << QString::number(qsos) ;
//qDebug() << "Inserting: " << dataProxy->getEntityNameFromId((entities.at(i)).toInt()) << " - " << entities.at(i) << " - QSOs: " << QString::number(qsos) ;
map.insert(qsos, (entities.at(i)).toInt());
}
else
@ -84,8 +84,8 @@ void StatsQSOsPerDXCCBarChartWidget::prepareChart()
it.next();
if (it.key()< qsos)
{
//qDebug() << "Removing: " << QString::number(it.key()) << " / " << QString::number(it.value()) << endl;
//qDebug() << "Replacing by: " << entities.at(i) << " / " << QString::number(qsos) << " - " << dataProxy->getEntityNameFromId((entities.at(i)).toInt()) << endl;
//qDebug() << "Removing: " << QString::number(it.key()) << " / " << QString::number(it.value()) << endl;
//qDebug() << "Replacing by: " << entities.at(i) << " / " << QString::number(qsos) << " - " << dataProxy->getEntityNameFromId((entities.at(i)).toInt()) << endl;
map.remove(it.key());
map.insert(qsos, (entities.at(i)).toInt());
it.toBack();
@ -101,36 +101,33 @@ void StatsQSOsPerDXCCBarChartWidget::prepareChart()
{
i = entities.size();
}
//qDebug() << "End of for iteration" << endl;
//qDebug() << "End of for iteration" << endl;
}
QMapIterator<int, int> it(map);
while (it.hasNext()) {
it.next();
categories.append(dataProxy->getEntityMainPrefix(it.value()));
x_axis.append(dataProxy->getEntityMainPrefix(it.value()));
numberPerX = it.key();
*set0 << numberPerX;
numberPerX = 0;
//qDebug() << "End of while iteration" << endl;
//qDebug() << "End of while iteration" << endl;
}
//qDebug() << "Out of while" << endl;
//qDebug() << "Out of while" << endl;
categoriesElem = tr("DXCC");
categoriesTitle = tr("Top ten DXCC per QSO");
x_axisElem = tr("DXCC");
x_axisTitle = tr("Top ten DXCC per QSO");
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
set0->setLabel(categoriesElem);
set0->setLabel(x_axisElem);
chart->addSeries(series);
chart->setTitle(categoriesTitle);
chart->setTitle(x_axisTitle);
axis->append(categories);
//chart->createDefaultAxes();
//series->attachAxis(axis);
chart->addAxis(axis, Qt::AlignBottom);
//chart->setAxisX(axis, series);
axis->append(x_axis);
chart->createDefaultAxes();
chart->setAxisX(axis, series);
}

2
charts/statsqsosperdxccbarchartwidget.h Executable file → Normal file
View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

50
charts/statsqsosperhourbarchartwidget.cpp Executable file → Normal file
View File

@ -1,11 +1,11 @@
#include "charts/statsqsosperhourbarchartwidget.h"
#include "statsqsosperhourbarchartwidget.h"
StatsQSOsPerHourBarChartWidget::StatsQSOsPerHourBarChartWidget(){}
StatsQSOsPerHourBarChartWidget::StatsQSOsPerHourBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
//qDebug() << "StatsQSOsPerHourBarChartWidget::StatsQSOsPerHourBarChartWidget" << endl;
//qDebug() << "StatsQSOsPerHourBarChartWidget::StatsQSOsPerHourBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@ -30,67 +30,63 @@ void StatsQSOsPerHourBarChartWidget::createUI()
void StatsQSOsPerHourBarChartWidget::prepareChart()
{
QString categoriesTitle;
QString categoriesElem;
QStringList categories;
QString x_axisTitle;
QString x_axisElem;
QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
categoriesTitle = QString();
categoriesElem = QString();
categories.clear();
x_axisTitle = QString();
x_axisElem = QString();
x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("QSOs per hour"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
QStringList hours;
hours.clear();
hours << "00" << "01" << "02" << "03" << "04" << "05" << "06" << "07" << "08" << "09" << "10" << "11"
<< "12" << "13" << "14" << "15" << "16" << "17" << "18" << "19" << "20" << "21" << "22" << "23";
categories.append(hours);
categoriesElem = tr("Hours");
categoriesTitle = tr("QSOs at hour");
x_axis.append(hours);
x_axisElem = tr("Hours");
x_axisTitle = tr("QSOs at hour");
aux.clear();
for (int i = 0; i < categories.count(); i++ )
for (int i = 0; i < x_axis.count(); i++ )
{
numberPerX = dataProxy->getQSOsAtHour((categories.at(i)).toInt(), -1);
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour: " << categories.at(i) << " - " << QString::number(numberPerX) << endl;
numberPerX = dataProxy->getQSOsAtHour((x_axis.at(i)).toInt(), -1);
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour: " << x_axis.at(i) << " - " << QString::number(numberPerX) << endl;
*set0 << numberPerX;
numberPerX = 0;
aux = tr("Reading data ...") + "\n" + tr("Hours: ") + QString::number(i) + "/" + QString::number(categories.count());
aux = tr("Reading data ...") + "\n" + tr("Hours: ") + QString::number(i) + "/" + QString::number(x_axis.count());
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
i = categories.count();
i = x_axis.count();
}
//qDebug() << "BarChartStats::prepareChart CQz: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
//qDebug() << "BarChartStats::prepareChart CQz: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
set0->setLabel(categoriesElem);
set0->setLabel(x_axisElem);
chart->addSeries(series);
chart->setTitle(categoriesTitle);
chart->setTitle(x_axisTitle);
axis->append(categories);
//chart->createDefaultAxes();
//series->attachAxis(axis);
chart->addAxis(axis, Qt::AlignBottom);
//chart->setAxisX(axis, series);
axis->append(x_axis);
chart->createDefaultAxes();
chart->setAxisX(axis, series);
}

2
charts/statsqsosperhourbarchartwidget.h Executable file → Normal file
View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

View File

@ -1,11 +1,11 @@
#include "charts/statsqsospermodebarchartwidget.h"
#include "statsqsospermodebarchartwidget.h"
StatsQSOsPerModeBarChartWidget::StatsQSOsPerModeBarChartWidget(){}
StatsQSOsPerModeBarChartWidget::StatsQSOsPerModeBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
//qDebug() << "StatsQSOsPerModeBarChartWidget::StatsQSOsPerModeBarChartWidget" << endl;
//qDebug() << "StatsQSOsPerModeBarChartWidget::StatsQSOsPerModeBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@ -30,62 +30,59 @@ void StatsQSOsPerModeBarChartWidget::createUI()
void StatsQSOsPerModeBarChartWidget::prepareChart()
{
QString categoriesTitle;
QString categoriesElem;
QStringList categories;
QString x_axisTitle;
QString x_axisElem;
QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
categoriesTitle = QString();
categoriesElem = QString();
categories.clear();
x_axisTitle = QString();
x_axisElem = QString();
x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("QSOs per mode"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
//qDebug() << "StatsQSOsPerModeBarChartWidget::prepareChart: SelectedGrapth-1: MODES " << endl;
categories.append(dataProxy->getModesInLog(-1));
categoriesElem = tr("Modes");
categoriesTitle = tr("QSOs per mode distribution");
//qDebug() << "StatsQSOsPerModeBarChartWidget::prepareChart: SelectedGrapth-1: MODES " << endl;
x_axis.append(dataProxy->getModesInLog(-1));
x_axisElem = tr("Modes");
x_axisTitle = tr("QSO per mode distribution");
aux.clear();
for (int i = 0; i < categories.count();i++ )
for (int i = 0; i < x_axis.count();i++ )
{
numberPerX = dataProxy->getQSOsInMode((categories.at(i)), -1);
//qDebug() << categories.at(i) + "-" + QString::number(numberPerX) << endl;
numberPerX = dataProxy->getQSOsInMode((x_axis.at(i)), -1);
//qDebug() << x_axis.at(i) + "-" + QString::number(numberPerX) << endl;
*set0 << numberPerX;
numberPerX = 0;
//qDebug() << "StatsQSOsPerModeBarChartWidget::prepareChart QSOs: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
aux = tr("Reading data ...") + "\n" + tr("Modes: ") + QString::number(i) + "/" + QString::number(categories.count());
//aux = tr("Reading data ...") + "\n" + tr("Modes: %1/%2").arg(QString::number(i)).arg(QString::number(categories.count()));
//qDebug() << "StatsQSOsPerModeBarChartWidget::prepareChart QSOs: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
aux = tr("Reading data ...") + "\n" + tr("Modes: ") + QString::number(i) + "/" + QString::number(x_axis.count());
//aux = tr("Reading data ...") + "\n" + tr("Modes: %1/%2").arg(QString::number(i)).arg(QString::number(x_axis.count()));
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
i = categories.count();
i = x_axis.count();
}
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
set0->setLabel(categoriesElem);
set0->setLabel(x_axisElem);
chart->addSeries(series);
chart->setTitle(categoriesTitle);
chart->setTitle(x_axisTitle);
axis->append(categories);
//chart->createDefaultAxes();
//series->attachAxis(axis);
chart->addAxis(axis, Qt::AlignBottom);
//chart->setAxisX(axis, series);
axis->append(x_axis);
chart->createDefaultAxes();
chart->setAxisX(axis, series);
}

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

47
charts/statsqsospermonthbarchartwidget.cpp Executable file → Normal file
View File

@ -1,11 +1,11 @@
#include "charts/statsqsospermonthbarchartwidget.h"
#include "statsqsospermonthbarchartwidget.h"
StatsQSOsPerMonthBarChartWidget::StatsQSOsPerMonthBarChartWidget(){}
StatsQSOsPerMonthBarChartWidget::StatsQSOsPerMonthBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
//qDebug() << "StatsQSOsPerMonthBarChartWidget::StatsQSOsPerMonthBarChartWidget" << endl;
//qDebug() << "StatsQSOsPerMonthBarChartWidget::StatsQSOsPerMonthBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@ -30,66 +30,63 @@ void StatsQSOsPerMonthBarChartWidget::createUI()
void StatsQSOsPerMonthBarChartWidget::prepareChart()
{
QString categoriesTitle;
QString categoriesElem;
QStringList categories;
QString x_axisTitle;
QString x_axisElem;
QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
categoriesTitle = QString();
categoriesElem = QString();
categories.clear();
x_axisTitle = QString();
x_axisElem = QString();
x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("QSOs per month"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
QStringList months;
months.clear();
months << tr("Jan") << tr("Feb") << tr("Mar") << tr("Apr") << tr("May") << tr("Jun")
<< tr("Jul") << tr("Aug") << tr("Sep") << tr("Oct") << tr("Nov") << tr("Dec");
categories.append(months);
categoriesElem = tr("Months");
categoriesTitle = tr("QSOs at Month");
x_axis.append(months);
x_axisElem = tr("Months");
x_axisTitle = tr("QSOs at Month");
aux.clear();
for (int i = 0; i < categories.count(); i++ )
for (int i = 0; i < x_axis.count(); i++ )
{
numberPerX = dataProxy->getQSOsOnMonth(i+1, -1);
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour: " << categories.at(i) << " - " << QString::number(numberPerX) << endl;
//qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour: " << x_axis.at(i) << " - " << QString::number(numberPerX) << endl;
*set0 << numberPerX;
numberPerX = 0;
aux = tr("Reading data ...") + "\n" + tr("Months: ") + QString::number(i) + "/" + QString::number(categories.count());
aux = tr("Reading data ...") + "\n" + tr("Months: ") + QString::number(i) + "/" + QString::number(x_axis.count());
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
i = categories.count();
i = x_axis.count();
}
//qDebug() << "BarChartStats::prepareChart CQz: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
//qDebug() << "BarChartStats::prepareChart CQz: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
set0->setLabel(categoriesElem);
set0->setLabel(x_axisElem);
chart->addSeries(series);
chart->setTitle(categoriesTitle);
chart->setTitle(x_axisTitle);
axis->append(categories);
//chart->createDefaultAxes();
//series->attachAxis(axis);
chart->addAxis(axis, Qt::AlignBottom);
//chart->setAxisX(axis, series);
axis->append(x_axis);
chart->createDefaultAxes();
chart->setAxisX(axis, series);
}

2
charts/statsqsospermonthbarchartwidget.h Executable file → Normal file
View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

View File

@ -1,11 +1,11 @@
#include "charts/statsqsosperyearbarchartwidget.h"
#include "statsqsosperyearbarchartwidget.h"
StatsQSOsPerYearBarChartWidget::StatsQSOsPerYearBarChartWidget(){}
StatsQSOsPerYearBarChartWidget::StatsQSOsPerYearBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
//qDebug() << "StatsQSOsPerYearBarChartWidget::StatsQSOsPerYearBarChartWidget" << endl;
//qDebug() << "StatsQSOsPerYearBarChartWidget::StatsQSOsPerYearBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@ -30,61 +30,59 @@ void StatsQSOsPerYearBarChartWidget::createUI()
void StatsQSOsPerYearBarChartWidget::prepareChart()
{
QString categoriesTitle;
QString categoriesElem;
QStringList categories;
QString x_axisTitle;
QString x_axisElem;
QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
categoriesTitle = QString();
categoriesElem = QString();
categories.clear();
x_axisTitle = QString();
x_axisElem = QString();
x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("Chart title"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
//qDebug() << "StatsQSOsPerYearBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
categories.append(dataProxy->getOperatingYears(-1));
categoriesElem = tr("QSOs");
categoriesTitle = tr("QSOs per year");
//qDebug() << "StatsQSOsPerYearBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
x_axis.append(dataProxy->getOperatingYears(-1));
x_axisElem = tr("QSOs");
x_axisTitle = tr("QSOs per year");
aux.clear();
for (int i = 0; i < categories.count();i++ )
for (int i = 0; i < x_axis.count();i++ )
{
numberPerX = dataProxy->getQSOonYear((categories.at(i)).toInt(), -1);
//qDebug() << categories.at(i) + "-" + QString::number(numberPerX) << endl;
numberPerX = dataProxy->getQSOonYear((x_axis.at(i)).toInt(), -1);
//qDebug() << x_axis.at(i) + "-" + QString::number(numberPerX) << endl;
*set0 << numberPerX;
numberPerX = 0;
//qDebug() << "StatsQSOsPerYearBarChartWidget::prepareChart QSOs: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
//qDebug() << "StatsQSOsPerYearBarChartWidget::prepareChart QSOs: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
aux = tr("Reading data ...") + "\n" + tr("QSO: %1/%2").arg(QString::number(i)).arg(QString::number(categories.count()));
aux = tr("Reading data ...") + "\n" + tr("QSO: %1/%2").arg(QString::number(i)).arg(QString::number(x_axis.count()));
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
i = categories.count();
i = x_axis.count();
}
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
set0->setLabel(categoriesElem);
set0->setLabel(x_axisElem);
chart->addSeries(series);
chart->setTitle(categoriesTitle);
chart->setTitle(x_axisTitle);
axis->append(categories);
//chart->createDefaultAxes();
//series->attachAxis(axis);
chart->addAxis(axis, Qt::AlignBottom);
//chart->setAxisX(axis, series);
axis->append(x_axis);
chart->createDefaultAxes();
chart->setAxisX(axis, series);
}

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

10
charts/statssentconfirmedpiechartwidget.cpp Executable file → Normal file
View File

@ -1,10 +1,10 @@
#include "charts/statssentconfirmedpiechartwidget.h"
#include "statssentconfirmedpiechartwidget.h"
StatsSentConfirmedPieChartWidget::StatsSentConfirmedPieChartWidget(){}
StatsSentConfirmedPieChartWidget::StatsSentConfirmedPieChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
//qDebug() << "StatsSentConfirmedPieChartWidget::StatsSentConfirmedPieChartWidget" << endl;
//qDebug() << "StatsSentConfirmedPieChartWidget::StatsSentConfirmedPieChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@ -32,9 +32,9 @@ void StatsSentConfirmedPieChartWidget::prepareChart()
//PieSlice append(string label, real value)
int sent = dataProxy->getHowManyQSLSentInLog(-1);
int confirmed = dataProxy->getHowManyConfirmedQSLInLog(-1);
//qDebug() << "Confirmed: " << QString::number(confirmed) << endl;
//qDebug() << "QSOs: " << QString::number(qsos) << endl;
//qDebug() << "Confirmed: " << QString::number(confirmed) << endl;
//qDebug() << "Worked: " << QString::number(qsos - confirmed) << endl;
series->append(tr("Sent - %1").arg(sent), sent);
series->append(tr("Confirmed - %2").arg(confirmed), confirmed);

4
charts/statssentconfirmedpiechartwidget.h Executable file → Normal file
View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -40,7 +40,7 @@ class StatsSentConfirmedPieChartWidget : public StatsGeneralChartWidget
{
Q_OBJECT
public:
StatsSentConfirmedPieChartWidget(DataProxy_SQLite *dp, QWidget *parent = nullptr);
StatsSentConfirmedPieChartWidget(DataProxy_SQLite *dp, QWidget *parent = 0);
StatsSentConfirmedPieChartWidget();
void prepareChart();

10
charts/statsworkedconfirmedpiechartwidget.cpp Executable file → Normal file
View File

@ -1,10 +1,10 @@
#include "charts/statsworkedconfirmedpiechartwidget.h"
#include "statsworkedconfirmedpiechartwidget.h"
StatsWorkedConfirmedPieChartWidget::StatsWorkedConfirmedPieChartWidget(){}
StatsWorkedConfirmedPieChartWidget::StatsWorkedConfirmedPieChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
//qDebug() << "StatsWorkedConfirmedPieChartWidget::StatsWorkedConfirmedPieChartWidget" << endl;
//qDebug() << "StatsWorkedConfirmedPieChartWidget::StatsWorkedConfirmedPieChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@ -32,9 +32,9 @@ void StatsWorkedConfirmedPieChartWidget::prepareChart()
//PieSlice append(string label, real value)
int qsos = dataProxy->getHowManyQSOInLog(-1);
int confirmed = dataProxy->getHowManyConfirmedQSLInLog(-1);
//qDebug() << "QSOs: " << QString::number(qsos) << endl;
//qDebug() << "Confirmed: " << QString::number(confirmed) << endl;
//qDebug() << "Worked: " << QString::number(qsos - confirmed) << endl;
//qDebug() << "QSOs: " << QString::number(qsos) << endl;
//qDebug() << "Confirmed: " << QString::number(confirmed) << endl;
//qDebug() << "Worked: " << QString::number(qsos - confirmed) << endl;
series->append(tr("Worked, not confirmed - %1").arg(qsos-confirmed), qsos - confirmed);
series->append(tr("Confirmed - %2").arg(confirmed), confirmed);

2
charts/statsworkedconfirmedpiechartwidget.h Executable file → Normal file
View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

10
charts/statsworkedsentpiechartwidget.cpp Executable file → Normal file
View File

@ -1,10 +1,10 @@
#include "charts/statsworkedsentpiechartwidget.h"
#include "statsworkedsentpiechartwidget.h"
StatsWorkedSentPieChartWidget::StatsWorkedSentPieChartWidget(){}
StatsWorkedSentPieChartWidget::StatsWorkedSentPieChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
//qDebug() << "StatsWorkedSentPieChartWidget::StatsWorkedSentPieChartWidget" << endl;
//qDebug() << "StatsWorkedSentPieChartWidget::StatsWorkedSentPieChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@ -32,9 +32,9 @@ void StatsWorkedSentPieChartWidget::prepareChart()
//PieSlice append(string label, real value)
int qsos = dataProxy->getHowManyQSOInLog(-1);
int confirmed = dataProxy->getHowManyQSLSentInLog(-1);
//qDebug() << "QSOs: " << QString::number(qsos) << endl;
//qDebug() << "Confirmed: " << QString::number(confirmed) << endl;
//qDebug() << "Worked: " << QString::number(qsos - confirmed) << endl;
//qDebug() << "QSOs: " << QString::number(qsos) << endl;
//qDebug() << "Confirmed: " << QString::number(confirmed) << endl;
//qDebug() << "Worked: " << QString::number(qsos - confirmed) << endl;
series->append(tr("Worked - %1").arg(qsos), qsos);
series->append(tr("Sent - %2").arg(confirmed), confirmed);

2
charts/statsworkedsentpiechartwidget.h Executable file → Normal file
View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -108,8 +108,8 @@ public:
QString getFreqFromBandId(const int _i);
//int getLogTypeNumber(const QString &_logType);
//QString getLogTypeName(const int _logType);
int getLogTypeNumber(const QString &_logType);
QString getLogTypeName(const int _logType);
bool unMarkAllQSO();
bool updateIfNeeded();

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include <QString>
@ -30,6 +30,7 @@
#include <QObject>
//#include <QtGlobal>
#include "dataproxy_sqlite.h"
#include "database.h"
@ -85,9 +86,6 @@ public:
bool isThisFreqInBand(const QString &_band, const QString &_fr);
int getLastQSOid();
QDate getFirstQSODateFromCall (const QString &_call); // If the callsign provided is not valid it provides the date of the first QSO
QDate getLastQSODateFromCall (const QString &_call); // If the callsign provided is not valid it provides the date of the last QSO
bool addQSOFromWSJTX(const QString &_dxcall, const double _freq, const QString &_mode,
const QString &_dx_grid, const QString &_time_off, const QString &_report_sent, const QString &_report_rec,
const QString &_tx_power, const QString &_comments, const QString &_name, const QString &_time_on,
@ -135,19 +133,12 @@ public:
//LOTW
bool lotwSentQueue(const QString &_updateDate, const int _currentLog); // Mark LOTW QSL SENT as Q (Queued)
bool lotwSentYes(const QString &_updateDate, const int _currentLog, const QString &_station); // Update LOTW QSL SENT marked as Q as Y (Queued)
bool lotwSentQSOs(const QList<int> &_qsos);
int lotwUpdateQSLReception (const QString &_call, const QString &_qso_date, const QString &_time_on, const QString &_band, const QString &_mode, const QString &_qslrdate);
QList<int> getQSOsListLoTWNotSent(const QString &_stationCallsign, const QDate &_startDate, const QDate &_endDate, bool _justQueued=true);
QStringList getQSODetailsForLoTWDownload(const int _id);
int getContinentIdFromContinentShortName(const QString &_n);
QString getContinentShortNameFromEntity(const int _n);
int getContinentIdFromEntity(const int _n);
QStringList getContinentShortNames();
bool isValidContinentShortName(const QString &_n);
bool isValidDXCC(const int _e);
int getCQzFromPrefix(const QString &_p);
int getCQzFromEntity(const int _n);
@ -156,7 +147,6 @@ public:
QString getEntityNameFromId(const int _n);
int getEntityIdFromName(const QString &_e);
QString getEntityMainPrefix(const int _entityN);
int getEntityIdFromMainPrefix(const QString &_e);
bool isNewCQz(int _c);
bool isNewEntity(int _e);
double getLongitudeFromEntity(const int _e);
@ -171,6 +161,8 @@ public:
QStringList getOperatingYears(const int _currentLog);
void compressDB();
bool unMarkAllQSO(); // Unmarks all the marked QSO
bool lotwSentQueue(const QString &_updateDate, const int _currentLog); // Mark LOTW QSL SENT as Q (Queued)
bool lotwSentYes(const QString &_updateDate, const int _currentLog, const QString &_station); // Update LOTW QSL SENT marked as Q as Y (Queued)
bool clearLog();
@ -201,11 +193,11 @@ public:
QStringList getContestNames();
QStringList getContestCat(const int _catn);
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);
//QString getLogTypeOfUserLog(const int _logN);
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);
QString getLogTypeOfUserLog(const int _logN);
int getLogNumberFromQSOId(const int _qsoId);
QStringList getBandNames();
@ -240,7 +232,7 @@ public:
QString getOperatorsFromLog(const int _log);
QString getCommentsFromLog(const int _log);
QString getLogDateFromLog(const int _log);
//QString getLogTypeNFromLog(const int _log);
QString getLogTypeNFromLog(const int _log);
bool addNewLog (const QStringList _qs);
bool doesThisLogExist(const int _log);
@ -278,4 +270,5 @@ signals:
void queryError(QString functionFailed, QString errorCodeS, int errorCodeN, QString failedQuery); // To alert about any failed query execution
};
#endif // DATAPROXY_SQLITE_H

View File

@ -15,13 +15,15 @@ DownLoadCTY::DownLoadCTY(const QString _klogDir, const QString _klogVersion) : Q
manager = new QNetworkAccessManager;
request = new QNetworkRequest;
//request->setUrl(QUrl("https://www.country-files.com/cty/cty.csv"));
request->setUrl(QUrl("https://www.country-files.com/bigcty/cty.csv"));
//request->setUrl(QUrl("http://www.country-files.com/cty/cty.csv"));
request->setUrl(QUrl("http://www.country-files.com/bigcty/cty.csv"));
QString ver = "KLog"+_klogVersion;
QByteArray str;
str.clear();
str.append(util->getAgent(_klogVersion));
//str.append(_klogVersion);
//request.setUrl(QUrl("http://qt.nokia.com"));
request->setRawHeader("User-Agent", str);
//request->setHeader(QNetworkRequest::UserAgentHeader, str);
@ -41,7 +43,7 @@ DownLoadCTY::~DownLoadCTY()
void DownLoadCTY::slotDownloadFinished(QNetworkReply *reply)
{
//qDebug() << "DownLoadCTY::slotDownloadFinished" << endl;
emit downloadStopped();
QUrl url = reply->url();
//qDebug() << "DownLoadCTY::slotDownloadFinished - URL: " << url.toString() << endl;
@ -84,7 +86,7 @@ DownLoadCTY::~DownLoadCTY()
reply->deleteLater();
emit done(true);
emit done();
}
@ -124,7 +126,7 @@ void DownLoadCTY::slotErrorManagement(QNetworkReply::NetworkError networkError)
//qDebug() << "DownLoadCTY::downloadFinished: ERROR: " << QString::number(result) << endl;
}
emit actionError(result);
actionError(result);
}
QString DownLoadCTY::saveFileName(const QUrl &url)
@ -149,6 +151,7 @@ QString DownLoadCTY::saveFileName(const QUrl &url)
msgBox.exec();
// already exists, don't overwrite
//int i = 0;
//basename += '.';

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include <QObject>
@ -74,10 +74,9 @@ private slots:
signals:
void actionReturnDownload(const int _i);
void done(bool _success);
void done();
void actionShowProgres(qint64 received, qint64 total);
void actionError(const int _i);
void downloadStopped();
};

View File

@ -11,16 +11,16 @@ TODO: Call the creation of this depending on the bands that the user is using
DXCCStatusWidget::DXCCStatusWidget(DataProxy_SQLite *dp, const QString &_parentFunction, QWidget *parent) : QWidget(parent)
{
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget from: " << _parentFunction << endl;
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget from: " << _parentFunction << endl;
dataProxy = dp;
locator = new Locator();
awards = new Awards(dataProxy, Q_FUNC_INFO);
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget-1" << endl;
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget-1" << endl;
world = new World(dataProxy,Q_FUNC_INFO);
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget-2" << endl;
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget-2" << endl;
dxccView = new QTableWidget;
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget-3" << endl;
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget-3" << endl;
dxccView->setMouseTracking(true);
dxccView->setSortingEnabled(true);
numberOfColumns = 0;
@ -31,39 +31,39 @@ DXCCStatusWidget::DXCCStatusWidget(DataProxy_SQLite *dp, const QString &_parentF
bandNames.clear();
validBands.clear();
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget-4" << endl;
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget-4" << endl;
setDefaultBands();
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget-5" << endl;
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget-5" << endl;
createUI();
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget - END" << endl;
//qDebug() << "DXCCStatusWidget::DXCCStatusWidget - END" << endl;
}
DXCCStatusWidget::~DXCCStatusWidget(){}
void DXCCStatusWidget::createUI()
{
//qDebug() << "DXCCStatusWidget::createUI " << endl;
//qDebug() << "DXCCStatusWidget::createUI " << endl;
// We remove the vertical header
hv = dxccView->verticalHeader();
hv->hide();
hv->setStretchLastSection(true);
hh = dxccView->horizontalHeader();
//qDebug() << "DXCCStatusWidget::createUI-10" << endl;
//qDebug() << "DXCCStatusWidget::createUI-10" << endl;
refreshButton->setText(tr("Update"));
//showAllLogsButton->setText("All logs");
//qDebug() << "DXCCStatusWidget::createUI-11" << endl;
//qDebug() << "DXCCStatusWidget::createUI-11" << endl;
dxccView->setContextMenuPolicy(Qt::CustomContextMenu);
//qDebug() << "DXCCStatusWidget::createUI-12" << endl;
//qDebug() << "DXCCStatusWidget::createUI-12" << endl;
dxccView->setColumnCount(numberOfColumns);
//qDebug() << "DXCCStatusWidget::createUI-13" << endl;
//qDebug() << "DXCCStatusWidget::createUI-13" << endl;
dxccView->horizontalHeader()->setStretchLastSection(true);
//qDebug() << "DXCCStatusWidget::createUI-14" << endl;
//qDebug() << "DXCCStatusWidget::createUI-14" << endl;
//qDebug() << "DXCCStatusWidget::createUI-15" << endl;
//qDebug() << "DXCCStatusWidget::createUI-15" << endl;
dxccView->setRowCount(0);
//qDebug() << "DXCCStatusWidget::createUI-20" << endl;
//qDebug() << "DXCCStatusWidget::createUI-20" << endl;
QHBoxLayout *bottonLineLayout = new QHBoxLayout;
bottonLineLayout->addSpacerItem(new QSpacerItem(10,0,QSizePolicy::Expanding,QSizePolicy::Maximum));
bottonLineLayout->addWidget(refreshButton);
@ -72,84 +72,76 @@ void DXCCStatusWidget::createUI()
tabLayout->addWidget(dxccView);
tabLayout->addLayout(bottonLineLayout);
setLayout(tabLayout);
//qDebug() << "DXCCStatusWidget::createUI-30" << endl;
//qDebug() << "DXCCStatusWidget::createUI-30" << endl;
dxccView->resizeColumnsToContents();
dxccView->resizeRowsToContents();
//qDebug() << "DXCCStatusWidget::createUI-90" << endl;
//qDebug() << "DXCCStatusWidget::createUI-90" << endl;
connect(refreshButton, SIGNAL(clicked()), this, SLOT(slotRefreshButtonClicked() ) );
//qDebug() << "DXCCStatusWidget::createUI-91" << endl;
//qDebug() << "DXCCStatusWidget::createUI-91" << endl;
connect(dxccView, SIGNAL(itemDoubleClicked(QTableWidgetItem *)), this, SLOT(slotItemDoubleClicked(QTableWidgetItem *) ) );
//qDebug() << "DXCCStatusWidget::createUI-92" << endl;
//qDebug() << "DXCCStatusWidget::createUI-92" << endl;
connect(dxccView, SIGNAL(itemEntered(QTableWidgetItem *)), this, SLOT(slotItemEntered(QTableWidgetItem *) ) );
//connect(dxccView, SIGNAL(customContextMenuRequested( const QPoint& ) ), this, SLOT(slotRightButton( const QPoint& ) ) );
//qDebug() << "DXCCStatusWidget::createUI-93" << endl;
//qDebug() << "DXCCStatusWidget::createUI-93" << endl;
//dxccView->setSortingEnabled(false);
//qDebug() << "DXCCStatusWidget::createUI-END" << endl;
//qDebug() << "DXCCStatusWidget::createUI-END" << endl;
}
void DXCCStatusWidget::update()
{
//qDebug() << "DXCCStatusWidget::update " << endl;
//qDebug() << "DXCCStatusWidget::update " << endl;
//int entities = world->getHowManyEntities();
int entities = dataProxy->getMaxEntityID(false);
//qDebug() << "DXCCStatusWidget::update: " << QString::number(entities) << " entities to update" << endl;
//qDebug() << "DXCCStatusWidget::update: " << QString::number(entities) << " entities to update" << endl;
QStringList list;
//qDebug() << "DXCCStatusWidget::update: -1" << endl;
//qDebug() << "DXCCStatusWidget::update: -1" << endl;
list.clear();
//qDebug() << "DXCCStatusWidget::update: -2" << endl;
//qDebug() << "DXCCStatusWidget::update: -2" << endl;
QString aux, prefix;
//qDebug() << "DXCCStatusWidget::update: -3" << endl;
if (dxccView->columnCount()>0)
QString aux;
//qDebug() << "DXCCStatusWidget::update: -3" << endl;
if (dxccView->columnCount()>1)
{
//dxccView->sortByColumn(1, Qt::AscendingOrder);
dxccView->clearContents();
tempLog = -1;
//qDebug() << "DXCCStatusWidget::update pre FOR" << endl;
//qDebug() << "DXCCStatusWidget::update pre FOR" << endl;
for (int i=1; i<=entities; i++)
{
//qDebug() << "DXCCStatusWidget::update in FOR " << QString::number(i) << endl;
//qDebug() << "DXCCStatusWidget::update in FOR " << QString::number(i) << endl;
aux = world->getEntityName(i);
prefix = world->getEntityMainPrefix(i);
if (prefix.startsWith("*"))
{
QString a = prefix.right(prefix.length()-1);
prefix = a;
}
//qDebug() << "DXCCStatusWidget::update in FOR aux: " << aux << endl;
//qDebug() << "DXCCStatusWidget::update in FOR aux: " << aux << endl;
list.clear();
if (aux.length()>2) // Not all integers refers to an entity.
{
list << prefix << aux << bandNames;
list << QString::number(i) << aux << bandNames;
addEntity(list);
}
}
}
//qDebug() << "DXCCStatusWidget::update END" << endl;
//qDebug() << "DXCCStatusWidget::update END" << endl;
}
void DXCCStatusWidget::addEntity(const QStringList &_ent)
{
//qDebug() << "DXCCStatusWidget::addEntity: " << _ent.at(1) << " / " << QString::number(_ent.length()) << endl;
//qDebug() << "DXCCStatusWidget::addEntity: " << _ent.at(1) << " / " << QString::number(_ent.length()) << endl;
// DXCC id, Entity Name, bandName1, bandName2, ...
if (_ent.length() != numberOfColumns)
{
//qDebug() << "DXCCStatusWidget::addEntity: ERROR: in number of columns" << QString::number(_ent.length()) << "/" << QString::number(numberOfColumns) << endl;
//qDebug() << "DXCCStatusWidget::addEntity: ERROR: in number of columns" << QString::number(_ent.length()) << "/" << QString::number(numberOfColumns) << endl;
return;
}
int status = -1;
int ent = dataProxy->getEntityIdFromMainPrefix(_ent.at(0));
//(_ent.at(0)).toInt();
int ent = (_ent.at(0)).toInt();
int bandid = 0;
//qDebug() << "DXCCStatusWidget::addEntity: ent = " << QString::number(ent) << endl;
QString entName = _ent.at(1);
if (entName.length()<2)
{
//qDebug() << "DXCCStatusWidget::addEntity: ERROR: entname too short!" << endl;
//qDebug() << "DXCCStatusWidget::addEntity: ERROR: entname too short!" << endl;
return;
}
@ -170,13 +162,12 @@ void DXCCStatusWidget::addEntity(const QStringList &_ent)
flagSt = ":/flags/" + aux + ".png";
QIcon flagIcon(flagSt);
//qDebug() << "DXCCStatusWidget::addEntity: Flag: " << flagSt << endl;
//qDebug() << "DXCCStatusWidget::addEntity: Flag: " << flagSt << endl;
dxccView->insertRow(dxccView->rowCount());
//qDebug() << "DXCCStatusWidget::addEntity: rowCount: " << QString::number(dxccView->rowCount()) << endl;
//qDebug() << "DXCCStatusWidget::addEntity: rowCount: " << QString::number(dxccView->rowCount()) << endl;
QTableWidgetItem *newItemID = new QTableWidgetItem(_ent.at(0));
newItemID->setTextAlignment(Qt::AlignCenter);
newItemID->setFlags(Qt::NoItemFlags);
dxccView->setItem(dxccView->rowCount()-1, 0, newItemID);
@ -185,8 +176,10 @@ void DXCCStatusWidget::addEntity(const QStringList &_ent)
{
bandid = dataProxy->getIdFromBandName(_ent.at(i));
QTableWidgetItem *newItem = new QTableWidgetItem(awards->getDXCCStatusBand(ent, bandid, tempLog));
newItem->setTextAlignment(Qt::AlignCenter);
newItem->setTextAlignment(Qt::AlignCenter);
//newItem->setFlags(Qt::NoItemFlags);
newItem->setFlags(Qt::ItemIsEnabled);
//newItem->setFont(font);
if (newItem->text()=="C")
{
@ -205,16 +198,13 @@ void DXCCStatusWidget::addEntity(const QStringList &_ent)
}
else
{
}
dxccView->setItem(dxccView->rowCount()-1, i, newItem);
//qDebug() << "DXCCStatusWidget::addEntity: rowCount-2: " << QString::number(dxccView->rowCount()) << "/" << QString::number(i) << " / " << newItem->text() << endl;
//qDebug() << "DXCCStatusWidget::addEntity: rowCount-2: " << QString::number(dxccView->rowCount()) << "/" << QString::number(i) << " / " << newItem->text() << endl;
}
QTableWidgetItem *newItemPref = new QTableWidgetItem(_ent.at(0));
newItemPref->setTextAlignment(Qt::AlignLeft|Qt::AlignVCenter);
newItemPref->setFlags(Qt::ItemIsEnabled);
QTableWidgetItem *newItemName = new QTableWidgetItem(entName);
newItemName->setTextAlignment(Qt::AlignLeft|Qt::AlignVCenter);
@ -225,38 +215,44 @@ void DXCCStatusWidget::addEntity(const QStringList &_ent)
if (status == 1)
{
newItemName->setTextColor(Qt::blue);
newItemPref->setTextColor(Qt::blue);
//newItemName->setTextColor(Qt::blue);
//newItemName->setBackgroundColor(Qt::green);
}
else if (status == 0)
{
newItemName->setTextColor(Qt::darkRed);
newItemPref->setTextColor(Qt::darkRed);
}
else
{
newItemName->setTextColor(Qt::red);
newItemPref->setTextColor(Qt::red);
}
dxccView->setItem(dxccView->rowCount()-1, 0, newItemPref);
dxccView->setItem(dxccView->rowCount()-1, 1, newItemName);
//qDebug() << "DXCCStatusWidget::addEntity: END" << endl;
//qDebug() << "DXCCStatusWidget::addEntity: END" << endl;
}
void DXCCStatusWidget::setBands(QStringList const &_ent, const bool _creating)
{// Receives the list of band names
//qDebug() << "DXCCStatusWidget::setBands: " << endl;
//qDebug() << "DXCCStatusWidget::setBands: " << endl;
//qDebug() << "DXCCStatusWidget::setBands: " << QString::number(_ent.length()) << endl;
//if (_creating)
//{
//qDebug() << "DXCCStatusWidget::setBands (creating true) " << QString::number(_ent.length()) << endl;
//}
//else
//{
//qDebug() << "DXCCStatusWidget::setBands (creating false) " << QString::number(_ent.length()) << endl;
//}
QStringList qs;
qs.clear();
//qDebug() << "DXCCStatusWidget::setBands - 01" << endl;
//qDebug() << "DXCCStatusWidget::setBands - 01" << endl;
qs << dataProxy->sortBandNamesBottonUp(_ent);
//qDebug() << "DXCCStatusWidget::setBands - 02: Lenght qs: " << QString::number(qs.size()) << endl;
//qDebug() << "DXCCStatusWidget::setBands - 02: Lenght qs: " << QString::number(qs.size()) << endl;
if (qs.length()<0)
{
//qDebug() << "DXCCStatusWidget::setBands no bands received here " << endl;
//qDebug() << "DXCCStatusWidget::setBands no bands received here " << endl;
return;
}
@ -265,76 +261,88 @@ void DXCCStatusWidget::setBands(QStringList const &_ent, const bool _creating)
bandNames.clear();
//bandNames << "Id" << "Entity";
//qDebug() << "DXCCStatusWidget::setBands - 03 " << endl;
//qDebug() << "DXCCStatusWidget::setBands - 03 " << endl;
validBands.clear();
//validBands << dataProxy->getBands();
validBands = dataProxy->getBandNames();
//qDebug() << "DXCCStatusWidget::setBands - 04 " << endl;
validBands << dataProxy->getBandNames();
//qDebug() << "DXCCStatusWidget::setBands - 04 " << endl;
//dxccView->clearContents();
dxccView->clearSelection();
dxccView->clear();
// for (int x = 0; x < dxccView->columnCount(); x++)
// {
// dxccView->removeColumn(x);
// }
//bands.clear();
for (int i = 0; i<qs.length(); i++)
{
//qDebug() << "DXCCStatusWidget::setBands-4.1: " << qs.at(i) << endl;
//qDebug() << "DXCCStatusWidget::setBands-4.1: " << qs.at(i) << endl;
testBand = qs.at(i);
if (validBands.contains(qs.at(i)))
{
bandNames.append(testBand);
//qDebug() << "DXCCStatusWidget::setBands-4.2: Added: " << bandNames.last() << endl;
//qDebug() << "DXCCStatusWidget::setBands-4.2: Added: " << bandNames.last() << endl;
}
else
{
//qDebug() << "DXCCStatusWidget::setBands -4.3 Not valid band: " << testBand << endl;
//qDebug() << "DXCCStatusWidget::setBands -4.3 Not valid band: " << testBand << endl;
}
}
dxccView->setColumnCount(0);
numberOfColumns = dxccView->columnCount();
//qDebug() << "DXCCStatusWidget::setBands 5 to Remove: " << QString::number(dxccView->columnCount()) << endl;
//for (int i=0; i<dxccView->columnCount(); i++)
//{
// dxccView->removeColumn(i);
// //qDebug() << "DXCCStatusWidget::setBands: Still pending: " << QString::number(i) << endl;
//}
//dxccView->clear();
while(dxccView->columnCount()>0)
{
//qDebug() << "DXCCStatusWidget::setBands: Still pending: " << QString::number(dxccView->columnCount()) << endl;
//qDebug() << "DXCCStatusWidget::setBands: Still pending: " << QString::number(dxccView->columnCount()) << endl;
dxccView->removeColumn(0);
}
numberOfColumns = dxccView->columnCount();
//qDebug() << "DXCCStatusWidget::setBands: -6 All removed: " << QString::number(numberOfColumns) << endl;
//qDebug() << "DXCCStatusWidget::setBands: -6 All removed: " << QString::number(numberOfColumns) << endl;
//qDebug() << "DXCCStatusWidget::setBands - 7 " << endl;
//qDebug() << "DXCCStatusWidget::setBands - 7 " << endl;
numberOfColumns = 2 + bandNames.length(); //Prefix, Entity Name
//qDebug() << "DXCCStatusWidget::setBands - 7.1 - columnCount: " << QString::number(dxccView->columnCount()) << endl;
//qDebug() << "DXCCStatusWidget::setBands - 7.1 - numberOfColumns: " << QString::number(numberOfColumns) << endl;
numberOfColumns = 2 + bandNames.length();
//qDebug() << "DXCCStatusWidget::setBands - 7.1 - columnCount: " << QString::number(dxccView->columnCount()) << endl;
//qDebug() << "DXCCStatusWidget::setBands - 7.1 - numberOfColumns: " << QString::number(numberOfColumns) << endl;
dxccView->setColumnCount(numberOfColumns);
//qDebug() << "DXCCStatusWidget::setBands - 7.2 " << endl;
//qDebug() << "DXCCStatusWidget::setBands - 7.2 " << endl;
dxccView->setRowCount(0);
//qDebug() << "DXCCStatusWidget::setBands - 7.3 " << endl;
//qDebug() << "DXCCStatusWidget::setBands - 7.3 " << endl;
QStringList headerqs;
//qDebug() << "DXCCStatusWidget::setBands - 7.4 " << endl;
//qDebug() << "DXCCStatusWidget::setBands - 7.4 " << endl;
headerqs.clear();
//qDebug() << "DXCCStatusWidget::setBands - 7.5 " << endl;
headerqs << tr("Prefix") << tr("Entity") << bandNames;
//qDebug() << "DXCCStatusWidget::setBands - 8 " << endl;
//qDebug() << "DXCCStatusWidget::setBands - 7.5 " << endl;
headerqs << tr("ID") << tr("Entity") << bandNames;
//qDebug() << "DXCCStatusWidget::setBands - 8 " << endl;
dxccView->setHorizontalHeaderLabels(headerqs);
//qDebug() << "DXCCStatusWidget::setBands - 9 PRE-END" << endl;
//qDebug() << "DXCCStatusWidget::setBands - 9 PRE-END" << endl;
if (!_creating)
{
//qDebug() << "DXCCStatusWidget::setBands: 9.1 !_creating" << endl;
//qDebug() << "DXCCStatusWidget::setBands: 9.1 !_creating" << endl;
update();
}
//qDebug() << "DXCCStatusWidget::setBands: END" << endl;
//qDebug() << "DXCCStatusWidget::setBands: END" << endl;
}
void DXCCStatusWidget::setDefaultBands()
{
//qDebug() << "DXCCStatusWidget::setDefaultBands" << endl;
//qDebug() << "DXCCStatusWidget::setDefaultBands" << endl;
/*
Default bands:
160M 80M 40M 30M 20M 17M 15M 12M 10M 6M 4M 2M 70CM
@ -345,17 +353,16 @@ void DXCCStatusWidget::setDefaultBands()
bandNames << "160M" << "80M" << "40M" << "30M" << "20M" << "17M" << "15M" << "12M" << "10M" << "6M" << "4M" << "2M" << "70CM";
setBands(bandNames, true);
//qDebug() << "DXCCStatusWidget::setDefaultBands - END" << endl;
//qDebug() << "DXCCStatusWidget::setDefaultBands - END" << endl;
}
void DXCCStatusWidget::slotRefreshButtonClicked()
{
//qDebug() << "DXCCStatusWidget::slotRefreshButtonClicked" << endl;
//qDebug() << "DXCCStatusWidget::slotRefreshButtonClicked" << endl;
//TODO: Define a way to show the status of the selected log or all the logs in the DB
if (dxccView->rowCount()<1)
{
//qDebug() << "DXCCStatusWidget::slotRefreshButtonClicked - rowcount <1" << endl;
return;
}
QStringList _bands = bandNames;
@ -367,7 +374,7 @@ void DXCCStatusWidget::slotRefreshButtonClicked()
void DXCCStatusWidget::refresh()
{
//qDebug() << "DXCCStatusWidget::refresh" << endl;
//qDebug() << "DXCCStatusWidget::refresh" << endl;
//update();
slotRefreshButtonClicked();
@ -375,7 +382,7 @@ void DXCCStatusWidget::refresh()
void DXCCStatusWidget::setCurrentLog(const int _logN)
{
//qDebug() << "DXCCStatusWidget::setCurrentLog: " << QString::number(_logN) << endl;
//qDebug() << "DXCCStatusWidget::setCurrentLog: " << QString::number(_logN) << endl;
if (dataProxy->doesThisLogExist(_logN))
{
logNumber = _logN;
@ -388,15 +395,13 @@ void DXCCStatusWidget::refresh()
void DXCCStatusWidget::slotItemEntered(QTableWidgetItem * item )
{
//qDebug() << "DXCCStatusWidget::slotItemEntered: " << ((item->data(0)).toString()).simplified() << endl;
//qDebug() << "DXCCStatusWidget::slotItemEntered: " << item->text() << endl;
//qDebug() << "DXCCStatusWidget::slotItemEntered: " << endl;
if (dxccView->rowCount()<1)
{
return;
}
//qDebug() << "DXCCStatusWidget::slotItemEntered: " << ((item->data(0)).toString()).simplified() << endl;
//qDebug() << "DXCCStatusWidget::slotItemEntered: " << item->text() << endl;
//qDebug() << "DXCCStatusWidget::slotItemEntered: " << endl;
if (dxccView->rowCount()<1)
{
return;
}
QString tip;
tip.clear();
int row = -1;
@ -404,32 +409,30 @@ void DXCCStatusWidget::refresh()
int bandi = -1;
QString band = QString();
if (item)
{
// row = dxccView->row(item);
row = dxccView->row(item);
column = dxccView->column(item);
//qDebug() << "DXCCStatusWidget::slotItemEntered: row: " << QString::number(row) << endl;
//qDebug() << "DXCCStatusWidget::slotItemEntered: hrow: " << dxccView->verticalHeaderItem(row)->text() << endl;
// row = (dxccView->item(row,0)->text()).toInt();
int entiID = dataProxy->getEntityIdFromMainPrefix(dxccView->item(dxccView->row(item),0)->text());
if (entiID<0)
{ // Some prefix are shown with a * in the begining that is removed to show the real prefix
entiID = dataProxy->getEntityIdFromMainPrefix("*" + dxccView->item(dxccView->row(item),0)->text());
}
//qDebug() << "DXCCStatusWidget::slotItemEntered: entiID: " << QString::number(entiID) << endl;
//qDebug() << "DXCCStatusWidget::slotItemEntered: row: " << QString::number(row) << endl;
//qDebug() << "DXCCStatusWidget::slotItemEntered: hrow: " << dxccView->verticalHeaderItem(row)->text() << endl;
row = (dxccView->item(row,0)->text()).toInt();
//qDebug() << "DXCCStatusWidget::slotItemEntered: column: " << QString::number(column) << endl;
if ((column == 0) || (column == 1))
if (column == 1)
{
int _enti = dataProxy->getEntityIdFromName(item->text()) ;
tip = tr("Pref: ") + dataProxy->getEntityMainPrefix(_enti) + " - ";
tip = tip + tr("CQ: ") + QString::number(dataProxy->getCQzFromEntity(_enti)) + " - ";
tip = tip + tr("ITU: ") + QString::number(dataProxy->getITUzFromEntity(_enti)) + " - ";
//tip = tr("Pref: ") + (dxccView->item(row, 1))->text() + " - ";
tip = tr("Pref: ") + dataProxy->getEntityMainPrefix(entiID) + " - ";
tip = tip + tr("CQ: ") + QString::number(dataProxy->getCQzFromEntity(entiID)) + " - ";
tip = tip + tr("ITU: ") + QString::number(dataProxy->getITUzFromEntity(entiID)) + " - ";
QString dxLoc = locator->getLocator(dataProxy->getLongitudeFromEntity(entiID), dataProxy->getLatitudeFromEntity(entiID)) ;
QString dxLoc = locator->getLocator(dataProxy->getLongitudeFromEntity(_enti), dataProxy->getLatitudeFromEntity(_enti)) ;
tip = tip + tr("Beam: ") + QString::number(locator->getBeamBetweenLocators(loc, dxLoc));
//qDebug() << "DXCCStatusWidget::slotItemEntered: myLoc: " << loc << endl;
//qDebug() << "DXCCStatusWidget::slotItemEntered: DXLoc: " << dxLoc << endl;
}
else if (column >= 2)
@ -441,12 +444,11 @@ void DXCCStatusWidget::refresh()
else
{
band = dxccView->horizontalHeaderItem(column)->text();
//qDebug() << "DXCCStatusWidget::slotItemEntered: band: " << band << endl;
//qDebug() << "DXCCStatusWidget::slotItemEntered: band: " << band << endl;
bandi = dataProxy->getIdFromBandName(band);
//qDebug() << "DXCCStatusWidget::slotItemEntered: band: " << QString::number(bandi) << endl;
//tip = awards->getQSOofAward(row, bandi);
tip = awards->getQSOofAward(entiID, bandi);
//qDebug() << "DXCCStatusWidget::slotItemEntered: tip: " << tip << endl;
//qDebug() << "DXCCStatusWidget::slotItemEntered: band: " << QString::number(bandi) << endl;
tip = awards->getQSOofAward(row, bandi);
//qDebug() << "DXCCStatusWidget::slotItemEntered: tip: " << tip << endl;
if (tip.length()>3)
{
tip = "QSO: " + tip;
@ -457,29 +459,32 @@ void DXCCStatusWidget::refresh()
tip = tr("");
}
}
}
else
{
//tip = tr("ADD: Pref: Bearing, CQ & ITU.");
tip = ""; // TODO define a text to be shown when no band column is selected (maybe Continent and bearing or a link to wikipedia or whatever!)
tip = ""; // TODO define a text to be shown when no band column is selected (maybe Continent & bearing or a link to wikipedia or whatever!)
}
item->setToolTip(tip);
//qDebug() << "DXCCStatusWidget::slotItemEntered: tip: " << tip << endl;
//qDebug() << "DXCCStatusWidget::slotItemEntered: tip: " << tip << endl;
}
else
{}
//qDebug() << "DXCCStatusWidget::slotItemEntered: END " << endl;
//qDebug() << "DXCCStatusWidget::slotItemEntered: END " << endl;
}
void DXCCStatusWidget::slotItemDoubleClicked(QTableWidgetItem * item )
{
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: " << ((item->data(0)).toString()).simplified() << endl;
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: " << item->text() << endl;
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked - start" << endl;
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: " << ((item->data(0)).toString()).simplified() << endl;
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: " << item->text() << endl;
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked - start" << endl;
if (dxccView->rowCount()<1)
{
return;
@ -489,70 +494,78 @@ void DXCCStatusWidget::slotItemDoubleClicked(QTableWidgetItem * item )
int qsoId = -1;
int bandi = -1;
int columns = dxccView->columnCount();
int _entiNumb = -1; //Read the Entity number that the user is selecting.
int _entiNumb = -1; //Read the ENtity number that the user is selecting.
QString band = QString();
//QString entityName = QString();
QList<int> qsos;
qsos.clear();
QTableWidgetItem * it = new QTableWidgetItem(0);
//it->setText(item->data(Qt::DisplayRole));
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - 01" << endl;
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - 01" << endl;
if (item)
{
row = dxccView->row(item);
//column = dxccView->column(item);
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column = 1" << endl;
_entiNumb= dataProxy->getEntityIdFromMainPrefix(dxccView->item(dxccView->row(item),0)->text());
if (_entiNumb<0)
{ // Some prefix are shown with a * in the begining that is removed to show the real prefix
_entiNumb= dataProxy->getEntityIdFromMainPrefix("*" + dxccView->item(dxccView->row(item),0)->text());
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: row: " << QString::number(row) << endl;
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: column: " << QString::number(column) << endl;
//if (column == 1)
if (true)
{
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column = 1" << endl;
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column header: " << dxccView->horizontalHeaderItem(column)->text() << endl;
_entiNumb = ((dxccView->item(row,0))->text()).toInt();
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - EntityNumber: " << QString::number(_entiNumb) << endl;
for (int i = 2; i < columns; ++i)
{
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column: " << QString::number(i) << endl;
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column header: " << (dxccView->horizontalHeaderItem(i))->text() << endl;
//entityName = (dxccView->item(row,i))->text() ;
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - item: " << endl;
it->setText(dxccView->item(row,i)->text());
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column-txt: " << it->text() << endl;
band = dxccView->horizontalHeaderItem(i)->text();
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: band: " << band << endl;
bandi = dataProxy->getIdFromBandName(band);
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: band: " << QString::number(bandi) << endl;
qsoId = awards->getQSOIdofAward(_entiNumb, bandi);
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: QSOid: " << QString::number(qsoId) << endl;
if (qsoId>0)
{
qsos.append(qsoId);
}
}
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - END of for" << endl;
if (qsos.length()>0)
{
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - qsos.length = " << QString::number(qsos.length()) << endl;
emit showQsos(qsos);
}
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - END of column == 1" << endl;
}
else
{
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column != 1" << endl;
//tip = ""; // TODO define a text to be shown when no band column is selected (maybe Continent & bearing or a link to wikipedia or whatever!)
}
//_entiNumb = ((dxccView->item(row,0))->text()).toInt();
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - EntityNumber: " << QString::number(_entiNumb) << endl;
for (int i = 2; i < columns; ++i)
{
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column: " << QString::number(i) << endl;
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column header: " << (dxccView->horizontalHeaderItem(i))->text() << endl;
//entityName = (dxccView->item(row,i))->text() ;
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - item: " << endl;
it->setText(dxccView->item(row,i)->text());
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column-txt: " << it->text() << endl;
band = dxccView->horizontalHeaderItem(i)->text();
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: band: " << band << endl;
bandi = dataProxy->getIdFromBandName(band);
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: band: " << QString::number(bandi) << endl;
qsoId = awards->getQSOIdofAward(_entiNumb, bandi);
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: QSOid: " << QString::number(qsoId) << endl;
if (qsoId>0)
{
qsos.append(qsoId);
}
}
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - END of for" << endl;
if (qsos.length()>0)
{
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - qsos.length = " << QString::number(qsos.length()) << endl;
emit showQsos(qsos);
}
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - END of column == 1" << endl;
}
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: END " << endl;
//qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: END " << endl;
}
void DXCCStatusWidget::setMyLocator(const QString &_loc)
{
//qDebug() << "DXCCStatusWidget::setMyLocator: " << _loc << endl;
//qDebug() << "DXCCStatusWidget::setMyLocator: " << _loc << endl;
QString l = _loc;
if ( locator->isValidLocator(l.toUpper()) )
{
@ -560,44 +573,3 @@ void DXCCStatusWidget::setMyLocator(const QString &_loc)
}
}
/*
void DXCCStatusWidget::slotRightButton(const QPoint& pos)
{
//qDebug() << "DXCCStatusWidget::slotRighButton" << endl;
int row = (dxccView->indexAt(pos)).row();
showDXCCWikipediaAct = new QAction(tr("&Wikipedia"), this);
showDXCCWikipediaAct->setShortcut(Qt::CTRL + Qt::Key_W);
showDXCCWikipediaAct->setStatusTip(tr("Show this DXCC in Wikipedia"));
connect(showDXCCWikipediaAct, SIGNAL(triggered()), this, SLOT(slotWikipedia()));
righButtonFromLogMenu(row);
}
void DXCCStatusWidget::slotWikipedia()
{
//qDebug() << "DXCCStatusWidget::slotWikipedia: " << (showDXCCWikipediaAct->data()).toString() << endl;
//TODO: To be added to the DXCCStatusWidget and create an action that emist the QSO id
//int QSOid = ((logModel->index((showDXCCWikipediaAct->data()).toInt(), 0)).data(0)).toInt();
//qDebug() << "DXCCStatusWidget::slotQsoDeleteFromLog (id): " << QString::number(QSOid) << endl;
}
void DXCCStatusWidget::righButtonFromLogMenu(const int trow)
{
//qDebug() << "DXCCStatusWidget::slotshowRighButtonFromLogMenu: " << QString::number(trow) << endl;
//int _qsoID = ((logModel->index(trow, 0)).data(0)).toInt();
//qDebug() << "DXCCStatusWidget::slotshowRighButtonFromLogMenu: QSOid: " << QString::number(_qsoID) << endl;
QMenu menu(this);
menu.addAction(showDXCCWikipediaAct);
showDXCCWikipediaAct->setData(trow);
menu.exec(QCursor::pos());
}
*/

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include <QWidget>
@ -60,21 +60,14 @@ signals:
public slots:
//void slotSearchLineEditTextChanged();
void slotRefreshButtonClicked();
private slots:
//void slotRightButton(const QPoint& pos);
//void slotWikipedia();
void slotItemEntered(QTableWidgetItem * item );
void slotItemDoubleClicked(QTableWidgetItem * item );
private:
void createUI();
void setDefaultBands();
void addEntity(const QStringList &_ent); // DXCC id, bandid, bandid, ...
// void showMenuRightButtonFromLogCreateActions();
// void righButtonFromLogMenu(const int trow);
//QStringList sortBandNamesBottonUp(const QStringList _qs);
QTableWidget *dxccView;
Awards *awards;
@ -93,8 +86,6 @@ private:
int logNumber, tempLog; // log in use in the log / log to be used in the widget
QString loc; // The locator of the user.
QAction *showDXCCWikipediaAct;
};
#endif // DXCCSTATUSWIDGET_H

View File

@ -20,7 +20,7 @@ email : jaime@robles.es
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include "dxcluster.h"
@ -28,29 +28,25 @@ email : jaime@robles.es
DXClusterWidget::DXClusterWidget(DataProxy_SQLite *dp, QWidget *parent)
: QWidget(parent)
{
//qDebug() << "DXClusterWidget::DXClusterWidget" << endl;
//qDebug() << "DXClusterWidget::DXClusterWidget" << endl;
dataProxy = dp;
constrid = 1;
awards = new Awards(dataProxy, Q_FUNC_INFO);
util = new Utilities;
saveSpotsFile = new QFile();
initClass();
//qDebug() << "DXClusterWidget::DXClusterWidget - END" << endl;
//qDebug() << "DXClusterWidget::DXClusterWidget - END" << endl;
}
DXClusterWidget::DXClusterWidget(DataProxy_SQLite *dp, const QString &clusterToConnect, const int portToConnect, QWidget *parent)
: QWidget(parent)
{
//qDebug() << "DXClusterWidget::DXClusterWidget2" << clusterToConnect << QString::number(portToConnect) << endl;
//qDebug() << "DXClusterWidget::DXClusterWidget2" << clusterToConnect << QString::number(portToConnect) << endl;
constrid = 2;
util = new Utilities;
saveSpotsFile = new QFile();
initClass();
server = clusterToConnect;
port = quint16(portToConnect);
port = portToConnect;
dxSpotColor.setNamedColor("slategrey");
//defaultColor.setNamedColor("slategrey");
@ -103,7 +99,7 @@ DXClusterWidget::DXClusterWidget(DataProxy_SQLite *dp, const QString &clusterToC
addData();
//TESTADDSPOT();
//qDebug() << "DXClusterWidget::DXClusterWidget2 - END" << endl;
//qDebug() << "DXClusterWidget::DXClusterWidget2 - END" << endl;
}
@ -121,10 +117,8 @@ void DXClusterWidget::initClass()
showann = true;
showwwv = true;
showwcy = true;
saveSpots = false;
myQrz = QString();
currentLog = 0;
saveSpotsFile->setFileName(util->getSaveSpotsLogFile());
}
void DXClusterWidget::setMyQRZ(const QString &_qrz)
@ -138,7 +132,7 @@ void DXClusterWidget::setMyQRZ(const QString &_qrz)
void DXClusterWidget::addData()
{
//qDebug() << "DXClusterWidget::addData " << endl;
//qDebug() << "DXClusterWidget::addData " << endl;
/*
QTreeWidgetItem *item = new QTreeWidgetItem(searchResultsTreeWidget);
@ -153,21 +147,21 @@ void DXClusterWidget::addData()
item->setToolTip(6, aux);
*/
dxClusterSpotItem * item = new dxClusterSpotItem(dxClusterListWidget, tr("Click on connect to connect to the DX-Cluster"), awards->getDefaultColor());
dxClusterSpotItem * item = new dxClusterSpotItem(dxClusterListWidget, tr("Click on connect to connect to the DX-Cluster"), awards->getDefaultColor());
}
DXClusterWidget::~DXClusterWidget()
{
//qDebug() << "DXClusterWidget::~DXClusterWidget" << endl;
//qDebug() << "DXClusterWidget::~DXClusterWidget" << endl;
}
void DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked( QListWidgetItem * item )
{
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: " << item->text() << endl;
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: " << item->text() << endl;
QStringList ql;
ql.clear();
@ -175,31 +169,31 @@ void DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked( QListWidgetIt
if (item)
{
ql = readItem(item);
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: Length: " << QString::number(ql.length()) << endl;
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: Length: " << QString::number(ql.length()) << endl;
if (ql.length()==2)
{
ql << "double";
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: EMMITED" << endl;
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: EMMITED" << endl;
emit dxspotclicked(ql);
}
else
{
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: NOT EMMITED-1" << endl;
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: NOT EMMITED-1" << endl;
}
}
else
{
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: NOT EMMITED-2 (no item)" << endl;
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: NOT EMMITED-2 (no item)" << endl;
}
}
void DXClusterWidget::connectToDXCluster()
{
//qDebug() << "DXClusterWidget::connectToDXCluster" << endl;
//qDebug() << "DXClusterWidget::connectToDXCluster" << endl;
if (dxClusterConnected)
{
//qDebug() << "DXClusterWidget::connectToDXCluster: - Already connected!!" << endl;
//qDebug() << "DXClusterWidget::connectToDXCluster: - Already connected!!" << endl;
return; // If we are connected we don't want to start another connection
}
@ -209,18 +203,17 @@ void DXClusterWidget::connectToDXCluster()
connect(tcpSocket, SIGNAL(disconnected()), SLOT(slotClusterSocketConnectionClosed()) );
connect(inputCommand, SIGNAL(returnPressed()), this, SLOT(slotClusterSendToServer()) );
connect(clearButton, SIGNAL(clicked()), this, SLOT(slotClusterClearLineInput()) );
//openFile(); // This functions opens the file to save the DX-Cluster activity. The file will be closed when the DX is disconnected.
tcpSocket->connectToHost( server, port );
dxClusterListWidget->setSortingEnabled (false);
dxClusterSpotItem * item = new dxClusterSpotItem(dxClusterListWidget, tr("Trying to connect to the server") + "\n", awards->getDefaultColor());
}
void DXClusterWidget::slotClusterDisplayError(QAbstractSocket::SocketError socketError)
{
//qDebug() << "DXClusterWidget:displayError:" << endl;
//qDebug() << "DXClusterWidget:displayError:" << endl;
switch (socketError) {
case QAbstractSocket::RemoteHostClosedError:
break;
@ -247,74 +240,74 @@ void DXClusterWidget::slotClusterDisplayError(QAbstractSocket::SocketError socke
bool DXClusterWidget::checkIfNeedsToBePrinted(const QString &_DXEntity, int const _band, const int _mode)
{
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: " << _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: " << _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
QStringList qs;
qs.clear();
qs << _DXEntity << QString::number(_band) << QString::number(_mode) << QString::number(currentLog);
//bool isConfirmed = false;
bool status = awards->isThisSpotConfirmed (qs);
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: Status: " << _DXEntity << "/" << QString::number(status);
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: Status: " << _DXEntity << "/" << QString::number(status);
if (!showconfirmed)
{
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is confirmed? ("<< QString::number(status)<< ")" << endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is confirmed? ("<< QString::number(status)<< ")" << endl;
if (status)
{
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: It is confirmed: DON'T' print: " << _DXEntity <<"/" << dataProxy->getNameFromBandId(_band) << endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: It is confirmed: DON'T' print: " << _DXEntity <<"/" << dataProxy->getNameFromBandId(_band) << endl;
return false;
}
}
if (!showhf)
{
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is HF?" << endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is HF?" << endl;
if (dataProxy->isHF(_band))
{
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: Not showing HF but... is it WARC?" << endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: Not showing HF but... is it WARC?" << endl;
if ( (showwarc) && dataProxy->isWARC(_band) )
{
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: Not showing HF but... is WARC, print!" << endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: Not showing HF but... is WARC, print!" << endl;
return true;
}
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is HF: DON'T print: "<< _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is HF: DON'T print: "<< _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
return false;
}
else
{
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is NOT HF" << endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is NOT HF" << endl;
}
}
if (!showwarc)
{
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is WARC?" << endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is WARC?" << endl;
if (dataProxy->isWARC(_band))
{
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is WARC, DON'T print: "<< _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is WARC, DON'T print: "<< _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
return false;
}
else
{
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is NOT WARC" << endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is NOT WARC" << endl;
}
}
if (!showvhf)
{
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is VHF?" << endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is VHF?" << endl;
if (dataProxy->isVHF(_band))
{
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is VHF, DON'T print: "<< _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is VHF, DON'T print: "<< _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
return false;
}
else
{
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is NOT VHF " << endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is NOT VHF " << endl;
}
}
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: returns TRUE and will be printed: " << _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
//qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: returns TRUE and will be printed: " << _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
return true;
}
@ -333,7 +326,7 @@ void DXClusterWidget::setCurrentLog(const int _log)
void DXClusterWidget::slotClusterDataArrived()
{
//qDebug() << "DXClusterWidget::slotClusterDataArrived" << endl;
//qDebug() << "DXClusterWidget::slotClusterDataArrived" << endl;
QStringList qs;
QString dxClusterString;
QString dxCall;
@ -343,11 +336,9 @@ void DXClusterWidget::slotClusterDataArrived()
//bool isADXSpot = false;
int dxEntity = -1;
while ( tcpSocket->canReadLine() )
{
while ( tcpSocket->canReadLine() ) {
dxClusterString = tcpSocket->readLine();
dxClusterString = dxClusterString.trimmed();
saveSpot(dxClusterString);
QStringList tokens = dxClusterString.split(" ", QString::SkipEmptyParts);
if (tokens.size()<2){
@ -355,18 +346,18 @@ void DXClusterWidget::slotClusterDataArrived()
}
// It is a "DX de SP0TTER FREC DXCALL"
//0 = DX, 1 = de, 2 = spotter, 3 = Freq, 4 = dxcall, 5 = comment
//qDebug() << "DXClusterWidget::slotClusterDataArrived: " << "DXCLUSTER->" << dxClusterString << "\nTOKENS: " << tokens << endl;
//qDebug() << "DXClusterWidget::slotClusterDataArrived: " << "DXCLUSTER->" << dxClusterString << "\nTOKENS: " << tokens << endl;
if ((tokens[0] == "DX") && (tokens[1] == "de"))
{
//qDebug() << "******************** DXClusterWidget::slotClusterDataArrived: DX DE" << endl;
//qDebug() << "******************** DXClusterWidget::slotClusterDataArrived: DX DE" << endl;
//isADXSpot = true;
QString spotter = tokens[2];
spotter.truncate(spotter.size() - 1);
dxFrequency = tokens[3];
// Convert KHz to MHz...
//dxFrequency = QString::number(abs (dxFrequency.toFloat())/1000);
dxFrequency = QString::number( (dxFrequency.toDouble())/1000);
dxFrequency = QString::number( (dxFrequency.toFloat())/1000);
dxCall = tokens[4];
dxEntity = world->getQRZARRLId(dxCall);
//
@ -376,7 +367,7 @@ void DXClusterWidget::slotClusterDataArrived()
qs.clear();
//spotBand = QString::number(world->getBandIdFromFreq( dxFrequency ) );
qs << QString::number(dxEntity) << spotBand << "-1" << QString::number(currentLog) ;
//qDebug() << "DXClusterWidget::slotClusterDataArrived: Calling-2: " << QString::number(dxEntity) << endl;
//qDebug() << "DXClusterWidget::slotClusterDataArrived: Calling-2: " << QString::number(dxEntity) << endl;
dxSpotColor = awards->getQRZDXStatusColor(qs);
if (showDxMarathon)
{
@ -387,29 +378,29 @@ void DXClusterWidget::slotClusterDataArrived()
}
//qDebug() << "DX de ->" << "Spotter: " << spotter << "Freq: "<< dxFrequency << "DX: " << dxCall << endl;
//qDebug() << "DX de ->" << "Spotter: " << spotter << "Freq: "<< dxFrequency << "DX: " << dxCall << endl;
}
else if ((tokens[0] == "To") && (tokens[1] == "ALL"))
{
//qDebug() << "DXClusterWidget::slotClusterDataArrived: TO ALL" << endl;
//qDebug() << "DXClusterWidget::slotClusterDataArrived: TO ALL" << endl;
dxSpotColor = awards->getDefaultColor();
}
else if ( (dxClusterString.length()>=5) && (world->checkQRZValidFormat(tokens[1])) && (tokens[0]!="login:"))
{ // Freq / DXCall / Date // time
//_qs << QRZ << Freq in MHz << lognumber;
//qDebug() << "DXClusterWidget::slotClusterDataArrived: LENGTH >= 5" << endl;
//qDebug() << "DXClusterWidget::slotClusterDataArrived: token0=" << tokens[0] << " / token1=" << tokens[1] << endl;
//qDebug() << "DXClusterWidget::slotClusterDataArrived: LENGTH >= 5" << endl;
//qDebug() << "DXClusterWidget::slotClusterDataArrived: token0=" << tokens[0] << " / token1=" << tokens[1] << endl;
//isADXSpot = true;
dxCall = tokens[1];
dxFrequency = tokens[0];
dxFrequency = QString::number( (dxFrequency.toDouble())/1000);
dxFrequency = QString::number( (dxFrequency.toFloat())/1000);
qs.clear();
spotBand = QString::number(dataProxy->getBandIdFromFreq( dxFrequency.toDouble() ) );
dxEntity = world->getQRZARRLId(dxCall);
//qDebug() << "DXClusterWidget::slotClusterDataArrived: Calling-1: " << QString::number(dxEntity) << endl;
//qDebug() << "DXClusterWidget::slotClusterDataArrived: Calling-1: " << QString::number(dxEntity) << endl;
qs << QString::number(dxEntity) << spotBand << "-1" << QString::number(currentLog) ;
dxSpotColor = awards->getQRZDXStatusColor(qs);
if (showDxMarathon)
@ -424,7 +415,7 @@ void DXClusterWidget::slotClusterDataArrived()
}
else
{
//qDebug() << "DXClusterWidget::slotClusterDataArrived: DEFAULT" << endl;
//qDebug() << "DXClusterWidget::slotClusterDataArrived: DEFAULT" << endl;
dxSpotColor = awards->getDefaultColor();
}
@ -433,12 +424,12 @@ void DXClusterWidget::slotClusterDataArrived()
//qs << dxCall << spotBand << "0";
//dxSpotColor = awards->getQRZDXStatusColor(qs);
//qDebug() << "DXClusterWidget::slotClusterDataArrived: Call/dxSpotColor: " << dxCall <<"/"<< dxSpotColor.name() << endl;
//qDebug() << "DXClusterWidget::slotClusterDataArrived: Call/dxSpotColor: " << dxCall <<"/"<< dxSpotColor.name() << endl;
//dxClusterSpotItem * item = new dxClusterSpotItem(dxClusterListWidget, dxClusterString, dxSpotColor);
//TODO: Change the "-1" by the mode
if (!checkIfNeedsToBePrinted(QString::number(dxEntity), spotBand.toInt(), -1))
{
//qDebug() << "DXClusterWidget::slotClusterDataArrived - Not to be printed!: " << dxCall << endl;
//qDebug() << "DXClusterWidget::slotClusterDataArrived - Not to be printed!: " << dxCall << endl;
return;
}
@ -479,15 +470,15 @@ void DXClusterWidget::slotClusterDataArrived()
//dxClusterListWidget->insertItem(0,item);
}
//qDebug() << "--------------------- DXClusterWidget::slotClusterDataArrived: " << dxClusterString << endl;
//qDebug() << "--------------------- DXClusterWidget::slotClusterDataArrived: " << dxClusterString << endl;
//qDebug() << "DXClusterWidget::slotClusterDataArrived: " << dxClusterString << endl;
//qDebug() << "DXClusterWidget::slotClusterDataArrived: " << dxClusterString << endl;
}
void DXClusterWidget::slotClusterSocketConnected()
{
//qDebug() << "DXClusterWidget::slotClusterSocketConnected" << endl;
//qDebug() << "DXClusterWidget::slotClusterSocketConnected" << endl;
QListWidgetItem *item = new QListWidgetItem();
item->setForeground(QBrush(awards->getDefaultColor()));
@ -532,7 +523,7 @@ void DXClusterWidget::slotClusterSocketConnected()
void DXClusterWidget::slotClusterSocketConnectionClosed()
{
//qDebug() << "DXClusterWidget::slotClusterSocketConnectionClosed" << endl;
//qDebug() << "DXClusterWidget::slotClusterSocketConnectionClosed" << endl;
QListWidgetItem *item = new QListWidgetItem();
item->setForeground(QBrush(awards->getDefaultColor()));
item->setText(tr("Connection closed by the server"));
@ -548,7 +539,7 @@ void DXClusterWidget::slotClusterSocketConnectionClosed()
void DXClusterWidget::slotClusterSendToServer()
{
//qDebug() << "DXClusterWidget::slotClusterSendToServer()" << endl;
//qDebug() << "DXClusterWidget::slotClusterSendToServer()" << endl;
if (!dxClusterConnected)
{
@ -557,7 +548,7 @@ void DXClusterWidget::slotClusterSendToServer()
}
if ( inputCommand ->text().length() < 1 )
{
//qDebug() << "DXClusterWidget::slotClusterSendToServer() - Vacio..." << endl;
//qDebug() << "DXClusterWidget::slotClusterSendToServer() - Vacio..." << endl;
QTextStream os(tcpSocket);
os << "bye\n";
return;
@ -570,7 +561,7 @@ void DXClusterWidget::slotClusterSendToServer()
void DXClusterWidget::slotClusterClearLineInput()
{
//qDebug() << "DXClusterWidget::slotClusterClearLineInput" << endl;
//qDebug() << "DXClusterWidget::slotClusterClearLineInput" << endl;
if ( ((inputCommand->text()).length()) <= 0 )
{
@ -592,7 +583,7 @@ void DXClusterWidget::slotClusterClearLineInput()
void DXClusterWidget::slotClusterInputTextChanged()
{
//qDebug() << "DXClusterWidget::slotClusterInputTextChanged" << endl;
//qDebug() << "DXClusterWidget::slotClusterInputTextChanged" << endl;
if ( ((inputCommand->text()).length()) <= 0 )
{
@ -610,7 +601,7 @@ void DXClusterWidget::slotClusterInputTextChanged()
void DXClusterWidget::setColors (const QString &_newOne, const QString &_needed, const QString &_worked, const QString &_confirmed, const QString &_default)
{
//qDebug() << "DXClusterWidget::setColors: " << _newOne << "/" << _needed << "/" << _worked << "/" << _confirmed << "/" << _default << endl;
//qDebug() << "DXClusterWidget::setColors: " << _newOne << "/" << _needed << "/" << _worked << "/" << _confirmed << "/" << _default << endl;
// Just to pass the colors to the awards class
awards->setColors(_newOne, _needed, _worked, _confirmed, _default);
@ -618,7 +609,7 @@ void DXClusterWidget::setColors (const QString &_newOne, const QString &_needed,
void DXClusterWidget::setDXClusterSpotConfig(bool _showhf, bool _showvhf, bool _showwarc, bool _showworked, bool _showconfirmed, bool _showann, bool _showwwv, bool _showwcy )
{
//qDebug() << "DXClusterWidget::setDXClusterSpotConfig " << endl;
//qDebug() << "DXClusterWidget::setDXClusterSpotConfig " << endl;
showhf = _showhf;
showvhf = _showvhf;
@ -632,7 +623,7 @@ void DXClusterWidget::setDXClusterSpotConfig(bool _showhf, bool _showvhf, bool _
void DXClusterWidget::slotClusterDXClusterWidgetItemSelected()
{
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemSelected " << endl;
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemSelected " << endl;
QListWidgetItem * item = dxClusterListWidget->currentItem();
QStringList ql;
@ -652,7 +643,7 @@ void DXClusterWidget::slotClusterDXClusterWidgetItemSelected()
void DXClusterWidget::slotClusterDXClusterWidgetItemEntered( QListWidgetItem * item )
{
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemEntered" << endl;
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemEntered" << endl;
/*
This code comes from slotClusterDXClusterWidgetItemDoubleClicked
*/
@ -687,7 +678,7 @@ bool DXClusterWidget::isConnected()
QStringList DXClusterWidget::readItem(QListWidgetItem * item)
{
//qDebug() << "DXClusterWidget::readItem" << endl;
//qDebug() << "DXClusterWidget::readItem" << endl;
QStringList fields;
QString dxClusterString;
@ -698,7 +689,7 @@ QStringList DXClusterWidget::readItem(QListWidgetItem * item)
if (item) {
fields.clear();
dxClusterString = ((item->data(0)).toString()).simplified();
dxClusterString = ((item->data(0)).toString()).simplified();
fields << dxClusterString.split(" ");
(fields.at(0)).toFloat(&FirstFrecOK); // Just to see if the first string is a frecuency
@ -708,7 +699,7 @@ QStringList DXClusterWidget::readItem(QListWidgetItem * item)
if ( world->getQRZARRLId(fields.at(4))> 0 )
{
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: ARRLid: " << QString::number(world->getQRZARRLId(fields.at(4))) << endl;
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: ARRLid: " << QString::number(world->getQRZARRLId(fields.at(4))) << endl;
dxCallsign = (fields.at(4)).toUpper();
(fields.at(3)).toFloat(&FirstFrecOK);
if (FirstFrecOK)
@ -730,14 +721,14 @@ QStringList DXClusterWidget::readItem(QListWidgetItem * item)
else
{ // The call is not from a valid country
// TODO: if it is from a new entity/prefix it would not work.
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: Entity not valid" << endl;
//qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: Entity not valid" << endl;
dxCallsign.clear();
dxFreq.clear();
fields.clear();
}
}
//else if (( isAFrecuency(fields.at(0) ) ) && ( isACall(fields.at(1)) ) )
else if ( (((fields.at(0)).toDouble()) > 0.0 )&& ( world->getQRZARRLId(fields.at(1))> 0 ) )
else if ( (((fields.at(0)).toFloat()) > 0.0 )&& ( world->getQRZARRLId(fields.at(1))> 0 ) )
{ // 14205.0 EA0JC 5-Mar-2012 1500Z <EA4K>
dxCallsign = (fields.at(1)).toUpper();
@ -764,8 +755,8 @@ QStringList DXClusterWidget::readItem(QListWidgetItem * item)
void DXClusterWidget::setDXClusterServer(const QString &clusterToConnect, const int portToConnect)
{
server = clusterToConnect;
port = quint16(portToConnect);
//qDebug() << "DXClusterWidget::setDXClusterServer: " << server << ":"<< QString::number(port) << endl;
port = portToConnect;
//qDebug() << "DXClusterWidget::setDXClusterServer: " << server << ":"<< QString::number(port) << endl;
}
void DXClusterWidget::setDXMarathon (const bool _enable)
@ -773,64 +764,10 @@ void DXClusterWidget::setDXMarathon (const bool _enable)
showDxMarathon = _enable;
}
void DXClusterWidget::setSaveSpots (const bool _enable)
{
saveSpots = _enable;
}
bool DXClusterWidget::openFile()
{
if (saveSpotsFile->isOpen())
{
return true;
}
if (!saveSpotsFile->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append))
{
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Warning);
QString aux = tr("It was not possible to open the file to save the DX-Spots for writing. DX-Cluster activity will not be saved!");
msgBox.setText(aux);
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.exec();
return false;
}
else
{
return true;
}
}
void DXClusterWidget::saveSpot(const QString &_spot)
{
//qDebug() << "DXClusterWidget::saveSpot: " << _spot << endl;
if (!saveSpots)
{
//qDebug() << "DXClusterWidget::saveSpot: Not saving" << endl;
return;
}
else
{
if (openFile())
{
//qDebug() << "DXClusterWidget::saveSpot: File Open" << endl;
QTextStream out(saveSpotsFile);
//out << _spot << endl;
out << (QDateTime::currentDateTime()).toString("yyyy/MM/dd-hh:mm:ss") << " - " << _spot << endl;
saveSpotsFile->close();
}
else {
{
//qDebug() << "DXClusterWidget::saveSpot: File NOT Open" << endl;
}
}
}
}
/*
void DXClusterWidget::TESTADDSPOT()
{
//qDebug() << "DXClusterWidget::TESTADDSPOT " << endl;
//qDebug() << "DXClusterWidget::TESTADDSPOT " << endl;
; // Just a test spot
QListWidgetItem *item = new QListWidgetItem();
item->setForeground(QBrush(dxSpotColor));
@ -838,17 +775,13 @@ void DXClusterWidget::TESTADDSPOT()
dxClusterListWidget->insertItem(0,item);
}
*/
/***************************************************************************
** This is an auxiliary class intended to provide color to the DX-Cluster **
** spots. **
** It may be moved to a self .h & .cpp archives **
****************************************************************************/
dxClusterSpotItem::dxClusterSpotItem( QListWidget *parent, const QString& spot, const QColor& color ) : QListWidgetItem( parent ){
//qDebug() << "dxClusterSpotItem::dxClusterSpotItem - Constructor" << endl;
//qDebug() << "dxClusterSpotItem::dxClusterSpotItem - Constructor" << endl;
spotColor = color;
setText(spot);
// Experimenting with fonts for the cluster
@ -859,6 +792,6 @@ dxClusterSpotItem::dxClusterSpotItem( QListWidget *parent, const QString& spot,
dxClusterSpotItem::~dxClusterSpotItem()
{
//qDebug() << "dxClusterSpotItem::dxClusterSpotItem - Destructor" << endl;
//qDebug() << "dxClusterSpotItem::dxClusterSpotItem - Destructor" << endl;
}

View File

@ -22,7 +22,7 @@ email : jaime@robles.es
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -33,7 +33,6 @@ email : jaime@robles.es
#include <QObject>
#include "awards.h"
#include "world.h"
#include "utilities.h"
#include "dataproxy_sqlite.h"
class QWidget;
@ -54,7 +53,6 @@ class DXClusterWidget : public QWidget
bool isConnected();
void setMyQRZ(const QString &_qrz);
void setDXMarathon (const bool _enable);
void setSaveSpots (const bool _enable);
//void sendSpotToCluster(const QString &_dx, const QString &_freq);
@ -76,7 +74,6 @@ private slots:
signals:
void dxspotclicked(const QStringList &_qs); // DXSpotCall, DX-Freq, doubleClicked
//void dxspot(const QString &_spot); // The text string to be saved
private:
@ -86,10 +83,8 @@ private:
void connectToDXCluster();
QStringList readItem(QListWidgetItem * item);
bool checkIfNeedsToBePrinted(const QString &_DXEntity, const int _band, const int _mode);
void saveSpot (const QString &_spot);
bool openFile();
void addData(); //TO BE DELETED, JUST FOR TESTING PURPOSES
void addData(); //TO BE DELETED, JUST FOR TESTING PURPOSES
QTcpSocket *tcpSocket;
QListWidget *dxClusterListWidget;
@ -108,19 +103,14 @@ private:
World *world;
Awards *awards;
DataProxy_SQLite *dataProxy;
Utilities *util;
bool showhf, showvhf, showwarc, showworked, showconfirmed, showann, showwwv, showwcy;
bool dxClusterShowHF, dxClusterShowVHF, dxClusterShowWARC, dxClusterShowWorked, dxClusterShowConfirmed, dxClusterShowAnn, dxClusterShowWWV, dxClusterShowWCY;
bool showDxMarathon;
QString myQrz;
int currentLog;
int constrid; // Just an id for the constructor to check who is being executed at one specific time
QFile *saveSpotsFile;
bool saveSpots; // write/save the spots to a file
};
class dxClusterSpotItem : public QListWidgetItem {

View File

@ -9,7 +9,7 @@
eLogClubLog::eLogClubLog() : QObject(nullptr)
{
//qDebug() << "eLogClubLog::eLogClubLog" << endl;
//qDebug() << "eLogClubLog::eLogClubLog" << endl;
call= QString();
email = QString();
pass = QString();
@ -17,21 +17,21 @@ eLogClubLog::eLogClubLog() : QObject(nullptr)
currentQSO = -1;
useQSOStationCallsign = false;
stationCallsign = QString();
//qDebug() << "eLogClubLog::eLogClubLog - END" << endl;
//qDebug() << "eLogClubLog::eLogClubLog - END" << endl;
}
eLogClubLog::~eLogClubLog()
{
//qDebug() << "eLogClubLog::~eLogClubLog" << endl;
//qDebug() << "eLogClubLog::~eLogClubLog" << endl;
}
void eLogClubLog::slotQsoUploadFinished(QNetworkReply *data)
{
//qDebug() << "eLogClubLog::slotQsoUploadFinished" << endl;
//qDebug() << "eLogClubLog::slotQsoUploadFinished" << endl;
result = data->error();
//qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = " << QString::number(result) << endl;
//qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = " << QString::number(result) << endl;
const QByteArray sdata = data->readAll();
@ -48,28 +48,28 @@ eLogClubLog::~eLogClubLog()
{
text = "ClubLog: " + prepareToTranslate(sdata);
//qDebug() << sdata;
//qDebug() << sdata;
}
else if (result == QNetworkReply::HostNotFoundError)
{
//qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = Host Not found! = " << QString::number(result) << endl;
//qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = Host Not found! = " << QString::number(result) << endl;
text = "ClubLog: " + tr("Host not found!");
//TODO: Mark the previous QSO as not sent to clublog
}
else if (result == QNetworkReply::TimeoutError)
{
//qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = Time out error! = " << QString::number(result) << endl;
//qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = Time out error! = " << QString::number(result) << endl;
text = "ClubLog: " + tr("Timeout error!");
//TODO: Mark the previous QSO as not sent to clublog
}
else if (result == 202)
{
//qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = Password Error! = " << QString::number(result) << endl;
//qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = Password Error! = " << QString::number(result) << endl;
text = "ClubLog: " + tr("It seems to be a PASSWORD ERROR; check your password.");
QMessageBox::warning(nullptr, tr("KLog - ClubLog"),
QMessageBox::warning(0, tr("KLog - ClubLog"),
tr("It seems that your ClubLog password is not correct.") + "\n" +
tr("Please check your password in the setup. ClubLog uploads will be disabled."),
QMessageBox::Ok);
@ -80,12 +80,12 @@ eLogClubLog::~eLogClubLog()
}
else
{
//qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = UNDEFINED = " << QString::number(result) << endl;
//qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = UNDEFINED = " << QString::number(result) << endl;
text = "ClubLog: " + tr("Undefined error...");
//TODO: Mark the previous QSO as not sent to clublog
}
//qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = " << QString::number(result) << endl;
//qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = " << QString::number(result) << endl;
//emit done();
emit showMessage(text);
@ -93,10 +93,10 @@ eLogClubLog::~eLogClubLog()
void eLogClubLog::slotFileUploadFinished(QNetworkReply *data)
{
//qDebug() << "eLogClubLog::slotFileUploadFinished" << endl;
//qDebug() << "eLogClubLog::slotFileUploadFinished" << endl;
result = data->error();
//qDebug() << "eLogClubLog::slotFileUploadFinished - Result = " << QString::number(result) << endl;
//qDebug() << "eLogClubLog::slotFileUploadFinished - Result = " << QString::number(result) << endl;
const QByteArray sdata = data->readAll();
@ -107,42 +107,42 @@ void eLogClubLog::slotFileUploadFinished(QNetworkReply *data)
{
text = "ClubLog: " + prepareToTranslate(sdata);
//qDebug() << "eLogClubLog::slotFileUploadFinished - Result = NoError = " << QString::number(result) << endl;
//qDebug() << sdata;
//qDebug() << "eLogClubLog::slotFileUploadFinished - Result = NoError = " << QString::number(result) << endl;
//qDebug() << sdata;
}
else if (result == QNetworkReply::HostNotFoundError)
{
//qDebug() << "eLogClubLog::slotFileUploadFinished - Result = Host Not found! = " << QString::number(result) << endl;
//qDebug() << "eLogClubLog::slotFileUploadFinished - Result = Host Not found! = " << QString::number(result) << endl;
text = "ClubLog: " + tr("Host not found!");
}
else if (result == QNetworkReply::TimeoutError)
{
//qDebug() << "eLogClubLog::slotFileUploadFinished - Result = Time out error! = " << QString::number(result) << endl;
//qDebug() << "eLogClubLog::slotFileUploadFinished - Result = Time out error! = " << QString::number(result) << endl;
text = "ClubLog: " + tr("Timeout error!");
}
else
{
//qDebug() << "eLogClubLog::slotFileUploadFinished - Result = UNDEFINED = " << QString::number(result) << endl;
//qDebug() << "eLogClubLog::slotFileUploadFinished - Result = UNDEFINED = " << QString::number(result) << endl;
text = "ClubLog: " + tr("Undefined error...");
}
//qDebug() << "eLogClubLog::slotFileUploadFinished - Result = " << QString::number(result) << endl;
//qDebug() << "eLogClubLog::slotFileUploadFinished - Result = " << QString::number(result) << endl;
//emit done();
emit showMessage(text);
}
void eLogClubLog::downloadProgress(qint64 received, qint64 total) {
//qDebug() << "eLogClubLog::downloadProgress: " << QString::number(received) << "/" << QString::number(total) << endl;
//qDebug() << "eLogClubLog::downloadProgress: " << QString::number(received) << "/" << QString::number(total) << endl;
//qDebug() << received << total;
//qDebug() << received << total;
emit actionShowProgres(received, total);
}
void eLogClubLog::slotErrorManagement(QNetworkReply::NetworkError networkError)
{
//qDebug() << "eLogClubLog::slotErrorManagement: " << QString::number(networkError) << endl;
//qDebug() << "eLogClubLog::slotErrorManagement: " << QString::number(networkError) << endl;
result = networkError;
if (result == QNetworkReply::NoError)
@ -150,11 +150,11 @@ void eLogClubLog::slotErrorManagement(QNetworkReply::NetworkError networkError)
}
else if (result == QNetworkReply::HostNotFoundError)
{
//qDebug() << "eLogClubLog::slotErrorManagement: Host not found" << endl;
//qDebug() << "eLogClubLog::slotErrorManagement: Host not found" << endl;
}
else
{
//qDebug() << "eLogClubLog::slotErrorManagement: ERROR!" << endl;
//qDebug() << "eLogClubLog::slotErrorManagement: ERROR!" << endl;
}
//actionError(result);
@ -163,8 +163,8 @@ void eLogClubLog::slotErrorManagement(QNetworkReply::NetworkError networkError)
int eLogClubLog::sendQSO(QStringList _qso)
{
//qDebug() << "eLogClubLog::sendQSO: " << call <<"/"<< email << "/" << pass << "/" << api << endl;
//qDebug() << "eLogClubLog::sendQSO:: length = " << QString::number(_qso.length()) << endl;
//qDebug() << "eLogClubLog::sendQSO: " << call <<"/"<< email << "/" << pass << "/" << api << endl;
//qDebug() << "eLogClubLog::sendQSO:: length = " << QString::number(_qso.length()) << endl;
// First Data in the QStringList is the QSO id, not to be sent to clublog but used in the signal actionReturnDownload(const int _i, const int _qsoId);
if (_qso.length()!=18)
@ -180,19 +180,19 @@ int eLogClubLog::sendQSO(QStringList _qso)
{
stationCallsign = _qso.last();
}
//qDebug() << "eLogClubLog::sendQSO (stationCallsign = " << _qso.last() << ")" << endl;
//qDebug() << "eLogClubLog::sendQSO (stationCallsign = " << _qso.last() << ")" << endl;
_qso.removeLast();
QString qso = getClubLogAdif(_qso);
//qDebug() << "eLogClubLog::sendQSO: " << qso << endl;
//qDebug() << "eLogClubLog::sendQSO: " << qso << endl;
return sendData(qso);
}
int eLogClubLog::sendData(const QString &_q)
int eLogClubLog::sendData(const QString _q)
{
//qDebug() << "eLogClubLog::sendData: " << _q << endl;
//qDebug() << "eLogClubLog::sendData: " << _q << endl;
//Posiblemente tenga que usar una de estas: void QUrlQuery::addQueryItem(const QString & key, const QString & value)
@ -208,12 +208,12 @@ int eLogClubLog::sendData(const QString &_q)
if ((useQSOStationCallsign) && (stationCallsign.length()>2))
{
params.addQueryItem("callsign",stationCallsign);
//qDebug() << "eLogClubLog::sendData - callsign 1: " << stationCallsign << endl;
//qDebug() << "eLogClubLog::sendData - callsign 1: " << stationCallsign << endl;
}
else
{
params.addQueryItem("callsign",call);
//qDebug() << "eLogClubLog::sendData - callsign 2: " << call << endl;
//qDebug() << "eLogClubLog::sendData - callsign 2: " << call << endl;
}
params.addQueryItem("api",api);
@ -227,12 +227,12 @@ int eLogClubLog::sendData(const QString &_q)
if ((useQSOStationCallsign) && (stationCallsign.length()>2))
{
params.addQueryItem("callsign",stationCallsign);
//qDebug() << "eLogClubLog::sendData - callsign 1: " << stationCallsign << endl;
//qDebug() << "eLogClubLog::sendData - callsign 1: " << stationCallsign << endl;
}
else
{
params.addQueryItem("callsign",call);
//qDebug() << "eLogClubLog::sendData - callsign 2: " << call << endl;
//qDebug() << "eLogClubLog::sendData - callsign 2: " << call << endl;
}
params.addQueryItem("api",api);
@ -259,7 +259,7 @@ int eLogClubLog::sendData(const QString &_q)
QString eLogClubLog::getClubLogAdif(const QStringList _q)
{
//qDebug() << "eLogClubLog::getClubLogAdif: " << QString::number(_q.length()) << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: " << QString::number(_q.length()) << endl;
// _qso must include 16 ordered fields than can be empty or contain data. This function builds the ADIF QSO
/* http://clublog.freshdesk.com/support/solutions/articles/53202-which-adif-fields-does-club-log-use-
ClubLog only accepts the following ADIF fields:
@ -297,19 +297,19 @@ ClubLog only accepts the following ADIF fields:
//qso = "<QSO_DATE:" + QString::number((_q.at(0)).length()) + ">" + _q.at(0) + " ";
qso = qso + "<TIME_ON:" + QString::number((_q.at(1)).length()) + ">" + _q.at(1) + " ";
//qDebug() << "eLogClubLog::getClubLogAdif: 10" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 10" << endl;
qso = qso + "<QSLRDATE:" + QString::number((_q.at(2)).length()) + ">" + _q.at(2) + " ";
//qDebug() << "eLogClubLog::getClubLogAdif: 20" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 20" << endl;
qso = qso + "<QSLSDATE:" + QString::number((_q.at(3)).length()) + ">" + _q.at(3) + " ";
//qDebug() << "eLogClubLog::getClubLogAdif: 30" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 30" << endl;
qso = qso + "<CALL:" + QString::number((_q.at(4)).length()) + ">" + _q.at(4) + " ";
//qDebug() << "eLogClubLog::getClubLogAdif: 40" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 40" << endl;
qso = qso + "<OPERATOR:" + QString::number((_q.at(5)).length()) + ">" + _q.at(5) + " ";
//qDebug() << "eLogClubLog::getClubLogAdif: 50" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 50" << endl;
qso = qso + "<MODE:" + QString::number((_q.at(6)).length()) + ">" + _q.at(6) + " ";
//qDebug() << "eLogClubLog::getClubLogAdif: 60" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 60" << endl;
qso = qso + "<BAND:" + QString::number((_q.at(7)).length()) + ">" + _q.at(7) + " ";
//qDebug() << "eLogClubLog::getClubLogAdif: 70" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 70" << endl;
if ((_q.at(8)).length()> 2)
{
qso = qso + "<BAND_RX:" + QString::number((_q.at(8)).length()) + ">" + _q.at(8) + " ";
@ -321,35 +321,35 @@ ClubLog only accepts the following ADIF fields:
}
//qDebug() << "eLogClubLog::getClubLogAdif: 90" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 90" << endl;
qso = qso + "<QSL_RCVD:" + QString::number((_q.at(10)).length()) + ">" + _q.at(10) + " ";
//qDebug() << "eLogClubLog::getClubLogAdif: 100" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 100" << endl;
qso = qso + "<LOTW_QSL_RCVD:" + QString::number((_q.at(11)).length()) + ">" + _q.at(11) + " ";
//qDebug() << "eLogClubLog::getClubLogAdif: 110" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 110" << endl;
qso = qso + "<QSL_SENT:" + QString::number((_q.at(12)).length()) + ">" + _q.at(12) + " ";
//qDebug() << "eLogClubLog::getClubLogAdif: 120" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 120" << endl;
if ((_q.at(13)).toInt()> 0)
{
qso = qso + "<DXCC:" + QString::number((_q.at(13)).length()) + ">" + _q.at(13) + " ";
}
//qDebug() << "eLogClubLog::getClubLogAdif: 130'" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 130'" << endl;
qso = qso + "<PROP_MODE:" + QString::number((_q.at(14)).length()) + ">" + _q.at(14) + " ";
//qDebug() << "eLogClubLog::getClubLogAdif: 140" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 140" << endl;
qso = qso + "<CREDIT_GRANTED:" + QString::number((_q.at(15)).length()) + ">" + _q.at(15) + " ";
//qDebug() << "eLogClubLog::getClubLogAdif: 150" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 150" << endl;
qso = qso + "<EOR>";
//qDebug() << "eLogClubLog:: - QSO: " << qso << endl;
// //qDebug() << "eLogClubLog:: - QSO: " << qso << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 100" << endl;
//qDebug() << "eLogClubLog::getClubLogAdif: 100" << endl;
return qso;
}
void eLogClubLog::setCredentials(const QString &_call, const QString &_email, const QString &_pass, const bool _useQSOStationCall)
void eLogClubLog::setCredentials(const QString _call, const QString _email, const QString _pass, const bool _useQSOStationCall)
{
//qDebug() << "eLogClubLog::setCredentials" << endl;
//qDebug() << "eLogClubLog::setCredentials" << endl;
call = _call;
email = _email;
pass = _pass;
@ -360,7 +360,7 @@ void eLogClubLog::setCredentials(const QString &_call, const QString &_email, co
int eLogClubLog::deleteQSO(QStringList _qso)
{
//qDebug() << "eLogClubLog::deleteQSO: length = " << QString::number(_qso.length()) << endl;
//qDebug() << "eLogClubLog::deleteQSO: length = " << QString::number(_qso.length()) << endl;
if (_qso.length()!=17)
{
return -1;
@ -376,16 +376,16 @@ int eLogClubLog::deleteQSO(QStringList _qso)
QString qso = getClubLogAdif(_qso);
qso.replace("<EOR>", replaceCall);
//qDebug() << "eLogClubLog::deleteQSO: ready to send = " << qso << endl;
//qDebug() << "eLogClubLog::deleteQSO: ready to send = " << qso << endl;
return sendData(qso);
}
QString eLogClubLog::prepareToTranslate(const QString &_m)
QString eLogClubLog::prepareToTranslate(const QString _m)
{
//qDebug() << "eLogClubLog:: = prepareToTranslate" << _m << endl;
//qDebug() << "eLogClubLog:: = prepareToTranslate" << _m << endl;
if (_m == "Callsign missing")
{
return tr("Callsign missing");

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include <QObject>
@ -42,7 +42,7 @@ public:
explicit eLogClubLog();
~eLogClubLog();
void setCredentials(const QString &_call, const QString &_email, const QString &_pass, const bool _useQSOStationCall);
void setCredentials(const QString _call, const QString _email, const QString _pass, const bool _useQSOStationCall);
int sendQSO(QStringList _qso);
int deleteQSO(QStringList _qso);
int modifyQSO (QStringList _oldQSO, QStringList _newQSO);
@ -50,8 +50,8 @@ public:
private:
QString getClubLogAdif(const QStringList _q);
int sendData(const QString &_q); // Sends the data (http post) to ClubLog
QString prepareToTranslate(const QString &_m); // Get the message and put it in a tr to be able to translate it
int sendData(const QString _q); // Sends the data (http post) to ClubLog
QString prepareToTranslate(const QString _m); // Get the message and put it in a tr to be able to translate it
QString call, email, pass, api, stationCallsign;

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -55,36 +55,32 @@ enum
DXCCEntities = 521 // http://www.adif.org/adif302.htm#Country%20Codes
};
//enum ExportMode {ModeLotW, ModeADIF};
class FileManager : public QWidget
{
Q_OBJECT
public:
FileManager(DataProxy_SQLite *dp);
//FileManager(DataProxy_SQLite *dp, const QString _klogDir);
FileManager(DataProxy_SQLite *dp, const QString &_klogDir, const QString &_softVersion);
FileManager(DataProxy_SQLite *dp, const QString _klogDir, const QString _softVersion);
//FileManager(DataProxy_SQLite *dp, const QString _softVersion);
~FileManager();
//bool readAdif(const QString& tfileName, const int logN);
bool adifReadLog(const QString& tfileName, const int logN);
QList<int> adifLoTWReadLog(const QString& tfileName);
QList<int> adifLoTWLogExport(const QString& _fileName, const QString &_callsign, const QDate &_startDate, const QDate &_endDate, const int _logN);
//QList<int> adifLogExport(const QString& _fileName, const QString &_callsign, const QDate &_startDate, const QDate &_endDate, const int _logN, const bool LoTWOnly);
QList<int> adifLogExport(const QString& _fileName, const QString &_callsign, const QDate &_startDate, const QDate &_endDate, const int _logN, const ExportMode _em);
bool adifLoTWReadLog(const QString& tfileName);
int adifLoTWLogExport(const QString& _fileName, const int _logN);
bool adifLogExport(const QString& _fileName, const int _logN);
// QList<int> adifLogExportDates(const QString& _fileName, const QString &_callsign, const QDate &_startDate, const QDate &_endDate, const int _logN);
bool adifLogExportMarked(const QString& _fileName);
bool adifReqQSLExport(const QString& _fileName);
bool cabrilloLogExport(const QString& _fileName, const QString &_contestType, const int logNconst);
bool modifySetupFile(const QString& _filename, const QString &_field, const QString &_value);
void setVersion(const QString &_version);
bool cabrilloLogExport(const QString& _fileName, const QString _contestType, const int logNconst);
bool modifySetupFile(const QString& _filename, QString _field, const QString _value);
void setVersion(const QString _version);
QDateTime getDateTimeOfLastBackup();
void setStationCallSign(const QString& _st);
private:
bool adifLogExportToFile(const QString& _fileName, const int _logN, bool justMarked, bool _qslRequested, bool _lotw);
private:
bool adifLogExportToFile(const QString& _fileName, const int _logN=0, bool justMarked = false, bool _qslRequested = false, bool _lotw=false);
bool cabrilloLogExportToFile(const QString& _fileName, const int logNconst);
bool cabrilloLogExportCQWWToFile(const QString& _fileName, const int logNconst);
//bool adifCheckMoreThanOneLog(QFile &_f);
@ -92,20 +88,17 @@ private:
bool fillHashLog(QFile & _f);
QStringList getListOfLogsInFile(QFile & _f);
bool writeBackupDate();
bool getStationCallsignFromUser(const QString &_qrzDX, const QDate &_dt);
void showError (const QString &_txt);
//QString checkAndFixASCIIinADIF(_data);
bool processQsoReadingADIF(const QStringList &_line, const int logNumber);//, const bool _keepLogsInFile);
//QString checkAndFixASCIIinADIF(const QString _data);
bool processQsoReadingADIF(const QStringList _line, const int logNumber, const bool _keepLogsInFile);
void queryPreparation(const int _logN);
bool checkADIFValidFormat(const QStringList &_qs);
bool checkADIFValidFormat(const QStringList _qs);
QStringList readAdifField (const QString &_field);
// void writeAdifField(const QString &_field, const QString &_data); // It should possibly receive also the QTextStream
QStringList readAdifField (const QString _field);
QString prepareStringLog();
@ -121,14 +114,12 @@ private:
//bool printQs(const QString _q, const QStringList _line);
bool printQs(const QStringList &_line);
bool printQs(const QStringList _line);
//int confirmed;
QString klogDir;
QString klogVersion;
QString defaultStationCallsign;
//QProgressBar *progressBar;
bool ignoreUnknownAlways; // When importing ADIF, ignore all unknown fields.
bool usePreviousStationCallsignAnswerAlways; // When importing ADIF, ignore all unknown fields.
bool noMoreQso;
World *world;
@ -143,8 +134,7 @@ private:
signals:
void addQSOToList(QStringList _qso);
void queryError(QString _functionFailed, QString errorCodeS, int errorCodeN, QString failedQuery); // To alert about any failed query execution
void queryError(QString functionFailed, QString errorCodeS, int errorCodeN, QString failedQuery); // To alert about any failed query execution
};
#endif // FILEMANAGER_H

0
flags/balear.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 398 B

After

Width:  |  Height:  |  Size: 398 B

0
flags/ceuta.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 449 B

After

Width:  |  Height:  |  Size: 449 B

0
flags/marquesas.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 371 B

After

Width:  |  Height:  |  Size: 371 B

0
flags/sardinia.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 455 B

After

Width:  |  Height:  |  Size: 455 B

0
flags/southbritish.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 514 B

After

Width:  |  Height:  |  Size: 514 B

0
flags/xk.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 432 B

After

Width:  |  Height:  |  Size: 432 B

View File

@ -8,7 +8,7 @@
HamLibClass::HamLibClass(QObject *parent) : QObject(parent)
{
//qDebug() << "HamLibClass::HamLibClass" << endl;
//qDebug() << "HamLibClass::HamLibClass" << endl;
timer = new QTimer(this);
rigLaunched = false;
pollInterval = 300;
@ -25,7 +25,7 @@ HamLibClass::HamLibClass(QObject *parent) : QObject(parent)
//timer->start(1000);
clean();
//qDebug() << "HamLibClass::HamLibClass END" << endl;
//qDebug() << "HamLibClass::HamLibClass END" << endl;
}
HamLibClass::~HamLibClass()
@ -64,22 +64,22 @@ void HamLibClass::slotTimer()
if (retcode == RIG_OK)
{
errorCount = 0;
//qDebug() << "HamLibClass::slotTimer: Freq: " << QString::number(freq) << endl;
//qDebug() << "HamLibClass::slotTimer: Freq: " << QString::number(freq) << endl;
if ((freq_old > freq) || (freq_old < freq))
//if (freq_old != freq)
{
emit freqChanged(freq/1000000);
freq_old = freq;
//qDebug() << "HamLibClass::slotTimer EMITING; " << QString::number(freq) << endl;
//qDebug() << "HamLibClass::slotTimer EMITING; " << QString::number(freq) << endl;
}
//qDebug() << "HamLibClass::slotTimer read: " << QString::number(freq) << endl;
//qDebug() << "HamLibClass::slotTimer read: " << QString::number(freq) << endl;
}
else
{
//qDebug() << "HamLibClass::slotTimer Unable to read FREQ - Error: " << QString::number(retcode) << endl;
//qDebug() << "HamLibClass::slotTimer Unable to read FREQ - Error: " << rigerror(retcode) << endl;
//qDebug() << "HamLibClass::slotTimer Unable to read FREQ - Error: " << QString::number(retcode) << endl;
//qDebug() << "HamLibClass::slotTimer Unable to read FREQ - Error: " << rigerror(retcode) << endl;
stop();
}
@ -87,7 +87,7 @@ void HamLibClass::slotTimer()
if (retcode == RIG_OK)
{
errorCount = 0;
//qDebug() << "HamLibClass::slotTimer: Mode: " << hamlibMode2Mode(rmode) << endl;
//qDebug() << "HamLibClass::slotTimer: Mode: " << hamlibMode2Mode(rmode) << endl;
if (mode_old != rmode)
{
if (justEmitted)
@ -110,7 +110,7 @@ void HamLibClass::slotTimer()
void HamLibClass::setMode(const QString &_m)
{
//qDebug() << "HamLibClass::setMode: " << _m << endl;
//qDebug() << "HamLibClass::setMode: " << _m << endl;
if ((!isRunning()) || (readOnlyMode))
{
return;
@ -128,12 +128,12 @@ void HamLibClass::setMode(const QString &_m)
if (retcode != RIG_OK)
{
errorCount++;
//qDebug() << "HamLibClass::setMode: ERROR: Could not set mode: " << _m << endl;
//qDebug() << "HamLibClass::setMode: ERROR: Could not set mode: " << _m << endl;
return;
}
errorCount = 0;
//qDebug() << "HamLibClass::setMode - END true " << endl;
//qDebug() << "HamLibClass::setMode - END true " << endl;
return;
}
@ -305,89 +305,89 @@ QString HamLibClass::hamlibMode2Mode(rmode_t _rmode)
void HamLibClass::stop()
{
//qDebug() << "HamLibClass::stop" << endl;
//qDebug() << "HamLibClass::stop" << endl;
timer->stop();
if (!isRunning())
{
return;
}
int errorCode = rig_close(my_rig);
//qDebug() << "HamLibClass::stop-1" << endl;
//qDebug() << "HamLibClass::stop-1" << endl;
if (errorCode == RIG_OK)
{
errorCount = 0;
//qDebug() << "HamLibClass::stop: rig_close OK" << endl;
//qDebug() << "HamLibClass::stop: rig_close OK" << endl;
errorCode = rig_cleanup(my_rig);
if (errorCode == RIG_OK)
{
errorCount = 0;
//qDebug() << "HamLibClass::stop: rig_cleanUp OK" << endl;
//qDebug() << "HamLibClass::stop: rig_cleanUp OK" << endl;
rigLaunched = false;
//qDebug() << "HamLibClass::stop - true" << endl;
//qDebug() << "HamLibClass::stop - true" << endl;
return;
}
else
{
errorCount++;
//qDebug() << "HamLibClass::stop: rig_cleanup NOK: " << QString::number(errorCode) << endl;
//qDebug() << "HamLibClass::stop: rig_cleanup NOK: " << QString::number(errorCode) << endl;
}
}
else
{
errorCount++;
//qDebug() << "HamLibClass::stop: rig_close NOK: " << QString::number(errorCode) << endl;
//qDebug() << "HamLibClass::stop: rig_close NOK: " << QString::number(errorCode) << endl;
}
//qDebug() << "HamLibClass::stop - false" << endl;
//qDebug() << "HamLibClass::stop - false" << endl;
return;
}
void HamLibClass::clean()
{
//qDebug() << "HamLibClass::Clean" << endl;
//qDebug() << "HamLibClass::Clean" << endl;
myrig_model = 1; //Dummy equipment
//qDebug() << "HamLibClass::Clean 0" << endl;
//qDebug() << "HamLibClass::Clean 0" << endl;
//myport.parm.serial.rate = 57600;
bauds = 9600;
//qDebug() << "HamLibClass::Clean - 1" << endl;
//qDebug() << "HamLibClass::Clean - 1" << endl;
dataBits = 8;
//qDebug() << "HamLibClass::Clean - 2" << endl;
//qDebug() << "HamLibClass::Clean - 2" << endl;
stopBits = 1;
//qDebug() << "HamLibClass::Clean - 3" << endl;
//qDebug() << "HamLibClass::Clean - 3" << endl;
shandshake = RIG_HANDSHAKE_NONE;
//qDebug() << "HamLibClass::Clean - 4" << endl;
//qDebug() << "HamLibClass::Clean - 4" << endl;
sparity = RIG_PARITY_NONE;
//qDebug() << "HamLibClass::Clean - 5" << endl;
//qDebug() << "HamLibClass::Clean - 5" << endl;
//myport.type.rig = RIG_PORT_SERIAL;
//qDebug() << "HamLibClass::Clean - 8" << endl;
//qDebug() << "HamLibClass::Clean - 8" << endl;
serialPort = QString();
sdtr = RIG_SIGNAL_UNSET;
//qDebug() << "HamLibClass::Clean - 9" << endl;
//qDebug() << "HamLibClass::Clean - 9" << endl;
srts = RIG_SIGNAL_UNSET;
//qDebug() << "HamLibClass::Clean - 10" << endl;
//qDebug() << "HamLibClass::Clean - 10" << endl;
rigLaunched = false;
//qDebug() << "HamLibClass::clean - END" << endl;
//qDebug() << "HamLibClass::clean - END" << endl;
}
void HamLibClass::init(bool _active)
{
//qDebug()<< "HamLibClass::init: " << endl;
//qDebug() << "HamLibClass::init: " << getNameFromModelId(myrig_model) << endl;
//qDebug() << "HamLibClass::init: " << getNameFromModelId(myrig_model) << endl;
//qDebug()<< "HamLibClass::init: " << endl;
//qDebug() << "HamLibClass::init: " << getNameFromModelId(myrig_model) << endl;
//qDebug() << "HamLibClass::init: " << getNameFromModelId(myrig_model) << endl;
if (!_active)
{
//qDebug()<< "HamLibClass::init: Stopping..." << endl;
//qDebug()<< "HamLibClass::init: Stopping..." << endl;
stop();
//qDebug() << "HamLibClass::init: Stopped!" << endl;
//qDebug() << "HamLibClass::init: Stopped!" << endl;
return;
}
if (myrig_model == -1)
{
//qDebug()<< "HamLibClass::init: Rig Model not valid" << endl;
//qDebug()<< "HamLibClass::init: Rig Model not valid" << endl;
return;
}
@ -396,50 +396,50 @@ void HamLibClass::init(bool _active)
if (my_rig == nullptr)
{
//qDebug()<< "HamLibClass::init: Init failed, hamlib returned fail!" << endl;
//qDebug()<< "HamLibClass::init: Init failed, hamlib returned fail!" << endl;
return;
}
else
{
//qDebug() << "HamLibClass::init: rig_init went OK!" << endl;
//qDebug() << "HamLibClass::init: rig_init went OK!" << endl;
}
my_rig->state.rigport.type.rig = RIG_PORT_SERIAL;
//serialPort = "/dev/cu.usbserial";
//qDebug() << "HamLibClass::init: serialport: " << serialPort << endl;
//qDebug() << "HamLibClass::init: serialport2: " << serialPort.toLocal8Bit() << endl;
//qDebug() << "HamLibClass::init: serialport: " << serialPort << endl;
//qDebug() << "HamLibClass::init: serialport2: " << serialPort.toLocal8Bit() << endl;
strncpy (my_rig->state.rigport.pathname, serialPort.toLocal8Bit().constData(), FILPATHLEN);
//qDebug() << "HamLibClass::init: rigport: " << my_rig->state.rigport.pathname << endl;
//qDebug() << "HamLibClass::init: rigport: " << my_rig->state.rigport.pathname << endl;
my_rig->state.rigport.parm.serial.rate = bauds;
//qDebug() << "HamLibClass::init: serial rate: " << QString::number(my_rig->state.rigport.parm.serial.rate) << endl;
//qDebug() << "HamLibClass::init: serial rate: " << QString::number(my_rig->state.rigport.parm.serial.rate) << endl;
my_rig->state.rigport.parm.serial.data_bits = dataBits;
//qDebug() << "HamLibClass::init: data bits: " << QString::number(my_rig->state.rigport.parm.serial.data_bits) << endl;
//qDebug() << "HamLibClass::init: data bits: " << QString::number(my_rig->state.rigport.parm.serial.data_bits) << endl;
my_rig->state.rigport.parm.serial.stop_bits = stopBits;
//qDebug() << "HamLibClass::init: stop bits: " << QString::number(my_rig->state.rigport.parm.serial.stop_bits) << endl;
//qDebug() << "HamLibClass::init: stop bits: " << QString::number(my_rig->state.rigport.parm.serial.stop_bits) << endl;
my_rig->state.rigport.parm.serial.parity = sparity;
//my_rig->state.rigport.parm.serial.dtr_state = RIG_SIGNAL_ON;
//my_rig->state.rigport.parm.serial.rts_state = RIG_SIGNAL_ON;
//qDebug() << "HamLibClass::init: handshake before" << endl;
//qDebug() << "HamLibClass::init: handshake before" << endl;
my_rig->state.rigport.parm.serial.handshake = shandshake;
//qDebug() << "HamLibClass::init: handshake after" << endl;
//qDebug() << "HamLibClass::init: handshake after" << endl;
// Config done
retcode = rig_open(my_rig);
//qDebug() << "HamLibClass::init: retcode" << endl;
//qDebug() << "HamLibClass::init: retcode" << endl;
if (retcode != RIG_OK)
{
//qDebug()<< "HamLibClass::init: Can't open: " << rigerror(retcode) << endl;
//qDebug()<< "HamLibClass::init: Can't open: " << rigerror(retcode) << endl;
errorCount++;
rig_cleanup(my_rig);
return ;
}
//qDebug()<< "HamLibClass::init: Rig open!" << endl;
//qDebug()<< "HamLibClass::init: Rig open!" << endl;
errorCount = 0;
rigLaunched = true;
timer->start(pollInterval);
//qDebug() << "HamLibClass::init: END TRUE" << endl;
//qDebug() << "HamLibClass::init: END TRUE" << endl;
return;
}
@ -452,7 +452,7 @@ bool HamLibClass::isRunning()
QStringList HamLibClass::getRigList ()
{
//qDebug() << "HamLibClass::getRigList" << endl;
//qDebug() << "HamLibClass::getRigList" << endl;
// Rutine to fill the rig combo boxes
// Do not display debug codes when load the rig's
rig_set_debug (RIG_DEBUG_NONE);
@ -461,30 +461,30 @@ QStringList HamLibClass::getRigList ()
strings.clear();
rig_load_all_backends ();
//qDebug() << "HamLibClass::getRigList-10" << endl;
//qDebug() << "HamLibClass::getRigList-10" << endl;
rig_list_foreach (addRigToList, this);
//qDebug() << "HamLibClass::getRigList-11" << endl;
//qDebug() << "HamLibClass::getRigList-11" << endl;
strings.sort ();
//qDebug() << "HamLibClass::getRigList-12" << endl;
//qDebug() << "HamLibClass::getRigList-12" << endl;
return strings;
}
int HamLibClass::addRigToList (const struct rig_caps *caps, void *data)
{
//qDebug() << "HamLibClass::addRigToList" << caps->model_name << endl;
//qDebug() << "HamLibClass::addRigToList" << caps->model_name << endl;
QString name;
//qDebug() << "HamLibClass::addRigToList-10" << endl;
//qDebug() << "HamLibClass::addRigToList-10" << endl;
HamLibClass *r = (HamLibClass *) data;
//qDebug() << "HamLibClass::addRigToList-11" << endl;
//qDebug() << "HamLibClass::addRigToList-11" << endl;
name = caps->model_name;
//qDebug() << "HamLibClass::addRigToList-12" << endl;
//qDebug() << "HamLibClass::addRigToList-12" << endl;
r->rigName2RigId[name] = caps->rig_model; // We fill the equivalences between name & Id
//qDebug() << "HamLibClass::addRigToList-13" << endl;
//qDebug() << "HamLibClass::addRigToList-13" << endl;
r->rigId2RigName[caps->rig_model] = name;
//qDebug() << "HamLibClass::addRigToList-14" << endl;
//qDebug() << "HamLibClass::addRigToList-14" << endl;
r->strings << name;
//qDebug() << "HamLibClass::addRigToList-END" << endl;
//qDebug() << "HamLibClass::addRigToList-END" << endl;
return -1; // not 0 --> we want all rigs
}
@ -498,20 +498,20 @@ int HamLibClass::getModelIdFromName (const QString &_name)
QString HamLibClass::getNameFromModelId(const int _id)
{
//qDebug() << "HamLibClass::getNameFromModelId: " << QString::number(_id) << "/" << rigId2RigName.value(_id)<< endl;
//qDebug() << "HamLibClass::getNameFromModelId: " << QString::number(_id) << "/" << rigId2RigName.value(_id)<< endl;
return rigId2RigName.value(_id);
}
void HamLibClass::setModelId(const int _id)
{
//qDebug() << "HamLibClass::setModelId: " << QString::number(_id) << endl;
//qDebug() << "HamLibClass::setModelId: " << QString::number(_id) << endl;
myrig_model = _id;
}
void HamLibClass::setPort(const QString &_port)
{
//qDebug() << "HamLibClass::setPort: " << _port << endl;
//qDebug() << "HamLibClass::setPort: " << _port << endl;
serialPort = _port;
//strncpy (my_rig->state.rigport.pathname, serialPort.toLocal8Bit().constData(), FILPATHLEN);
//qstrncpy(myport.pathname, serialPort.toLocal8Bit().constData(), serialPort.length()+1);
@ -578,7 +578,7 @@ void HamLibClass::setParity(const QString &_parity)
void HamLibClass::setFreq(const double _fr)
{
//qDebug() << "HamLibClass::setFreq: " << QString::number(_fr) << endl;
//qDebug() << "HamLibClass::setFreq: " << QString::number(_fr) << endl;
if ((!isRunning()) || (readOnlyMode))
{
return;
@ -588,7 +588,7 @@ void HamLibClass::setFreq(const double _fr)
int retcode = rig_set_freq(my_rig, RIG_VFO_CURR, freq);
if (retcode != RIG_OK)
{
//qDebug() << "HamLibClass::setFreq NOK: " << endl;
//qDebug() << "HamLibClass::setFreq NOK: " << endl;
stop();
errorCount++;
@ -597,18 +597,18 @@ void HamLibClass::setFreq(const double _fr)
else
{
errorCount = 0;
//qDebug() << "HamLibClass::setFreq OK: " << QString::number(freq) << endl;
//qDebug() << "HamLibClass::setFreq OK: " << QString::number(freq) << endl;
retcode = rig_get_freq(my_rig, RIG_VFO_CURR, &freq);
if (retcode == RIG_OK)
{
errorCount = 0;
//qDebug() << "HamLibClass::setFreq read: " << QString::number(freq) << endl;
//qDebug() << "HamLibClass::setFreq read: " << QString::number(freq) << endl;
}
else
{
stop();
errorCount++;
//qDebug() << "HamLibClass::setFreq Unable to read FREQ" << endl;
//qDebug() << "HamLibClass::setFreq Unable to read FREQ" << endl;
}
return;
}

View File

@ -3,7 +3,7 @@
InfoWidget::InfoWidget(DataProxy_SQLite *dp, QWidget *parent) :
QWidget(parent)
{
//qDebug() << "InfoWidget::InfoWidget: " << endl;
//qDebug() << "InfoWidget::InfoWidget: " << endl;
dataProxy = dp;
awards = new Awards(dataProxy, Q_FUNC_INFO); //Just to know colors
@ -40,7 +40,7 @@ InfoWidget::InfoWidget(DataProxy_SQLite *dp, QWidget *parent) :
createUI();
clearBandLabels();
//qDebug() << "InfoWidget::InfoWidget: - END" << endl;
//qDebug() << "InfoWidget::InfoWidget: - END" << endl;
}
void InfoWidget::createUI()
@ -232,7 +232,7 @@ void InfoWidget::createUI()
bandLabel12->setFrameShadow(QFrame::Raised);
bandLabel12->setFrameStyle(QFrame::StyledPanel);
#else
#else
continentLabelN->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
continentLabel->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
prefixLabelN->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
@ -290,7 +290,7 @@ void InfoWidget::clearBandLabels()
void InfoWidget::clearInfoFromLocators()
{
//qDebug() << "InfoWidget::clearInfoFromLocators" << endl;
//qDebug() << "InfoWidget::clearInfoFromLocators" << endl;
gradShortLabel->setText( "0" );
gradLongLabel->setText( "0" );
distShortLabel->setText( "0" );
@ -337,13 +337,13 @@ void InfoWidget::setImperialSystem (const bool _imp)
QString InfoWidget::getStyleColorToLabelFromBand(const QString _b, const QString _q)
{ // Receives band name, Entity number (as a String)
//qDebug() << "InfoWidget::getStyleColorToLabelFromBand: " << _b << "/" << _q << endl;
//qDebug() << "InfoWidget::getStyleColorToLabelFromBand: " << _b << "/" << _q << endl;
QStringList _qs;
_qs.clear();
_qs << _q << QString::number(dataProxy->getIdFromBandName(_b)) << QString::number(-1) << QString::number(currentLog);
//TODO: Check if we can know the mode and replace the -1
//qDebug() << "InfoWidget::getStyleColorToLabelFromBand (Band/background-color): " << _b << (awards->getQRZDXStatusColor(_qs)).name() << endl;
//qDebug() << "InfoWidget::getStyleColorToLabelFromBand (Band/background-color): " << _b << (awards->getQRZDXStatusColor(_qs)).name() << endl;
return "* { background-color: " + (awards->getQRZDXStatusColor(_qs)).name() + "; }";
}
@ -351,7 +351,7 @@ QString InfoWidget::getStyleColorToLabelFromBand(const QString _b, const QString
//void InfoWidget::showInfo(const int _entity, const int _bandid, const int _modeid, const int _log)
void InfoWidget::showInfo(const int _entity)
{ // Default values of _modeid & _log = -1
//qDebug() << "InfoWidget::showInfo: " << QString::number(_entity) << endl;
//qDebug() << "InfoWidget::showInfo: " << QString::number(_entity) << endl;
//QColor getQRZDXStatusColor(const QStringList _qs); // Receives Entity, band, mode & log
bandLabel1->setStyleSheet(getStyleColorToLabelFromBand(bandLabel1->text(), QString::number(_entity)));
@ -370,7 +370,7 @@ void InfoWidget::showInfo(const int _entity)
void InfoWidget::showEntityInfo(const int _enti, int _cq, int _itu)
{
//qDebug() << "InfoWidget::showEntityInfo" << QString::number(_enti) << endl;
//qDebug() << "InfoWidget::showEntityInfo" << QString::number(_enti) << endl;
if (_enti<=0)
{
@ -440,7 +440,7 @@ void InfoWidget::showEntityInfo(const int _enti, int _cq, int _itu)
void InfoWidget::showDistanceAndBearing(const QString _locLocal, const QString _locDX)
{// Local / DX
//qDebug() << "InfoWidget::showDistanceAndBearing: " << _locLocal << "/" << _locDX << endl;
//qDebug() << "InfoWidget::showDistanceAndBearing: " << _locLocal << "/" << _locDX << endl;
QString lloc = _locLocal.toUpper();
QString ldx = _locDX.toUpper();

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
//

2
klog.1
View File

@ -1,4 +1,4 @@
.TH KLog 1 "version 1.1" "Jaime Robles, EA4K" "Hamradio"
.TH KLog 1 "version 0.9.9" "Jaime Robles, EA4K" "Hamradio"
.SH "NAME"
klog \- The Ham Radio Logging program

View File

@ -3,8 +3,8 @@
IDI_ICON1 ICON DISCARDABLE "C:\\Users\\radio\\Desktop\\DEVEL\\klog\\klog.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,0,0
PRODUCTVERSION 1,1,0,0
FILEVERSION 0,9,9,0
PRODUCTVERSION 0,9,9,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
@ -21,11 +21,11 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "EA4K\0"
VALUE "FileDescription", "Hamradio logging\0"
VALUE "FileVersion", "1.1.0.0\0"
VALUE "FileVersion", "0.9.9.0\0"
VALUE "LegalCopyright", "\0"
VALUE "OriginalFilename", "klog.exe\0"
VALUE "ProductName", "klog\0"
VALUE "ProductVersion", "1.1.0.0\0"
VALUE "ProductVersion", "0.9.9.0\0"
END
END
BLOCK "VarFileInfo"

View File

@ -20,7 +20,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -53,7 +53,7 @@ Wikipedia:
*/
//qDebug() << "Locator::isValidLocator: " << tlocator << endl;
//qDebug() << "Locator::isValidLocator: " << tlocator << endl;
//int lenght_of_locator;
@ -65,7 +65,7 @@ Wikipedia:
rx.setPattern("^[A-R]{2}$");
if (rx.match(testLocator).hasMatch())
{
//qDebug() << "Locator::isValidLocator: Match 2: " << testLocator;
//qDebug() << "Locator::isValidLocator: Match 2: " << testLocator;
return true;
}
else
@ -73,7 +73,7 @@ Wikipedia:
rx.setPattern("^[A-R]{2}[0-9]{2}$");
if (rx.match(testLocator).hasMatch())
{
//qDebug() << "Locator::isValidLocator: Match 4: " << testLocator;
//qDebug() << "Locator::isValidLocator: Match 4: " << testLocator;
return true;
}
else
@ -81,7 +81,7 @@ Wikipedia:
rx.setPattern("^[A-R]{2}[0-9]{2}[A-X]{2}$");
if (rx.match(testLocator).hasMatch())
{
//qDebug() << "Locator::isValidLocator: Match 6: " << testLocator;
//qDebug() << "Locator::isValidLocator: Match 6: " << testLocator;
return true;
}
else
@ -89,7 +89,7 @@ Wikipedia:
rx.setPattern("^[A-R]{2}[0-9]{2}[A-X]{2}[0-9]{2}$");
if (rx.match(testLocator).hasMatch())
{
//qDebug() << "Locator::isValidLocator: Match 8: " << testLocator;
//qDebug() << "Locator::isValidLocator: Match 8: " << testLocator;
return true;
}
else
@ -103,7 +103,7 @@ Wikipedia:
double Locator::getLat(const QString& tlocator){
//qDebug() << "Locator::getLat: " << tlocator;
//qDebug() << "Locator::getLat: " << tlocator;
// Read formula from: https://unclassified.software/files/source/MaidenheadLocator.cs
//Revisar las formulas porque salen distancias erroneas
if (!isValidLocator(tlocator))
@ -113,8 +113,8 @@ double Locator::getLat(const QString& tlocator){
if (tlocator.length() == 2)
{
//qDebug() << "Locator::getLat - num: " << QString::number((tlocator.at(1)).toLatin1() );
//qDebug() << "Locator::getLat: " << QString::number((((tlocator.at(1)).toLatin1() - 65) * 10) - 90) << endl;
//qDebug() << "Locator::getLat - num: " << QString::number((tlocator.at(1)).toLatin1() );
//qDebug() << "Locator::getLat: " << QString::number((((tlocator.at(1)).toLatin1() - 65) * 10) - 90) << endl;
return (((tlocator.at(1)).toLatin1() - 65) * 10) - 90;
}
if (tlocator.length() == 4)
@ -124,19 +124,19 @@ double Locator::getLat(const QString& tlocator){
}
else if (tlocator.length()== 6)
{
//qDebug() << "Locator::getLat: " << QString::number(((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.5) / 24 - 90) << endl;
//qDebug() << "Locator::getLat: " << QString::number(((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.5) / 24 - 90) << endl;
return ((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.5) / 24 - 90;
//return (((tlocator.at(1)).toLatin1() - 65) * 10) + ((tlocator.at(3)).toLatin1() - 48) + (((tlocator.at(5)).toLatin1() - 65 + 0.5) / 24) - 90;
}
else if (tlocator.length()== 8)
{
//qDebug() << "Locator::getLat: " << QString::number(((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.0) / 24 + ((tlocator.at(7)).toLatin1() - '0' + 0.5) / 240 - 90) << endl;
//qDebug() << "Locator::getLat: " << QString::number(((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.0) / 24 + ((tlocator.at(7)).toLatin1() - '0' + 0.5) / 240 - 90) << endl;
return ((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.0) / 24 + ((tlocator.at(7)).toLatin1() - '0' + 0.5) / 240 - 90;
//return (((tlocator.at(1)).toLatin1() - 65) * 10) + ((tlocator.at(3)).toLatin1() - 48) + (((tlocator.at(5)).toLatin1() - 65 + 0.5) / 24) - 90;
}
else if (tlocator.length()== 10)
{
//qDebug() << "Locator::getLat: " << QString::number(((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.0) / 24 + ((tlocator.at(7)).toLatin1() - '0' + 0.0) / 240 + ((tlocator.at(9)).toLatin1() - 'A' + 0.5) / 240 / 24 - 90) << endl;
//qDebug() << "Locator::getLat: " << QString::number(((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.0) / 24 + ((tlocator.at(7)).toLatin1() - '0' + 0.0) / 240 + ((tlocator.at(9)).toLatin1() - 'A' + 0.5) / 240 / 24 - 90) << endl;
return ((tlocator.at(1)).toLatin1() - 'A') * 10 + ((tlocator.at(3)).toLatin1() - '0') + ((tlocator.at(5)).toLatin1() - 'A' + 0.0) / 24 + ((tlocator.at(7)).toLatin1() - '0' + 0.0) / 240 + ((tlocator.at(9)).toLatin1() - 'A' + 0.5) / 240 / 24 - 90;
//return (((tlocator.at(1)).toLatin1() - 65) * 10) + ((tlocator.at(3)).toLatin1() - 48) + (((tlocator.at(5)).toLatin1() - 65 + 0.5) / 24) - 90;
}
@ -149,7 +149,7 @@ double Locator::getLat(const QString& tlocator){
double Locator::getLon(const QString& tlocator)
{
//qDebug() << "Locator::getLon: " << tlocator;
//qDebug() << "Locator::getLon: " << tlocator;
if (!isValidLocator(tlocator))
{
@ -169,13 +169,13 @@ double Locator::getLon(const QString& tlocator)
}
else if (tlocator.length()== 6)
{
//qDebug() << "Locator::getLon: " << QString::number(((tlocator.at(0)).toLatin1() - 'A') * 20 + ((tlocator.at(2)).toLatin1() - '0') * 2 + ((tlocator.at(4)).toLatin1() - 'A' + 0.5) / 12 - 180) << endl;
//qDebug() << "Locator::getLon: " << QString::number(((tlocator.at(0)).toLatin1() - 'A') * 20 + ((tlocator.at(2)).toLatin1() - '0') * 2 + ((tlocator.at(4)).toLatin1() - 'A' + 0.5) / 12 - 180) << endl;
return ((tlocator.at(0)).toLatin1() - 'A') * 20 + ((tlocator.at(2)).toLatin1() - '0') * 2 + ((tlocator.at(4)).toLatin1() - 'A' + 0.5) / 12 - 180;
//return (((tlocator.at(0)).toLatin1() - 65) * 20) + (((tlocator.at(2)).toLatin1() - 48) * 2) + (((tlocator.at(4)).toLatin1() - 65 + 0.5) / 12) - 180;
}
else if (tlocator.length()== 8)
{
//qDebug() << "Locator::getLon: " << QString::number(((tlocator.at(0)).toLatin1() - 'A') * 20 + ((tlocator.at(2)).toLatin1() - '0') * 2 + ((tlocator.at(4)).toLatin1() - 'A' + 0.0) / 12 + ((tlocator.at(6)).toLatin1() - '0' + 0.5) / 120 - 180) << endl;
//qDebug() << "Locator::getLon: " << QString::number(((tlocator.at(0)).toLatin1() - 'A') * 20 + ((tlocator.at(2)).toLatin1() - '0') * 2 + ((tlocator.at(4)).toLatin1() - 'A' + 0.0) / 12 + ((tlocator.at(6)).toLatin1() - '0' + 0.5) / 120 - 180) << endl;
return ((tlocator.at(0)).toLatin1() - 'A') * 20 + ((tlocator.at(2)).toLatin1() - '0') * 2 + ((tlocator.at(4)).toLatin1() - 'A' + 0.0) / 12 + ((tlocator.at(6)).toLatin1() - '0' + 0.5) / 120 - 180;
}
//else if (tlocator.length()== 10)
@ -190,8 +190,8 @@ double Locator::getLon(const QString& tlocator)
int Locator::getBeam(const double lon1, const double lat1, const double lon2, const double lat2){
double lon_a,lat_a,lon_b,lat_b, bearing;
//qDebug() << "Locator::getBeam1: " << QString::number(lon1) << "/" << QString::number(lat1) << endl;
//qDebug() << "Locator::getBeam2: " << QString::number(lon2) << "/" << QString::number(lat2) << endl;
//qDebug() << "Locator::getBeam1: " << QString::number(lon1) << "/" << QString::number(lat1) << endl;
//qDebug() << "Locator::getBeam2: " << QString::number(lon2) << "/" << QString::number(lat2) << endl;
lon_a=lon1*PI/180; // Convert degrees to radians
@ -232,7 +232,7 @@ int Locator::getBeam(const double lon1, const double lat1, const double lon2, co
bearing = 360 - (180/PI*bearing);
bearing = 360 - bearing;
//qDebug() << "Locator::getBeam: " << QString::number(bearing) << endl;
//qDebug() << "Locator::getBeam: " << QString::number(bearing) << endl;
/* Convert to degrees */
return int(bearing);
@ -241,7 +241,7 @@ int Locator::getBeam(const double lon1, const double lat1, const double lon2, co
int Locator::getDistance(const double lon1, const double lat1, const double lon2, const double lat2, const bool _imperialSystem){
//http://en.wikipedia.org/wiki/Haversine_formula
//qDebug() << "Locator::getDistanceKilometres: MyPos("<< QString::number(lon1) << ")" << endl;
//qDebug() << "Locator::getDistanceKilometres: MyPos("<< QString::number(lon1) << ")" << endl;
// << QString::number(lat1) << ") - DxPos(" << QString::number(lon2) << "/" << QString::number(lat2) << ")" << endl;
double lo1,la1,lo2,la2;
@ -255,16 +255,16 @@ int Locator::getDistance(const double lon1, const double lat1, const double lon2
la2=lat2* DEG_TO_RAD;
if (!_imperialSystem){
//qDebug() << "Locator::getDistance (Km): " << QString::number((int)(acos(cos(la1)*cos(lo1)*cos(la2)*cos(lo2)+cos(la1)*sin(lo1)*cos(la2)*sin(lo2)+sin(la1)*sin(la2)) * EARTH_RADIUS)) << endl;
//qDebug() << "Locator::getDistance (Km): " << QString::number((int)(acos(cos(la1)*cos(lo1)*cos(la2)*cos(lo2)+cos(la1)*sin(lo1)*cos(la2)*sin(lo2)+sin(la1)*sin(la2)) * EARTH_RADIUS)) << endl;
return int(acos(cos(la1)*cos(lo1)*cos(la2)*cos(lo2)+cos(la1)*sin(lo1)*cos(la2)*sin(lo2)+sin(la1)*sin(la2)) * EARTH_RADIUS);
}else{ // In milles
//qDebug() << "Locator::getDistance (Milles): " << QString::number(((int)(acos(cos(la1)*cos(lo1)*cos(la2)*cos(lo2)+cos(la1)*sin(lo1)*cos(la2)*sin(lo2)+sin(la1)*sin(la2)) * EARTH_RADIUS))* 0.62137) << endl;
//qDebug() << "Locator::getDistance (Milles): " << QString::number(((int)(acos(cos(la1)*cos(lo1)*cos(la2)*cos(lo2)+cos(la1)*sin(lo1)*cos(la2)*sin(lo2)+sin(la1)*sin(la2)) * EARTH_RADIUS))* 0.62137) << endl;
return int(((acos(cos(la1)*cos(lo1)*cos(la2)*cos(lo2)+cos(la1)*sin(lo1)*cos(la2)*sin(lo2)+sin(la1)*sin(la2)) * EARTH_RADIUS)) * 0.62137);
}
}
bool Locator::checkCoords(const double lon1, const double lat1){
//qDebug() << "Locator::checkCoords" ;
//qDebug() << "Locator::checkCoords" ;
// Checks if a coordinates is correct.
if ((lat1 > 90.0 || lat1 < -90.0) && (lon1 > 180.0 || lon1 < -180.0)){
return true;
@ -280,7 +280,7 @@ QString Locator::getLocator(const double lon1, const double lat1) const{
lat = Latitude in decimal degrees (+ = North; - = South).
Output: locator = 6 characters world wide locator.
------------------------------------------------- */
//qDebug() << "Locator::getLocator: (" << QString::number(lon1) << "/" << QString::number(lat1) << ")" << endl;
//qDebug() << "Locator::getLocator: (" << QString::number(lon1) << "/" << QString::number(lat1) << ")" << endl;
QString locat = ""; //NO locator
double lo, la;
@ -344,7 +344,7 @@ double Locator::dmsTodeg (int deg, int min, int sec)
int Locator::getBeamBetweenLocators (const QString& tlocator1, const QString& tlocator2)
{
//qDebug() << "Locator::getBeamBetweenLocators: " << tlocator1 << "/" << tlocator2 << endl;
//qDebug() << "Locator::getBeamBetweenLocators: " << tlocator1 << "/" << tlocator2 << endl;
if ( !(isValidLocator(tlocator1) && isValidLocator(tlocator2) ) )
{
return -1;

View File

@ -20,7 +20,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

View File

@ -2,12 +2,12 @@
LogModel::LogModel(DataProxy_SQLite *dp, QObject *parent):QSqlRelationalTableModel(parent)
{
//qDebug() << "LogModel::LogModel " << endl;
//qDebug() << "LogModel::LogModel " << endl;
//logModel = new QSqlRelationalTableModel(this);
dataProxy = dp;
setTable("log");
setEditStrategy(QSqlTableModel::OnFieldChange);
//qDebug() << "LogModel::LogModel - END" << endl;
//qDebug() << "LogModel::LogModel - END" << endl;
}
@ -36,14 +36,14 @@ the view should present the city's name field to the user.
This should be coherent with the logview
*/
//qDebug() << "LogModel::createlogModel: log: " << QString::number(_i) << endl;
//qDebug() << "LogModel::createlogModel: log: " << QString::number(_i) << endl;
//QString contestMode = dataProxy->getLogTypeOfUserLog(_i);
//qDebug() << "LogModel::createlogModel - contestMode: " << contestMode << endl;
QString stringQuery = QString("lognumber='%1'").arg(_i);
QSqlQuery query(stringQuery);
setFilter(stringQuery);
QString stringQuery = QString("lognumber='%1'").arg(_i);
QSqlQuery query(stringQuery);
setFilter(stringQuery);
setColumnsToDX();
/*
@ -51,18 +51,18 @@ This should be coherent with the logview
//if (contestMode.compare("DX"))
if (contestMode == "DX")
{
//qDebug() << "LogModel::createlogModel: found type DX" << endl;
//qDebug() << "LogModel::createlogModel: found type DX" << endl;
}
else if (contestMode == "CQ-WW-SSB")
{
//qDebug() << "LogModel::createlogModel: found type CQ-WW-SSB" << endl;
//qDebug() << "LogModel::createlogModel: found type CQ-WW-SSB" << endl;
}
else
{
// THIS POINT SHOULD NOT BE REACHED. It means that there is a kind of contest not supported.
// Maybe the way should be to move ALL the actions from DX here.
//qDebug() << "LogModel::createlogModel: log type NOT found" << endl;
//qDebug() << "LogModel::createlogModel: log type NOT found" << endl;
}
*/
@ -73,7 +73,7 @@ This should be coherent with the logview
void LogModel::setColumnsToDX()
{
//qDebug() << "LogModel::setColumnsToDX" << endl;
//qDebug() << "LogModel::setColumnsToDX" << endl;
QSqlQuery q;
QString stringQuery = QString("SELECT * from log LIMIT 1");
@ -90,7 +90,7 @@ This should be coherent with the logview
q.next();
rec = q.record(); // Number of columns
//qDebug() << "LogModel::createlogModel - columns: " << QString::number(rec.count()) << endl;
//qDebug() << "LogModel::createlogModel - columns: " << QString::number(rec.count()) << endl;

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include <QDebug>

View File

@ -56,8 +56,32 @@
LogViewSortFilterProxyModel::LogViewSortFilterProxyModel(QObject *parent)
: QSortFilterProxyModel(parent)
{
//setDynamicSortFilter(true);
}
/*
void LogViewSortFilterProxyModel::setFilterMinimumDate(const QDate &date)
{
minDate = date;
invalidateFilter();
}
void LogViewSortFilterProxyModel::setFilterMaximumDate(const QDate &date)
{
maxDate = date;
invalidateFilter();
}
bool LogViewSortFilterProxyModel::filterAcceptsRow(int sourceRow,
const QModelIndex &sourceParent) const
{
QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent);
QModelIndex index1 = sourceModel()->index(sourceRow, 1, sourceParent);
QModelIndex index2 = sourceModel()->index(sourceRow, 2, sourceParent);
return (sourceModel()->data(index0).toString().contains(filterRegExp())
|| sourceModel()->data(index1).toString().contains(filterRegExp()))
&& dateInRange(sourceModel()->data(index2).toDate());
}
*/
bool LogViewSortFilterProxyModel::lessThan(const QModelIndex &left,
const QModelIndex &right) const
@ -65,96 +89,23 @@ bool LogViewSortFilterProxyModel::lessThan(const QModelIndex &left,
QVariant leftData = sourceModel()->data(left);
QVariant rightData = sourceModel()->data(right);
QString leftString = leftData.toString();
QString rightString = rightData.toString();
//qDebug() << "LogViewSortFilterProxyModel::lessThan (leftString): " << leftString << endl;
//qDebug() << "LogViewSortFilterProxyModel::lessThan (rightString): " << rightString << endl;
QDateTime leftDT = QDateTime::fromString((sourceModel()->data(left.siblingAtColumn(1))).toString() + (sourceModel()->data(left.siblingAtColumn(2))).toString(), "yyyy/MM/ddHH:mm:ss");
QDateTime rightDT = QDateTime::fromString((sourceModel()->data(right.siblingAtColumn(1))).toString() + (sourceModel()->data(right.siblingAtColumn(2))).toString(), "yyyy/MM/ddHH:mm:ss");
//qDebug() << "LogViewSortFilterProxyModel::lessThan - DateTime: " << leftDT.toString("yyyy-MM-dd / hh:mm:ss") << endl;
//qDebug() << "LogViewSortFilterProxyModel::lessThan - Columns: " << (sourceModel()->data(left.siblingAtColumn(2))).toString() << endl;
/*
* if (leftData.type() == QVariant::String)
{
//qDebug() << "LogViewSortFilterProxyModel::lessThan - QString" << endl;
}
*/
//qDebug() << "LogViewSortFilterProxyModel::lessThan - Left column: " << QString::number(left.column())<< endl;
//qDebug() << "LogViewSortFilterProxyModel::lessThan - Right column: " << QString::number(right.column())<< endl;
//qDebug() << "LogViewSortFilterProxyModel::lessThan - date: " << leftDT.toString("yyyy-MM-dd--hh:mm:ss") <<"<==>" << rightDT.toString("yyyy-MM-dd--hh:mm:ss") << endl;
if (left.column() == 1)
{
//qDebug() << "LogViewSortFilterProxyModel::lessThan - left: " << (sourceModel()->data(left.siblingAtColumn(1))).toString() << endl;
//QDate leftD = QDate::fromString((sourceModel()->data(left.siblingAtColumn(1))).toString(), "yyyy/MM/dd");
//QDate rightD = QDate::fromString((sourceModel()->data(right.siblingAtColumn(1))).toString(), "yyyy/MM/dd");
if (leftDT.date() == rightDT.date())
{
//qDebug() << "LogViewSortFilterProxyModel::lessThan - SAME" << endl;
if (leftDT.time() < rightDT.time())
{
//qDebug() << "LogViewSortFilterProxyModel::lessThan - SAME - (time) TRUE - Left" << endl;
}
else
{
//qDebug() << "LogViewSortFilterProxyModel::lessThan - SAME - (time) FALSE - Right" << endl;
}
return QString::localeAwareCompare(leftDT.toString("hh:mm:ss"), rightDT.toString("hh:mm:ss")) < 0;
//return leftDT.time() < rightDT.time();
}
else
{
//qDebug() << "LogViewSortFilterProxyModel::lessThan - DIFFERENT: " << endl;
//return leftD < rightD;
if (leftDT.date() < rightDT.date())
{
//qDebug() << "LogViewSortFilterProxyModel::lessThan - DIFFERENT - (date) TRUE - Left" << endl;
}
else
{
//qDebug() << "LogViewSortFilterProxyModel::lessThan - DIFFERENT - (date) FALSE - Right" << endl;
}
//return leftDT.date() < rightDT.date();
return QString::localeAwareCompare(leftString, rightString) < 0;
}
}
else
{
//return leftData < rightData;
//qDebug() << "LogViewSortFilterProxyModel::lessThan - No column 1: " << leftString << " / " << rightString << endl;
return QString::localeAwareCompare(leftString, rightString) < 0;
}
/*
if (rightData.type() == QVariant::DateTime) {
//if (rightData.type() == QVariant::Time) {
//qDebug() << "LogViewSortFilterProxyModel::lessThan - 1" << endl;
return leftData.toDateTime() < rightData.toDateTime();
}
else
{
} else {
QString leftString = leftData.toString();
QString rightString = rightData.toString();
if (left.column() == 1)
{
//qDebug() << "LogViewSortFilterProxyModel::lessThan - left Column == 1" << endl;
//qDebug() << "LogViewSortFilterProxyModel::lessThan - leftData/rightData: " << leftString<< "/" << rightString << endl;
if (leftD == rightD)
if (leftData == rightData)
{
//qDebug() << "LogViewSortFilterProxyModel::lessThan - leftData == rightData: " << leftString<< "/" << rightString << endl;
QString leftN = (sourceModel()->data(left.siblingAtColumn(2))).toString();
QString rightN = (sourceModel()->data(right.siblingAtColumn(2))).toString();
@ -167,17 +118,23 @@ bool LogViewSortFilterProxyModel::lessThan(const QModelIndex &left,
else
{
//qDebug() << "LogViewSortFilterProxyModel::lessThan - left != right" << endl;
//qDebug() << "LogViewSortFilterProxyModel::lessThan - leftData != rightData: " << leftString<< "/" << rightString << endl;
return leftD < rightD;
}
}
//qDebug() << "LogViewSortFilterProxyModel::lessThan - 2: " << leftString << "/" << rightString << endl;
return QDate::fromString(leftString, "yyyy/MM/dd") < QDate::fromString(rightString, "yyyy/MM/dd");
//return QString::localeAwareCompare(leftString, rightString) < 0;
/*
static QRegExp emailPattern("[\\w\\.]*@[\\w\\.]*)");
if(left.column() == 1 && emailPattern.indexIn(leftString) != -1)
leftString = emailPattern.cap(1);
if(right.column() == 1 && emailPattern.indexIn(rightString) != -1)
rightString = emailPattern.cap(1);
*/
return QString::localeAwareCompare(leftString, rightString) < 0;
}
*/
}

View File

@ -20,7 +20,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -29,9 +29,8 @@
LogWindow::LogWindow(DataProxy_SQLite *dp, QWidget *parent) : QWidget(parent)
{
//qDebug() << "LogWindow::LogWindow: " << endl;
//qDebug() << "LogWindow::LogWindow: " << endl;
dataProxy = dp;
//sortingThroughProxyModel = false;
logModel = new LogModel(dataProxy, this);
connect(logModel, SIGNAL(queryError(QString, QString, int, QString)), this, SLOT(slotQueryErrorManagement(QString, QString, int, QString)) );
logView = new QTableView;
@ -39,15 +38,15 @@ LogWindow::LogWindow(DataProxy_SQLite *dp, QWidget *parent) : QWidget(parent)
elogClublog = new eLogClubLog();
currentLog = -1;
//proxyModel = new LogViewSortFilterProxyModel(this);
proxyModel = new LogViewSortFilterProxyModel(this);
proxyModel->setSourceModel(logModel);
awards = new Awards(dataProxy, Q_FUNC_INFO);
createUI();
createActions();
setDefaultData();
//qDebug() << "LogWindow::LogWindow: - END" << endl;
//qDebug() << "LogWindow::LogWindow: - END" << endl;
}
@ -55,11 +54,10 @@ LogWindow::~LogWindow()
{
// emit clearError();
}
/*
void LogWindow::setProxyModel (const bool _p)
{
sortingThroughProxyModel = _p;
if (sortingThroughProxyModel)
if (_p)
{
logView->setModel(proxyModel);
logView->setCurrentIndex(proxyModel->index(0, 0));
@ -69,23 +67,17 @@ void LogWindow::setProxyModel (const bool _p)
logView->setModel(logModel);
logView->setCurrentIndex(logModel->index(0, 0));
}
}
*/
void LogWindow::sortColumn(const int _c)
{
//proxyModel->sort(_c);
logModel->sort(_c, Qt::AscendingOrder);
}
void LogWindow::clear()
{
//qDebug() << "LogWindow::clear " << endl;
//qDebug() << "LogWindow::clear " << endl;
}
void LogWindow::createUI()
{
//qDebug() << "LogWindow::createUI" << endl;
//qDebug() << "LogWindow::createUI" << endl;
logView->setContextMenuPolicy(Qt::CustomContextMenu);
logView->setSortingEnabled(true);
@ -98,65 +90,51 @@ void LogWindow::createUI()
void LogWindow::setDefaultData()
{
//qDebug() << "LogWindow::setDefaultData" << endl;
//qDebug() << "LogWindow::setDefaultData" << endl;
}
void LogWindow::createlogPanel(const int _currentLog)
{
//qDebug() << "LogWindow::createlogPanel: " << QString::number(_currentLog) << endl;
//qDebug() << "LogWindow::createlogPanel: " << QString::number(_currentLog) << endl;
currentLog = _currentLog;
logModel->createlogModel(currentLog);
//proxyModel->setSourceModel(logModel);
logView->setModel(logModel);
logView->setCurrentIndex(logModel->index(0, 0));
//logView->setModel(logModel);
//logView->setCurrentIndex(logModel->index(0, 0));
//setProxyModel(false);
setProxyModel(false);
//QString contestMode = dataProxy->getLogTypeOfUserLog(currentLog);
QString contestMode = dataProxy->getLogTypeOfUserLog(currentLog);
setColumnsToDX();
sortColumn(1); //Initial sort by column 1 (date & time)
/*
if (contestMode == "DX")
{
//qDebug() << "LogWindow::createlogPanel: DX" << endl;
//qDebug() << "LogWindow::createlogPanel: DX" << endl;
setColumnsToDX();
}
else if (contestMode == "CQ-WW-SSB")
{
//qDebug() << "LogWindow::createlogPanel: CQ-WW-SSB" << endl;
//qDebug() << "LogWindow::createlogPanel: CQ-WW-SSB" << endl;
}
else
{
// THIS POINT SHOULD NOT BE REACHED. It means that there is a kind of contest not supported.
// Maybe the way should be to move ALL the actions from DX here.
//qDebug() << "LogWindow::createlogPanel: No log type found!" << endl;
//qDebug() << "LogWindow::createlogPanel: No log type found!" << endl;
}
*/
logView->setItemDelegate(new QSqlRelationalDelegate(this));
logView->setSelectionMode(QAbstractItemView::SingleSelection);
logView->setSelectionMode( QAbstractItemView::SingleSelection);
logView->setSelectionBehavior(QAbstractItemView::SelectRows);
logView->resizeColumnsToContents();
logView->horizontalHeader()->setStretchLastSection(true);
logView->sortByColumn(1);
/*
if (sortingThroughProxyModel)
{
proxyModel->sort(1);
}
else
{
logView->sortByColumn(1);
}
*/
}
void LogWindow::setColumnsToDX()
{
//qDebug() << "LogWindow::setColumnsToDX" << endl;
//qDebug() << "LogWindow::setColumnsToDX" << endl;
QString stringQuery;
stringQuery = QString("SELECT * FROM log LIMIT 1");
QSqlQuery query;
@ -195,7 +173,7 @@ void LogWindow::setColumnsToDX()
void LogWindow::refresh()
{
//qDebug() << "LogWindow::refresh" << endl;
//qDebug() << "LogWindow::refresh" << endl;
logModel->select();
}
@ -215,7 +193,7 @@ void LogWindow::createActionsCommon()
void LogWindow::slotRighButtonFromLog(const QPoint& pos)
{
//qDebug() << "LogWindow::slotshowRighButtonFromLog" << endl;
//qDebug() << "LogWindow::slotshowRighButtonFromLog" << endl;
int row = (logView->indexAt(pos)).row();
showMenuRightButtonFromLogCreateActions();
righButtonFromLogMenu(row);
@ -224,10 +202,10 @@ void LogWindow::slotRighButtonFromLog(const QPoint& pos)
void LogWindow::righButtonFromLogMenu(const int trow)
{
//qDebug() << "LogWindow::slotshowRighButtonFromLogMenu: " << QString::number(trow) << endl;
//qDebug() << "LogWindow::slotshowRighButtonFromLogMenu: " << QString::number(trow) << endl;
int _qsoID = ((logModel->index(trow, 0)).data(0)).toInt();
//qDebug() << "LogWindow::slotshowRighButtonFromLogMenu: QSOid: " << QString::number(_qsoID) << endl;
//qDebug() << "LogWindow::slotshowRighButtonFromLogMenu: QSOid: " << QString::number(_qsoID) << endl;
bool qslReceived = isQSLReceived(_qsoID);
bool qslSent = isQSLSent(_qsoID);
QMenu menu(this);
@ -236,12 +214,11 @@ void LogWindow::righButtonFromLogMenu(const int trow)
delQSOFromLogAct->setData(trow);
menu.addAction(qsoToEditFromLogAct);
qsoToEditFromLogAct->setData(trow);
menu.addAction(checkQRZCOMFromLogAct);
checkQRZCOMFromLogAct->setData(trow);
menu.addAction(checkDXHeatFromLogAct);
checkDXHeatFromLogAct->setData(trow);
QString contestMode = dataProxy->getLogTypeOfUserLog(currentLog);
if (contestMode == "DX")
{
menu.addSeparator();
if (qslSent)
{
@ -266,19 +243,31 @@ void LogWindow::righButtonFromLogMenu(const int trow)
qslRecViaBureauFromLogAct->setData(trow);
qslRecViaDirectFromLogAct->setData(trow);
}
}
else if (contestMode == "CQ-WW-SSB")
{
}
else
{
// THIS POINT SHOULD NOT BE REACHED. It means that there is a kind of contest not supported.
// Maybe the way should be to move ALL the actions from DX here.
}
menu.exec(QCursor::pos());
}
void LogWindow::slotDoubleClickLog(const QModelIndex & index)
{
//qDebug() << "LogWindow::slotDoubleClickLog: Row: " << QString::number(index.row()) << "Column: " << QString::number(index.column()) << endl;
//qDebug() << "LogWindow::slotDoubleClickLog: Row: " << QString::number(index.row()) << "Column: " << QString::number(index.column()) << endl;
int row = index.row();
//qsoToEdit((logModel->index(row, 0)).data(0).toInt());
int qsoID = ((logModel->index(row, Qt::DisplayRole)).data(0)).toInt();
//qDebug() << "LogWindow::slotDoubleClickLog: n: " << QString::number (logModel->data(index, Qt::DisplayRole).toInt()) << endl;
//qDebug() << "LogWindow::slotDoubleClickLog: emitted: " << QString::number (((logModel->index(row, Qt::DisplayRole)).data(0)).toInt()) << endl;
//qDebug() << "LogWindow::slotDoubleClickLog: n: " << QString::number (logModel->data(index, Qt::DisplayRole).toInt()) << endl;
//qDebug() << "LogWindow::slotDoubleClickLog: emitted: " << QString::number (((logModel->index(row, Qt::DisplayRole)).data(0)).toInt()) << endl;
emit actionQSODoubleClicked(qsoID);
//qsoToEdit((logModel->index(row, 0)).data(0).toInt());
@ -290,61 +279,51 @@ void LogWindow::slotDoubleClickLog(const QModelIndex & index)
bool LogWindow::isQSLReceived(const int _qsoId)
{
//qDebug() << "LogWindow::isQSLReceived: " << QString::number(_qsoId) << endl;
//qDebug() << "LogWindow::isQSLReceived: " << QString::number(_qsoId) << endl;
return dataProxy->isQSLReceived(_qsoId);
}
bool LogWindow::isQSLSent(const int _qsoId)
{
//qDebug() << "LogWindow::isQSLSent: " << QString::number(_qsoId) << endl;
//qDebug() << "LogWindow::isQSLSent: " << QString::number(_qsoId) << endl;
return dataProxy->isQSLSent(_qsoId);
}
void LogWindow::showMenuRightButtonFromLogCreateActions()
{
//qDebug() << "LogWindow::showMenuRightButtonFromLogCreateActions" << endl;
//qDebug() << "LogWindow::showMenuRightButtonFromLogCreateActions" << endl;
delQSOFromLogAct = new QAction(tr("&Delete"), this);
delQSOFromLogAct->setShortcut(Qt::CTRL + Qt::Key_D);
delQSOFromLogAct->setStatusTip(tr("Delete a QSO"));
connect(delQSOFromLogAct, SIGNAL(triggered()), this, SLOT(slotQsoDeleteFromLog()));
qsoToEditFromLogAct = new QAction(tr("&Edit QSO"), this);
qsoToEditFromLogAct->setShortcut(Qt::CTRL + Qt::Key_E);
qsoToEditFromLogAct->setStatusTip(tr("Edit this QSO"));
connect(qsoToEditFromLogAct, SIGNAL(triggered()), this, SLOT(slotQSOToEditFromLog()));
delQSOFromLogAct = new QAction(tr("&Delete"), this);
delQSOFromLogAct->setShortcut(Qt::CTRL + Qt::Key_D);
delQSOFromLogAct->setStatusTip(tr("Delete a QSO"));
connect(delQSOFromLogAct, SIGNAL(triggered()), this, SLOT(slotQsoDeleteFromLog()));
qslSentViaBureauFromLogAct = new QAction(tr("Via &bureau"), this);
qslSentViaBureauFromLogAct->setShortcut(Qt::CTRL + Qt::Key_B);
qslSentViaBureauFromLogAct->setStatusTip(tr("Send this QSL via bureau"));
connect(qslSentViaBureauFromLogAct, SIGNAL(triggered()), this, SLOT( slotQSLSentViaBureauFromLog() ));
qsoToEditFromLogAct = new QAction(tr("&Edit QSO"), this);
qsoToEditFromLogAct->setShortcut(Qt::CTRL + Qt::Key_E);
qsoToEditFromLogAct->setStatusTip(tr("Edit this QSO"));
connect(qsoToEditFromLogAct, SIGNAL(triggered()), this, SLOT(slotQSOToEditFromLog()));
qslSentViaDirectFromLogAct = new QAction(tr("D&irect"), this);
qslSentViaDirectFromLogAct->setShortcut(Qt::CTRL + Qt::Key_I);
qslSentViaDirectFromLogAct->setStatusTip(tr("Send this QSL via direct"));
connect(qslSentViaDirectFromLogAct, SIGNAL(triggered()), this, SLOT( slotQSLSentViaDirectFromLog() ));
qslSentViaBureauFromLogAct = new QAction(tr("Via &bureau"), this);
qslSentViaBureauFromLogAct->setShortcut(Qt::CTRL + Qt::Key_B);
qslSentViaBureauFromLogAct->setStatusTip(tr("Send this QSL via bureau"));
connect(qslSentViaBureauFromLogAct, SIGNAL(triggered()), this, SLOT( slotQSLSentViaBureauFromLog() ));
qslRecViaBureauFromLogAct = new QAction(tr("Via bureau"), this);
qslRecViaBureauFromLogAct->setShortcut(Qt::CTRL + Qt::Key_R);
qslRecViaBureauFromLogAct->setStatusTip(tr("QSL &received via bureau"));
connect(qslRecViaBureauFromLogAct, SIGNAL(triggered()), this, SLOT( slotQSLRecViaBureauFromLog() ));
qslSentViaDirectFromLogAct = new QAction(tr("D&irect"), this);
qslSentViaDirectFromLogAct->setShortcut(Qt::CTRL + Qt::Key_I);
qslSentViaDirectFromLogAct->setStatusTip(tr("Send this QSL via direct"));
connect(qslSentViaDirectFromLogAct, SIGNAL(triggered()), this, SLOT( slotQSLSentViaDirectFromLog() ));
qslRecViaDirectFromLogAct = new QAction(tr("Direct"), this);
qslRecViaDirectFromLogAct->setShortcut(Qt::CTRL + Qt::Key_T);
qslRecViaDirectFromLogAct->setStatusTip(tr("QSL received via direc&t"));
connect(qslRecViaDirectFromLogAct, SIGNAL(triggered()), this, SLOT( slotQSLRecViaDirectFromLog() ));
checkQRZCOMFromLogAct = new QAction(tr("Check in QRZ.com"), this);
checkQRZCOMFromLogAct->setShortcut(Qt::CTRL + Qt::Key_Q);
checkQRZCOMFromLogAct->setStatusTip(tr("Check this callsign in QRZ.com"));
connect(checkQRZCOMFromLogAct, SIGNAL(triggered()), this, SLOT( slotCheckQRZCom() ));
checkDXHeatFromLogAct = new QAction(tr("Check in DXHeat.com"), this);
checkDXHeatFromLogAct->setShortcut(Qt::CTRL + Qt::Key_Q);
checkDXHeatFromLogAct->setStatusTip(tr("Check this callsign in DXHeat.com"));
connect(checkDXHeatFromLogAct, SIGNAL(triggered()), this, SLOT( slotCheckDXHeatCom() ));
qslRecViaBureauFromLogAct = new QAction(tr("Via bureau"), this);
qslRecViaBureauFromLogAct->setShortcut(Qt::CTRL + Qt::Key_R);
qslRecViaBureauFromLogAct->setStatusTip(tr("QSL &received via bureau"));
connect(qslRecViaBureauFromLogAct, SIGNAL(triggered()), this, SLOT( slotQSLRecViaBureauFromLog() ));
qslRecViaDirectFromLogAct = new QAction(tr("Direct"), this);
qslRecViaDirectFromLogAct->setShortcut(Qt::CTRL + Qt::Key_T);
qslRecViaDirectFromLogAct->setStatusTip(tr("QSL received via direc&t"));
connect(qslRecViaDirectFromLogAct, SIGNAL(triggered()), this, SLOT( slotQSLRecViaDirectFromLog() ));
}
@ -352,7 +331,7 @@ void LogWindow::showMenuRightButtonFromLogCreateActions()
void LogWindow::slotQSLSentViaBureauFromLog()
{
//qDebug() << "LogWindow::slotQSLSentViaBureauFromLog: " << (qslSentViaBureauFromLogAct->data()).toString() << " - Id = " << QString::number( ((logModel->index( ( (qslSentViaBureauFromLogAct->data()).toInt() ) , 0)).data(0).toInt()) ) << endl;
//qDebug() << "LogWindow::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());
qslSentViaBureau(_qsoId);
@ -360,7 +339,7 @@ void LogWindow::slotQSLSentViaBureauFromLog()
void LogWindow::slotQSLSentViaDirectFromLog()
{
//qDebug() << "LogWindow::slotQSLSentViaDirectFromLog: " << (qslSentViaDirectFromLogAct->data()).toString() << " - Id = " << QString::number( ((logModel->index( ( (qslSentViaDirectFromLogAct->data()).toInt() ) , 0)).data(0).toInt()) ) << endl;
//qDebug() << "LogWindow::slotQSLSentViaDirectFromLog: " << (qslSentViaDirectFromLogAct->data()).toString() << " - Id = " << QString::number( ((logModel->index( ( (qslSentViaDirectFromLogAct->data()).toInt() ) , 0)).data(0).toInt()) ) << endl;
int _qsoId = ((logModel->index( ( (qslSentViaDirectFromLogAct->data()).toInt() ) , 0)).data(0).toInt());
dataProxy->qslSentViaDirect(_qsoId, (QDateTime::currentDateTime()).toString("yyyy/MM/dd"));
@ -368,7 +347,7 @@ void LogWindow::slotQSLSentViaDirectFromLog()
void LogWindow::slotQSLRecViaBureauFromLog()
{
//qDebug() << "LogWindow::slotQSLRecViaBureauFromLog: " << endl;
//qDebug() << "LogWindow::slotQSLRecViaBureauFromLog: " << endl;
int _qsoId = ((logModel->index( ( (qslRecViaBureauFromLogAct->data()).toInt() ) , 0)).data(0).toInt());
qslRecViaBureau(_qsoId);
@ -377,7 +356,7 @@ void LogWindow::slotQSLRecViaBureauFromLog()
void LogWindow::slotQSLRecViaDirectFromLog()
{
//qDebug() << "LogWindow::slotQSLRecViaDirectFromLog: " << (qslRecViaDirectFromLogAct->data()).toString() << " - Id = " << QString::number( ((logModel->index( ( (qslRecViaDirectFromLogAct->data()).toInt() ) , 0)).data(0).toInt()) ) << endl;
//qDebug() << "LogWindow::slotQSLRecViaDirectFromLog: " << (qslRecViaDirectFromLogAct->data()).toString() << " - Id = " << QString::number( ((logModel->index( ( (qslRecViaDirectFromLogAct->data()).toInt() ) , 0)).data(0).toInt()) ) << endl;
int _qsoId = ((logModel->index( ( (qslRecViaDirectFromLogAct->data()).toInt() ) , 0)).data(0).toInt());
qslRecViaDirect(_qsoId);
// Mark Sent, Bureau, date, update log.
@ -386,15 +365,10 @@ void LogWindow::slotQSLRecViaDirectFromLog()
void LogWindow::slotQSOToEditFromLog()
{
//qDebug() << "slotQSOToEditFromLog: " << (qsoToEditFromLogAct->data()).toString() << endl;
//qDebug() << "slotQSOToEditFromLog: " << (qsoToEditFromLogAct->data()).toString() << endl;
//qsoToEdit((logModel->index((qsoToEditFromLogAct->data()).toInt(), 0)).data(0).toInt());
int QSOid = ((logModel->index((qsoToEditFromLogAct->data()).toInt(), 0)).data(0)).toInt();
/*
int row = index.row();
int qsoID = ((logModel->index(row, Qt::DisplayRole)).data(0)).toInt();
emit actionQSODoubleClicked(qsoID);
*/
//int row = index.row();
//qsoToEdit((logModel->index(row, 0)).data(0).toInt());
@ -402,19 +376,19 @@ void LogWindow::slotQSOToEditFromLog()
//TODO: To be added to the logWindow and create an action that emit the QSO id
//TODO: To be added to the logWindow and create an action that emist the QSO id
}
void LogWindow::deleteQSO(const int _qsoID)
{
//qDebug() << "LogWindow::deleteQSO: " << QString::number(_qsoID) << endl;
//qDebug() << "LogWindow::deleteQSO: " << QString::number(_qsoID) << endl;
elogClublog->deleteQSO(dataProxy->getClubLogRealTimeFromId(_qsoID));
dataProxy->deleteQSO(_qsoID);
//logModel->removeRow((delQSOFromLogAct->data()).toInt()); //TODO: This has been replaced by the previous line
//awards->recalculateAwards();
awards->recalculateAwards();
refresh();
//dxccStatusWidget->refresh();
emit updateAwards();
@ -424,7 +398,7 @@ void LogWindow::deleteQSO(const int _qsoID)
void LogWindow::slotQsoDeleteFromLog()
{
//qDebug() << "LogWindow::slotQsoDeleteFromLog: " << (delQSOFromLogAct->data()).toString() << endl;
//qDebug() << "LogWindow::slotQsoDeleteFromLog: " << (delQSOFromLogAct->data()).toString() << endl;
//TODO: To be added to the logWindow and create an action that emist the QSO id
QMessageBox msgBox;
@ -437,11 +411,11 @@ void LogWindow::slotQsoDeleteFromLog()
int QSOid = ((logModel->index((delQSOFromLogAct->data()).toInt(), 0)).data(0)).toInt();
//qDebug() << "LogWindow::slotQsoDeleteFromLog (id): " << QString::number(QSOid) << endl;
//qDebug() << "LogWindow::slotQsoDeleteFromLog (id): " << QString::number(QSOid) << endl;
switch (ret) {
case QMessageBox::Yes:
//qDebug() << "LogWindow::slotQsoDeleteFromLog (id): -1" << endl;
//qDebug() << "LogWindow::slotQsoDeleteFromLog (id): -1" << endl;
deleteQSO(QSOid);
break;
@ -456,14 +430,14 @@ void LogWindow::slotQsoDeleteFromLog()
void LogWindow::qslSentViaBureau(const int _qsoId)
{
//qDebug() << "LogWindow::qslSentViaBureau: " << QString::number(_qsoId) << endl;
//qDebug() << "LogWindow::qslSentViaBureau: " << QString::number(_qsoId) << endl;
dataProxy->qslSentViaBureau(_qsoId, (QDateTime::currentDateTime()).toString("yyyy/MM/dd"));
}
void LogWindow::qslRecViaBureau(const int _qsoId)
{
// //qDebug() << "LogWindow::qslRecViaBureau: " << QString::number(_qsoId) << "/" << (dateTime->currentDateTime()).toString("yyyy/MM/dd") << endl;
// //qDebug() << "LogWindow::qslRecViaBureau: " << QString::number(_qsoId) << "/" << (dateTime->currentDateTime()).toString("yyyy/MM/dd") << endl;
dataProxy->qslRecViaBureau(_qsoId, (QDateTime::currentDateTime()).toString("yyyy/MM/dd"), false);
awards->setAwards(_qsoId); //Update the Award status
@ -474,7 +448,7 @@ void LogWindow::qslRecViaBureau(const int _qsoId)
void LogWindow::qslRecViaDirect(const int _qsoId)
{
//qDebug() << "LogWindow::qslRecViaDirect: " << QString::number(_qsoId) << endl;
//qDebug() << "LogWindow::qslRecViaDirect: " << QString::number(_qsoId) << endl;
dataProxy->qslRecViaDirect(_qsoId, (QDateTime::currentDateTime()).toString("yyyy/MM/dd"), false);
awards->setAwards(_qsoId);
@ -489,22 +463,3 @@ void LogWindow::slotQueryErrorManagement(QString functionFailed, QString errorCo
emit queryError(functionFailed, errorCodeS, errorCodeN, failedQuery);
}
void LogWindow::slotCheckQRZCom()
{
int _qsoId = ((logModel->index( ( (qslRecViaDirectFromLogAct->data()).toInt() ) , 0)).data(0).toInt());
QString _qrz = dataProxy->getCallFromId(_qsoId);
//qDebug() << "LogWindow::sloTCheckQRZCom: " << _qrz << endl;
QString url = "https://www.qrz.com/db/" + _qrz;
QDesktopServices::openUrl(QUrl(url));
}
void LogWindow::slotCheckDXHeatCom()
{
int _qsoId = ((logModel->index( ( (qslRecViaDirectFromLogAct->data()).toInt() ) , 0)).data(0).toInt());
QString _qrz = dataProxy->getCallFromId(_qsoId);
//qDebug() << "LogWindow::slotCheckDXHeatCom(): " << _qrz << endl;
QString url = "https://www.dxheat.com/db/" + _qrz;
QDesktopServices::openUrl(QUrl(url));
}

View File

@ -23,7 +23,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -35,15 +35,14 @@
#include <QSqlQuery>
#include <QSqlRecord>
#include <QSqlRelationalDelegate>
#include <QDesktopServices>
#include "dataproxy_sqlite.h"
#include "logmodel.h"
#include "awards.h"
//#include "dxccstatuswidget.h"
#include "elogclublog.h"
//#include "logviewsortfilterproxymodel.h"
#include "logviewsortfilterproxymodel.h"
//class LogViewSortFilterProxyModel;
class LogViewSortFilterProxyModel;
class LogWindow : public QWidget
{
@ -63,8 +62,7 @@ public:
bool isQSLReceived(const int _qsoId);
bool isQSLSent(const int _qsoId);
//void setProxyModel (const bool _p);
void sortColumn(const int _c);
void setProxyModel (const bool _p);
signals:
void actionQSODoubleClicked(const int _qsoid);
@ -79,6 +77,8 @@ private slots:
void slotDoubleClickLog(const QModelIndex & index);
void slotRighButtonFromLog(const QPoint& pos);
void slotQSLSentViaBureauFromLog();
void slotQSLSentViaDirectFromLog();
void slotQSLRecViaDirectFromLog();
@ -86,8 +86,6 @@ private slots:
void slotQsoDeleteFromLog();
void slotQSOToEditFromLog();
void slotQueryErrorManagement(QString functionFailed, QString errorCodeS, int errorCodeN, QString failedQuery);
void slotCheckQRZCom();
void slotCheckDXHeatCom();
private:
@ -119,13 +117,10 @@ private:
QAction *qslSentViaDirectFromLogAct;
QAction *qslRecViaBureauFromLogAct;
QAction *qslRecViaDirectFromLogAct;
QAction *checkQRZCOMFromLogAct;
QAction *checkDXHeatFromLogAct;
int currentLog;
//LogViewSortFilterProxyModel *proxyModel;
//bool sortingThroughProxyModel;
LogViewSortFilterProxyModel *proxyModel;
};

View File

@ -1,506 +0,0 @@
#include "lotwutilities.h"
#include <QCoreApplication>
#include <QUrl>
#include <QNetworkRequest>
#include <QFile>
//#include <QDebug>
LoTWUtilities::LoTWUtilities(const QString &_klogDir, const QString &_klogVersion, const QString &_parentFunction, DataProxy_SQLite *dp)
{
//qDebug() << "LoTWUtilities::LoTWUtilities(): " << _klogDir << endl;
dataProxy = dp;
util = new Utilities;
manager = new QNetworkAccessManager(this);
reply = nullptr;
file = new QFile;
//url = new QUrl;
klogDir = _klogDir;
klogVersion = _klogVersion;
downloadAborted = false;
stationCallsign.clear();
startDate.clear();
lotwQuery.clear();
lotwUser.clear();
lotwPassword.clear();
fileName = "lotwDownload.adi";
pDialog = new QProgressDialog(nullptr);
pDialog->cancel();
//qDebug() << "LoTWUtilities::LoTWUtilities(): - END" << endl;
}
LoTWUtilities::~LoTWUtilities()
{
//qDebug() << "LoTWUtilities::~LoTWUtilities" << endl;
}
void LoTWUtilities::setFileName(const QString &_fn)
{
//qDebug() << "LoTWUtilities::setFileName: " << _fn << endl;
if (_fn.length()>0)
{
fileName = _fn;
}
//qDebug() << "LoTWUtilities::setFileName - END" << endl;
}
QString LoTWUtilities::getFileName()
{
//qDebug() << "LoTWUtilities::getFileName: " << fileName << endl;
return fileName;
}
bool LoTWUtilities::selectQuery(const int _queryId)
{
//qDebug() << "LoTWUtilities::selectQuery: - Start: " << QString::number(_queryId) << endl;
bool savePassword = true;
if (lotwPassword.length()<1)
{
savePassword = false;
bool ok;
lotwPassword = QInputDialog::getText(nullptr, tr("KLog - LoTW password needed"),
tr("Please enter your LoTW password: "), QLineEdit::Password, "", &ok);
if (!ok)
{
//qDebug() << "LoTWUtilities::selectQuery: - END 1" << endl;
return false;
}
}
lotwQuery = QString("https://lotw.arrl.org/lotwuser/lotwreport.adi?login=%1&password=%2&qso_query=1&qso_qsl=no&qso_owncall=%3&qso_startdate=%4").arg(lotwUser).arg(lotwPassword).arg(stationCallsign).arg(startDate);
if (!savePassword)
{// We delete the password as soon as possible if the user is not willing to save it
lotwPassword = QString();
}
url = QUrl(lotwQuery);
//qDebug() << "LoTWUtilities::selectQuery: - END" << endl;
return true;
}
bool LoTWUtilities::setStationCallSign (const QString &_call)
{
//qDebug() << "LoTWUtilities::setStationCallSign: " << _call << endl;
if (!util->isValidCall(_call))
{
//qDebug() << "LoTWUtilities::setStationCallSign: FALSE " << endl;
return false;
}
if (((dataProxy->getStationCallSignsFromLog(-1)).contains(_call)))
{
//qDebug() << "LoTWUtilities::setStationCallSign: TRUE" << endl;
stationCallsign = _call;
QDate date = dataProxy->getFirstQSODateFromCall(stationCallsign);
//qDebug() << "LoTWUtilities::setStationCallSign: Date: " << startDate << endl;
//date = QDate::fromString(startDate, "yyyy/MM/dd");
if (date.isValid())
{
startDate = date.toString("yyyyMMdd");
//qDebug() << "LoTWUtilities::setStationCallSign: StartDate" << startDate << endl;
}
else
{
startDate.clear();
//qDebug() << "LoTWUtilities::setStationCallSign: StartDate not valid Date" << endl;
return false;
}
//qDebug() << "LoTWUtilities::setStationCallSign: startDate: " << startDate << endl;
return true;
}
//qDebug() << "LoTWUtilities::setStationCallSign: FALSE 2" << endl;
return false;
}
void LoTWUtilities::startRequest(QUrl url)
{
//qDebug() << "LoTWUtilities::startRequest: " << url.toString() << endl;
QByteArray agent = QString("KLog-" + klogVersion).toUtf8();
QNetworkRequest request;
request.setUrl(url);
request.setHeader(QNetworkRequest::UserAgentHeader, agent);
//request.setRawHeader("User-Agent", agent);
//reply = manager->get(QNetworkRequest(url));
reply = manager->get(request);
//qDebug() << "LoTWUtilities::startRequest - 10" << endl;
// Whenever more data is received from the network,
// this readyRead() signal is emitted
connect(reply, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
// Also, downloadProgress() signal is emitted when data is received
connect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(slotDownloadProgress(qint64)));
// This signal is emitted when the reply has finished processing.
// After this signal is emitted,
// there will be no more updates to the reply's data or metadata.
connect(reply, SIGNAL(finished()), this, SLOT(slotFinished()));
//qDebug() << "LoTWUtilities::startRequest: - END" << endl;
}
int LoTWUtilities::download()
{
//qDebug() << "LoTWUtilities::download - Start" << endl;
if (!selectQuery(-1))
{
//qDebug() << "LoTWUtilities::download - END-1" << endl;
return -1;
}
//qDebug() << "LoTWUtilities::download: - 10" << endl;
QFileInfo fileInfo(url.path());
//qDebug() << "LoTWUtilities::download: - 11" << endl;
if (QFile::exists(fileName))
{
//qDebug() << "LoTWUtilities::download: - 12" << endl;
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Question);
msgBox.setWindowTitle(tr("KLog - File exist"));
QString aux = QString(tr("There is a file already existing with the name that will be used.") );
msgBox.setText(tr("The file %1 already exist. Do you want to overwrite?").arg(fileName));
msgBox.setDetailedText(aux);
msgBox.setStandardButtons(QMessageBox::Yes|QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);
int ret = msgBox.exec();
//qDebug() << "LoTWUtilities::download: - 13" << endl;
if (ret == QMessageBox::No)
{
//qDebug() << "LoTWUtilities::download - END- 2" << endl;
return -2;
}
//qDebug() << "LoTWUtilities::download: - 14" << endl;
//file->close();
//file->remove(fileName);
//QFile::remove(fileName);
//qDebug() << "LoTWUtilities::download: - 15" << endl;
}
//qDebug() << "LoTWUtilities::download: - 20 Filename: -" << fileName << "-" << endl;
if (!file->isOpen())
{
//qDebug() << "LoTWUtilities::download: - 21 Filename: -" << endl;
file->setFileName(fileName);
//qDebug() << "LoTWUtilities::download: - 22 Filename: -" << endl;
}
//qDebug() << "LoTWUtilities::download: - 23 Filename: -" << endl;
if (!file->open(QIODevice::WriteOnly))
{
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Warning);
msgBox.setWindowTitle(tr("KLog - Can't write the file"));
QString aux = QString(tr("KLog was not able to save the file %1.\nError returned: %2") ).arg(fileName).arg(file->errorString());
msgBox.setText(tr("The file already %1 exist.").arg(fileName));
msgBox.setDetailedText(aux);
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.exec();
//file->close();
//delete file;
//file = nullptr;
//qDebug() << "LoTWUtilities::download - END - 3" << endl;
return -3;
}
//qDebug() << "LoTWUtilities::download: - 30" << endl;
// used for progressDialog
// This will be set true when canceled from progress dialog
downloadAborted = false;
//qDebug() << "LoTWUtilities::download: - 31" << endl;
//progressDialog = new QProgressDialog(nullptr);
//qDebug() << "LoTWUtilities::download: - 40" << endl;
pDialog->setLabelText(tr("Downloading data to file: %1.").arg(fileName));
//qDebug() << "LoTWUtilities::download: - 41" << endl;
pDialog->setWindowTitle(tr("KLog - LoTW download"));
//qDebug() << "LoTWUtilities::download: - 42" << endl;
pDialog->setWindowModality(Qt::WindowModal);
//qDebug() << "LoTWUtilities::download: - 43" << endl;
pDialog->reset();
//qDebug() << "LoTWUtilities::download: - 44" << endl;
pDialog->setRange(0, 0);
//qDebug() << "LoTWUtilities::download: - 45" << endl;
pDialog->setMinimumDuration(0);
//qDebug() << "LoTWUtilities::download: - 46" << endl;
pDialog->show();
//qDebug() << "LoTWUtilities::download: - 47" << endl;
connect(pDialog, SIGNAL(canceled()), this, SLOT(slotCancelDownload()));
//qDebug() << "LoTWUtilities::download: - 50" << endl;
startRequest(url);
//qDebug() << "LoTWUtilities::download - END" << endl;
return 1;
}
void LoTWUtilities::slotDownloadProgress(qint64 bytesRead) {
//qDebug() << "LoTWUtilities::slotDownloadProgress: " << QString::number(bytesRead) << "/" << QString::number(totalBytes) << endl;
if (downloadAborted)
{
//qDebug() << "LoTWUtilities::slotDownloadProgress: CANCELLED" << endl;
return;
}
pDialog->setValue(bytesRead);
//qDebug() << "LoTWUtilities::slotDownloadProgress - END " << endl;
}
void LoTWUtilities::slotReadyRead()
{
//qDebug() << "LoTWUtilities::slotReadyRead: " << reply->readLine() << endl;
if (file)
{
file->write(reply->readAll());
}
//qDebug() << "LoTWUtilities::slotReadyRead - END" << endl;
}
void LoTWUtilities::slotFinished()
{
//qDebug() << "LoTWUtilities::slotFinished - Started" << endl;
// when canceled
if (downloadAborted)
{
if (file)
{
file->close();
file->remove();
//delete file;
//file = nullptr;
}
//reply->deleteLater();
pDialog->cancel();
reply->close();
//qDebug() << "LoTWUtilities::slotFinished - END Canceled" << endl;
return;
}
// download finished normally
pDialog->cancel();
file->flush();
file->close();
// get redirection url
QVariant redirectionTarget = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if (reply->error())
{
file->remove();
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Warning);
msgBox.setWindowTitle(tr("KLog - Download error"));
QString aux = QString(tr("The downloading error is: %1") ).arg(reply->errorString());
msgBox.setText(tr("There was an error while downloading the file from LoTW."));
msgBox.setDetailedText(aux);
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.exec();
}
else if (!redirectionTarget.isNull())
{
QUrl newUrl = url.resolved(redirectionTarget.toUrl());
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Question);
msgBox.setWindowTitle(tr("KLog - Redirection found"));
QString aux = QString(tr("The remote server redirected our connection to %1") ).arg(newUrl.toString());
msgBox.setText(tr("Do you want to follow the redirection?"));
msgBox.setDetailedText(aux);
msgBox.setStandardButtons(QMessageBox::Yes|QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);
int ret = msgBox.exec();
if (ret == QMessageBox::Yes)
{
url = newUrl;
//reply->deleteLater();
file->open(QIODevice::WriteOnly);
file->resize(0);
startRequest(url);
//qDebug() << "LoTWUtilities::slotFinished - END-1" << endl;
return;
}
}
else
{
//QString fileName = QFileInfo(QUrl(ui->urlEdit->text()).path()).fileName();
//ui->statusLabel->setText(tr("Downloaded %1 to %2.").arg(fileName).arg(QDir::currentPath()));
//ui->downloadButton->setEnabled(true);
//qDebug() << "LoTWUtilities::slotFinished: " << endl;
}
//reply->deleteLater();
parseDownloadedFile(file->fileName());
//delete file;
//file = nullptr;
//qDebug() << "LoTWUtilities::slotReadyRead - END" << endl;
}
void LoTWUtilities::slotCancelDownload()
{
//qDebug() << "LoTWUtilities::slotCancelDownload - Start" << endl;
downloadAborted = true;
reply->abort();
//qDebug() << "LoTWUtilities::slotCancelDownload - END" << endl;
}
void LoTWUtilities::setUser(const QString &_call)
{
//qDebug() << "LoTWUtilities::setUser: " << _call << endl;
lotwUser = _call;
//qDebug() << "LoTWUtilities::setUser: END" << endl;
}
void LoTWUtilities::setPass(const QString &_pass)
{
//qDebug() << "LoTWUtilities::setPass: " << _pass << endl;
lotwPassword = _pass;
//qDebug() << "LoTWUtilities::setPass: END" << endl;
}
bool LoTWUtilities::getIsReady()
{
//qDebug() << "LoTWUtilities::getIsReady: user/station: -" << lotwUser <<"/" << stationCallsign << "-" << endl;
if ((lotwUser.length()>1) && (stationCallsign.length()>1))
{
//qDebug() << "LoTWUtilities::getIsReady: true" << endl;
return true;
}
else
{
//qDebug() << "LoTWUtilities::getIsReady: false" << endl;
return false;
}
}
void LoTWUtilities::parseDownloadedFile(const QString &_fn)
{
//qDebug() << "LoTWUtilities::parseDownloadedFile: " << _fn << endl;
QString _fileName = _fn;
QMessageBox msgBox;
QString aux;
QFile file( _fileName );
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
{
//qDebug() << "LoTWUtilities::parseDownloadedFile File not found" << _fileName << endl;
msgBox.setIcon(QMessageBox::Warning);
msgBox.setWindowTitle(tr("KLog - File not found"));
msgBox.setText(tr("KLog can't find the downloaded file."));
aux = QString(tr("It was not possible for find the file %1 that has been just downloaded.") ).arg(_fn);
msgBox.setDetailedText(aux);
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.exec();
//qDebug() << "LoTWUtilities::parseDownloadedFile: END-1" << endl;
return ;
}
else
{
//qint64 startOfFile = file.pos();
// Look for a Header
bool hasHeader = false;
int numQSO = 0;
QString Lotw_owncall = QString("OWNCALL: %1").arg(stationCallsign.toUpper());
//bool hasOwnCall = false;
//bool hasProgramID = false;
bool userPasswordError = false;
while ((!file.atEnd()) && (!hasHeader))
{
QByteArray line = file.readLine();
QString lineU = line.toUpper();
//qDebug() << "LoTWUtilities::parseDownloadedFile: lineU: " << lineU << endl;
if (lineU.contains("<EOH>"))
{
//qDebug() << "LoTWUtilities::parseDownloadedFile: EOH found" << endl;
hasHeader = true;
}
//else if (lineU.contains("<PROGRAMID:4>LOTW"))
//{
// //qDebug() << "LoTWUtilities::parseDownloadedFile: ProgramID found" << endl;
// hasProgramID = true;
//}
//else if (lineU.contains(Lotw_owncall))
//{
// //qDebug() << "LoTWUtilities::parseDownloadedFile: OWNCALL found" << endl;
// hasOwnCall = true;
//}
else if (lineU.contains("<APP_LOTW_NUMREC:"))
{
QStringList data;
data << lineU.split('>', QString::SkipEmptyParts);
numQSO = (data.at(1)).toInt();
//qDebug() << "LoTWUtilities::parseDownloadedFile: QSOs: " << QString::number(numQSO) << endl;
}
else if (lineU.contains("<I>USERNAME/PASSWORD INCORRECT</I>"))
{
userPasswordError = true;
}
}
// WE HAVE JUST FINISHED TO READ THE HEADER OR THE FILE, IF IT IS NOT AN ADIF
if (!hasHeader || (numQSO<1))
{
//qDebug() << "LoTWUtilities::parseDownloadedFile Header not found" << _fileName << endl;
QString aux;
if (userPasswordError)
{
msgBox.setWindowTitle(tr("KLog - LoTW user/password error"));
msgBox.setText(tr("LoTW server did not recognized your user/password"));
aux = QString(tr("Check your user and password and ensure your are using the right one before trying again.") );
}
else if(numQSO<1)
{
msgBox.setWindowTitle(tr("KLog - LoTW No QSOs "));
msgBox.setText(tr("LoTW sent no QSOs"));
aux = QString(tr("It seems that LoTW has no QSO with the Station Callsign you are using (%1).") ).arg(stationCallsign);
}
else
{
msgBox.setWindowTitle(tr("KLog - LoTW Unknown error"));
msgBox.setText(tr("KLog can't recognize the file that has been downloaded from LoTW."));
aux = QString(tr("Try again and send the downloaded file (%1) to the KLog developer for analysis.") ).arg(_fileName);
}
msgBox.setIcon(QMessageBox::Warning);
msgBox.setDetailedText(aux);
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.exec();
//qDebug() << "LoTWUtilities::parseDownloadedFile: END-2" << endl;
file.remove();
return ;
}
msgBox.setIcon(QMessageBox::Information);
msgBox.setWindowTitle(tr("KLog - LoTW download"));
msgBox.setText(tr("KLog downloaded %1 QSOs successfully. Do you want to update your log with the downloaded data?").arg(QString::number(numQSO)));
aux = QString(tr("Now KLog will process the downloaded QSO and update your local log.") );
msgBox.setDetailedText(aux);
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);
if (msgBox.exec() == QMessageBox::No)
{
//qDebug() << "LoTWUtilities::parseDownloadedFile: END-2" << endl;
return ;
}
//file.seek(startOfFile);
emit actionProcessLoTWDownloadedFile(_fileName);
}
//Procesar los QSOs y meterlos en una tabla? o en un QStringList o alguna otra estructura
//qDebug() << "LoTWUtilities::parseDownloadedFile - END" << endl;
}
void LoTWUtilities::showMessage(const int _messageIcon, const QString &_msg, const QString &_msgExt)
{
}

View File

@ -1,103 +0,0 @@
#ifndef LOTWUTILITIES_H
#define LOTWUTILITIES_H
/***************************************************************************
lotwutilities.h - description
-------------------
begin : apr 2020
copyright : (C) 2020 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 <https://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include <QObject>
#include <QString>
#include <QProgressDialog>
#include <QFile>
#include <QFileInfo>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QSslError>
#include <QTimer>
#include <QUrl>
#include <QMessageBox>
#include <QInputDialog>
#include "dataproxy_sqlite.h"
#include "utilities.h"
class QSslError;
class LoTWUtilities : public QObject
{
Q_OBJECT
public:
explicit LoTWUtilities(const QString &_klogDir, const QString &_klogVersion, const QString &_parentFunction, DataProxy_SQLite *dp);
~LoTWUtilities();
bool setStationCallSign(const QString &_call);
int download();
void setUser(const QString &_call);
void setPass(const QString &_pass);
bool getIsReady();
void setFileName(const QString &_fn);
QString getFileName();
private:
void startRequest(QUrl url);
bool selectQuery(const int _queryId);
void parseDownloadedFile(const QString &_fn);
void showMessage(const int _messageIcon, const QString &_msg, const QString &_msgExt);
Utilities *util;
//void setTarget(const QString& t);
QNetworkAccessManager *manager;
QNetworkReply *reply;
QFile *file;
bool downloadAborted;
qint64 fileSize;
QUrl url;
QProgressDialog *pDialog;
QString klogDir, klogVersion;
QString urld;
QString fileName;
QString stationCallsign;
QString startDate;
QString lotwQuery;
QString lotwUser, lotwPassword;
DataProxy_SQLite *dataProxy;//, *dataProxyPrepared;
private slots:
void slotReadyRead();
void slotFinished();
void slotDownloadProgress(qint64 bytesRead);
void slotCancelDownload();
signals:
void actionProcessLoTWDownloadedFile(QString _fn);
};
#endif // LOTWUTILITIES_H

View File

@ -11,7 +11,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -20,8 +20,6 @@
#include <QTranslator>
#include <cstdlib>
#include <QTextStream>
#include <QCoreApplication>
#include <QCommandLineParser>
//#include <QDebug>
@ -33,10 +31,9 @@
int main(int argc, char *argv[])
{
//qDebug() << "KLog Main: Start! " << endl;
//qDebug() << "KLog Main: " << QSslSocket::supportsSsl() << QSslSocket::sslLibraryBuildVersionString() << QSslSocket::sslLibraryVersionString() << endl;
//qDebug() << "KLog Main: Start! " << endl;
QString version = "0.9.9.1" ;
QDir d1 = QDir();
QString version = "1.1";
Utilities util = Utilities();
QStringList arguments;
QTextStream cout(stdout);
@ -50,9 +47,8 @@ int main(int argc, char *argv[])
//QApplication app(argc, argv);
app.setApplicationName(QString("KLog"));
app.setApplicationVersion(QString(version));
//qDebug() << "KLog Main: -10 " << endl;
//qDebug() << "KLog Main: -10 " << endl;
// Now we check if the user is executing from the command line
arguments.clear();
arguments << app.arguments();
@ -94,8 +90,8 @@ int main(int argc, char *argv[])
return 0;
}
//qDebug() << "KLog Main: Start of translation activities: "<< (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main: Detected language: " << (QLocale::system().name()).left(2) << ".qm" << endl;
//qDebug() << "KLog Main: Start of translation activities: "<< (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main: Detected language: " << (QLocale::system().name()).left(2) << ".qm" << endl;
// Translations begin
QTranslator qtTranslator;
qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
@ -106,8 +102,8 @@ int main(int argc, char *argv[])
//QString msgOSFilePath = QString(); // The OS depending part of the message to be printed if no translation is found.
#if defined(Q_OS_WIN)
//qDebug() << "KLog WIN " << endl;
//qDebug() << "KLog Main: -20 - WIN" << endl;
//qDebug() << "KLog WIN " << endl;
//qDebug() << "KLog Main: -20 - WIN" << endl;
if (QFile::exists(QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name()).left(2) + ".qm") )
{
myappTranslator.load(QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name()).left(2) + ".qm");
@ -124,9 +120,9 @@ int main(int argc, char *argv[])
missingTranslation = true;
//msgOSFilePath = QCoreApplication::applicationDirPath() + "/translations/" ;
}
//qDebug() << "KLog Main: -20 - end WIN " << endl;
//qDebug() << "KLog Main: -20 - end WIN " << endl;
#elif defined(Q_OS_OSX)
//qDebug() << "KLog OSX " << endl;
//qDebug() << "KLog OSX " << endl;
if (QFile::exists(QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name()).left(2) + ".qm") )
{
@ -144,19 +140,19 @@ int main(int argc, char *argv[])
}
#else
//qDebug() << "KLog OTHER OS: " << (QLocale::system()).name() << endl;
//qDebug() << "KLog OTHER OS: " << (QLocale::system()).name() << endl;
if (QFile::exists("klog_" + (QLocale::system().name()).left(2) + ".qm") )
{
myappTranslator.load("klog_" + (QLocale::system().name()).left(2));
}
else if (QFile::exists("/usr/share/klog/translations/klog_" + (QLocale::system().name()).left(2) + ".qm") )
{
//qDebug() << "KLog OTHER -2: " << "/usr/share/klog/klog_" + (QLocale::system().name()).left(2) << endl;
//qDebug() << "KLog OTHER -2: " << "/usr/share/klog/klog_" + (QLocale::system().name()).left(2) << endl;
myappTranslator.load("/usr/share/klog/translations/klog_" + (QLocale::system().name()));
}
else if (QFile::exists(QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name()).left(2) + ".qm"))
{
//qDebug() << "KLog OTHER -3: " << QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name()).left(2) << endl;
//qDebug() << "KLog OTHER -3: " << QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name()).left(2) << endl;
myappTranslator.load(QCoreApplication::applicationDirPath() + "/translations/klog_" + (QLocale::system().name()));
}
@ -171,10 +167,10 @@ int main(int argc, char *argv[])
}
#endif
//qDebug() << "KLog Main: -40 " << endl;
//qDebug() << "KLog Main: -40 " << endl;
if (missingTranslation)
{
//qDebug() << "KLog Main: Translation missing! " << endl;
//qDebug() << "KLog Main: Translation missing! " << endl;
QMessageBox msgBox;
QString urlTranslate = QString();
urlTranslate = "<p><a href=\"https://translate.google.com/?sl=auto&tl=auto#en/auto/No%20translation%20files%20for%20your%20language%20have%20been%20found%20so%20KLog%20will%20be%20shown%20in%20English.%0A%0AIf%20you%20have%20the%20klog_en.qm%20file%20for%20your%20language%2C%20you%20can%20copy%20it%20in%20the%20%2Fhome%2Fdevel%2F.klog%2F%20folder%20and%20restart%20KLog%20again.%0A%0A%20If%20you%20want%20to%20help%20to%20translate%20KLog%20into%20your%20language%2C%20please%20contact%20the%20author.\">TRANSLATE</a></p>";
@ -197,10 +193,10 @@ int main(int argc, char *argv[])
}
//qDebug() << "KLog Main-1" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main-1" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
app.installTranslator(&myappTranslator);
//qDebug() << "KLog Main: End of translation activities: "<< (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main: End of translation activities: "<< (QTime::currentTime()).toString("HH:mm:ss") << endl;
// Traslations end
QString configFileName, klogDir;
@ -208,51 +204,51 @@ int main(int argc, char *argv[])
klogDir = util.getHomeDir();
configFileName = util.getCfgFile();
//qDebug() << "KLog Main-10" << endl;
//qDebug() << "KLog Main-10" << endl;
//qDebug() << "KLog Main: Setting klog dir: " << (QTime::currentTime()).toString("HH:mm:ss")<< endl;;
//qDebug() << "KLog Main: Setting klog dir: " << (QTime::currentTime()).toString("HH:mm:ss")<< endl;;
if (!QDir::setCurrent (klogDir) )
{
//qDebug() << "MAIN: KLogDir does not exist.... creating " << endl;
//qDebug() << "MAIN: KLogDir does not exist.... creating " << endl;
if (d1.mkdir(klogDir))
{
if (QDir::setCurrent (klogDir) )
{
//qDebug() << "MAIN: KLogDir has just been created and pointed " << endl;
//qDebug() << "MAIN: KLogDir has just been created and pointed " << endl;
}
else
{
//qDebug() << "MAIN: KLogDir has just been created and pointed FAILED! " << endl;
//qDebug() << "MAIN: KLogDir has just been created and pointed FAILED! " << endl;
}
}
else
{
//qDebug() << "MAIN: KLogDir can not be created?? " << endl;
//qDebug() << "MAIN: KLogDir can not be created?? " << endl;
}
}
else
{
//qDebug() << "MAIN: KLogDir already existed!! " << endl;
//qDebug() << "MAIN: KLogDir already existed!! " << endl;
}
//qDebug() << "KLog Main: Setting klog dir - finished: " << (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main: Setting klog dir - finished: " << (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main: Setting config file: " << (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main: Setting config file: " << (QTime::currentTime()).toString("HH:mm:ss") << endl;
QPixmap pixmap(":img/klog_512x512.png");
//qDebug() << "KLog Main-51" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main-51" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
QSplashScreen splash(pixmap);
if(!QFile::exists(configFileName))
{
//qDebug() << "MAIN: Starting wizard... " << endl;
//qDebug() << "MAIN: Starting wizard... " << endl;
StartWizard *wizard = new StartWizard(klogDir, version);
wizard->setModal(true);
int inMemory = wizard->exec();
//qDebug() << "MAIN: Wizard inMemory: " << QString::number(inMemory) << endl;
//qDebug() << "MAIN: Wizard inMemory: " << QString::number(inMemory) << endl;
if (inMemory == 1)
{
//qDebug() << "MAIN: Wizard accepted " << QString::number(inMemory) << " ... Will run in Memory " << endl;
qDebug() << "MAIN: Wizard accepted " << QString::number(inMemory) << " ... Will run in Memory " << endl;
MainWindow mw(klogDir, version);
mw.init();
splash.finish(&mw);
@ -264,7 +260,7 @@ int main(int argc, char *argv[])
else
{
//qDebug() << "MAIN: Wizard cancelled " << QString::number(inMemory) << " ... should close " << endl;
qDebug() << "MAIN: Wizard cancelled " << QString::number(inMemory) << " ... should close " << endl;
QMessageBox msgBox;
msgBox.setText(QObject::tr("Install wizard was canceled before completing..."));
@ -310,21 +306,25 @@ int main(int argc, char *argv[])
else
{
//qDebug() << "Main: Start of DB Activities" << endl;
//qDebug() << "Main: Start of DB Activities" << endl;
DataBase *db = new DataBase(Q_FUNC_INFO, version, util.getKLogDBFile());
//qDebug() << "Main: After Start of DB Activities" << endl;
//qDebug() << "Main: After Start of DB Activities" << endl;
if (!db->createConnection(Q_FUNC_INFO))
{
//qDebug() << "Main: Conection not created" << endl;
//qDebug() << "Main: Conection not created" << endl;
return -1; // Exits with an error; no DB has been created
}
else
{
db->updateIfNeeded(); // Check if we need to update the DB
//qDebug() << "Main: DB Updated" << endl;
//qDebug() << "Main: DB Updated" << endl;
}
db->~DataBase();
//qDebug() << "Main: End of DB Activities" << endl;
//qDebug() << "KLog Main-50" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main-52" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
splash.show();
//qDebug() << "KLog Main-100" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
MainWindow mw(klogDir, version);
@ -333,16 +333,16 @@ int main(int argc, char *argv[])
mw.checkIfNewVersion();
mw.recommendBackupIfNeeded();
//qDebug() << "KLog Main-101" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main-101" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
mw.show();
//qDebug() << "KLog Main-101.5" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main-101.5" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main-102" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main-102" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
return app.exec();
//qDebug() << "KLog Main-103" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main-103" << (QTime::currentTime()).toString("HH:mm:ss") << endl;
}
//qDebug() << "KLog Main-END: " << (QTime::currentTime()).toString("HH:mm:ss") << endl;
//qDebug() << "KLog Main-END: " << (QTime::currentTime()).toString("HH:mm:ss") << endl;
//return app.exec();
}

View File

@ -1,675 +0,0 @@
#include "mainqsoentrywidget.h"
MainQSOEntryWidget::MainQSOEntryWidget(DataProxy_SQLite *dp, QWidget *parent) : QWidget(parent)
{
//qDebug()<< "MainQSOEntryWidget::MainQSOEntryWidget " << endl;
upAndRunning = false;
dataProxy = dp;
qrzLineEdit = new QLineEdit;
bandComboBox = new QComboBox;
modeComboBox = new QComboBox;
dateEdit = new QDateEdit;
timeEdit = new QTimeEdit;
realTime =true;
realtimeCheckBox = new QCheckBox;
enabledCR = realtimeCheckBox->backgroundRole();
OKButton = new QPushButton(tr("&Add"), this);
clearButton = new QPushButton(tr("&Clear"), this);
timer = new QTimer(this);
util = new Utilities;
logSeverity = 7; //7 Debug /0=emergency or no debug
createUI();
setInitialData();
//qDebug()<< "MainQSOEntryWidget::MainQSOEntryWidget: - END" << endl;
}
void MainQSOEntryWidget::createUI()
{
//qDebug()<< "MainQSOEntryWidget::createUI" << endl;
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
qrzLineEdit->setToolTip(tr("QRZ of the QSO."));
bandComboBox->setToolTip(tr("Band of the QSO."));
modeComboBox->setToolTip(tr("Mode of the QSO."));
dateEdit->setToolTip(tr("Date of the QSO."));
timeEdit->setToolTip(tr("Time of the QSO."));
OKButton->setToolTip(tr("Add the QSO to the log."));
clearButton->setToolTip(tr("Clears the QSO entry."));
realtimeCheckBox->setToolTip(tr("KLog will show real time if enabled."));
QHBoxLayout *TimeLayout = new QHBoxLayout;
TimeLayout->addWidget(dateEdit);
TimeLayout->addWidget(timeEdit);
TimeLayout->addWidget(realtimeCheckBox);
QHBoxLayout *BandModeLayout = new QHBoxLayout;
BandModeLayout->addWidget(bandComboBox);
BandModeLayout->addWidget(modeComboBox);
QHBoxLayout *QrzBandModeLayout = new QHBoxLayout;
QrzBandModeLayout->addWidget(qrzLineEdit);
QrzBandModeLayout->addLayout(BandModeLayout);
qrzgroupBox = new QGroupBox(tr("QRZ"));
qrzgroupBox->setFlat(true);
QVBoxLayout *qrzvbox = new QVBoxLayout;
qrzvbox->addLayout(QrzBandModeLayout);
qrzgroupBox->setLayout(qrzvbox);
QHBoxLayout *buttonsLayout = new QHBoxLayout;
buttonsLayout->addWidget(OKButton);
buttonsLayout->addWidget(clearButton);
dateEdit->setDisplayFormat("yyyy/MM/dd");
timeEdit->setDisplayFormat("HH:mm:ss");
QGridLayout *widgetLayout = new QGridLayout;
widgetLayout->addWidget(qrzgroupBox, 0, 0, 1, 0);
widgetLayout->addLayout(TimeLayout, 1, 0);
widgetLayout->addLayout(buttonsLayout,1, 1);
setLayout(widgetLayout);
palRed.setColor(QPalette::Text, Qt::red);
palBlack.setColor(QPalette::Text, Qt::black);
connect(qrzLineEdit, SIGNAL(returnPressed()), this, SLOT(slotOKButtonClicked() ) );
connect(qrzLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotQRZTextChanged() ) );
connect(bandComboBox, SIGNAL(currentIndexChanged (int)), this, SLOT(slotBandComboBoxChanged() ) ) ;
connect(modeComboBox, SIGNAL(currentIndexChanged (int)), this, SLOT(slotModeComboBoxChanged() ) ) ;
connect(OKButton, SIGNAL(clicked()), this, SLOT(slotOKButtonClicked() ) );
connect(clearButton, SIGNAL(clicked()), this, SLOT(slotClearButtonClicked() ) );
connect(timer, SIGNAL(timeout()), this, SLOT(slotUpdateTime()) );
connect(realtimeCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckBoxClicked()) );
//qDebug()<< "MainQSOEntryWidget::createUI-END" << endl;
}
void MainQSOEntryWidget::slotCheckBoxClicked()
{
if (realtimeCheckBox->isChecked())
{
realTime = true;
timeEdit->setBackgroundRole(enabledCR);
}
else
{
realTime = false;
timeEdit->setBackgroundRole(QPalette::BrightText);
}
}
void MainQSOEntryWidget::setCleaning (const bool _c)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
cleaning = _c;
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
}
void MainQSOEntryWidget::slotQRZTextChanged()
{
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: " << qrzLineEdit->text() << " / Length: " << QString::number((qrzLineEdit->text()).size()) << "###### START ######" << endl;
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
if ((qrzLineEdit->text()).length()<1)
{
slotClearButtonClicked();
emit debugLog(Q_FUNC_INFO, "END-1", logSeverity);
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: QRZ <1 - END" << endl;
return;
}
int cursorP = qrzLineEdit->cursorPosition();
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: cursor position: " << QString::number(cursorP) << endl;
qrzLineEdit->setText((qrzLineEdit->text()).toUpper());
if (cleaning)
{
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: Cleaning - END" << endl;
emit debugLog(Q_FUNC_INFO, "END-2", logSeverity);
return;
}
if (qrzAutoChanging)
{
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: qrzAutoChanging - END" << endl;
qrzAutoChanging = false;
emit debugLog(Q_FUNC_INFO, "END-3", logSeverity);
return;
}
qrzAutoChanging = true;
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: cursor position.1: " << QString::number(cursorP) << endl;
if ( (qrzLineEdit->text()).endsWith(' ') )
{/*Remove the space and moves the focus to SRX to write the RX exchange*/
previousQRZ = (qrzLineEdit->text()).simplified();
qrzLineEdit->setText(previousQRZ);
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: Space detected" << endl;
}
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: Simplifiying & Capitalizing" << endl;
qrzLineEdit->setText(((qrzLineEdit->text())).simplified());
qrzLineEdit->setText((qrzLineEdit->text()).remove(" "));
//qrzLineEdit->setText((qrzLineEdit->text()).toUpper());
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: checking for invalid chars" << endl;
//TODO: This validCharactersInCall may be removed?
InValidCharsInPrevCall = validCharactersInCall(qrzLineEdit->text());
if (!util->isValidCall(qrzLineEdit->text()))
{
qrzLineEdit->setPalette(palRed);
//emit showInfoLabel(tr("QRZ not valid"));
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: QRZ not valid - END" << endl;
emit debugLog(Q_FUNC_INFO, "END-4", logSeverity);
//return;
}
else
{
qrzLineEdit->setPalette(palBlack);
//emit showInfoLabel(tr(""));
}
/*
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: checking for length" << endl;
if (((qrzLineEdit->text()).length() < 1))
{ // If QRZ box is blank, Information labels should be cleared.
slotClearButtonClicked();
emit debugLog(Q_FUNC_INFO, "END-5", logSeverity);
return;
}
*/
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: checking for modify or length<1" << endl;
if (qrzSmallModDontCalculate)
//if ((modify) || ((qrzLineEdit->text()).length() < 1) || (qrzSmallModDontCalculate))
{
//qDebug() << "MainQSOEntryWidget::slotQRZTextChanged: qrzSmallModDontCalculate < 1" << endl;
qrzSmallModDontCalculate=false;
emit debugLog(Q_FUNC_INFO, "END-6", logSeverity);
return;
}
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: running..." << endl;
qrzSmallModDontCalculate = true; // A kind of flag to prevent multiple calls to this method.
currentQrz = qrzLineEdit->text();
if ((currentQrz).count('\\'))
{ // Replaces \ by / to ease operation.
currentQrz.replace(QChar('\\'), QChar('/'));
qrzLineEdit->setText(currentQrz);
}
currentQrz = qrzLineEdit->text();
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: cursor position.3: " << QString::number(cursorP) << endl;
if (cursorP>currentQrz.length())
{// A Space that has been removed without updating the cursor
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: cursorP > currentQRZ.length" << endl;
}
else
{
if (cursorP==0)
{
}
else if ((currentQrz.at(cursorP-1)).isSpace())
{
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: cursor position.5: " << QString::number(cursorP) << endl;
previousQRZ = currentQrz.remove(cursorP-1, 1);
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: cursor position.6: " << QString::number(cursorP) << endl;
cursorP--;
//qDebug()<< "MainQSOEntryWidget::slotQRZTextChanged: cursor position.7: " << QString::number(cursorP) << endl;
qrzLineEdit->setText(previousQRZ);
}
}
currentQrz = qrzLineEdit->text();
//qDebug() << "MainQSOEntryWidget::slotQRZTextChanged: Emitting: " << currentQrz << endl;
emit currentQRZSignal(currentQrz);
qrzSmallModDontCalculate = false; // If the text has not been modified in this method
//qDebug() << "MainQSOEntryWidget::slotQRZTextChanged: cursorP at the end : " << QString::number(cursorP) << endl;
qrzLineEdit->setCursorPosition(cursorP);
qrzAutoChanging = false;
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
//qDebug() << "MainQSOEntryWidget::slotQRZTextChanged: END" << endl;
}
void MainQSOEntryWidget::setCurrentQRZ(const QString &_qrz)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
currentQrz = _qrz;
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
}
void MainQSOEntryWidget::slotBandComboBoxChanged(){
//qDebug() << "MainQSOEntryWidgetslotBandComboBoxChanged: " << endl;
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
emit bandChanged(bandComboBox->currentText());
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
//qDebug() << "MainQSOEntryWidgetslotBandComboBoxChanged: END" << endl;
}
void MainQSOEntryWidget::slotModeComboBoxChanged()
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
emit modeChanged(modeComboBox->currentText());
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
}
void MainQSOEntryWidget::slotOKButtonClicked()
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
if ((qrzLineEdit->text()).length()<1)
{
return;
}
emit OKClicked();
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
}
void MainQSOEntryWidget::slotClearButtonClicked()
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
clear();
emit clearForNextQSOSignal();
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
}
void MainQSOEntryWidget::clear()
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
cleaning = true;
OKButton->setText(tr("&Add"));
qrzLineEdit->clear();
qrzLineEdit->setFocus(Qt::OtherFocusReason);
cleaning = false;
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
}
void MainQSOEntryWidget::setInitialData()
{
//qDebug()<< "MainQSOEntryWidget::setInitialData" << endl;
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
//Default band/modes
modify = false;
qrzAutoChanging = false;
InValidCharsInPrevCall = false;
qrzSmallModDontCalculate=false;
previousQRZ = QString();
bands.clear();
modes.clear();
bands << "10M" << "15M" << "20M" << "40M" << "80M" << "160M";
modes << "SSB" << "CW" << "RTTY";
setBands(bands);
setModes(modes);
selectDefaultBand(true);
selectDefaultMode(true);
dateEdit->setDate(QDate::currentDate());
timeEdit->setTime(QTime::currentTime());
UTCTime = true;
//realTime = true;
timer->start(1000);
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
//qDebug()<< "MainQSOEntryWidget::setInitialData-END" << endl;
}
void MainQSOEntryWidget::setBands(const QStringList _bands)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
//qDebug()<< "MainQSOEntryWidget::setBands" << endl;
bands.clear();
bands = _bands;
bands.removeDuplicates();
bands = dataProxy->sortBandNamesBottonUp(bands);
bandComboBox->clear();
bandComboBox->addItems(bands);
selectDefaultBand(true);
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
//qDebug()<< "MainQSOEntryWidget::setBands-END" << endl;
}
void MainQSOEntryWidget::setModes(const QStringList _modes)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
modes.clear();
modes = _modes;
modes.removeDuplicates();
modes.sort();
modeComboBox->clear();
modeComboBox->addItems(modes);
selectDefaultMode(true);
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
}
QStringList MainQSOEntryWidget::getModes()
{
return modes;
}
bool MainQSOEntryWidget::setBand(const QString &_band)
{
//qDebug() << "MainQSOEntryWidget::setBand: " << _band << endl;
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
if (bandComboBox->findText(_band, Qt::MatchCaseSensitive) < 0)
{
//qDebug() << "MainQSOEntryWidget::setBand-1: Band not found " << _band << endl;
emit debugLog(Q_FUNC_INFO, "END-1", logSeverity);
return false;
}
else
{
bandComboBox->setCurrentIndex(bandComboBox->findText(_band, Qt::MatchCaseSensitive));
emit debugLog(Q_FUNC_INFO, "END-2", logSeverity);
//qDebug() << "MainQSOEntryWidget::setBand-2: " << _band << endl;
return true;
}
}
bool MainQSOEntryWidget::setMode(const QString &_mode)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
//qDebug() << "MainQSOEntryWidget::setMode: " << _mode << endl;
if (modeComboBox->findText(_mode, Qt::MatchCaseSensitive) < 0)
{
emit debugLog(Q_FUNC_INFO, "END-1", logSeverity);
return false;
}
else
{
modeComboBox->setCurrentIndex(modeComboBox->findText(_mode, Qt::MatchCaseSensitive));
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
return true;
}
}
bool MainQSOEntryWidget::setQRZ(const QString &_qrz)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
//TODO: Add validations to prevent that non valid qrz are sent from the outside of this function or at least manage this appropriately.
qrzLineEdit->setText(_qrz.toUpper());
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
return false;
}
bool MainQSOEntryWidget::setDate(const QDate _date)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
if (_date.isValid())
{
dateEdit->setDate(_date);
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
return true;
}
else
{
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
return false;
}
}
bool MainQSOEntryWidget::setTime(const QTime _time)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
if (_time.isValid())
{
timeEdit->setTime(_time);
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
return true;
}
else
{
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
return false;
}
}
QString MainQSOEntryWidget::getQrz()
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
return (qrzLineEdit->text()).toUpper();
}
QString MainQSOEntryWidget::getBand(const int _b)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
if (_b<0)
{
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
return bandComboBox->currentText();
}
else
{
if (bandComboBox->count()>=_b)
{
emit debugLog(Q_FUNC_INFO, "END-1", logSeverity);
return bandComboBox->itemText(_b);
}
else
{
emit debugLog(Q_FUNC_INFO, "END-2", logSeverity);
return bandComboBox->currentText();
}
}
}
QString MainQSOEntryWidget::getMode(const int _m)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
if (_m<0)
{
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
return modeComboBox->currentText();
}
else
{
if (modeComboBox->count()>=_m)
{
emit debugLog(Q_FUNC_INFO, "END-1", logSeverity);
return modeComboBox->itemText(_m);
}
else
{
emit debugLog(Q_FUNC_INFO, "END-2", logSeverity);
return modeComboBox->currentText();
}
}
}
QDate MainQSOEntryWidget::getDate()
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
return dateEdit->date();
}
QTime MainQSOEntryWidget::getTime()
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
return timeEdit->time();
}
void MainQSOEntryWidget::setRealTime(const bool _realTime)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
realtimeCheckBox->setChecked(_realTime);
realTime = _realTime;
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
}
void MainQSOEntryWidget::setUTC(const bool _utc)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
UTCTime = _utc;
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
}
void MainQSOEntryWidget::setModify(const bool _modify)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
modify = _modify;
if (modify)
{
realTime = realtimeCheckBox->isChecked();
OKButton->setText(tr("&Modify"));
realtimeCheckBox->setChecked(false);
}
else
{
OKButton->setText(tr("&Add"));
realtimeCheckBox->setChecked(realTime);
}
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
}
void MainQSOEntryWidget::slotUpdateTime()
{
//qDebug()<< "MainQSOEntryWidget::slotUpdateTime" << endl;
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
if ( (!modify) && (realTime) )
{
//qDebug()<< "MainQSOEntryWidget::slotUpdateTime - Real Time & update" << endl;
if (UTCTime)
{
dateEdit->setDate(QDateTime::currentDateTime().toUTC().date());
timeEdit->setTime(QDateTime::currentDateTime().toUTC().time());
}
else
{
dateEdit->setDate(QDateTime::currentDateTime().date());
timeEdit->setTime(QDateTime::currentDateTime().time());
}
}
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
}
bool MainQSOEntryWidget::validCharactersInCall(const QString &_qrz)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
for (int i = 0; i<_qrz.size();i++)
{
if (!( ((_qrz.at(i)).isLetterOrNumber()) || (_qrz.at(i)=='\\') || (_qrz.at(i)=='/') ))
{
emit debugLog(Q_FUNC_INFO, "END-1", logSeverity);
return false;
}
}
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
return true;
}
bool MainQSOEntryWidget::isModeExisting(const QString &_m)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
if (modeComboBox->findText(_m, Qt::MatchCaseSensitive) >= 0)
{
emit debugLog(Q_FUNC_INFO, "END-1", logSeverity);
return true;
}
else
{
emit debugLog(Q_FUNC_INFO, "END-2", logSeverity);
return false;
}
}
bool MainQSOEntryWidget::isBandExisting(const QString &_b)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
if (bandComboBox->findText(_b, Qt::MatchCaseSensitive) >= 0)
{
emit debugLog(Q_FUNC_INFO, "END-1", logSeverity);
return true;
}
else
{
emit debugLog(Q_FUNC_INFO, "END-2", logSeverity);
return false;
}
}
void MainQSOEntryWidget::setUpAndRunning(const bool _u)
{
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
upAndRunning = _u;
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
}
void MainQSOEntryWidget::selectDefaultBand(const bool _init)
{
//qDebug() << "MainQSOEntryWidget::selectDefaultBand" << endl;
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
if ((upAndRunning) || (!_init))
{
emit debugLog(Q_FUNC_INFO, "END-1", logSeverity);
//qDebug() << "MainQSOEntryWidgetselectDefaultBand-END-1" << endl;
return;
}
QString aux;
aux = QString();
int defaultBand = dataProxy->getMostUsedBand(-1); //TODO: The log could be defined here
//qDebug() << "MainQSOEntryWidget::selectDefaultBand: " << QString::number(defaultBand) << dataProxy->getNameFromBandId (defaultBand)<< endl;
if (defaultBand<1)
{
defaultBand = dataProxy->getIdFromBandName(getBand(0));
}
aux = dataProxy->getNameFromBandId(defaultBand);
setBand(aux);
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
//qDebug() << "MainQSOEntryWidgetselectDefaultBand_END" << endl;
}
void MainQSOEntryWidget::selectDefaultMode(const bool _init)
{
//qDebug() << "MainQSOEntryWidgetselectDefaultMode" << endl;
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
if ((upAndRunning) || (!_init))
{
emit debugLog(Q_FUNC_INFO, "END-1", logSeverity);
return;
}
int defaultMode = dataProxy->getMostUsedMode(-1); //TODO: The log could be defined here
//qDebug() << "MainQSOEntryWidgetselectDefaultMode: " << QString::number(defaultMode) << endl;
if (defaultMode < 1)
{
defaultMode = dataProxy->getSubModeIdFromSubMode(getBand(0));
}
setMode(dataProxy->getNameFromSubModeId(defaultMode));
//modeComboBox->setCurrentIndex(modeComboBox->findText(dataProxy->getNameFromSubModeId(defaultMode)));
//qDebug() << "MainQSOEntryWidgetselectDefaultMode3: " << QString::number(defaultMode) << endl;
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
//qDebug() << "MainQSOEntryWidgetselectDefaultMode-END" << endl;
}

View File

@ -1,128 +0,0 @@
#ifndef MAINQSOENTRYWIDGET_H
#define MAINQSOENTRYWIDGET_H
/***************************************************************************
mainqsoentrywidget.h - description
-------------------
begin : january 2020
copyright : (C) 2020 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 <https://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include <QObject>
#include <QWidget>
#include <QtWidgets>
#include "dataproxy_sqlite.h"
#include "utilities.h"
class MainQSOEntryWidget : public QWidget
{
Q_OBJECT
public:
explicit MainQSOEntryWidget(DataProxy_SQLite *dp, QWidget *parent = nullptr);
void setBands(const QStringList _bands);
void setModes(const QStringList _modes);
bool setBand(const QString &_band);
bool setMode(const QString &_mode);
bool setQRZ(const QString &_qrz);
void setCurrentQRZ(const QString &_qrz);
bool setDate(const QDate _date);
bool setTime(const QTime _time);
void setCleaning (const bool _c);
bool isModeExisting(const QString &_m);
bool isBandExisting(const QString &_b);
QString getQrz();
QString getBand(const int _b=-1);
QString getMode(const int _m=-1);
QStringList getModes();
QDate getDate();
QTime getTime();
void setRealTime(const bool _realTime);
void setUTC(const bool _utc);
void setModify(const bool _modify);
void setUpAndRunning(const bool _u);
void selectDefaultBand(const bool _init = false);
void selectDefaultMode(const bool _init = false);
void clear();
protected:
// void keyPressEvent(QKeyEvent *event);
signals:
void debugLog (QString _func, QString _msg, int _level);
void showInfoLabel(QString _msg);
void currentQRZSignal(QString _msg);
void clearForNextQSOSignal();
void bandChanged(QString _band);
void modeChanged(QString _mode);
void OKClicked();
private slots:
void slotUpdateTime();
void slotQRZTextChanged();
void slotBandComboBoxChanged();
void slotModeComboBoxChanged();
void slotOKButtonClicked();
void slotClearButtonClicked();
void slotCheckBoxClicked();
//void slotRealTimeCheckBoxChanged();
private:
void createUI();
void setInitialData();
bool validCharactersInCall(const QString &_qrz);
void clearForNextQSO();
DataProxy_SQLite *dataProxy;
QGroupBox *qrzgroupBox;//, *searchgroupBox;
QLineEdit *qrzLineEdit;
QComboBox *bandComboBox, *modeComboBox;
QDateEdit *dateEdit;
QTimeEdit *timeEdit;
QPushButton *OKButton, *clearButton;
QCheckBox *realtimeCheckBox;
int logSeverity;
bool cleaning;
bool qrzAutoChanging;
bool InValidCharsInPrevCall;
bool qrzSmallModDontCalculate;
bool upAndRunning;
QString previousQRZ;
QString currentQrz;
QStringList bands, modes;
QTimer *timer;
bool UTCTime, modify, realTime;
QPalette palRed, palBlack; // To paint Text in red or black(normal)
Utilities *util;
QPalette::ColorRole enabledCR, disabledCR;
};
#endif // MAINQSOENTRYWIDGET_H

File diff suppressed because it is too large Load Diff

View File

@ -9,20 +9,20 @@
***************************************************************************/
/*****************************************************************************
* This file is part of KLog. *
* This file is part of KLog. *
* *
* KLog is free software: you can redistribute it and/or modify *
* 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, *
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -38,7 +38,6 @@
#include "setupdialog.h"
//#include "helpaboutdialog.h"
#include "aboutdialog.h"
//#include "dxccsummarydialog.h"
#include "tipsdialog.h"
#include "world.h"
#include "filemanager.h"
@ -55,7 +54,6 @@
#include "mainwindowinputothers.h"
#include "mainwindowinputeqsl.h"
#include "mainwindowinputqsl.h"
#include "mainqsoentrywidget.h"
#include "elogclublog.h"
#include "utilities.h"
#include "downloadcty.h"
@ -71,14 +69,11 @@
#include "statisticswidget.h"
#include "updatesatsdata.h"
#include "hamlibclass.h"
#include "pstrotatorsupport.h"
#include "lotwutilities.h"
#include "widgets/rotator.h"
#include "widgets/adiflotwexportwidget.h"
#include "widgets/showadifimportwidget.h"
//#include "worldmapwidget.h"
class QTimer;
class QDateTime;
@ -130,7 +125,6 @@ enum
CQ_WPX_RTTY = 5
};
*/
//enum ExportMode {ModeLotW, ModeADIF};
class MainWindow : public QMainWindow
{
@ -149,10 +143,10 @@ private slots:
void slotClearNoMorErrorShown();
void slotQueryErrorManagement(QString functionFailed, QString errorCodeS, int errorCodeN, QString queryFailed);
void slotQRZReturnPressed();
//void slotQRZSpacePressed();
void slotQRZTextChanged(QString _qrz);
//void slotSRXTextChanged();
//void slotSTXTextChanged();
void slotQRZSpacePressed();
void slotQRZTextChanged();
void slotSRXTextChanged();
void slotSTXTextChanged();
void slotUpdateLocator(QString _loc);
void slotLocatorTextChanged();
//void slotMyLocatorTextChanged();
@ -169,19 +163,16 @@ private slots:
void slotToolLoTWMarkAllQueued();
void slotToolLoTWMarkAllYesThisLog();
void slotToolLoTWMarkAllYes();
void slotLoTWDownloadedFileProcess(const QString &_fn);
//void slotModeComboBoxChanged();
//void slotBandComboBoxChanged();
void slotModeComboBoxChanged();
void slotBandComboBoxChanged();
//void slotIOTAComboBoxChanged();
//void slotOperatingYearComboBoxChanged();
void slotOKButtonClicked();
//void slotSpotItButtonClicked();
void slotSpotItButtonClicked();
void slotClearButtonClicked();
void slotBandChanged (const QString &_b);
void slotModeChanged (const QString &_m);
void slotRefreshDXCCWidget();
//void slotUpdateTime();
void slotUpdateTime();
void slotLogWinShow();
void slotLogRefresh();
//void slotScoreWinShow();
@ -192,21 +183,14 @@ private slots:
void slotSetup(const int _page=0);
//void slotrstTXTextChanged();
//void slotrstRXTextChanged();
void slotrstTXTextChanged();
void slotrstRXTextChanged();
void slotADIFExport();
//void slotLoTWImport();
//void slotLoTWExport();
void slotLoTWImport();
void slotLoTWExport();
void slotLoTWDownload();
void slotADIFExportSelection(const QString &_st, const QDate &_startDate, const QDate &_endDate, const ExportMode _eM);
//void slotADIFExportPeriod(const QString &_st, const QDate &_startDate, const QDate &_endDate, const ExportMode _eM);
void slotADIFExportAll();
void slotADIFImport();
void slotRQSLExport();
void slotReceiveQSOListToShowFromFile(QStringList _qs);
//void slotCabrilloExport();
//void slotQSLViaTextChanged();
void slotTimeOutInfoBars(); // Clears the infoLabels when the timeout emits the signal
@ -216,8 +200,7 @@ private slots:
void slotUpdateCTYDAT();
void slotUpdateSATSDAT();
void slotShowStats();
//void slotShowDXCCSummary();
void slotWorldReload(const bool _b);
void slotWorldReload();
void slotExitFromSlotDialog(const int exitID);
void exitQuestion();
@ -237,13 +220,10 @@ private slots:
//void slotHelpHelpAction();
void slotHelpAboutAction();
void slotHelpCheckUpdatesAction();
//void slotHelpCheckUpdatesAction();
void slotAboutQt();
void slotTipsAction();
// MainQSOEntryWidget
void slotShowInfoLabel(const QString _m);
//void slotClearForNextQSO();
// To support AwardsWidget
//void slotRecalculateAwardsButtonClicked();
void slotAwardsWidgetSetLog();
@ -271,7 +251,7 @@ private slots:
void slotElogClubLogDisable(const bool _b);
//CLUBLOG
void slotShowSoftUpdateResults(const bool _b); // Software Update: Receives the signal to see if it is needed or not to update
//void slotShowSoftUpdateResults(const bool _b); // Software Update: Receives the signal to see if it is needed or not to update
//SATELLITE
//void slotSatBandTXComboBoxChanged(const QString _q);
@ -286,8 +266,6 @@ private slots:
void slotHamlibModeChanged(const QString &_m);
//void slotHamlibModeNotADIF();
// PST Rotator
void slotRotatorShow();
// WORLD MAP
//void slotWorldMapShow();
@ -306,25 +284,18 @@ private slots:
const QString &_dx_grid, const QString &_time_off, const QString &_report_sent, const QString &_report_rec,
const QString &_tx_power, const QString &_comments, const QString &_name, const QString &_time_on, const QString &_de_call, const QString &_de_grid);
//void slotTipsFindQSL2QSO();
//void slotTipsFillInDXCC();
//void slotsTipsFillQSO();
void slotCaptureDebugLogs(const QString &_func, const QString &_msg, const int _level=7);
private:
//void setWidgetsOrder();
void setWidgetsOrder();
bool maybeSave();
void setCleaning(const bool _c);
void logEvent(const QString &_func, const QString &_msg, const int _level=7);
void setSeverity(const int _sev);
void updateBandComboBox(const QString &_band);
void fileExportLoTW(const QString &_st, const QDate &_startDate, const QDate &_endDate);
void fileExportADIF(const QString &_st, const QDate &_startDate, const QDate &_endDate);
bool callTQSL(const QString &_filename, const QString &_call);
void showNumberOfSavedQSO(const QString &_fn, const int _n);
//QString getCallToUseForLoTWExportUpload();
UpdateSatsData *updateSatsData;
//UPDATE CTY.DAT
DownLoadCTY *downloadcty;
@ -332,15 +303,11 @@ private:
bool hamlibActive;
bool hamlibChangingMode;
bool hamlibModeNotADIFSupported;
// PST Rotator
PSTRotatorSupport *pstRotator;
bool usePSTRotator;
RotatorWidget *rotatorWidget;
//</UPDATE CTY.DAT>
//WorldMapWidget *worldMapWidget;
void createStatusBar();
void createUI();
void createUI();
void createUICQWW();
void createUIDX();
void reconfigureDXMarathonUI(const bool _dxM);
//void createDXClusterUI();
@ -356,12 +323,12 @@ private:
bool isQSLReceived(const int _qsoId);
bool isQSLSent(const int _qsoId);
//bool validCharactersInCall(const QString &_qrz); // Looks for SQLi and no valid chars in the QRZ
bool validCharactersInCall(const QString &_qrz); // Looks for SQLi and no valid chars in the QRZ
QString readDataFromUI(); // Reads the QSO data from the UI and returns the SQL Query
QString readDataFromUIDX();
QString readDataFromUIDXModifying();
void actionsJustAfterAddingOneQSO();
//void clearForNextQSO();
void clearForNextQSO();
void clearUIDX(bool full=false); //full= false leaves some data to allow pileup or normal Dx in same band; full removes freqs and everything
void setAwardDXCC(const int _qsoId, bool modifying); // Adds or modify the status of a DXCC entity
@ -408,10 +375,6 @@ private:
int dxclusterServerPort;
// CLUSTER
//LOTW
AdifLoTWExportWidget *adifLoTWExportWidget;
//LOTW
ShowAdifImportWidget *showAdifImportWidget;
QWidget *mainWidget;
//QWidget *dxClusterTabWidget;//, *searchTabWidget;
@ -426,10 +389,9 @@ private:
//HelpAboutDialog *helpAboutDialog;
AboutDialog *aboutDialog;
TipsDialog *tipsDialog;
//DXCCSummaryDialog *dxccSummaryDialog;
//QPushButton *addButton;
QPushButton *addButton;
//QLabel *distShortLabelN;
//QLabel *distLongLabelN;
StatisticsWidget *statsWidget;
@ -454,10 +416,10 @@ private:
QGroupBox *gridGroupBox, *qrzgroupBox;//, *searchgroupBox;
QFrame *dxUpLeftInputFrame;//, *dxUpRightOutputFrame;
QLineEdit *nameLineEdit, *qthLineEdit, *locatorLineEdit;
//QComboBox *bandComboBox, *modeComboBox;
//QDateEdit *dateEdit;
//QTimeEdit *timeEdit;
QLineEdit *qrzLineEdit, *nameLineEdit, *qthLineEdit, *locatorLineEdit;
QComboBox *bandComboBox, *modeComboBox;
QDateEdit *dateEdit;
QTimeEdit *timeEdit;
//QStatusBar *statusBar, *qsoStatusBar;
QString statusBarMessage;
@ -494,7 +456,7 @@ private:
QAction *ADIFExport;
QAction *ADIFExportAll;
QAction *ADIFImport;
//QAction *LoTWExport;
QAction *LoTWExport;
QAction *LoTWImport;
QAction *ReqQSLExport;
QAction *CabrilloExport;
@ -508,14 +470,10 @@ private:
QAction *lotwMarkSentQueuedAct;
QAction *lotwMarkSentYesThisLogAct;
QAction *lotwMarkSentYesAct;
QAction *lotwCallTQSL;
QAction *lotwUpdateFromLoTWAct;
QAction *downloadCTYAct;
QAction *downloadSATSAct;
QAction *showStatsAct;
QAction *showRotatorAct;
//QAction *showDXCCSummaryAct;
QAction *loggWinAct;
/*
@ -544,9 +502,9 @@ private:
QLineEdit *rstTXLineEdit;
QLineEdit *rstRXLineEdit;
//QLineEdit *STXLineEdit;
//QLineEdit *SRXLineEdit;
//QPushButton *OKButton, *spotItButton, *clearButton;
QLineEdit *STXLineEdit;
QLineEdit *SRXLineEdit;
QPushButton *OKButton, *spotItButton, *clearButton;
QStringList bands;
QStringList modes;
QStringList entitiesList, propModeList;
@ -570,8 +528,6 @@ private:
QDoubleSpinBox *rxPowerSpinBox, *txFreqSpinBox, *rxFreqSpinBox; //*myPowerSpinBox,
QLCDNumber *freqQLCDNumber;
QString lotwTQSLpath;
//eQSL
//QComboBox *eqslSentComboBox, *eqslRecComboBox, *lotwSentComboBox, *lotwRecComboBox, *clublogComboBox;
//QDateEdit *eqslSentQDateEdit, *eqslRecQDateEdit, *lotwSentQDateEdit, *lotwRecQDateEdit, *clublogQDateEdit;
@ -606,7 +562,6 @@ private:
MainWindowInputOthers *othersTabWidget;
MainWindowInputEQSL *eQSLTabWidget;
MainWindowInputQSL *QSLTabWidget;
MainQSOEntryWidget *mainQSOEntryWidget;
AwardsWidget *awardsWidget;
SearchWidget *searchWidget;
@ -638,20 +593,19 @@ private:
bool itIsANewversion;
//QString currentQrz;
//QString previousQrz;
QString currentQrz;
QString previousQrz;
QString stx;
QString srx;
QPalette palRed, palBlack; // To paint Text in red or black(normal)
bool alwaysADIF, needToSave, useDefaultLogFileName, upAndRunning, qrzSmallModDontCalculate, imperialSystem, sendQSLWhenRec, manageDxMarathon, keepMyData, completeWithPrevious, completedWithPreviousQTH, completedWithPreviousLocator, completedWithPreviousName, completedWithPreviousIOTA, completedWithPreviousQSLVia;
// bool realTime, UTCTime;
bool realTime, UTCTime, alwaysADIF, needToSave, useDefaultLogFileName, upAndRunning, qrzSmallModDontCalculate, imperialSystem, sendQSLWhenRec, manageDxMarathon, keepMyData, completeWithPrevious, completedWithPreviousQTH, completedWithPreviousLocator, completedWithPreviousName, completedWithPreviousIOTA, completedWithPreviousQSLVia;
bool cleaning;
bool manageMode; // If true, the DXCC and awards will take the mode into consideration to decide if needed or worked. False implies only band is taken into account
// Station Setup
bool configured, modify;
bool needToEnd; // Just to control if the software needs to end.
//bool qrzAutoChanging; //To stop executing the slotQRZTextChanged just because KLog uppercase a letter
bool qrzAutoChanging; //To stop executing the slotQRZTextChanged just because KLog uppercase a letter
QString mainQRZ, stationQRZ, operatorQRZ, dxLocator;
QString lastOperatorQRZ, lastStationQRZ, lastMyLocator;
double myPower, lastPower;
@ -692,13 +646,13 @@ private:
DataBase *db;
QTextDocument *doc;
SoftwareUpdate *softUpdate;
bool callingUpdate;
bool UDPServerStart;
// LOTWUTILITIES
LoTWUtilities *lotwUtilities;
//LOGVIEW
//QString bandOld, modeOld;
//LOGVIEW

View File

@ -20,7 +20,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -30,11 +30,11 @@
MainWindowInputComment::MainWindowInputComment(QWidget *parent) :
QWidget(parent)
{
//qDebug() << "MainWindowInputComment::MainWindowInputComment" << endl;
//qDebug() << "MainWindowInputComment::MainWindowInputComment" << endl;
commentLineEdit = new QLineEdit();
comment.clear();
createUI();
//qDebug() << "MainWindowInputComment::MainWindowInputComment - END" << endl;
//qDebug() << "MainWindowInputComment::MainWindowInputComment - END" << endl;
}
@ -51,6 +51,9 @@ void MainWindowInputComment::createUI()
setLayout(tabLayout);
}
void MainWindowInputComment::setData(const QString &_comment)
{
comment = _comment;
@ -67,3 +70,5 @@ void MainWindowInputComment::clear()
comment.clear();
commentLineEdit->clear();
}

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
//
@ -41,6 +41,7 @@ public:
void createUI();
void setData(const QString &_comment);
QString getComment();
void clear();
private:

View File

@ -3,10 +3,18 @@
MainWindowInputEQSL::MainWindowInputEQSL(DataProxy_SQLite *dp, QWidget *parent) :
QWidget(parent)
{
//qDebug() << "MainWindowInputEQSL::MainWindowInputEQSL" << endl;
//qDebug() << "MainWindowInputEQSL::MainWindowInputEQSL" << endl;
util = new Utilities;
qslSentStatusList.clear();
qslRcvdStatusList.clear();
clubLogStatusList.clear();
dataProxy = dp;
qslSentStatusList = dataProxy->getQSLSentList();
qslRcvdStatusList = dataProxy->getQSLRcvdList();
clubLogStatusList = dataProxy->getClubLogStatusList();
eqslSentComboBox = new QComboBox;
eqslRecComboBox = new QComboBox;
lotwSentComboBox = new QComboBox;
@ -19,27 +27,20 @@ MainWindowInputEQSL::MainWindowInputEQSL(DataProxy_SQLite *dp, QWidget *parent)
lotwRecQDateEdit = new QDateEdit;
clublogQDateEdit = new QDateEdit;
createUI();
setDefaultData();
clear();
//qDebug() << "MainWindowInputEQSL::MainWindowInputEQSL - END" << endl;
}
void MainWindowInputEQSL::createUI()
{
qslSentStatusList.clear();
qslRcvdStatusList.clear();
clubLogStatusList.clear();
qslSentStatusList = dataProxy->getQSLSentList();
qslRcvdStatusList = dataProxy->getQSLRcvdList();
clubLogStatusList = dataProxy->getClubLogStatusList();
eqslSentQDateEdit->setDisplayFormat("dd/MM/yyyy");
eqslRecQDateEdit->setDisplayFormat("dd/MM/yyyy");
lotwSentQDateEdit->setDisplayFormat("dd/MM/yyyy");
lotwRecQDateEdit->setDisplayFormat("dd/MM/yyyy");
clublogQDateEdit->setDisplayFormat("dd/MM/yyyy");
createUI();
setDefaultData();
clear();
//qDebug() << "MainWindowInputEQSL::MainWindowInputEQSL - END" << endl;
}
void MainWindowInputEQSL::createUI()
{
clublogQDateEdit->setToolTip(tr("Date of the ClubLog upload."));
eqslSentQDateEdit->setToolTip(tr("Date of the eQSL sending."));
eqslRecQDateEdit->setToolTip(tr("Date of the eQSL reception."));
@ -69,7 +70,27 @@ void MainWindowInputEQSL::createUI()
QLabel *lotWRecLabelN = new QLabel(tr("LoTW Rec"));
lotWRecLabelN->setAlignment(Qt::AlignVCenter| Qt::AlignRight);
/*
QHBoxLayout *eqslSentLayout = new QHBoxLayout;
eqslSentLayout->addWidget(eqslSentComboBox);
eqslSentLayout->addWidget(eqslSentQDateEdit);
QHBoxLayout *eqslRecLayout = new QHBoxLayout;
eqslRecLayout->addWidget(eqslRecComboBox);
eqslRecLayout->addWidget(eqslRecQDateEdit);
QHBoxLayout *lotwSentLayout = new QHBoxLayout;
lotwSentLayout->addWidget(lotwSentComboBox);
lotwSentLayout->addWidget(lotwSentQDateEdit);
QHBoxLayout *lotwRecLayout = new QHBoxLayout;
lotwRecLayout->addWidget(lotwRecComboBox);
lotwRecLayout->addWidget(lotwRecQDateEdit);
QFormLayout *eqslInputTabWidgetLayout = new QFormLayout;
eqslInputTabWidgetLayout->addRow(eQSLSentLabelN, eqslSentLayout);
eqslInputTabWidgetLayout->addRow(eQSLRecLabelN, eqslRecLayout);
eqslInputTabWidgetLayout->addRow(lotWSentLabelN, lotwSentLayout);
eqslInputTabWidgetLayout->addRow(lotWRecLabelN, lotwRecLayout);
*/
QGridLayout *eqslInputTabWidgetLayout = new QGridLayout;
eqslInputTabWidgetLayout->addWidget(clublogLabelN, 0, 0);
@ -107,6 +128,7 @@ void MainWindowInputEQSL::createUI()
void MainWindowInputEQSL::setDefaultData()
{
//qsAux << tr("Y-Yes") << tr("N-No") << tr("R-Requested") << tr("I-Ignore") << tr("V-Validated");
//eqslRecComboBox->addItems(qsAux);
@ -126,25 +148,14 @@ void MainWindowInputEQSL::setDefaultData()
//qsAux << tr("Y-Uploaded") << tr("N-Do not upload") << tr("M-Modified");
clublogComboBox->addItems(clubLogStatusList);
queueSentByDefault = true;
}
void MainWindowInputEQSL::clear()
{
//qDebug() << "MainWindowInputEQSL::clear" << endl;
//qDebug() << "MainWindowInputEQSL::clear" << endl;
clublogComboBox->setCurrentIndex(1); // Do not upload
if (queueSentByDefault)
{
eqslSentComboBox->setCurrentIndex( eqslSentComboBox->findText("Q", Qt::MatchStartsWith));
lotwSentComboBox->setCurrentIndex( lotwSentComboBox->findText("Q", Qt::MatchStartsWith));
}
else
{
eqslSentComboBox->setCurrentIndex(1);
lotwSentComboBox->setCurrentIndex(1);
}
eqslRecComboBox->setCurrentIndex(1);
eqslSentComboBox->setCurrentIndex(1);
eqslRecComboBox->setCurrentIndex(1);
lotwSentComboBox->setCurrentIndex(1);
lotwRecComboBox->setCurrentIndex(1);
//dateEdit->setDate(QDate::fromString(aux1, "yyyy/MM/dd"));
@ -168,9 +179,9 @@ void MainWindowInputEQSL::clear()
QString MainWindowInputEQSL::getClubLogStatus()
{
QString _pm = QString();
//qDebug() << "MainWindowInputEQSL::getClubLogStatus:" << clublogComboBox->currentText() << endl;
//qDebug() << "MainWindowInputEQSL::getClubLogStatus:" << clublogComboBox->currentText() << endl;
_pm = (((clublogComboBox->currentText()).split('-')).at(0)).simplified();
//qDebug() << "MainWindowInputEQSL::getClubLogStatus: " << _pm << endl;
//qDebug() << "MainWindowInputEQSL::getClubLogStatus: " << _pm << endl;
//if (_pm == "Not")
//{
// return QString();
@ -181,9 +192,9 @@ QString MainWindowInputEQSL::getClubLogStatus()
QString MainWindowInputEQSL::getEQSLRecStatus()
{
QString _pm = QString();
//qDebug() << "MainWindowInputEQSL::getEQSLRecStatus:" << eqslRecComboBox->currentText() << endl;
//qDebug() << "MainWindowInputEQSL::getEQSLRecStatus:" << eqslRecComboBox->currentText() << endl;
_pm = (((eqslRecComboBox->currentText()).split('-')).at(0)).simplified();
//qDebug() << "MainWindowInputEQSL::getEQSLRecStatus: " << _pm << endl;
//qDebug() << "MainWindowInputEQSL::getEQSLRecStatus: " << _pm << endl;
//if (_pm == "Not")
//{
// return QString();
@ -195,9 +206,9 @@ QString MainWindowInputEQSL::getEQSLRecStatus()
QString MainWindowInputEQSL::getEQSLSenStatus()
{
QString _pm = QString();
//qDebug() << "MainWindowInputEQSL::getEQSLSenStatus:" << eqslSentComboBox->currentText() << endl;
//qDebug() << "MainWindowInputEQSL::getEQSLSenStatus:" << eqslSentComboBox->currentText() << endl;
_pm = (((eqslSentComboBox->currentText()).split('-')).at(0)).simplified();
//qDebug() << "MainWindowInputEQSL::getEQSLSenStatus: " << _pm << endl;
//qDebug() << "MainWindowInputEQSL::getEQSLSenStatus: " << _pm << endl;
//if (_pm == "Not")
//{
// return QString();
@ -208,9 +219,9 @@ QString MainWindowInputEQSL::getEQSLSenStatus()
QString MainWindowInputEQSL::getLOTWRecStatus()
{
QString _pm = QString();
//qDebug() << "MainWindowInputEQSL::getLOTWRecStatus:" << lotwRecComboBox->currentText() << endl;
//qDebug() << "MainWindowInputEQSL::getLOTWRecStatus:" << lotwRecComboBox->currentText() << endl;
_pm = (((lotwRecComboBox->currentText()).split('-')).at(0)).simplified();
//qDebug() << "MainWindowInputEQSL::getLOTWRecStatus: " << _pm << endl;
//qDebug() << "MainWindowInputEQSL::getLOTWRecStatus: " << _pm << endl;
//if (_pm == "Not")
//{
// return QString();
@ -221,9 +232,9 @@ QString MainWindowInputEQSL::getLOTWRecStatus()
QString MainWindowInputEQSL::getLOTWSenStatus()
{
QString _pm = QString();
//qDebug() << "MainWindowInputEQSL::getLOTWSenStatus:" << lotwSentComboBox->currentText() << endl;
//qDebug() << "MainWindowInputEQSL::getLOTWSenStatus:" << lotwSentComboBox->currentText() << endl;
_pm = (((lotwSentComboBox->currentText()).split('-')).at(0)).simplified();
//qDebug() << "MainWindowInputEQSL::getLOTWSenStatus: " << _pm << endl;
//qDebug() << "MainWindowInputEQSL::getLOTWSenStatus: " << _pm << endl;
//if (_pm == "Not")
//{
// return QString();
@ -234,7 +245,7 @@ QString MainWindowInputEQSL::getLOTWSenStatus()
void MainWindowInputEQSL::setClubLogStatus(const QString _qs)
{
//qDebug() << "MainWindowInputEQSL::setClubLogStatus: " << _qs << endl;
//qDebug() << "MainWindowInputEQSL::setClubLogStatus: " << _qs << endl;
if(( clublogComboBox->findText(_qs+" -", Qt::MatchStartsWith))>=0)
{
clublogComboBox->setCurrentIndex( clublogComboBox->findText(_qs+" -", Qt::MatchStartsWith));
@ -248,7 +259,7 @@ void MainWindowInputEQSL::setClubLogStatus(const QString _qs)
void MainWindowInputEQSL::setEQSLRecStatus(const QString _qs)
{
//qDebug() << "MainWindowInputEQSL::setEQSLRecStatus: " << _qs << endl;
//qDebug() << "MainWindowInputEQSL::setEQSLRecStatus: " << _qs << endl;
if(( eqslRecComboBox->findText(_qs+" -", Qt::MatchStartsWith))>=0)
{
eqslRecComboBox->setCurrentIndex( eqslRecComboBox->findText(_qs+" -", Qt::MatchStartsWith));
@ -261,7 +272,7 @@ void MainWindowInputEQSL::setEQSLRecStatus(const QString _qs)
void MainWindowInputEQSL::setEQSLSenStatus(const QString _qs)
{
//qDebug() << "MainWindowInputEQSL::setEQSLSenStatus: #" << _qs+" -" << endl;
//qDebug() << "MainWindowInputEQSL::setEQSLSenStatus: #" << _qs+" -" << endl;
if(( eqslSentComboBox->findText(_qs, Qt::MatchStartsWith))>=0)
{
@ -269,14 +280,14 @@ void MainWindowInputEQSL::setEQSLSenStatus(const QString _qs)
}
else
{
//qDebug() << "MainWindowInputEQSL::setEQSLSenStatus: NOT found" << endl;
//qDebug() << "MainWindowInputEQSL::setEQSLSenStatus: NOT found" << endl;
eqslSentComboBox->setCurrentIndex(1);
}
}
void MainWindowInputEQSL::setLOTWRecStatus(const QString _qs)
{
//qDebug() << "MainWindowInputEQSL::setLOTWRecStatus: " << _qs << endl;
//qDebug() << "MainWindowInputEQSL::setLOTWRecStatus: " << _qs << endl;
if(( lotwRecComboBox->findText(_qs+" -", Qt::MatchStartsWith))>=0)
{
lotwRecComboBox->setCurrentIndex( lotwRecComboBox->findText(_qs+" -", Qt::MatchStartsWith));
@ -290,7 +301,7 @@ void MainWindowInputEQSL::setLOTWRecStatus(const QString _qs)
void MainWindowInputEQSL::setLOTWSenStatus(const QString _qs)
{
//qDebug() << "MainWindowInputEQSL::setLOTWSenStatus: " << _qs << endl;
//qDebug() << "MainWindowInputEQSL::setLOTWSenStatus: " << _qs << endl;
if(( lotwSentComboBox->findText(_qs+" -", Qt::MatchStartsWith))>=0)
{
lotwSentComboBox->setCurrentIndex( lotwSentComboBox->findText(_qs+" -", Qt::MatchStartsWith));
@ -303,7 +314,7 @@ void MainWindowInputEQSL::setLOTWSenStatus(const QString _qs)
void MainWindowInputEQSL::slotLotwRecvComboBoxChanged(){
//qDebug() << "MainWindowInputEQSL::slotLotwRecvComboBoxChanged" << endl;
//qDebug() << "MainWindowInputEQSL::slotLotwRecvComboBoxChanged" << endl;
//QSLRDATE (only valid if QSL_RCVD is Y-0, I-3, or V-4)
//Y-Yes-0
@ -312,8 +323,6 @@ void MainWindowInputEQSL::slotLotwRecvComboBoxChanged(){
//I-Ignore-3
//V-Verified-4
int i = lotwRecComboBox->currentIndex();
switch (i)
@ -324,8 +333,6 @@ void MainWindowInputEQSL::slotLotwRecvComboBoxChanged(){
break;
case 2:
lotwRecQDateEdit->setEnabled(true);
lotwRecQDateEdit->setDate((QDateTime::currentDateTime()).date());
break;
case 3:
lotwRecQDateEdit->setEnabled(true);
@ -336,13 +343,15 @@ void MainWindowInputEQSL::slotLotwRecvComboBoxChanged(){
default: //NO
lotwRecQDateEdit->setEnabled(false);
break;
}
}
void MainWindowInputEQSL::slotLotwSentComboBoxChanged(){
//qDebug() << "MainWindowInputEQSL::slotLotwSentComboBoxChanged" << endl;
//qDebug() << "MainWindowInputEQSL::slotLotwSentComboBoxChanged" << endl;
int i = lotwSentComboBox->currentIndex();
//{Y, N, R, I, V}
@ -357,18 +366,15 @@ void MainWindowInputEQSL::slotLotwSentComboBoxChanged(){
case 0:
lotwSentQDateEdit->setEnabled(true);
lotwSentQDateEdit->setDate((QDateTime::currentDateTime()).date());
break;
case 2:
lotwSentQDateEdit->setEnabled(true);
lotwSentQDateEdit->setDate((QDateTime::currentDateTime()).date());
break;
case 3:
lotwSentQDateEdit->setEnabled(true);
lotwSentQDateEdit->setDate((QDateTime::currentDateTime()).date());
break;
case 4:
lotwSentQDateEdit->setEnabled(true);
lotwSentQDateEdit->setDate((QDateTime::currentDateTime()).date());
break;
default: //NO
@ -379,7 +385,7 @@ void MainWindowInputEQSL::slotLotwSentComboBoxChanged(){
void MainWindowInputEQSL::sloteQSLRecvComboBoxChanged(){
//qDebug() << "MainWindowInputEQSL::sloteQSLRecvComboBoxChanged" << endl;
//qDebug() << "MainWindowInputEQSL::sloteQSLRecvComboBoxChanged" << endl;
//QSLRDATE (only valid if QSL_RCVD is Y-0, I-3, or V-4)
//Y-Yes-0
@ -395,18 +401,15 @@ void MainWindowInputEQSL::sloteQSLRecvComboBoxChanged(){
case 0:
eqslRecQDateEdit->setEnabled(true);
eqslRecQDateEdit->setDate((QDateTime::currentDateTime()).date());
break;
case 2:
eqslRecQDateEdit->setEnabled(true);
eqslRecQDateEdit->setDate((QDateTime::currentDateTime()).date());
break;
case 3:
eqslRecQDateEdit->setEnabled(true);
eqslRecQDateEdit->setDate((QDateTime::currentDateTime()).date());
break;
case 4:
eqslRecQDateEdit->setEnabled(true);
eqslRecQDateEdit->setDate((QDateTime::currentDateTime()).date());
break;
default: //NO
eqslRecQDateEdit->setEnabled(false);
@ -419,7 +422,7 @@ void MainWindowInputEQSL::sloteQSLRecvComboBoxChanged(){
void MainWindowInputEQSL::sloteQSLSentComboBoxChanged(){
//qDebug() << "MainWindowInputEQSL::sloteQSLSentComboBoxChanged" << endl;
//qDebug() << "MainWindowInputEQSL::sloteQSLSentComboBoxChanged" << endl;
int i = eqslSentComboBox->currentIndex();
//{Y, N, R, I, V}
@ -434,18 +437,15 @@ void MainWindowInputEQSL::sloteQSLSentComboBoxChanged(){
case 0:
eqslSentQDateEdit->setEnabled(true);
eqslSentQDateEdit->setDate((QDateTime::currentDateTime()).date());
break;
case 2:
eqslSentQDateEdit->setEnabled(true);
eqslSentQDateEdit->setDate((QDateTime::currentDateTime()).date());
break;
case 3:
eqslSentQDateEdit->setEnabled(true);
eqslSentQDateEdit->setDate((QDateTime::currentDateTime()).date());
break;
case 4:
eqslSentQDateEdit->setEnabled(true);
eqslSentQDateEdit->setDate((QDateTime::currentDateTime()).date());
break;
default: //NO
@ -564,7 +564,3 @@ QDate MainWindowInputEQSL::getLOTWSenDate()
return lotwSentQDateEdit->date();
}
void MainWindowInputEQSL::setQueueSentByDefault(const bool _b)
{
queueSentByDefault = _b;
}

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
//
@ -70,8 +70,6 @@ public:
void setLOTWRecDate(const QDate _qs);
void setLOTWSenDate(const QDate _qs);
void setQueueSentByDefault(const bool _b);
signals:
@ -94,7 +92,6 @@ private:
Utilities *util;
QStringList qslSentStatusList, qslRcvdStatusList, clubLogStatusList;
bool queueSentByDefault;
};

View File

@ -20,7 +20,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -30,7 +30,7 @@
MainWindowInputOthers::MainWindowInputOthers(DataProxy_SQLite *dp, QWidget *parent) :
QWidget(parent)
{
//qDebug() << "MainWindowInputOthers::MainWindowInputOthers" << endl;
//qDebug() << "MainWindowInputOthers::MainWindowInputOthers" << endl;
entitiesList.clear();
propModeList.clear();
@ -51,14 +51,14 @@ MainWindowInputOthers::MainWindowInputOthers(DataProxy_SQLite *dp, QWidget *pare
createUI();
//qDebug() << "MainWindowInputOthers::MainWindowInputOthers - END" << endl;
//qDebug() << "MainWindowInputOthers::MainWindowInputOthers - END" << endl;
}
MainWindowInputOthers::~MainWindowInputOthers(){}
void MainWindowInputOthers::createUI()
{
//qDebug() << "MainWindowInputOthers::createUI" << endl;
//qDebug() << "MainWindowInputOthers::createUI" << endl;
palRed.setColor(QPalette::Text, Qt::red);
palBlack.setColor(QPalette::Text, Qt::black);
@ -133,7 +133,7 @@ void MainWindowInputOthers::createUI()
void MainWindowInputOthers::clear()
{
//qDebug() << "MainWindowInputOthers::clear" << endl;
//qDebug() << "MainWindowInputOthers::clear" << endl;
entityNameComboBox->setCurrentIndex(0);
propModeComboBox->setCurrentIndex(0);
iotaContinentComboBox->setCurrentIndex(0);
@ -142,7 +142,7 @@ void MainWindowInputOthers::clear()
void MainWindowInputOthers::setEntitiesList(const QStringList _qs)
{
//qDebug() << "MainWindowInputOthers::setEntitiesList: " << QString::number(_qs.length()) << endl;
//qDebug() << "MainWindowInputOthers::setEntitiesList: " << QString::number(_qs.length()) << endl;
entitiesList.clear();
entitiesList << _qs;
if (entitiesList.size()>1)
@ -155,7 +155,7 @@ void MainWindowInputOthers::setEntitiesList(const QStringList _qs)
void MainWindowInputOthers::setEntity(const int _ent)
{// Select the appropriate entity in the ComboBox
//qDebug() << "MainWindowInputOthers::setEntity: " << QString::number(_ent) << endl;
//qDebug() << "MainWindowInputOthers::setEntity: " << QString::number(_ent) << endl;
if (_ent<=0)
{
entityNameComboBox->setCurrentIndex(0);
@ -174,11 +174,11 @@ void MainWindowInputOthers::setEntity(const int _ent)
pref = dataProxy->getEntityNameFromId(_ent);
//int indexC = entityNameComboBox->findText(pref, Qt::MatchContains);
//qDebug() << "MainWindow::selectCorrectEntity: aux to the findText: " << aux << endl;
//qDebug() << "MainWindow::selectCorrectEntity: aux to the findText: " << aux << endl;
//int indexC = entityNameComboBox->findText("(" + aux + ")", Qt::MatchContains);
int indexC = entityNameComboBox->findText("(" + aux + ")", Qt::MatchEndsWith);
//qDebug() << "MainWindow::selectCorrectEntity: " << pref << "/" << QString::number(indexC) << endl;
//qDebug() << "MainWindow::selectCorrectEntity: " << pref << "/" << QString::number(indexC) << endl;
entityNameComboBox->setCurrentIndex(indexC);
setIOTAContinentFromEntity(_ent);
@ -186,14 +186,14 @@ void MainWindowInputOthers::setEntity(const int _ent)
QString MainWindowInputOthers::getEntityPrefix()
{
//qDebug() << "MainWindowInputOthers::getEntityPrefix: " << (entityNameComboBox->currentText()).split('-').at(0) << endl;
//qDebug() << "MainWindowInputOthers::getEntityName" << endl;
return (entityNameComboBox->currentText()).split('-').at(0);
//return world->getQRZARRLId(pref);
}
void MainWindowInputOthers::setPropMode(const QString _qs)
{
//qDebug() << "MainWindowInputOthers::setPropMode: " << _qs << endl;
//qDebug() << "MainWindowInputOthers::setPropMode: " << _qs << endl;
if(( propModeComboBox->findText(_qs+" -", Qt::MatchContains))>0)
{
propModeComboBox->setCurrentIndex( propModeComboBox->findText(_qs+" -", Qt::MatchContains));
@ -207,12 +207,10 @@ void MainWindowInputOthers::setPropMode(const QString _qs)
QString MainWindowInputOthers::getPropModeFromComboBox()
{
QString _pm = QString();
//qDebug() << "MainWindow::getPropModeFromComboBox:" << propModeComboBox->currentText() << endl;
//qDebug() << "MainWindow::getPropModeFromComboBox:" << propModeComboBox->currentText() << endl;
_pm = (((propModeComboBox->currentText()).split('-')).at(1)).simplified();
QString _n = (((propModeComboBox->currentText()).split('-')).at(0)).simplified();
//qDebug() << "MainWindow::getPropModeFromComboBox: " << _pm << endl;
if (_n == "00")
//qDebug() << "MainWindow::getPropModeFromComboBox: " << _pm << endl;
if (_pm == "Not")
{
return QString();
}
@ -243,7 +241,7 @@ void MainWindowInputOthers::setIOTA(const QString _qs, const bool _black)
{//TODO: Seems to be better to send the color info like in: (it is much more flexible as I can send any color!)
//void MainWindowInputQSL::setQSLVia(const QString _qs, QColor qColor)
//qDebug() << "MainWindow::setIOTA: " << _qs << endl;
//qDebug() << "MainWindow::setIOTA: " << _qs << endl;
if ( (checkIfValidIOTA(_qs)).length() !=6 )
{
return;
@ -251,7 +249,7 @@ void MainWindowInputOthers::setIOTA(const QString _qs, const bool _black)
else
{
QStringList values = _qs.split("-", QString::SkipEmptyParts);
//qDebug() << "MainWindowInputOthers::setIOTA: IOTA " << _qs << endl;
//qDebug() << "MainWindowInputOthers::setIOTA: IOTA " << _qs << endl;
iotaContinentComboBox->setCurrentIndex( iotaContinentComboBox->findText(values.at(0) ) );
iotaNumberLineEdit->setText(values.at(1));
}
@ -273,22 +271,22 @@ QString MainWindowInputOthers::getIOTA()
void MainWindowInputOthers::setIOTAContinentFromEntity(const int _n)
{
//qDebug() << "MainWindow::setIOTAContinentFromEntity:" << QString::number(_n) << endl;
//qDebug() << "MainWindow::setIOTAContinentFromEntity:" << QString::number(_n) << endl;
setIOTAContinent(dataProxy->getContinentShortNameFromEntity(_n)) ;
}
void MainWindowInputOthers::setIOTAContinent(const QString _qs)
{
//qDebug() << "MainWindowInputOthers::setIOTAContinent: " << _qs << endl;
//qDebug() << "MainWindowInputOthers::setIOTAContinent: setting to index(a): " << QString::number(iotaContinentComboBox->findText(_qs, Qt::MatchContains)) << endl;
//qDebug() << "MainWindowInputOthers::setIOTAContinent: " << _qs << endl;
//qDebug() << "MainWindowInputOthers::setIOTAContinent: setting to index(a): " << QString::number(iotaContinentComboBox->findText(_qs, Qt::MatchContains)) << endl;
if(( iotaContinentComboBox->findText(_qs, Qt::MatchContains))>0)
{
//qDebug() << "MainWindowInputOthers::setIOTAContinent: setting to index: " << QString::number(iotaContinentComboBox->findText(_qs, Qt::MatchContains)) << endl;
//qDebug() << "MainWindowInputOthers::setIOTAContinent: setting to index: " << QString::number(iotaContinentComboBox->findText(_qs, Qt::MatchContains)) << endl;
iotaContinentComboBox->setCurrentIndex( iotaContinentComboBox->findText(_qs, Qt::MatchContains));
}
else
{
//qDebug() << "MainWindowInputOthers::setIOTAContinent: setting to index: 00" << endl;
//qDebug() << "MainWindowInputOthers::setIOTAContinent: setting to index: 00" << endl;
iotaContinentComboBox->setCurrentIndex(0);
}
}
@ -308,7 +306,7 @@ QString MainWindowInputOthers::checkIfValidIOTA(const QString _tiota)
Returns a valid format IOTA if possible and "" in other cases.
************************************/
//qDebug() << "MainWindowInputOthers::checkIfValidIOTA: " << _tiota << endl;
//qDebug() << "MainWindowInputOthers::checkIfValidIOTA: " << _tiota << endl;
//bool _valid = false;
QString _continent;
QString _number;
@ -324,8 +322,8 @@ Returns a valid format IOTA if possible and "" in other cases.
return "";
}
//qDebug() << "MainWindowInputOthers::checkIfValidIOTA (cont) " << _continent << endl;
//qDebug() << "MainWindowInputOthers::checkIfValidIOTA (numb): " << _number << endl;
//qDebug() << "MainWindowInputOthers::checkIfValidIOTA (cont) " << _continent << endl;
//qDebug() << "MainWindowInputOthers::checkIfValidIOTA (numb): " << _number << endl;
// Check if continent is valid

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
//

View File

@ -20,7 +20,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
//
@ -32,7 +32,7 @@
MainWindowInputQSL::MainWindowInputQSL(DataProxy_SQLite *dp, QWidget *parent) :
QWidget(parent)
{
//qDebug() << "MainWindowInputQSL::MainWindowInputQSL" << endl;
//qDebug() << "MainWindowInputQSL::MainWindowInputQSL" << endl;
util = new Utilities;
qslSentComboBox = new QComboBox;
qslRecComboBox = new QComboBox;
@ -50,7 +50,7 @@ MainWindowInputQSL::MainWindowInputQSL(DataProxy_SQLite *dp, QWidget *parent) :
createUI();
setDefaultData();
clear();
//qDebug() << "MainWindowInputQSL::MainWindowInputQSL - END" << endl;
//qDebug() << "MainWindowInputQSL::MainWindowInputQSL - END" << endl;
}
@ -170,7 +170,7 @@ QString MainWindowInputQSL::getSentVia()
{
QString _pm = QString();
_pm = (((qslSentViaComboBox->currentText()).split('-')).at(0)).simplified();
//qDebug() << "MainWindow::getSentVia: " << _pm << endl;
//qDebug() << "MainWindow::getSentVia: " << _pm << endl;
return _pm;
}
@ -178,7 +178,7 @@ QString MainWindowInputQSL::getRecVia()
{
QString _pm = QString();
_pm = (((qslRecViaComboBox->currentText()).split('-')).at(0)).simplified();
//qDebug() << "MainWindowInputQSL::getRecVia: " << _pm << endl;
//qDebug() << "MainWindowInputQSL::getRecVia: " << _pm << endl;
return _pm;
}
@ -231,7 +231,7 @@ void MainWindowInputQSL::setQSLRecVia(const QString _qs)
void MainWindowInputQSL::setQSLSenVia(const QString _qs)
{
//qDebug() << "MainWindowInputQSL::setQSLSenVia: " << _qs << endl;
//qDebug() << "MainWindowInputQSL::setQSLSenVia: " << _qs << endl;
if(( qslSentViaComboBox->findText(_qs+" -", Qt::MatchStartsWith))>=0)
{
qslSentViaComboBox->setCurrentIndex( qslSentViaComboBox->findText(_qs+" -", Qt::MatchStartsWith));
@ -309,7 +309,7 @@ void MainWindowInputQSL::setQSLSenDate(const QDate _qs)
void MainWindowInputQSL::slotQSLViaTextChanged()
{
//qDebug() << "MainWindow::slotQSLViaTextChanged: " << qslViaLineEdit->text() << " / Length: " << QString::number((qslViaLineEdit->text()).size()) << endl;
//qDebug() << "MainWindow::slotQSLViaTextChanged: " << qslViaLineEdit->text() << " / Length: " << QString::number((qslViaLineEdit->text()).size()) << endl;
qslViaLineEdit->setText((qslViaLineEdit->text()).toUpper());
}

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
//

View File

@ -20,7 +20,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -29,7 +29,7 @@
MainWindowMyDataTab::MainWindowMyDataTab(QWidget *parent) :
QWidget(parent)
{
//qDebug() << "MainWindowMyDataTab::MainWindowMyDataTab" << endl;
//qDebug() << "MainWindowMyDataTab::MainWindowMyDataTab" << endl;
myPowerSpinBox = new QDoubleSpinBox;
operatorLineEdit = new QLineEdit;
stationCallSignLineEdit = new QLineEdit;
@ -44,13 +44,12 @@ MainWindowMyDataTab::MainWindowMyDataTab(QWidget *parent) :
stationQRZ = QString(); // Defined in the configuration by the user, will be used if the user configured so in the setup
operatorQRZ = QString(); // Defined in the configuration by the user, will be used if the user configured so in the setup
myLocator = QString(); // Defined in the configuration by the user, will be used if the user configured so in the setup
util = new Utilities;
createUI();
myPower = 0;
lastPower = 0;
//qDebug() << "MainWindowMyDataTab::MainWindowMyDataTab - END" << endl;
//qDebug() << "MainWindowMyDataTab::MainWindowMyDataTab - END" << endl;
}
@ -63,7 +62,7 @@ void MainWindowMyDataTab::createUI()
myPowerSpinBox->setDecimals(2);
myPowerSpinBox->setMaximum(9999);
myPowerSpinBox->setSuffix(" " + tr("Watts"));
myPowerSpinBox->setSuffix(" " + tr("Watt"));
QLabel *keepLabel = new QLabel();
keepLabel->setText(tr("Keep this data"));
@ -110,9 +109,7 @@ void MainWindowMyDataTab::createUI()
connect(myLocatorLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotMyLocatorTextChanged() ) );
connect(myLocatorLineEdit, SIGNAL(returnPressed()), this, SLOT(slotReturnPressed() ) );
connect(operatorLineEdit, SIGNAL(returnPressed()), this, SLOT(slotReturnPressed() ) );
connect(operatorLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotOperatorTextChanged()) );
connect(stationCallSignLineEdit, SIGNAL(returnPressed()), this, SLOT(slotReturnPressed() ) );
connect(stationCallSignLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotStationCallSignTextChanged() ) );
connect(stationCallSignLineEdit, SIGNAL(returnPressed()), this, SLOT(slotReturnPressed() ) );
}
void MainWindowMyDataTab::clear(const bool _keepMyData)
@ -120,11 +117,11 @@ void MainWindowMyDataTab::clear(const bool _keepMyData)
// _keepMyData comes from the setup
if (_keepMyData)
{
//qDebug() << "MainWindowMyDataTab::clear: TRUE" << endl;
//qDebug() << "MainWindowMyDataTab::clear: TRUE" << endl;
}
else
{
//qDebug() << "MainWindowMyDataTab::clear: FALSE" << endl;
//qDebug() << "MainWindowMyDataTab::clear: FALSE" << endl;
}
if (keepThisDataForNextQSORadiobutton->isChecked())
@ -132,7 +129,6 @@ void MainWindowMyDataTab::clear(const bool _keepMyData)
myPowerSpinBox->setValue(lastPower);
operatorLineEdit->setText(lastOperatorQRZ.toUpper());
stationCallSignLineEdit->setText(lastStationQRZ.toUpper());
//qDebug() << "MainWindowMyDataTab::clear-1: setMyLocator: " << myLocator << endl;
myLocatorLineEdit->setText(lastMyLocator);
}
else
@ -142,7 +138,6 @@ void MainWindowMyDataTab::clear(const bool _keepMyData)
myPowerSpinBox->setValue(myPower);
operatorLineEdit->setText(operatorQRZ.toUpper());
stationCallSignLineEdit->setText(stationQRZ.toUpper());
//qDebug() << "MainWindowMyDataTab::clear-2: setMyLocator: " << myLocator << endl;
myLocatorLineEdit->setText(myLocator);
}
else
@ -157,31 +152,26 @@ void MainWindowMyDataTab::clear(const bool _keepMyData)
void MainWindowMyDataTab::show()
{
//qDebug() << "MainWindowMyDataTab::show: " << QString::number(myPower) << "/" << operatorQRZ << "/" << stationQRZ << "/" << myLocator << endl;
//qDebug() << "MainWindowMyDataTab::show: " << QString::number(myPower) << "/" << operatorQRZ << "/" << stationQRZ << "/" << myLocator << endl;
myPowerSpinBox->setValue(myPower);
operatorLineEdit->setText(operatorQRZ);
stationCallSignLineEdit->setText(stationQRZ);
//qDebug() << "MainWindowMyDataTab::show: setMyLocator: " << myLocator << endl;
myLocatorLineEdit->setText(myLocator);
}
void MainWindowMyDataTab::slotMyLocatorTextChanged()
{
//qDebug() << "MainWindowMyDataTab::slotMyLocatorTextChanged: " << myLocatorLineEdit->text() << endl;
//qDebug() << "MainWindowMyDataTab::slotMyLocatorTextChanged: " << myLocatorLineEdit->text() << endl;
//logEvent(Q_FUNC_INFO, "Start", logSeverity);
int cursorP = myLocatorLineEdit->cursorPosition();
myLocatorLineEdit->setText(myLocatorLineEdit->text().toUpper());
//qDebug() << "MainWindowMyDataTab::clear: setMyLocator: " << myLocatorLineEdit->text() << endl;
if ( locator->isValidLocator((myLocatorLineEdit->text()).toUpper()) )
{
myLocator = (myLocatorLineEdit->text()).toUpper();
myLocatorLineEdit->setPalette(palBlack);
myLocatorLineEdit->setToolTip(tr("My QTH locator."));
myLocatorLineEdit->setCursorPosition(cursorP);
emit myLocChangedSignal(myLocator);
//dxccStatusWidget->setMyLocator(myLocator);
//qDebug() << "MainWindowMyDataTab::slotMyLocatorTextChanged: My LOCATOR CHANGED TO: " << myLocator << endl;
//qDebug() << "MainWindowMyDataTab::slotMyLocatorTextChanged: My LOCATOR CHANGED TO: " << myLocator << endl;
//slotLocatorTextChanged();
}
else
@ -189,7 +179,6 @@ void MainWindowMyDataTab::slotMyLocatorTextChanged()
//logEvent(Q_FUNC_INFO, "END-2", logSeverity);
myLocatorLineEdit->setPalette(palRed);
myLocatorLineEdit->setToolTip(tr("My QTH locator. Format should be Maidenhead like IN70AA up to 10 characters."));
myLocatorLineEdit->setCursorPosition(cursorP);
return;
}
//logEvent(Q_FUNC_INFO, "END", logSeverity);
@ -222,7 +211,7 @@ void MainWindowMyDataTab::setSetupMyLocator(const QString _op)
void MainWindowMyDataTab::setMyPower(const double _power)
{
//qDebug() << "MainWindowMyDataTab::setMyPower: " << QString::number(_power) << endl;
//qDebug() << "MainWindowMyDataTab::setMyPower: " << QString::number(_power) << endl;
myPowerSpinBox->setValue(_power);
}
@ -268,7 +257,6 @@ QString MainWindowMyDataTab::getStationQRZ()
void MainWindowMyDataTab::setMyLocator(const QString _op)
{
//qDebug() << "MainWindowMyDataTab::setMyLocator: " << _op << endl;
myLocatorLineEdit->setText(_op);
}
@ -317,35 +305,3 @@ void MainWindowMyDataTab::setData(const double _power, const QString _stationQRZ
myLocator = QString();
}
}
void MainWindowMyDataTab::slotOperatorTextChanged()
{
int cursorP = operatorLineEdit->cursorPosition();
operatorLineEdit->setText(operatorLineEdit->text().toUpper());
if (util->isValidCall(operatorLineEdit->text()))
{
operatorLineEdit->setPalette(palBlack);
operatorQRZ = (operatorLineEdit->text()).toUpper();
}
else
{
operatorLineEdit->setPalette(palRed);
}
operatorLineEdit->setCursorPosition(cursorP);
}
void MainWindowMyDataTab::slotStationCallSignTextChanged()
{
int cursorP = stationCallSignLineEdit->cursorPosition();
stationCallSignLineEdit->setText(stationCallSignLineEdit->text().toUpper());
if (util->isValidCall(stationCallSignLineEdit->text()))
{
stationCallSignLineEdit->setPalette(palBlack);
stationQRZ = (stationCallSignLineEdit->text()).toUpper();
}
else
{
stationCallSignLineEdit->setPalette(palRed);
}
stationCallSignLineEdit->setCursorPosition(cursorP);
}

View File

@ -23,7 +23,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
//
@ -33,7 +33,6 @@
#include <QWidget>
#include <QtWidgets>
#include "locator.h"
#include "utilities.h"
//#include "dataproxy_sqlite.h"
//#include "dataproxy_sqlite.h"
@ -79,8 +78,6 @@ signals:
private slots:
void slotMyLocatorTextChanged();
void slotOperatorTextChanged();
void slotStationCallSignTextChanged();
void slotReturnPressed();
private:
@ -97,7 +94,6 @@ private:
QRadioButton *keepThisDataForNextQSORadiobutton;
QPalette palRed, palBlack; // To paint Text in red or black(normal)
Locator *locator;
Utilities *util;
};

View File

@ -21,7 +21,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include "mainwindowsattab.h"
@ -31,7 +31,7 @@ This class implements the Satellite TAB of the MainWindow
MainWindowSatTab::MainWindowSatTab(DataProxy_SQLite *dp, QWidget *parent) :
QWidget(parent)
{
//qDebug() << "MainWindowSatTab::MainWindowSatTab" << endl;
//qDebug() << "MainWindowSatTab::MainWindowSatTab" << endl;
satNameComboBox = new QComboBox;
satNameLineEdit = new QLineEdit;
satModeLineEdit = new QLineEdit;
@ -62,7 +62,7 @@ MainWindowSatTab::MainWindowSatTab(DataProxy_SQLite *dp, QWidget *parent) :
palBlack.setColor(QPalette::Text, Qt::black);
setDefaultBands(); //TODO: Check how the bands are included not to create an inconsistence with the selected (in the setup) bands
//qDebug() << "MainWindowSatTab::MainWindowSatTab - END" << endl;
//qDebug() << "MainWindowSatTab::MainWindowSatTab - END" << endl;
}
MainWindowSatTab::~MainWindowSatTab(){}
@ -181,7 +181,7 @@ void MainWindowSatTab::slotSatNameComboBoxChanged()
}
int i = satNameComboBox->currentIndex();
//qDebug() << "MainWindowSatTab::slotSatNameComboBoxChanged: " << QString::number(i) << endl;
//qDebug() << "MainWindowSatTab::slotSatNameComboBoxChanged: " << QString::number(i) << endl;
//QString _pm = (((satNameComboBox->currentText()).split(' ')).at(0)).simplified();
satNameLineEdit->clear();
@ -213,7 +213,7 @@ void MainWindowSatTab::slotSatNameComboBoxChanged()
void MainWindowSatTab::slotSatNameTextChanged()
{
//qDebug() << "MainWindowSatTab::slotSatNameTextChanged: " << satNameLineEdit->text() << endl;
//qDebug() << "MainWindowSatTab::slotSatNameTextChanged: " << satNameLineEdit->text() << endl;
satNameLineEdit->setText((satNameLineEdit->text()).toUpper());
if (modifying)
{
@ -233,7 +233,7 @@ void MainWindowSatTab::slotSatNameTextChanged()
void MainWindowSatTab::slotSatModeTextChanged()
{
//qDebug() << "MainWindowSatTab::slotSatModeTextChanged: " << satModeLineEdit->text() << endl;
//qDebug() << "MainWindowSatTab::slotSatModeTextChanged: " << satModeLineEdit->text() << endl;
/*
satModeLineEdit->setText((satModeLineEdit->text()).toUpper());
@ -251,32 +251,30 @@ void MainWindowSatTab::slotSatModeTextChanged()
void MainWindowSatTab::setLocator(const QString _t)
{
//qDebug() << "MainWindowSatTab::setLocator: " << _t << endl;
//qDebug() << "MainWindowSatTab::setLocator: " << _t << endl;
satDXLocatorLineEdit->setText(_t.toUpper());
}
void MainWindowSatTab::slotSatDXLocTextChanged()
{
//qDebug() << "MainWindowSatTab::slotSatDXLocTextChanged: " << satDXLocatorLineEdit->text() << endl;
//qDebug() << "MainWindowSatTab::slotSatDXLocTextChanged: " << satDXLocatorLineEdit->text() << endl;
satDXLocatorLineEdit->setText((satDXLocatorLineEdit->text()).toUpper());
if (modifying)
{
return;
}
if ( locator->isValidLocator((satDXLocatorLineEdit->text()).toUpper()) )
{
emit dxLocatorChanged((satDXLocatorLineEdit->text()).toUpper());
satDXLocatorLineEdit->setPalette(palBlack);
satDXLocatorLineEdit->setToolTip(tr("Locator of the DX station. This box is synchronized with the Locator box in the QSO tab."));
//if (!modifying)
//{
// emit dxLocatorChanged((satDXLocatorLineEdit->text()).toUpper());
//}
}
else
{
satDXLocatorLineEdit->setPalette(palRed);
satDXLocatorLineEdit->setToolTip(tr("Locator of the DX station. Format should be Maidenhead like IN70AA up to 10 characters."));
return;
}
emit dxLocatorChanged((satDXLocatorLineEdit->text()).toUpper());
}
QString MainWindowSatTab::getSatName()
@ -294,10 +292,10 @@ QString MainWindowSatTab::getSatName()
QString satName = QString();
//qDebug() << "MainWindowSatTab::getSatName:" << satNameComboBox->currentText() << endl;
//qDebug() << "MainWindowSatTab::getSatName:" << satNameComboBox->currentText() << endl;
_pm = (((satNameComboBox->currentText()).split(' ')).at(0)).simplified();
//qDebug() << "MainWindowSatTab::satNameComboBox: " << _pm << endl;
//qDebug() << "MainWindowSatTab::satNameComboBox: " << _pm << endl;
if (satNameComboBox->currentIndex() == 0)
{
return QString();
@ -324,7 +322,7 @@ QString MainWindowSatTab::getSatName()
void MainWindowSatTab::setSatName(const QString _t)
{
//TODO: Check that the format is OK
//qDebug() << "MainWindowSatTab::setSatName: " << _t << endl;
//qDebug() << "MainWindowSatTab::setSatName: " << _t << endl;
//satNameLineEdit->setText(_t);
if (getSatIndex(_t) > 0)
{
@ -345,7 +343,7 @@ QString MainWindowSatTab::getSatMode()
void MainWindowSatTab::setSatMode(const QString _t)
{
//qDebug() << "MainWindowSatTab::setSatMode: " << _t << endl;
//qDebug() << "MainWindowSatTab::setSatMode: " << _t << endl;
if (_t == "-CLEAR-")
{
satModeLineEdit->clear();
@ -369,7 +367,7 @@ void MainWindowSatTab::setRepeatThis(const bool _t)
void MainWindowSatTab::clear()
{
//qDebug() << "MainWindowSatTab::clear" << endl;
//qDebug() << "MainWindowSatTab::clear" << endl;
modifying = false;
if (keepThisDataForNextQSORadiobutton->isChecked())
{
@ -398,7 +396,7 @@ void MainWindowSatTab::refreshData()
void MainWindowSatTab::populateSatComboBox()
{
//qDebug() << "MainWindowSatTab::populateSatComboBox: " << endl;
//qDebug() << "MainWindowSatTab::populateSatComboBox: " << endl;
QString nosat = tr("Not Sat QSO");
QString othersat = tr("Other - Sat not in the list");
@ -414,18 +412,18 @@ void MainWindowSatTab::populateSatComboBox()
}
else
{
//TODO: Check how to do it better... now I could simply remove the if
//TODO: Check how to do it better... now I could simply remove the if
satNameComboBox->addItems(satellitesList);
}
}
void MainWindowSatTab::setSatelliteCombo(const QString _p)
{
//qDebug() << "MainWindowsatTab::setSatelliteCombo: " << _p << endl;
//qDebug() << "MainWindowsatTab::setSatelliteCombo: " << _p << endl;
QString aux = QString();
int indexC = getSatIndex(_p);
//int indexC = satNameComboBox->findText(_p, Qt::MatchContains);
//qDebug() << "MainWindowsatTab::setSatelliteCombo: N=" << QString::number(indexC) << endl;
//qDebug() << "MainWindowsatTab::setSatelliteCombo: N=" << QString::number(indexC) << endl;
if (indexC>0)
{
satNameComboBox->setCurrentIndex(indexC);
@ -438,7 +436,7 @@ void MainWindowSatTab::setSatelliteCombo(const QString _p)
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Warning);
aux = tr("KLog has detected a satellite name that it does not recognise. If it should use one of the names of known satellites instead, please select it from the list. Alternatively, please contact the development team to add the new satellite name.") + "\n\n";
msgBox.setText(aux + tr("The satellite you have in your QSO is: ") + _p + "\n\n" + tr("Please be aware that the satellite name will not be saved if it is not in the list, so that information may be lost!"));
msgBox.setText(aux + tr("The satellite you have in your QSO is: ") + _p + "\n\n" + tr("Please know that the satellite name will not be saved if it is not in the list so that information may be lost!"));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
int ret = msgBox.exec();
@ -457,7 +455,7 @@ void MainWindowSatTab::setSatelliteCombo(const QString _p)
void MainWindowSatTab::setOtherSatName(const QString _t)
{
//qDebug() << "MainWindowsatTab::setOtherSatName: " << _t << endl;
//qDebug() << "MainWindowsatTab::setOtherSatName: " << _t << endl;
satNameLineEdit->setText(_t);
}
@ -473,7 +471,7 @@ int MainWindowSatTab::getSatIndex(const QString _p)
void MainWindowSatTab::addBands(QStringList _bands)
{
//qDebug() << "MainWindowSatTab::addBands: " << QString::number(_bands.length()) << endl;
//qDebug() << "MainWindowSatTab::addBands: " << QString::number(_bands.length()) << endl;
updatingBands = true;
QString _txBand = satBandTXComboBox->currentText();
QString _rxBand = satBandRXComboBox->currentText();
@ -486,16 +484,19 @@ void MainWindowSatTab::addBands(QStringList _bands)
satBandRXComboBox->setCurrentIndex(satBandRXComboBox->findText(_rxBand, Qt::MatchCaseSensitive));
//txBandsBeingChanged = false;
updatingBands = false;
//qDebug() << "MainWindowSatTab::addBands - END" << endl;
//qDebug() << "MainWindowSatTab::addBands - END" << endl;
}
void MainWindowSatTab::setDefaultBands()
{//Defines the default bands for SAT communications: 10m/2m/70cm/23CM only if they exist in the selected bands
//qDebug() << "MainWindowsatTab::setDefaultBands: " << endl;
{//Defines the default bands for SAT communications: 10m/2m/70cm/23CM only if they exist on the selected bands
//qDebug() << "MainWindowsatTab::setDefaultBands: " << endl;
QStringList _b;
_b.clear();
_b << "10M" << "2M" << "70CM" << "23CM";
satBandRXComboBox->clear();
satBandTXComboBox->clear();
satBandRXComboBox->addItems(_b);
satBandTXComboBox->addItems(_b);
@ -503,7 +504,7 @@ void MainWindowSatTab::setDefaultBands()
void MainWindowSatTab::slotSatBandRXComboBoxChanged()
{
//qDebug() << "MainWindowsatTab::slotSatBandRXComboBoxChanged" << endl;
//qDebug() << "MainWindowsatTab::slotSatBandRXComboBoxChanged" << endl;
if (updatingBands || modifying)
{
return;
@ -513,13 +514,13 @@ void MainWindowSatTab::slotSatBandRXComboBoxChanged()
{ // If the freq does not belong to the current band, we need to update the band
rxFreqSpinBox->setValue(dataProxy->getLowLimitBandFromBandName(satBandRXComboBox->currentText()));
}
//qDebug() << "MainWindowsatTab::slotSatBandRXComboBoxChanged-END" << endl;
//qDebug() << "MainWindowsatTab::slotSatBandRXComboBoxChanged-END" << endl;
}
void MainWindowSatTab::slotSatFreqRXChanged()
{
//qDebug() << "MainWindowsatTab::slotSatFreqRXChanged: " << QString::number(rxFreqSpinBox->value()) << endl;
//qDebug() << "MainWindowsatTab::slotSatFreqRXChanged: " << QString::number(rxFreqSpinBox->value()) << endl;
if (modifying)
{
return;
@ -527,7 +528,7 @@ void MainWindowSatTab::slotSatFreqRXChanged()
int bandId = dataProxy->getBandIdFromFreq(rxFreqSpinBox->value());
if (bandId<1)
{ //This prevent that a non-hamradio frequency is used on TX
//qDebug() << "MainWindowsatTab::slotSatFreqRXChanged: Not in band, exiting... " << endl;
//qDebug() << "MainWindowsatTab::slotSatFreqRXChanged: Not in band, exiting... " << endl;
rxFreqSpinBox->setToolTip(tr("RX Frequency in MHz.\nFrequency is not in a hamradio band!"));
rxFreqSpinBox->setPalette(palRed);
}
@ -549,12 +550,12 @@ void MainWindowSatTab::slotSatFreqRXChanged()
emit satRxFreqChanged(rxFreqSpinBox->value());
}
//qDebug() << "MainWindowsatTab::slotSatFreqRXChanged-END" << endl;
//qDebug() << "MainWindowsatTab::slotSatFreqRXChanged-END" << endl;
}
void MainWindowSatTab::slotSatBandTXComboBoxChanged()
{
//qDebug() << "MainWindowsatTab::slotSatBandTXComboBoxChanged:" << endl;
//qDebug() << "MainWindowsatTab::slotSatBandTXComboBoxChanged:" << endl;
if (updatingBands || modifying)
{
return;
@ -565,13 +566,13 @@ void MainWindowSatTab::slotSatBandTXComboBoxChanged()
txFreqSpinBox->setValue(dataProxy->getLowLimitBandFromBandName(satBandTXComboBox->currentText()));
//setUpLinkFreq(dataProxy->getLowLimitBandFromBandName(satBandTXComboBox->currentText()));
}
//qDebug() << "MainWindowsatTab::slotSatBandTXComboBoxChanged-END" << endl;
//qDebug() << "MainWindowsatTab::slotSatBandTXComboBoxChanged-END" << endl;
}
void MainWindowSatTab::slotSatFreqTXChanged()
{
//qDebug() << "MainWindowsatTab::slotSatFreqTXChanged: " << QString::number(txFreqSpinBox->value()) << endl;
//qDebug() << "MainWindowsatTab::slotSatFreqTXChanged: " << QString::number(txFreqSpinBox->value()) << endl;
// user changes TX Freq
// If band is real and band is configured, bandcombo is selected
// If band is real and not configured, we launch the band config and select the band.
@ -584,7 +585,7 @@ void MainWindowSatTab::slotSatFreqTXChanged()
int bandId = dataProxy->getBandIdFromFreq(txFreqSpinBox->value());
if (bandId<1)
{ //This prevent that a non-hamradio frequency is used on TX
//qDebug() << "MainWindowsatTab::slotSatFreqTXChanged: Not in band, exiting... " << endl;
//qDebug() << "MainWindowsatTab::slotSatFreqTXChanged: Not in band, exiting... " << endl;
txFreqSpinBox->setToolTip(tr("TX Frequency in MHz.\nFrequency is not in a hamradio band!"));
txFreqSpinBox->setPalette(palRed);
}
@ -606,22 +607,21 @@ void MainWindowSatTab::slotSatFreqTXChanged()
emit satTxFreqChanged(txFreqSpinBox->value());
}
//qDebug() << "MainWindowsatTab::slotSatFreqTXChanged-END" << endl;
//qDebug() << "MainWindowsatTab::slotSatFreqTXChanged-END" << endl;
}
void MainWindowSatTab::setUpLink(const QString _t)
{
//qDebug() << "MainWindowsatTab::setUpLink: " << _t << endl;
//qDebug() << "MainWindowsatTab::setUpLink: " << _t << endl;
int index = satBandTXComboBox->findText(_t, Qt::MatchCaseSensitive);
//qDebug() << "MainWindowsatTab::setUpLink: new index: " << QString::number(index) << endl;
//qDebug() << "MainWindowsatTab::setUpLink: current index: " << QString::number(satBandTXComboBox->currentIndex()) << endl;
int indexRX;
if (index>=0)
{
satBandTXComboBox->setCurrentIndex(index);
int indexRX;
if (index>=0)
{
satBandTXComboBox->setCurrentIndex(index);
//if ((dataProxy->isVHF(dataProxy->getIdFromBandName(_t))) && !(dataProxy->isUHF(dataProxy->getIdFromBandName(_t))) )
if ( dataProxy->getIdFromBandName("2M") == dataProxy->getIdFromBandName(_t) )
{
//qDebug() << satNameComboBox->currentText() << endl;
//qDebug() << satNameComboBox->currentText() << endl;
if (satNameComboBox->findText("AO-7 - AMSAT-OSCAT 7", Qt::MatchCaseSensitive))
{
indexRX = satBandRXComboBox->findText("10M", Qt::MatchCaseSensitive);
@ -632,47 +632,39 @@ void MainWindowSatTab::setUpLink(const QString _t)
}
satBandRXComboBox->setCurrentIndex(indexRX);
}
}
//else if(dataProxy->isUHF(dataProxy->getIdFromBandName(_t)))
else if ( dataProxy->getIdFromBandName("70CM") == dataProxy->getIdFromBandName(_t) )
//else
{
indexRX = satBandRXComboBox->findText("2M", Qt::MatchCaseSensitive);
satBandRXComboBox->setCurrentIndex(indexRX);
}
}
}
void MainWindowSatTab::setUpLinkFreq(const double _t)
{
//qDebug() << "MainWindowsatTab::setUpLinkFreq: " << QString::number(_t) << endl;
//qDebug() << "MainWindowsatTab::setUpLinkFreq: " << QString::number(_t) << endl;
txFreqBeingAutoChanged = true;
txFreqSpinBox->setValue(_t);
setUpLink(dataProxy->getBandNameFromFreq(_t));
txFreqBeingAutoChanged = false;
//qDebug() << "MainWindowsatTab::setUpLinkFreq END" << endl;
}
double MainWindowSatTab::getRXFreq()
{
return rxFreqSpinBox->value();
//qDebug() << "MainWindowsatTab::setUpLinkFreq END" << endl;
}
void MainWindowSatTab::setDownLinkFreq(const double _t)
{
//qDebug() << "MainWindowsatTab::setDownLinkFreq: " << QString::number(_t) << endl;
//qDebug() << "MainWindowsatTab::setDownLinkFreq: " << QString::number(_t) << endl;
rxFreqBeingAutoChanged = true;
rxFreqSpinBox->setValue(_t);
QString downLinkBand = dataProxy->getBandNameFromFreq(_t);
int index = satBandRXComboBox->findText(downLinkBand, Qt::MatchCaseSensitive);
if (index>=0)
{
satBandRXComboBox->setCurrentIndex(index);
}
rxFreqBeingAutoChanged = false;
//qDebug() << "MainWindowsatTab::setDownLinkFreq END" << endl;
//qDebug() << "MainWindowsatTab::setDownLinkFreq END" << endl;
}
void MainWindowSatTab::setBandsOfSat(const QString _p)
@ -680,7 +672,7 @@ void MainWindowSatTab::setBandsOfSat(const QString _p)
// Until the data is in the DB, this function tries to solve data of active sats from: http://www.amsat.org/status/
// This functio:
// - identifies the freqs & bands that the sat is using
//qDebug() << "MainWindowSatTab::setBandsOfSat: " << _p << " - Short: " << _p.section(' ', 0, 0) << endl;
//qDebug() << "MainWindowSatTab::setBandsOfSat: " << _p << " - Short: " << _p.section(' ', 0, 0) << endl;
//"AO-7 - AMSAT-OSCAT 7"
//2M/10M << 2M/70CM
if (modifying)
@ -694,38 +686,33 @@ void MainWindowSatTab::setBandsOfSat(const QString _p)
double downLink = 0.0;
downLink = (dataProxy->getSatelliteDownlink(_p.section(' ', 0, 0))).toDouble();
//qDebug() << "MainWindowSatTab::setBandsOfSat upLink: " << QString::number(upLink)<< endl;
//qDebug() << "MainWindowSatTab::setBandsOfSat downLink: " << QString::number(downLink)<< endl;
//qDebug() << "MainWindowSatTab::setBandsOfSat upLink: " << QString::number(upLink)<< endl;
if (upLink>0)
{
//qDebug() << "MainWindowSatTab::setBandsOfSat upLink: emitting: " << QString::number(upLink)<< endl;
//qDebug() << "MainWindowSatTab::setBandsOfSat upLink: emitting: " << QString::number(upLink)<< endl;
emit satTXFreqNeeded(upLink);
//qDebug() << "MainWindowSatTab::setBandsOfSat upLink: emitted: " << QString::number(upLink)<< endl;
//qDebug() << "MainWindowSatTab::setBandsOfSat upLink: emitted: " << QString::number(upLink)<< endl;
}
else
{
//qDebug() << "MainWindowSatTab::setBandsOfSat upLink: setting to ZERO (should be = RX) " << endl;
txFreqSpinBox->setValue(0);
//satBandTXComboBox->setCurrentIndex(0);
satBandTXComboBox->setCurrentIndex(0);
}
if (downLink>0)
{
//qDebug() << "MainWindowSatTab::setBandsOfSat downLink: emitting: " << QString::number(downLink)<< endl;
//qDebug() << "MainWindowSatTab::setBandsOfSat downLink: emitting: " << QString::number(downLink)<< endl;
emit satRXFreqNeeded(downLink);
//qDebug() << "MainWindowSatTab::setBandsOfSat downLink: emitted: " << QString::number(downLink)<< endl;
//qDebug() << "MainWindowSatTab::setBandsOfSat downLink: emitted: " << QString::number(downLink)<< endl;
}
else
{
//qDebug() << "MainWindowSatTab::setBandsOfSat downLink: setting to ZERO" << endl;
rxFreqSpinBox->setValue(0);
//satBandRXComboBox->setCurrentIndex(0);
satBandRXComboBox->setCurrentIndex(0);
}
//qDebug() << "MainWindowSatTab::setBandsOfSat downLink: emiting: " << QString::number(downLink)<< endl;
//qDebug() << "MainWindowSatTab::setBandsOfSat downLink: emiting: " << QString::number(downLink)<< endl;
//emit satRxFreqChanged(downLink);
/*
@ -755,22 +742,22 @@ void MainWindowSatTab::setBandsOfSat(const QString _p)
satBandRXComboBox->setCurrentIndex(0);
}
*/
//qDebug() << "MainWindowSatTab::setBandsOfSat: " << _p << " - END " << endl;
//qDebug() << "MainWindowSatTab::setBandsOfSat: " << _p << " - END " << endl;
}
void MainWindowSatTab::addNewBand(const QString _p)
{
//qDebug() << "MainWindowSatTab::addNewBand: " << _p << endl;
//qDebug() << "MainWindowSatTab::addNewBand: " << _p << endl;
if (dataProxy->getIdFromBandName(_p)<0)
{
//qDebug() << "MainWindowSatTab::addNewBand: Id: " << QString::number(dataProxy->getIdFromBandName(_p)) << endl;
//qDebug() << "MainWindowSatTab::addNewBand: Id: " << QString::number(dataProxy->getIdFromBandName(_p)) << endl;
return;
}
QStringList bands;
bands.clear();
//qDebug() << "MainWindowSatTab::addNewBand: RX Id: " << QString::number(satBandRXComboBox->count()) << endl;
//qDebug() << "MainWindowSatTab::addNewBand: TX Id: " << QString::number(satBandTXComboBox->count()) << endl;
//qDebug() << "MainWindowSatTab::addNewBand: RX Id: " << QString::number(satBandRXComboBox->count()) << endl;
//qDebug() << "MainWindowSatTab::addNewBand: TX Id: " << QString::number(satBandTXComboBox->count()) << endl;
for (int i = 0; i < satBandTXComboBox->count(); i++)
{
@ -787,8 +774,8 @@ void MainWindowSatTab::addNewBand(const QString _p)
emit newBandsToBeAdded(bands);
//addBands(bands);
//qDebug() << "MainWindowSatTab::addNewBand: 2 RX Id: " << QString::number(satBandRXComboBox->count()) << endl;
//qDebug() << "MainWindowSatTab::addNewBand: 2 TX Id: " << QString::number(satBandTXComboBox->count()) << endl;
//qDebug() << "MainWindowSatTab::addNewBand: 2 RX Id: " << QString::number(satBandRXComboBox->count()) << endl;
//qDebug() << "MainWindowSatTab::addNewBand: 2 TX Id: " << QString::number(satBandTXComboBox->count()) << endl;
}

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
//
@ -46,15 +46,13 @@ public:
void setOtherSatName(const QString _t);
QString getOtherSatName();
QString getSatMode();
double getRXFreq();
void setSatMode(const QString _t);
bool getRepeatThis();
void setRepeatThis(const bool _t);
void addBands(QStringList _bands);
void setDefaultBands(); //Defines the default bands for SAT communications: 10m/2m/70cm/23CM only if they exist in the selected bands
void setDefaultBands(); //Defines the default bands for SAT communications: 10m/2m/70cm/23CM only if they exist on the selected bands
void setUpLinkFreq(const double _t);
@ -98,7 +96,6 @@ private:
void addNewBand(const QString _p);
void setUpLink(const QString _t);
QLineEdit *satNameLineEdit;
QLineEdit *satModeLineEdit;
QLineEdit *satDXLocatorLineEdit;

View File

@ -1,92 +0,0 @@
#include "pstrotatorsupport.h"
//#include <QString>
PSTRotatorSupport::PSTRotatorSupport(QObject *parent) :
QObject(parent)
{
//qDebug() << "PSTRotatorSupport::PSTRotatorSupport" << endl;
//address = QString("127.0.0.1");
port = 12040;
socketServer = new QUdpSocket(this);
//socketServer->bind(QHostAddress::AnyIPv4, port);
//connect(socketServer,SIGNAL(readyRead()),this,SLOT(slotReadPendingDatagrams()));
}
bool PSTRotatorSupport::start()
{
setServer(server);
return socketServer->bind(address, port);
//connect(socketServer,SIGNAL(readyRead()),this,SLOT(slotReadPendingDatagrams()));
}
void PSTRotatorSupport::setPort(const int _port)
{
//qDebug() << "PSTRotatorSupport::setPort: " << QString::number(_port) << endl;
if ((_port >= 0) && (_port<=65535))
{
port = _port;
}
else
{
port = 12040;
}
}
void PSTRotatorSupport::setServer(const QString &_s)
{
server = _s;
address.setAddress(_s);
}
void PSTRotatorSupport::sendAzimut(const int _d)
{
/*
<PST><AZIMUTH>85</AZIMUTH></PST>
*/
if ((_d >= 0) && (_d <= 365))
{
QString st;
st = QString("<PST><AZIMUTH>%1</AZIMUTH></PST>").arg(_d);
QByteArray ba;
ba.clear();
ba = st.toUtf8();
socketServer->writeDatagram(ba, address, port);
}
}
void PSTRotatorSupport::sendCall(const QString _c)
{
/*
<PST><CALL>EA4XXX</CALL></PST>
*/
if (_c.length()>=3)
{
QString st;
st = QString("<PST><CALL>%1</CALL></PST>").arg(_c);
QByteArray ba;
ba.clear();
ba = st.toUtf8();
socketServer->writeDatagram(ba, address, port);
}
}
void PSTRotatorSupport::sendFreq(const int _freq, const int _radio)
{// Frequencies for antennas Receives MHz (to pstrotator must be sent in 10hz but I will do the conversion in this function)
/* // Freq is in 10hz
* // Radio is 1..4
<PST><FREQUENCY>2489200</FREQUENCY><RADIO>1</RADIO></PST>
*/
//qDebug() << "PSTRotatorSupport::sendFreq: " << QString::number(_freq) << "/" << QString::number(_radio)<< endl;
if ((_freq>0) && (_radio>0) && (_radio <5))
{
int f = _freq/100;
QString st;
st = QString("<PST><FREQUENCY>%1</FREQUENCY><RADIO>%2</RADIO></PST>").arg(f).arg(_radio);
QByteArray ba;
ba.clear();
ba = st.toUtf8();
socketServer->writeDatagram(ba, address, port);
}
}

View File

@ -1,53 +0,0 @@
#ifndef PSTROTATORSUPPORT_H
#define PSTROTATORSUPPORT_H
#include <QUdpSocket>
#include <QObject>
#include <QHostAddress>
#include <QDataStream>
#include <QByteArray>
class PSTRotatorSupport : public QObject
{
Q_OBJECT
public:
explicit PSTRotatorSupport(QObject *parent = nullptr);
bool start();
void setPort(const int _port);
void setServer(const QString &_s);
void sendAzimut(const int _d); // Azimuth Degrees
void sendCall(const QString _c); // Sends the callsignto PSTRotator to point
void sendFreq(const int _freq, const int _radio); // Frequencies for antennas receives MHz (to pstrotator must be sent in 10hz but I will do the conversion in this function)
//void stopRotor (const bool _s);
//void parkRotor (const bool _s);
//void setLPSP (const QString &_s);
private:
QUdpSocket *socketServer;
QHostAddress address;
//QString address;
int port;
QString server;
signals:
private slots:
//void slotReadPendingDatagrams();
};
#endif // PSTRotatorSupport_H

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
//
@ -49,7 +49,6 @@ public:
void clear();
void showQSO(const int _q);
void showQSOs(QList<int> qsoIdList);
void setStationCallsign(const QString &_st);
void searchToolNeededQSLToSend();
@ -90,8 +89,6 @@ private slots:
void slotQSOToEditFromSearch();
void qslRecViaBureauMarkReq(const int _qsoId);
void qslRecViaDirectMarkReq(const int _qsoId);
void slotStationCallsignChanged();
void slotRadioButtonToggled();
signals:
@ -106,8 +103,6 @@ signals:
private:
void createUI();
void selectStationCallSign();
void fillStationCallsignComboBox();
// The following function is adding a line to the search list
void addQSOToSearchList(const QString _call, const QString _dateTime, const QString _band, const QString _mode, const QString _qslrx, const QString _qsltx, const QString _stationcallsign, const QString _id, const QColor _color);
bool fillTheList(const QString _query);
@ -118,12 +113,10 @@ private:
QPushButton *searchBoxClearButton, *searchBoxExportButton, *searchBoxSelectAllButton, *searchBoxReSearchButton;
QRadioButton *searchAllRadioButton;
QTreeWidget *searchResultsTreeWidget;
QComboBox *stationCallsignComboBox;
bool qslingNeeded;
bool searchSelectAllClicked, stationCallSignShownInSearch;
int currentLog;
QString mainStationCallsign;
DataProxy_SQLite *dataProxy;
Awards *awards;
@ -146,8 +139,6 @@ private:
QAction *qslSentRequestedAct;
QAction *qslRecRequestedAct;
};
#endif // SEARCHWIDGET_H

View File

@ -20,7 +20,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
@ -34,7 +34,7 @@ This class calls all the othet "Setup..." to manage the configuration
SetupDialog::SetupDialog(DataProxy_SQLite *dp, const bool _firstTime)
{
//qDebug() << "SetupDialog::SetupDialog 1" << endl;
//qDebug() << "SetupDialog::SetupDialog 1" << endl;
logSeverity = 7; //7 Debug /0=emergency or no debug
util = new Utilities;
constrid = 1;
@ -42,53 +42,51 @@ SetupDialog::SetupDialog(DataProxy_SQLite *dp, const bool _firstTime)
configFileName = "klogrc";
version = ".";
pageRequested = 0;
//qDebug() << "SetupDialog::SetupDialog 2" << endl;
//qDebug() << "SetupDialog::SetupDialog 2" << endl;
dataProxy = dp;
//qDebug() << "SetupDialog::SetupDialog 3" << endl;
//qDebug() << "SetupDialog::SetupDialog 3" << endl;
firstTime = _firstTime;
if (firstTime)
{
//qDebug() << "SetupDialog::SetupDialog FIRST TIME = TRUE" << endl;
//qDebug() << "SetupDialog::SetupDialog FIRST TIME = TRUE" << endl;
}
else
{
//qDebug() << "SetupDialog::SetupDialog FIRST TIME = FALSE" << endl;
//qDebug() << "SetupDialog::SetupDialog FIRST TIME = FALSE" << endl;
}
//qDebug() << "SetupDialog::SetupDialog 3.1" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.1" << endl;
logsPageTabN=-1;
//qDebug() << "SetupDialog::SetupDialog 3.2" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.2" << endl;
locator = new Locator();
//qDebug() << "SetupDialog::SetupDialog 3.3" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.3" << endl;
tabWidget = new QTabWidget;
//qDebug() << "SetupDialog::SetupDialog 3.4" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.4" << endl;
hamlibPage = new SetupPageHamLib(dataProxy, this);
//qDebug() << "SetupDialog::SetupDialog 3.4.1" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.4.1" << endl;
userDataPage = new SetupPageUserDataPage(dataProxy);
//qDebug() << "SetupDialog::SetupDialog 3.5" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.5" << endl;
bandModePage = new SetupPageBandMode(dataProxy, this);
//qDebug() << "SetupDialog::SetupDialog 3.6" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.6" << endl;
dxClusterPage = new SetupPageDxCluster(this);
//qDebug() << "SetupDialog::SetupDialog 3.7" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.7" << endl;
colorsPage = new SetupPageColors(this);
//qDebug() << "SetupDialog::SetupDialog 3.8" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.8" << endl;
miscPage = new SetupPageMisc(this);
//qDebug() << "SetupDialog::SetupDialog 3.9" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.9" << endl;
worldEditorPage = new SetupPageWorldEditor (dataProxy, this);
//qDebug() << "SetupDialog::SetupDialog 3.10" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.10" << endl;
logsPage = new SetupPageLogs(dataProxy, this);
//qDebug() << "SetupDialog::SetupDialog 3.11" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.11" << endl;
clubLogPage = new SetupPageClubLog(this);
lotwPage = new SetupPageLoTW(this);
//qDebug() << "SetupDialog::SetupDialog 3.12" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.12" << endl;
UDPPage = new SetupPageUDP(this);
//qDebug() << "SetupDialog::SetupDialog 3.13" << endl;
//qDebug() << "SetupDialog::SetupDialog 3.13" << endl;
satsPage = new SetupPageSats(dataProxy, this);
//hamlibPage = new SetupPageHamLib(dataProxy, this);
interfacesWindowsPage = new SetupPageInterfacesWindows(this);
//qDebug() << "SetupDialog::SetupDialog 4" << endl;
//qDebug() << "SetupDialog::SetupDialog 4" << endl;
tabWidget->addTab(userDataPage, tr("My Data"));
tabWidget->addTab(bandModePage, tr("Bands/Modes"));
@ -98,21 +96,18 @@ SetupDialog::SetupDialog(DataProxy_SQLite *dp, const bool _firstTime)
tabWidget->addTab(worldEditorPage, tr("World Editor"));
logsPageTabN = tabWidget->addTab(logsPage, tr("Logs"));
tabWidget->addTab(clubLogPage, "ClubLog");
tabWidget->addTab(lotwPage, "LoTW");
tabWidget->addTab(UDPPage, "WSJT-X");
tabWidget->addTab(satsPage , tr("Satellites"));
tabWidget->addTab(hamlibPage, tr ("HamLib"));
//tabWidget->addTab(interfacesWindowsPage, tr ("Interfaces"));
QPushButton *closeButton = new QPushButton(tr("Cancel"));
okButton = new QPushButton(tr("Ok"));
QPushButton *okButton = new QPushButton(tr("OK"));
connect(closeButton, SIGNAL(clicked()), this, SLOT(slotCancelButtonClicked()));
connect(okButton, SIGNAL(clicked()), this, SLOT(slotOkButtonClicked()));
connect(logsPage, SIGNAL(queryError(QString, QString, int, QString)), this, SLOT(slotQueryErrorManagement(QString, QString, int, QString)) );
connectActions();
@ -139,21 +134,21 @@ SetupDialog::SetupDialog(DataProxy_SQLite *dp, const bool _firstTime)
tabWidget->setCurrentIndex(logsPageTabN);
}
nolog = !(haveAtleastOneLog());
//qDebug() << "SetupDialog::SetupDialog 1 END" << endl;
//qDebug() << "SetupDialog::SetupDialog 1 END" << endl;
}
SetupDialog::SetupDialog(DataProxy_SQLite *dp, const QString &_configFile, const QString &_softwareVersion, const int _page, const bool _firstTime)
{
//qDebug() << "SetupDialog::SetupDialog 2: " << _configFile << "/" << _softwareVersion << "/" << QString::number(_page) ;
//qDebug() << "SetupDialog::SetupDialog 2: " << _configFile << "/" << _softwareVersion << "/" << QString::number(_page) ;
if (_firstTime)
{
//qDebug() << "/True";
//qDebug() << "/True";
}
else {
//qDebug() << "/False";
//qDebug() << "/False";
}
//qDebug() << endl;
//qDebug() << endl;
logSeverity = 7;
constrid = 2;
util = new Utilities;
@ -163,7 +158,7 @@ SetupDialog::SetupDialog(DataProxy_SQLite *dp, const QString &_configFile, const
version = _softwareVersion;
pageRequested = _page;
int logsPageTabN=-1;
//qDebug() << "SetupDialog::SetupDialog 01" << endl;
//qDebug() << "SetupDialog::SetupDialog 01" << endl;
locator = new Locator();
@ -177,14 +172,12 @@ SetupDialog::SetupDialog(DataProxy_SQLite *dp, const QString &_configFile, const
worldEditorPage = new SetupPageWorldEditor (dataProxy, this);
logsPage = new SetupPageLogs(dataProxy, this);
clubLogPage = new SetupPageClubLog(this);
lotwPage = new SetupPageLoTW(this);
UDPPage = new SetupPageUDP(this);
satsPage = new SetupPageSats(dataProxy, this);
hamlibPage = new SetupPageHamLib(dataProxy, this);
interfacesWindowsPage = new SetupPageInterfacesWindows(this);
//qDebug() << "SetupDialog::SetupDialog 02" << endl;
//qDebug() << "SetupDialog::SetupDialog 02" << endl;
tabWidget->addTab(userDataPage, tr("User data"));
tabWidget->addTab(bandModePage, tr("Bands/Modes"));
tabWidget->addTab(dxClusterPage, tr("D&X-Cluster"));
@ -193,16 +186,14 @@ SetupDialog::SetupDialog(DataProxy_SQLite *dp, const QString &_configFile, const
tabWidget->addTab(worldEditorPage, tr("World Editor"));
logsPageTabN = tabWidget->addTab(logsPage, tr("Logs"));
tabWidget->addTab(clubLogPage, tr("ClubLog"));
tabWidget->addTab(lotwPage, tr("LoTW"));
tabWidget->addTab(UDPPage, tr("WSJT-X"));
tabWidget->addTab(satsPage , tr("Satellites"));
tabWidget->addTab(hamlibPage, tr ("HamLib"));
tabWidget->addTab(interfacesWindowsPage, tr ("Interfaces"));
//qDebug() << "SetupDialog::SetupDialog 03" << endl;
//qDebug() << "SetupDialog::SetupDialog 03" << endl;
QPushButton *closeButton = new QPushButton(tr("Cancel"));
okButton = new QPushButton(tr("OK"));
QPushButton *okButton = new QPushButton(tr("OK"));
QHBoxLayout *horizontalLayout = new QHBoxLayout;
horizontalLayout->addWidget(tabWidget);
@ -216,43 +207,42 @@ SetupDialog::SetupDialog(DataProxy_SQLite *dp, const QString &_configFile, const
mainLayout->addLayout(horizontalLayout);
mainLayout->addLayout(buttonsLayout);
//qDebug() << "SetupDialog::SetupDialog 04" << endl;
//qDebug() << "SetupDialog::SetupDialog 04" << endl;
setLayout(mainLayout);
setWindowTitle(tr("Config Dialog"));
//qDebug() << "SetupDialog::SetupDialog 05" << endl;
//qDebug() << "SetupDialog::SetupDialog 05" << endl;
slotReadConfigData();
//qDebug() << "SetupDialog::SetupDialog 05.1" << endl;
//qDebug() << "SetupDialog::SetupDialog 05.1" << endl;
if ((pageRequested==6) && (logsPageTabN>0))// The user is opening a new log
{
//qDebug() << "SetupDialog::SetupDialog 05.2" << endl;
//qDebug() << "SetupDialog::SetupDialog 05.2" << endl;
tabWidget->setCurrentIndex(logsPageTabN);
}
//qDebug() << "SetupDialog::SetupDialog 05.3" << endl;
//qDebug() << "SetupDialog::SetupDialog 05.3" << endl;
nolog = !(haveAtleastOneLog());
connect(closeButton, SIGNAL(clicked()), this, SLOT(slotCancelButtonClicked()));
connect(okButton, SIGNAL(clicked()), this, SLOT(slotOkButtonClicked()));
connectActions();
//qDebug() << "SetupDialog::SetupDialog 2 - END" << endl;
//qDebug() << "SetupDialog::SetupDialog 2 - END" << endl;
}
SetupDialog::~SetupDialog()
{
//qDebug() << "SetupDialog::~SetupDialog " << endl;
//qDebug() << "SetupDialog::~SetupDialog " << endl;
}
void SetupDialog::connectActions()
{
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
connect (logsPage, SIGNAL(newLogData(QStringList)), this, SLOT(slotAnalyzeNewLogData(QStringList)));
connect(logsPage, SIGNAL(focusOK()), this, SLOT(slotFocusOK()) );
connect (userDataPage, SIGNAL(stationCallSignal(QString)), this, SLOT(slotSetStationCallSign(QString)));
connect (userDataPage, SIGNAL(operatorsSignal(QString)), this, SLOT(slotSetOperators(QString)));
connect (userDataPage, SIGNAL(enterKey()), this, SLOT(slotOkButtonClicked()));
@ -262,17 +252,17 @@ void SetupDialog::connectActions()
void SetupDialog::setData(const QString &_configFile, const QString &_softwareVersion, const int _page, const bool _firstTime)
{
//qDebug() << "SetupDialog::setData: " << "/" << _configFile << "/" << _softwareVersion << "/" << QString::number(_page) << endl;
//qDebug() << "SetupDialog::setData: " << "/" << _configFile << "/" << _softwareVersion << "/" << QString::number(_page) << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
nolog = !(haveAtleastOneLog());
firstTime = _firstTime;
if (firstTime)
{
//qDebug() << "SetupDialog::setData FIRST TIME! " << endl;
//qDebug() << "SetupDialog::setData FIRST TIME! " << endl;
}
else
{
//qDebug() << "SetupDialog::setData NOT FIRST TIME! " << endl;
//qDebug() << "SetupDialog::setData NOT FIRST TIME! " << endl;
miscPage->setUseDefaultDBPath(miscPage->getDefaultDBPath());
}
@ -282,12 +272,12 @@ void SetupDialog::setData(const QString &_configFile, const QString &_softwareVe
setPage(_page);
//removeBandModeDuplicates();
emit debugLog (Q_FUNC_INFO, "END", logSeverity);
//qDebug() << "SetupDialog::setData - END" << endl;
//qDebug() << "SetupDialog::setData - END" << endl;
}
void SetupDialog::setConfigFile(const QString &_configFile)
{
//qDebug() << "SetupDialog::setConfigFile" << endl;
//qDebug() << "SetupDialog::setConfigFile" << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
configFileName = _configFile;
emit debugLog (Q_FUNC_INFO, "END", logSeverity);
@ -295,7 +285,7 @@ void SetupDialog::setConfigFile(const QString &_configFile)
void SetupDialog::setSoftVersion(const QString &_softwareVersion)
{
//qDebug() << "SetupDialog::setSoftVersion" << endl;
//qDebug() << "SetupDialog::setSoftVersion" << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
version = _softwareVersion;
emit debugLog (Q_FUNC_INFO, "END", logSeverity);
@ -304,7 +294,7 @@ void SetupDialog::setSoftVersion(const QString &_softwareVersion)
void SetupDialog::setPage(const int _page)
{
//qDebug() << "SetupDialog::setPage("<<QString::number(_page) << ")" << endl;
//qDebug() << "SetupDialog::setPage("<<QString::number(_page) << ")" << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
pageRequested = _page;
@ -317,7 +307,7 @@ void SetupDialog::setPage(const int _page)
void SetupDialog::slotCancelButtonClicked()
{
//qDebug() << "SetupDialog::slotCancelButtonClicked" << endl;
//qDebug() << "SetupDialog::slotCancelButtonClicked" << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
if (firstTime || nolog)
{
@ -355,7 +345,7 @@ void SetupDialog::slotCancelButtonClicked()
void SetupDialog::createIcons()
{
//qDebug() << "SetupDialog::createIcons" << endl;
//qDebug() << "SetupDialog::createIcons" << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
QListWidgetItem *configButton = new QListWidgetItem(contentsWidget);
configButton->setIcon(QIcon(":/images/config.png"));
@ -408,7 +398,7 @@ void SetupDialog::createIcons()
void SetupDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous)
{
//qDebug() << "SetupDialog::changePage" << endl;
//qDebug() << "SetupDialog::changePage" << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
if (!current)
current = previous;
@ -421,14 +411,14 @@ void SetupDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous
void SetupDialog::slotOkButtonClicked()
{
//qDebug() << "SetupDialog::slotOkButtonClicked" << endl;
//qDebug() << "SetupDialog::slotOkButtonClicked" << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
if (!miscPage->areDBPathChangesApplied())
{
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Warning);
msgBox.setText(tr("DB has not been moved to new path."));
msgBox.setText(tr("DB has not been moved to new path"));
msgBox.setInformativeText(tr("Go to the Misc tab and click on Move DB\n or the DB will not be moved to the new location."));
msgBox.exec();
emit debugLog (Q_FUNC_INFO, "END-1", logSeverity);
@ -447,7 +437,7 @@ void SetupDialog::slotOkButtonClicked()
if (!haveAtleastOneLog())
{
//qDebug() << "SetupDialog::slotOkButtonClicked - NO LOG!" << endl;
//qDebug() << "SetupDialog::slotOkButtonClicked - NO LOG!" << endl;
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Information);
@ -463,6 +453,7 @@ void SetupDialog::slotOkButtonClicked()
return;
}
QFile file (configFileName);
QString tmp;
tmp = "true";
@ -576,12 +567,7 @@ void SetupDialog::slotOkButtonClicked()
stream << "CheckNewVersions=" << miscPage->getCheckNewVersions() << ";" << endl;
stream << "ManageDXMarathon=" << miscPage->getDXMarathon() << ";" << endl;
stream << "DebugLog=" << miscPage->getDebugLog() << ";" << endl;
//stream << "LogSort=" << miscPage->getLogSort() << ";" << endl;
stream << "SendEQSLByDefault=" << miscPage->getSendEQSLByDefault() << ";" << endl;
stream << "PSTRotatorActive=" << interfacesWindowsPage->getSendToPSTRotator() << ";" << endl;
stream << "PSTRotatorServer=" << interfacesWindowsPage->getPSTRotatorUDPServer() << ";" << endl;
stream << "PSTRotatorPort=" << interfacesWindowsPage->getPSTRotatorUDPServerPort() << ";" << endl;
stream << "LogSort=" << miscPage->getLogSort() << ";" << endl;
if ((miscPage->getReportInfo()).toUpper() == "TRUE")
{
@ -599,7 +585,7 @@ void SetupDialog::slotOkButtonClicked()
stringList << dxClusterPage->getDxclusterServersComboBox();
if (stringList.size()>0)
{
{
for (int i = 0; i < stringList.size(); i++)
{
stream << "DXClusterServerPort="<< stringList.at(i) << ";" << endl;
@ -614,7 +600,6 @@ void SetupDialog::slotOkButtonClicked()
stream << "DXClusterShowAnn=" << dxClusterPage->getShowANNRadiobutton() << ";" << endl;
stream << "DXClusterShowWWV=" << dxClusterPage->getShowWWVRadiobutton() << ";" << endl;
stream << "DXClusterShowWCY=" << dxClusterPage->getShowWCYRadiobutton() << ";" << endl;
stream << "DXClusterSave=" << dxClusterPage->getSaveActivityRadiobutton() << ";" << endl;
stream << "NewOneColor=" << colorsPage->getNewOneColor() << ";" << endl;
stream << "NeededColor=" << colorsPage->getNeededColor() << ";" << endl;
@ -637,26 +622,6 @@ void SetupDialog::slotOkButtonClicked()
// CLUBLOG
// LOTW
stream << "LoTWActive=" << lotwPage->getLoTW() << ";" << endl;
tmp = lotwPage->getPath();
if (tmp.length()>0)
{
stream << "LoTWPath=" << tmp << ";" << endl;
}
tmp = lotwPage->getLoTWUser();
if (tmp.length()>0)
{
stream << "LoTWUSer=" << tmp << ";" << endl;
}
tmp = lotwPage->getLoTWPass();
if (tmp.length()>0)
{
stream << "LoTWPass=" << tmp << ";" << endl;
}
// LOTW
//WSJTX
stream << "UDPServer=" << UDPPage->getUDPServer() << ";" << endl;
stream << "UDPServerPort=" << UDPPage->getUDPServerPort() << ";" << endl;
@ -665,26 +630,26 @@ void SetupDialog::slotOkButtonClicked()
stream << "RealTimeFromWSJTX=" << UDPPage->getReaDataFromWSJTx() << ";" << endl;
stream << "InfoTimeOut=" << UDPPage->getTimeout() << ";" << endl;
//qDebug() << "SetupDialog::slotOkButtonClicked: hamlib" << endl;
//qDebug() << "SetupDialog::slotOkButtonClicked: hamlib" << endl;
QString _aa = hamlibPage->getData();
stream << _aa << endl;
//qDebug() << "SetupDialog::slotOkButtonClicked: hamlib-2: " << _aa << endl;
//qDebug() << "SetupDialog::slotOkButtonClicked: hamlib-2: " << _aa << endl;
//WSJTX
file.close ();
}
//qDebug() << "SetupDialog::slotOkButtonClicked - just before leaving" << endl;
//qDebug() << "SetupDialog::slotOkButtonClicked - just before leaving" << endl;
QDialog::accept();
emit debugLog (Q_FUNC_INFO, "END", logSeverity);
//qDebug() << "SetupDialog::slotOkButtonClicked - END" << endl;
//qDebug() << "SetupDialog::slotOkButtonClicked - END" << endl;
//close();
}
void SetupDialog::slotReadConfigData()
{
//qDebug() << "SetupDialog::slotReadConfigData" << endl;
//qDebug() << "SetupDialog::slotReadConfigData" << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
if (firstTime)
{
@ -695,16 +660,16 @@ void SetupDialog::slotReadConfigData()
bandModePage->setActiveBands(bands);
}
//qDebug() << "SetupDialog::slotReadConfigData - 1" << endl;
//qDebug() << "SetupDialog::slotReadConfigData - 1" << endl;
QFile file(configFileName);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)){
//qDebug() << "SetupDialog::slotReadConfigData() File not found" << configFileName << endl;
//qDebug() << "SetupDialog::slotReadConfigData() File not found" << configFileName << endl;
//firstTime = true;
emit debugLog (Q_FUNC_INFO, "END-1", logSeverity);
return;
}
//qDebug() << "SetupDialog::slotReadConfigData - 2" << endl;
//qDebug() << "SetupDialog::slotReadConfigData - 2" << endl;
//dxClusterServers.clear();
@ -712,9 +677,9 @@ void SetupDialog::slotReadConfigData()
while (!file.atEnd()) {
QByteArray line = file.readLine();
processConfigLine(line);
//qDebug() << "SetupDialog::slotReadConfigData - in the while" << endl;
//qDebug() << "SetupDialog::slotReadConfigData - in the while" << endl;
}
//qDebug() << "SetupDialog::slotReadConfigData - 3" << endl;
//qDebug() << "SetupDialog::slotReadConfigData - 3" << endl;
dxClusterPage->setDxclusterServersComboBox(dxClusterServers);
dxClusterPage->setSelectedDxClusterServer(dxClusterServerToUse);
@ -730,10 +695,12 @@ void SetupDialog::slotReadConfigData()
}
modes.removeDuplicates();
//qDebug() << "SetupDialog::slotReadConfigData - duplicate modes: " << QString::number(a) << endl;
bandModePage->setActiveModes(modes);
bands.removeDuplicates();
//qDebug() << "SetupDialog::slotReadConfigData - duplicate bands: " << QString::number(a) << endl;
bandModePage->setActiveBands(bands);
//qDebug() << "SetupDialog::slotReadConfigData - END" << endl;
//qDebug() << "SetupDialog::slotReadConfigData - END" << endl;
emit debugLog (Q_FUNC_INFO, "END", logSeverity);
}
@ -741,7 +708,7 @@ void SetupDialog::slotReadConfigData()
bool SetupDialog::processConfigLine(const QString &_line)
{
//qDebug() << "SetupDialog::processConfigLine: " << _line << endl;
//qDebug() << "SetupDialog::processConfigLine: " << _line << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
QString line = _line.simplified();
@ -752,12 +719,12 @@ bool SetupDialog::processConfigLine(const QString &_line)
if (line.startsWith('#')){
//qDebug() << "SetupDialog::processConfigLine: Comment Line!" << endl;
//qDebug() << "SetupDialog::processConfigLine: Comment Line!" << endl;
emit debugLog (Q_FUNC_INFO, "END-1", logSeverity);
return true;
}
if (!( (line.contains('=')) && (line.contains(';')))){
//qDebug() << "SetupDialog::processConfigLine: Wrong Line!" << endl;
//qDebug() << "SetupDialog::processConfigLine: Wrong Line!" << endl;
emit debugLog (Q_FUNC_INFO, "END-2", logSeverity);
return false;
}
@ -770,10 +737,10 @@ bool SetupDialog::processConfigLine(const QString &_line)
value = value.left(value.length() - (value.length() - endValue));
}
value = checkAndFixASCIIinADIF(value); // Check whether the value is valid.
//qDebug() << "SetupDialog::processConfigLine: TAB: " << tab << endl;
//qDebug() << "SetupDialog::processConfigLine: VALUE: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: TAB: " << tab << endl;
//qDebug() << "SetupDialog::processConfigLine: VALUE: " << value << endl;
if (tab == "CALLSIGN"){
//qDebug() << "SetupDialog::processConfigLine: CALLSIGN: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: CALLSIGN: " << value << endl;
userDataPage->setStationQrz(value);
}else if (tab == "OPERATORS"){
userDataPage->setOperators(value);
@ -806,7 +773,7 @@ bool SetupDialog::processConfigLine(const QString &_line)
miscPage->setUseDefaultDBPath(value);
}else if (tab=="DEFAULTADIFFILE"){
miscPage->setDefaultFileName(value.toUpper());
//qDebug() << "SetupDialog::processConfigLine: FILE: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: FILE: " << value << endl;
}else if (tab=="IMPERIALSYSTEM"){
miscPage->setImperial(value.toUpper());
}else if (tab=="KEEPMYDATA"){
@ -829,24 +796,9 @@ bool SetupDialog::processConfigLine(const QString &_line)
else if (tab=="PROVIDEINFO"){
miscPage->setReportInfo(value);
}
/*
else if (tab=="LOGSORT"){
miscPage->setLogSort(value);
}
*/
else if (tab=="SENDEQSLBYDEFAULT"){
miscPage->setSetEQSLByDefault(value);
}
else if (tab=="PSTROTATORACTIVE"){
interfacesWindowsPage->setSendToPSTRotator(value);
}
else if (tab=="PSTROTATORPORT"){
interfacesWindowsPage->setPSTRotatorUDPServerPort(value);
}
else if (tab=="PSTROTATORSERVER")
{
interfacesWindowsPage->setPSTRotatorUDPServer(value);
}
else if (tab=="UDPSERVER"){
UDPPage->setUDPServer(value);
}
@ -959,14 +911,11 @@ bool SetupDialog::processConfigLine(const QString &_line)
dxClusterPage->setShowWCYRadiobutton(value);
}else if(tab =="DXCLUSTERSERVERPORT"){
dxClusterServers << value;
//qDebug() << "SetupDialog::processConfigLine: dxClusterServers: " << dxClusterServers.last() << endl;
//qDebug() << "SetupDialog::processConfigLine: dxClusterServers: " << dxClusterServers.last() << endl;
}else if (tab =="DXCLUSTERSERVERTOUSE"){
}else if (tab =="DXCLUSTERSERVERTOUSE"){
dxClusterServerToUse=value;
}
else if (tab =="DXCLUSTERSAVE"){
dxClusterPage->setSaveActivityRadiobutton(value);
}
else if(tab =="NEWONECOLOR"){
colorsPage->setNewOneColor(value);
}else if(tab =="NEEDEDCOLOR"){
@ -977,53 +926,53 @@ bool SetupDialog::processConfigLine(const QString &_line)
colorsPage->setConfirmedColor(value);
}else if(tab =="DEFAULTCOLOR"){
colorsPage->setDefaultColor(value);
//qDebug() << "SetupDialog::processConfigLine: DEFAULTCOLOR: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: DEFAULTCOLOR: " << value << endl;
}else if(tab =="HAMLIBRIGTYPE"){
//qDebug() << "SetupDialog::processConfigLine: Before HAMLIBRIGTYPE: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: Before HAMLIBRIGTYPE: " << value << endl;
hamlibPage->setRigType(value);
//qDebug() << "SetupDialog::processConfigLine: After HAMLIBRIGTYPE: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: After HAMLIBRIGTYPE: " << value << endl;
}else if(tab =="HAMLIBSERIALPORT"){
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALPORT: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALPORT: " << value << endl;
hamlibPage->setSerialPort(value);
}else if(tab =="HAMLIBSERIALBAUDS"){
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALBAUDS: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALBAUDS: " << value << endl;
hamlibPage->setSerialSpeed(value);
}else if(tab =="HAMLIB"){
//qDebug() << "SetupDialog::processConfigLine: HAMLIB: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: HAMLIB: " << value << endl;
hamlibPage->setActive(value);
}else if(tab=="HAMLIBREADONLY"){
hamlibPage->setReadOnly(value);
}else if(tab =="HAMLIBSERIALDATABITS"){
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALDATABITS: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALDATABITS: " << value << endl;
hamlibPage->setDataBits(value);
}else if(tab =="HAMLIBSERIALSTOPBITS"){
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALSTOPBITS: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALSTOPBITS: " << value << endl;
hamlibPage->setStopBits(value);
}else if(tab =="HAMLIBSERIALFLOWCONTROL"){
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALFLOWCONTROL: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALFLOWCONTROL: " << value << endl;
hamlibPage->setFlowControl(value);
}else if(tab =="HAMLIBSERIALPARITY"){
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALPARITY: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALPARITY: " << value << endl;
hamlibPage->setParity(value);
}else if(tab =="HAMLIBSERIALRTS"){
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALRTS: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALRTS: " << value << endl;
//hamlibPage->setRTS(value);
}else if(tab =="HAMLIBSERIALDTR"){
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALDTR: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: HAMLIBSERIALDTR: " << value << endl;
//hamlibPage->setDTR(value);
}else if(tab =="SELECTEDLOG"){
//qDebug() << "SetupDialog::processConfigLine: SELECTEDLOG: " << value << endl;
//qDebug() << "SetupDialog::processConfigLine: SELECTEDLOG: " << value << endl;
i = value.toInt();
if (dataProxy->doesThisLogExist(i))
{
//qDebug() << "SetupDialog::processConfigLine: dataProxy->doesThisLogExist TRUE" << endl;
//qDebug() << "SetupDialog::processConfigLine: dataProxy->doesThisLogExist TRUE" << endl;
}
else
{
//qDebug() << "SetupDialog::processConfigLine: dataProxy->doesThisLogExist FALSE" << endl;
//qDebug() << "SetupDialog::processConfigLine: dataProxy->doesThisLogExist FALSE" << endl;
i = 0;
while(!dataProxy->doesThisLogExist(i))
{
@ -1031,7 +980,7 @@ bool SetupDialog::processConfigLine(const QString &_line)
}
}
logsPage->setSelectedLog(i);
//qDebug() << "SetupDialog::processConfigLine: dataProxy->doesThisLogExist END" << endl;
//qDebug() << "SetupDialog::processConfigLine: dataProxy->doesThisLogExist END" << endl;
}else if(tab =="CLUBLOGACTIVE"){
clubLogPage->setClubLog(value);
@ -1050,26 +999,13 @@ bool SetupDialog::processConfigLine(const QString &_line)
}
else if(tab =="CLUBLOGUSESTATIONCALLSIGN"){
clubLogPage->setUseStationCall(value);
}
else if(tab =="LOTWACTIVE"){
lotwPage->setLoTW(value);
}
else if(tab =="LOTWPATH"){
lotwPage->setPath(value);
}
else if(tab =="LOTWUSER"){
lotwPage->setLoTWUser(value);
}
else if(tab =="LOTWPASS"){
lotwPage->setLoTWPass(value);
}else{
//qDebug() << "SetupDialog::processConfigLine: NONE: " << endl;
//qDebug() << "SetupDialog::processConfigLine: NONE: " << endl;
}
// Lines are: Option = value;
//qDebug() << "SetupDialog::processConfigLine: END " << endl;
//qDebug() << "SetupDialog::processConfigLine: END " << endl;
emit debugLog (Q_FUNC_INFO, "END", logSeverity);
return true;
@ -1079,7 +1015,7 @@ bool SetupDialog::processConfigLine(const QString &_line)
void SetupDialog::readActiveBands (const QString &actives)
{ // Checks a "10m, 12m" QString, checks if they are valid bands and import to the
// bands used in the program
//qDebug() << "SetupDialog::readActiveBands: " << actives << endl;
//qDebug() << "SetupDialog::readActiveBands: " << actives << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
bool atLeastOne = false;
@ -1093,21 +1029,22 @@ void SetupDialog::readActiveBands (const QString &actives)
{
if (!atLeastOne)
{
//qDebug() << "SetupDialog::readActiveBands (at least One!): " << values.at(i) << endl;
//qDebug() << "SetupDialog::readActiveBands (at least One!): " << values.at(i) << endl;
atLeastOne = true;
_abands.clear();
}
_abands << values.at(i);
//qDebug() << "SetupDialog::readActiveBands: " << values.at(i) << endl;
//qDebug() << "SetupDialog::readActiveBands: " << values.at(i) << endl;
}
}
bands.clear();
//_abands.removeDuplicates();
_abands.removeDuplicates();
bands << dataProxy->getBandsInLog(-1);
bands << _abands;
bands.removeDuplicates();
emit debugLog (Q_FUNC_INFO, "END", logSeverity);
@ -1115,7 +1052,7 @@ void SetupDialog::readActiveBands (const QString &actives)
void SetupDialog::readActiveModes (const QString &actives)
{
//qDebug() << "SetupDialog::readActiveModes: " << actives << endl;
//qDebug() << "SetupDialog::readActiveModes: " << actives << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
bool atLeastOne = false;
@ -1139,16 +1076,16 @@ void SetupDialog::readActiveModes (const QString &actives)
}
modes.clear();
modes = dataProxy->getModesInLog(-1);
modes << dataProxy->getModesInLog(-1);
modes << _amodes;
modes.removeDuplicates();
emit debugLog (Q_FUNC_INFO, "END", logSeverity);
//qDebug() << "SetupDialog::readActiveModes: " << modes.join(" / ") << endl;
//qDebug() << "SetupDialog::readActiveModes: " << modes.join(" / ") << endl;
}
bool SetupDialog::isValidBand (const QString &b)
{
//qDebug() << "SetupDialog::isValidBand: "<< b << endl;
//qDebug() << "SetupDialog::isValidBand: "<< b << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
QString stringQuery = QString("SELECT id FROM band WHERE name='%1'").arg(b);
QSqlQuery query(stringQuery);
@ -1159,7 +1096,7 @@ bool SetupDialog::isValidBand (const QString &b)
}
bool SetupDialog::isValidMode (const QString &b)
{
//qDebug() << "SetupDialog::isValidMode: " << b << endl;
//qDebug() << "SetupDialog::isValidMode: " << b << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
QString stringQuery = QString("SELECT id FROM mode WHERE name='%1'").arg(b);
QSqlQuery query(stringQuery);
@ -1171,7 +1108,7 @@ bool SetupDialog::isValidMode (const QString &b)
void SetupDialog::setDefaults()
{
//qDebug() << "SetupDialog::setDefaults" << endl;
//qDebug() << "SetupDialog::setDefaults" << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
miscPage->setRealTime("TRUE");
miscPage->setUTCTime("TRUE");
@ -1184,8 +1121,7 @@ void SetupDialog::setDefaults()
miscPage->setReportInfo("FALSE");
miscPage->setDXMarathon("FALSE");
miscPage->setDebugLog("FALSE");
//miscPage->setLogSort("FALSE");
miscPage->setSetEQSLByDefault("TRUE");
miscPage->setLogSort("FALSE");
UDPPage->setUDPServer("FALSE");
UDPPage->setUDPServerPort("2237");
@ -1193,9 +1129,6 @@ void SetupDialog::setDefaults()
UDPPage->setLogFromWSJTx("FALSE");
UDPPage->setReaDataFromWSJTx("FALSE");
UDPPage->setAutoLogFromWSJTx("FALSE");
interfacesWindowsPage->setSendToPSTRotator("FALSE");
interfacesWindowsPage->setPSTRotatorUDPServer("locahost");
interfacesWindowsPage->setPSTRotatorUDPServerPort("12040");
dxClusterPage->setShowHFRadiobutton("TRUE");
dxClusterPage->setShowVHFRadiobutton("TRUE");
@ -1225,7 +1158,7 @@ void SetupDialog::setDefaults()
QString SetupDialog::checkAndFixASCIIinADIF(const QString &_data)
{
//qDebug() << "SetupDialog::checkAndFixASCIIinADIF " << _data << endl;
//qDebug() << "SetupDialog::checkAndFixASCIIinADIF " << _data << endl;
//TODO: this function is also in the FileManager class. Maybe I should call that one and keep just one copy
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
ushort unicodeVal;
@ -1240,7 +1173,7 @@ QString SetupDialog::checkAndFixASCIIinADIF(const QString &_data)
{
newString.append(st.at(i));
}
//qDebug() << "SetupDialog::checkAndFixunicodeinADIF: " << st.at(i) <<" = " << QString::number(unicodeVal) << endl;
//qDebug() << "SetupDialog::checkAndFixunicodeinADIF: " << st.at(i) <<" = " << QString::number(unicodeVal) << endl;
}
// Show into another lineEdit
@ -1275,20 +1208,20 @@ void SetupDialog::setClubLogActive(const bool _b)
void SetupDialog::checkIfNewBandOrMode()
{
//qDebug() << "SetupDialog::checkIfNewBandOrMode: logSeverity: " << QString::number(logSeverity) << endl;
//qDebug() << "SetupDialog::checkIfNewBandOrMode: logSeverity: " << QString::number(logSeverity) << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
QStringList _items;
_items.clear();
//qDebug() << "SetupDialog::checkIfNewBandOrMode -1" << endl;
//qDebug() << "SetupDialog::checkIfNewBandOrMode -1" << endl;
_items << dataProxy->getBandsInLog(-1);
//qDebug() << "SetupDialog::checkIfNewBandOrMode -2" << endl;
//qDebug() << "SetupDialog::checkIfNewBandOrMode -2" << endl;
_items << (bandModePage->getBands()).split(", ", QString::SkipEmptyParts);
//qDebug() << "SetupDialog::checkIfNewBandOrMode -3" << endl;
//qDebug() << "SetupDialog::checkIfNewBandOrMode -3" << endl;
_items.removeDuplicates();
//qDebug() << "SetupDialog::checkIfNewBandOrMode -4" << endl;
//qDebug() << "SetupDialog::checkIfNewBandOrMode -4" << endl;
bandModePage->setActiveBands(_items);
//qDebug() << "SetupDialog::checkIfNewBandOrMode -5" << endl;
//qDebug() << "SetupDialog::checkIfNewBandOrMode -5" << endl;
_items.clear();
_items << dataProxy->getModesInLog(-1);
@ -1296,14 +1229,14 @@ void SetupDialog::checkIfNewBandOrMode()
_items.removeDuplicates();
bandModePage->setActiveModes(_items);
emit debugLog (Q_FUNC_INFO, "END", logSeverity);
//qDebug() << "SetupDialog::checkIfNewBandOrMode END" << endl;
//qDebug() << "SetupDialog::checkIfNewBandOrMode END" << endl;
}
void SetupDialog::slotAnalyzeNewLogData(const QStringList _qs)
{
//qDebug() << "SetupDialog::slotAnalyzeNewLogData (length=" << QString::number(_qs.length()) << ")" << endl;
//qDebug() << "SetupDialog::slotAnalyzeNewLogData" << endl;
//qDebug() << "SetupDialog::slotAnalyzeNewLogData (length=" << QString::number(_qs.length()) << ")" << endl;
//qDebug() << "SetupDialog::slotAnalyzeNewLogData" << endl;
// We receive the station callsign and operators from the logs tab
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
if (_qs.length()!=2)
@ -1318,7 +1251,7 @@ void SetupDialog::slotAnalyzeNewLogData(const QStringList _qs)
void SetupDialog::slotSetStationCallSign(const QString &_p)
{
//qDebug() << "SetupDialog::slotSetStationCallSign: " << _p << endl;
//qDebug() << "SetupDialog::slotSetStationCallSign: " << _p << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
logsPage->setDefaultStationCallsign(_p);
emit debugLog (Q_FUNC_INFO, "END", logSeverity);
@ -1326,7 +1259,7 @@ void SetupDialog::slotSetStationCallSign(const QString &_p)
void SetupDialog::slotSetOperators(const QString &_p)
{
//qDebug() << "SetupDialog::slotSetOperators: " << _p << endl;
//qDebug() << "SetupDialog::slotSetOperators: " << _p << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
logsPage->setDefaultOperators(_p);
emit debugLog (Q_FUNC_INFO, "END", logSeverity);
@ -1343,14 +1276,3 @@ void SetupDialog::slotQueryErrorManagement(QString functionFailed, QString error
emit debugLog (Q_FUNC_INFO, "END", logSeverity);
}
void SetupDialog::slotFocusOK()
{
//qDebug() << "SetupDialog::slotFocusOK" << endl;
okButton->setFocus(Qt::OtherFocusReason);
}
void SetupDialog::showEvent(QShowEvent *event)
{
QWidget::showEvent(event);
userDataPage->setStationFocus();
}

View File

@ -22,26 +22,26 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include <QDialog>
#include "setuppages/setuppageuserdata.h"
#include "setuppages/setuppagebandmode.h"
#include "setuppages/setuppagemisc.h"
#include "setuppages/setuppagedxcluster.h"
#include "setuppages/setuppagecolors.h"
#include "setuppages/setuppagelogs.h"
#include "setuppages/setuppageworldeditor.h"
#include "setuppages/setuppageclublog.h"
#include "setuppages/setuppagelotw.h"
#include "setuppages/setuppageudp.h"
#include "setuppages/setuppagesats.h"
#include "setuppages/setuppagehamlib.h"
#include "setuppages/setuppageinterfaceswindows.h"
#include "setuppageuserdata.h"
#include "setuppagebandmode.h"
#include "setuppagemisc.h"
#include "setuppagedxcluster.h"
#include "setuppagecolors.h"
#include "setuppagelogs.h"
#include "setuppageworldeditor.h"
#include "setuppageclublog.h"
#include "setuppageudp.h"
#include "setuppagesats.h"
#include "setuppagehamlib.h"
#include "utilities.h"
#include "locator.h"
@ -80,10 +80,9 @@ private slots:
void slotSetStationCallSign(const QString &_p); // We receive te station callsign from the userData tab to fill the new log
void slotSetOperators(const QString &_p); // We receive te station operators from the userData tab to fill the new log
void slotQueryErrorManagement(QString functionFailed, QString errorCodeS, int errorCodeN, QString failedQuery);
void slotFocusOK();
private:
void showEvent(QShowEvent *event);
void setConfigFile(const QString &_configFile);
void setSoftVersion(const QString &_softwareVersion);
void setConfigured(const bool _configured);
@ -108,7 +107,6 @@ private:
QString dxClusterServerToUse;
QStringList dxClusterServers;
QPushButton *okButton;
QTabWidget *tabWidget;
int logsPageTabN;
@ -123,11 +121,9 @@ private:
SetupPageLogs *logsPage;
SetupPageWorldEditor *worldEditorPage;
SetupPageClubLog *clubLogPage;
SetupPageLoTW *lotwPage;
SetupPageUDP *UDPPage;
SetupPageSats *satsPage;
SetupPageHamLib *hamlibPage;
SetupPageInterfacesWindows *interfacesWindowsPage;
int pageRequested; // The page on the Dialog that is requested to be shown when you call it
//QString klogDir;

View File

@ -20,11 +20,11 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include "setuppages/setupentitydialog.h"
#include "setupentitydialog.h"
//#include <QDebug>
/*
This class calls all the othet "Setup..." to manage the configuration
@ -34,7 +34,7 @@ This class calls all the othet "Setup..." to manage the configuration
SetupEntityDialog::SetupEntityDialog(){
//qDebug() << "SetupEntityDialog::SetupEntityDialog: " << endl;
//qDebug() << "SetupEntityDialog::SetupEntityDialog: " << endl;
//QPalette::ColorRole QWidget::foregroundRole () const;
//QPalette::ColorRole
@ -64,7 +64,7 @@ SetupEntityDialog::SetupEntityDialog(){
delBool = false;
delDateBool = false;
prefBool = false;
//qDebug() << "SetupEntityDialog::SetupEntityDialog - 0" << endl;
//qDebug() << "SetupEntityDialog::SetupEntityDialog - 0" << endl;
QLabel *entityLabel = new QLabel(tr("Entity"));
entityLineEdit = new QLineEdit;
@ -98,7 +98,7 @@ SetupEntityDialog::SetupEntityDialog(){
mprefLineEdit = new QLineEdit;
mprefLineEdit->setToolTip(tr("Main prefix of the entity."));
//qDebug() << "SetupEntityDialog::SetupEntityDialog - 1" << endl;
//qDebug() << "SetupEntityDialog::SetupEntityDialog - 1" << endl;
QLabel *arrlidLabel = new QLabel(tr("ARRL ID"));
arrlidLineEdit = new QLineEdit;
@ -118,9 +118,9 @@ SetupEntityDialog::SetupEntityDialog(){
delRbutton = new QRadioButton(tr("Deleted"), this);
QPushButton *closeButton = new QPushButton(tr("Cancel"));
QPushButton *okButton = new QPushButton(tr("Ok"));
QPushButton *okButton = new QPushButton(tr("OK"));
//qDebug() << "SetupEntityDialog::SetupEntityDialog - 2" << endl;
//qDebug() << "SetupEntityDialog::SetupEntityDialog - 2" << endl;
/*
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
connect(okButton, SIGNAL(clicked()), this, SLOT(slotOkButtonClicked()));
@ -138,7 +138,7 @@ SetupEntityDialog::SetupEntityDialog(){
connect(delQDateEdit, SIGNAL(dateChanged), this, SLOT(slotCheckDeletedDate() ) );
connect(prefLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotCheckPrefixes() ) );
*/
//qDebug() << "SetupEntityDialog::SetupEntityDialog - 3" << endl;
//qDebug() << "SetupEntityDialog::SetupEntityDialog - 3" << endl;
QVBoxLayout *cqLayout = new QVBoxLayout;
cqLayout->addWidget(cqLabel);
@ -203,23 +203,23 @@ SetupEntityDialog::SetupEntityDialog(){
mainLayout->addStretch(1);
mainLayout->addSpacing(12);
mainLayout->addLayout(buttonsLayout);
//qDebug() << "SetupEntityDialog::SetupEntityDialog - 3" << endl;
//qDebug() << "SetupEntityDialog::SetupEntityDialog - 3" << endl;
setLayout(mainLayout);
setWindowTitle(tr("Entity Dialog"));
pal = lonLineEdit->palette();
//qDebug() << "SetupEntityDialog::SetupEntityDialog: END" << endl;
//qDebug() << "SetupEntityDialog::SetupEntityDialog: END" << endl;
}
SetupEntityDialog::~SetupEntityDialog()
{
//qDebug() << "SetupEntityDialog::~SetupEntityDialog " << endl;
//qDebug() << "SetupEntityDialog::~SetupEntityDialog " << endl;
}
void SetupEntityDialog::slotOkButtonClicked()
{
//qDebug() << "SetupEntityDialog::slotOkButtonClicked " << endl;
//qDebug() << "SetupEntityDialog::slotOkButtonClicked " << endl;
QStringList ql;
ql.clear();
@ -261,7 +261,7 @@ void SetupEntityDialog::slotOkButtonClicked()
}
QString SetupEntityDialog::checkContinent()
{
//qDebug() << "SetupEntityDialog::checkContinent" << endl;
//qDebug() << "SetupEntityDialog::checkContinent" << endl;
if(contBool)
{
@ -276,7 +276,7 @@ QString SetupEntityDialog::checkContinent()
QString SetupEntityDialog::checkEntity()
{
//qDebug() << "SetupEntityDialog::checkEntity" << endl;
//qDebug() << "SetupEntityDialog::checkEntity" << endl;
if(entityBool)
{
@ -291,7 +291,7 @@ QString SetupEntityDialog::checkEntity()
QString SetupEntityDialog::checkMainprefix()
{
//qDebug() << "SetupEntityDialog::checkMainprefix" << endl;
//qDebug() << "SetupEntityDialog::checkMainprefix" << endl;
if(mainPrefixBool)
{
@ -306,7 +306,7 @@ QString SetupEntityDialog::checkMainprefix()
QString SetupEntityDialog::checkCQz()
{
//qDebug() << "SetupEntityDialog::checkCQz" << endl;
//qDebug() << "SetupEntityDialog::checkCQz" << endl;
if(cqBool)
{
@ -322,7 +322,7 @@ QString SetupEntityDialog::checkCQz()
QString SetupEntityDialog::checkITUz()
{
//qDebug() << "SetupEntityDialog::checkITUz" << endl;
//qDebug() << "SetupEntityDialog::checkITUz" << endl;
if(ituBool)
{
@ -338,7 +338,7 @@ QString SetupEntityDialog::checkITUz()
QString SetupEntityDialog::checkLatitude()
{
//qDebug() << "SetupEntityDialog::checkLatitude" << endl;
//qDebug() << "SetupEntityDialog::checkLatitude" << endl;
if(latBool)
{
@ -354,7 +354,7 @@ QString SetupEntityDialog::checkLatitude()
QString SetupEntityDialog::checkLongitude()
{
//qDebug() << "SetupEntityDialog::checkLongitude" << endl;
//qDebug() << "SetupEntityDialog::checkLongitude" << endl;
if(lonBool)
{
@ -370,7 +370,7 @@ QString SetupEntityDialog::checkLongitude()
QString SetupEntityDialog::checkUTC()
{
//qDebug() << "SetupEntityDialog::checkUTC" << endl;
//qDebug() << "SetupEntityDialog::checkUTC" << endl;
if(utcBool)
{
@ -386,7 +386,7 @@ QString SetupEntityDialog::checkUTC()
QString SetupEntityDialog::checkARRLid()
{
//qDebug() << "SetupEntityDialog::checkARRLid" << endl;
//qDebug() << "SetupEntityDialog::checkARRLid" << endl;
if(arrlidBool)
{
@ -403,7 +403,7 @@ QString SetupEntityDialog::checkARRLid()
QString SetupEntityDialog::checkDeleted()
{
//qDebug() << "SetupEntityDialog::checkDeleted" << endl;
//qDebug() << "SetupEntityDialog::checkDeleted" << endl;
if(delBool)
{
@ -419,7 +419,7 @@ QString SetupEntityDialog::checkDeleted()
QString SetupEntityDialog::checkDeletedDate()
{
//qDebug() << "SetupEntityDialog::checkDeletedDate" << endl;
//qDebug() << "SetupEntityDialog::checkDeletedDate" << endl;
if(delDateBool)
{
@ -434,7 +434,7 @@ QString SetupEntityDialog::checkDeletedDate()
QString SetupEntityDialog::checkPrefixes()
{
//qDebug() << "SetupEntityDialog::checkPrefixes" << endl;
//qDebug() << "SetupEntityDialog::checkPrefixes" << endl;
if(prefBool)
{
@ -451,7 +451,7 @@ QString SetupEntityDialog::checkPrefixes()
void SetupEntityDialog::slotCancelButtonClicked()
{
//qDebug() << "SetupEntityDialog::slotCancelButtonClicked " << endl;
//qDebug() << "SetupEntityDialog::slotCancelButtonClicked " << endl;
reject();
@ -459,7 +459,7 @@ void SetupEntityDialog::slotCancelButtonClicked()
void SetupEntityDialog::slotCheckEntity()
{
//qDebug() << "SetupEntityDialog::slotCheckEntity " << endl;
//qDebug() << "SetupEntityDialog::slotCheckEntity " << endl;
QString aux;
aux = entityLineEdit->text();
@ -478,7 +478,7 @@ void SetupEntityDialog::slotCheckEntity()
void SetupEntityDialog::slotCheckMainprefix()
{
//qDebug() << "SetupEntityDialog::slotCheckMainprefix" << endl;
//qDebug() << "SetupEntityDialog::slotCheckMainprefix" << endl;
QString aux;
aux = mprefLineEdit->text();
@ -497,7 +497,7 @@ void SetupEntityDialog::slotCheckMainprefix()
void SetupEntityDialog::slotCheckCQz()
{
//qDebug() << "SetupEntityDialog::slotCheckCQz" << endl;
//qDebug() << "SetupEntityDialog::slotCheckCQz" << endl;
QString aux;
aux = cqLineEdit->text();
@ -516,7 +516,7 @@ void SetupEntityDialog::slotCheckCQz()
void SetupEntityDialog::slotCheckITUz()
{
//qDebug() << "SetupEntityDialog::slotCheckITUz" << endl;
//qDebug() << "SetupEntityDialog::slotCheckITUz" << endl;
QString aux;
@ -536,7 +536,7 @@ void SetupEntityDialog::slotCheckITUz()
void SetupEntityDialog::slotCheckContinent()
{
//qDebug() << "SetupEntityDialog::slotCheckContinent" << endl;
//qDebug() << "SetupEntityDialog::slotCheckContinent" << endl;
QString aux;
aux = contLineEdit->text();
@ -555,7 +555,7 @@ void SetupEntityDialog::slotCheckContinent()
void SetupEntityDialog::slotCheckLatitude()
{
//qDebug() << "SetupEntityDialog::slotCheckLatitude" << endl;
//qDebug() << "SetupEntityDialog::slotCheckLatitude" << endl;
QString aux;
aux = latLineEdit->text();
@ -574,7 +574,7 @@ void SetupEntityDialog::slotCheckLatitude()
void SetupEntityDialog::slotCheckLongitude()
{
//qDebug() << "SetupEntityDialog::slotCheckLongitude" << endl;
//qDebug() << "SetupEntityDialog::slotCheckLongitude" << endl;
@ -600,7 +600,7 @@ void SetupEntityDialog::slotCheckLongitude()
void SetupEntityDialog::slotCheckUTC()
{
//qDebug() << "SetupEntityDialog::slotCheckUTC" << endl;
//qDebug() << "SetupEntityDialog::slotCheckUTC" << endl;
QString aux;
aux = utcLineEdit->text();
@ -619,7 +619,7 @@ void SetupEntityDialog::slotCheckUTC()
void SetupEntityDialog::slotCheckARRLid()
{
//qDebug() << "SetupEntityDialog::slotCheckARRLid" << endl;
//qDebug() << "SetupEntityDialog::slotCheckARRLid" << endl;
QString aux;
aux = arrlidLineEdit->text();
@ -640,7 +640,7 @@ void SetupEntityDialog::slotCheckARRLid()
void SetupEntityDialog::slotCheckDeleted()
{
//qDebug() << "SetupEntityDialog::slotCheckDeleted" << endl;
//qDebug() << "SetupEntityDialog::slotCheckDeleted" << endl;
if (delRbutton->isChecked())
{
@ -655,7 +655,7 @@ void SetupEntityDialog::slotCheckDeleted()
void SetupEntityDialog::slotCheckDeletedDate()
{
//qDebug() << "SetupEntityDialog::slotCheckDeletedDate" << endl;
//qDebug() << "SetupEntityDialog::slotCheckDeletedDate" << endl;
delDateBool = false;
//arrlidLineEdit->setPalette(palw);
@ -663,7 +663,7 @@ void SetupEntityDialog::slotCheckDeletedDate()
void SetupEntityDialog::slotCheckPrefixes()
{
//qDebug() << "SetupEntityDialog::slotCheckPrefixes" << endl;
//qDebug() << "SetupEntityDialog::slotCheckPrefixes" << endl;
QString aux;
aux = prefLineEdit->text();

View File

@ -22,7 +22,7 @@
* 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 <https://www.gnu.org/licenses/>. *
* along with KLog. If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/

View File

@ -1,8 +1,8 @@
#include "setuppages/setuppagebandmode.h"
#include "setuppagebandmode.h"
SetupPageBandMode::SetupPageBandMode(DataProxy_SQLite *dp, QWidget *parent) : QWidget(parent)
{
//qDebug() << "SetupPageBandMode::SetupPageBandMode" << endl;
//qDebug() << "SetupPageBandMode::SetupPageBandMode" << endl;
dataProxy = dp;
bandsListWidget = new QListWidget;
@ -35,7 +35,7 @@ SetupPageBandMode::SetupPageBandMode(DataProxy_SQLite *dp, QWidget *parent) : QW
//layout->addWidget(modesListWidget);
setLayout(layout);
//qDebug() << "SetupPageBandMode::SetupPageBandMode - END" << endl;
//qDebug() << "SetupPageBandMode::SetupPageBandMode - END" << endl;
}
SetupPageBandMode::~SetupPageBandMode()
@ -70,7 +70,7 @@ void SetupPageBandMode::addModes(QStringList _b)
QString SetupPageBandMode::getBands()
{
//qDebug() << "SetupPageBandMode::getBands" << endl;
//qDebug() << "SetupPageBandMode::getBands" << endl;
QString b;
QListWidgetItem *it;
@ -99,7 +99,7 @@ QString SetupPageBandMode::getBands()
QString SetupPageBandMode::getModes()
{
//qDebug() << "SetupPageBandMode::getModes" << endl;
//qDebug() << "SetupPageBandMode::getModes" << endl;
QString b;
QListWidgetItem *it;
@ -125,14 +125,14 @@ QString SetupPageBandMode::getModes()
{
b.chop(2);
}
//qDebug() << "SetupPageBandMode::getModes: " << b << endl;
//qDebug() << "SetupPageBandMode::getModes: " << b << endl;
return b;
}
void SetupPageBandMode::setActiveBands(QStringList q)
{
//qDebug() << "SetupPageBandMode::setActiveBands" << endl;
//qDebug() << "SetupPageBandMode::setActiveBands" << endl;
if (q.isEmpty())
{return;}
@ -162,7 +162,7 @@ void SetupPageBandMode::setActiveBands(QStringList q)
void SetupPageBandMode::setActiveModes(QStringList q)
{
//qDebug() << "SetupPageBandMode::setActiveModes" << endl;
//qDebug() << "SetupPageBandMode::setActiveModes" << endl;
if (q.isEmpty())
{return;}

Some files were not shown because too many files have changed in this diff Show More