Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ compile_commands.json
# QtCreator local machine specific files for imported projects
*creator.user*
.DS_Store
/build
5 changes: 4 additions & 1 deletion QLog.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
#-------------------------------------------------

QT += core gui sql network xml charts webenginewidgets serialport dbus quickwidgets webchannel websockets
QT += core gui sql network xml charts webenginewidgets serialport dbus quickwidgets webchannel websockets printsupport

greaterThan(QT_MAJOR_VERSION, 5): QT += widgets

Expand Down Expand Up @@ -178,6 +178,7 @@ SOURCES += \
ui/NewContactWidget.cpp \
ui/OnlineMapWidget.cpp \
ui/PaperQSLDialog.cpp \
ui/QSLLabelDialog.cpp \
ui/ProfileImageWidget.cpp \
ui/QSLImportStatDialog.cpp \
ui/QSODetailDialog.cpp \
Expand Down Expand Up @@ -342,6 +343,7 @@ HEADERS += \
ui/NewContactWidget.h \
ui/OnlineMapWidget.h \
ui/PaperQSLDialog.h \
ui/QSLLabelDialog.h \
ui/ProfileImageWidget.h \
ui/QSLImportStatDialog.h \
ui/QSODetailDialog.h \
Expand Down Expand Up @@ -402,6 +404,7 @@ FORMS += \
ui/MainWindow.ui \
ui/NewContactWidget.ui \
ui/PaperQSLDialog.ui \
ui/QSLLabelDialog.ui \
ui/ProfileImageWidget.ui \
ui/QSLImportStatDialog.ui \
ui/QSODetailDialog.ui \
Expand Down
23 changes: 23 additions & 0 deletions ui/LogbookWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "ui/ExportDialog.h"
#include "service/eqsl/Eqsl.h"
#include "ui/PaperQSLDialog.h"
#include "ui/QSLLabelDialog.h"
#include "ui/QSODetailDialog.h"
#include "core/MembershipQE.h"
#include "service/GenericCallbook.h"
Expand Down Expand Up @@ -129,12 +130,15 @@ LogbookWidget::LogbookWidget(QWidget *parent) :
ui->contactTable->addAction(ui->actionSendDXCSpot);
ui->contactTable->addAction(separator);
ui->contactTable->addAction(ui->actionExportAs);
ui->contactTable->addAction(ui->actionPrintQSLLabel);
ui->contactTable->addAction(ui->actionCallbookLookup);
ui->contactTable->addAction(separator1);
ui->contactTable->addAction(ui->actionDisplayedColumns);
ui->contactTable->addAction(separator2);
ui->contactTable->addAction(ui->actionDeleteContact);

connect(ui->actionPrintQSLLabel, &QAction::triggered, this, &LogbookWidget::printQSLLabel);

ui->contactTable->horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->contactTable->horizontalHeader(), &QHeaderView::customContextMenuRequested,
this, &LogbookWidget::showTableHeaderContextMenu);
Expand Down Expand Up @@ -976,6 +980,25 @@ void LogbookWidget::exportContact()
dialog.exec();
}

void LogbookWidget::printQSLLabel()
{
FCT_IDENTIFICATION;

const QModelIndexList &selectedIndexes = ui->contactTable->selectionModel()->selectedRows();

if ( selectedIndexes.isEmpty() )
return;

QList<QSqlRecord> qsos;
for ( const QModelIndex &index : selectedIndexes )
qsos << model->record(index.row());

QSLLabelDialog *dialog = new QSLLabelDialog(qsos, this);
dialog->setAttribute(Qt::WA_DeleteOnClose);
connect(dialog, &QDialog::finished, this, [this](int) { updateTable(); });
dialog->open();
}

void LogbookWidget::editContact()
{
FCT_IDENTIFICATION;
Expand Down
1 change: 1 addition & 0 deletions ui/LogbookWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public slots:
void uploadClublog();
void deleteContact();
void exportContact();
void printQSLLabel();
void editContact();
void displayedColumns();
void saveTableHeaderState();
Expand Down
12 changes: 12 additions & 0 deletions ui/LogbookWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,18 @@
<string>IOTA</string>
</property>
</action>
<action name="actionPrintQSLLabel">
<property name="icon">
<iconset theme="document-print">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Print QSL Label</string>
</property>
<property name="toolTip">
<string>Print QSL label for selected contact(s)</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
Expand Down
21 changes: 21 additions & 0 deletions ui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "ui/LoadDatabaseDialog.h"
#include "ui/PlatformSettingsDialog.h"
#include "ui/QSLGalleryDialog.h"
#include "ui/QSLLabelDialog.h"
#include <QFileDialog>
#include <QProcess>
#include <QThread>
Expand Down Expand Up @@ -1100,6 +1101,26 @@ void MainWindow::showQSLGallery()
dialog.exec();
}

void MainWindow::showPrintQSLLabels()
{
FCT_IDENTIFICATION;

const QList<QSqlRecord> queued = QSLLabelDialog::fetchQueuedContacts();

if (queued.isEmpty())
{
QMessageBox::information(this,
tr("Print QSL Labels"),
tr("No contacts with QSL Sent status 'Queued' (Q) were found."));
return;
}

QSLLabelDialog *dialog = new QSLLabelDialog(queued, this);
dialog->setAttribute(Qt::WA_DeleteOnClose);
connect(dialog, &QDialog::finished, this, [this](int) { ui->logbookWidget->updateTable(); });
dialog->open();
}

void MainWindow::showDumpDB()
{
FCT_IDENTIFICATION;
Expand Down
1 change: 1 addition & 0 deletions ui/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private slots:
void showDumpDB();
void showLoadDB();
void showQSLGallery();
void showPrintQSLLabels();

void saveProfileLayoutGeometry();
void setEquipmentKeepOptions(bool);
Expand Down
30 changes: 30 additions & 0 deletions ui/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
<addaction name="actionStatistics"/>
<addaction name="separator"/>
<addaction name="actionQSLGallery"/>
<addaction name="actionPrintQSLLabels"/>
</widget>
<widget class="QMenu" name="menuEquipment">
<property name="title">
Expand Down Expand Up @@ -463,6 +464,18 @@
<string>QSL &amp;Gallery</string>
</property>
</action>
<action name="actionPrintQSLLabels">
<property name="icon">
<iconset theme="document-print">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>Print QSL &amp;Labels (Queued)...</string>
</property>
<property name="toolTip">
<string>Print QSL labels for all contacts with QSL sent status Queued (Q)</string>
</property>
</action>
<action name="actionWsjtx">
<property name="text">
<string>Wsjtx</string>
Expand Down Expand Up @@ -1737,6 +1750,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>actionPrintQSLLabels</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>showPrintQSLLabels()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>456</x>
<y>278</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<signal>settingsChanged()</signal>
Expand Down Expand Up @@ -1770,5 +1799,6 @@
<slot>showDumpDB()</slot>
<slot>showLoadDB()</slot>
<slot>showQSLGallery()</slot>
<slot>showPrintQSLLabels()</slot>
</slots>
</ui>
Loading