diff --git a/CMakeLists.txt b/CMakeLists.txt index b5e872521..d8d191716 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -309,6 +309,7 @@ set (wsjtx_CXXSRCS main.cpp wsprnet.cpp WSPRBandHopping.cpp + ExportCabrillo.cpp ) set (wsjt_CXXSRCS @@ -648,6 +649,7 @@ set (wsjtx_UISRCS widegraph.ui logqso.ui Configuration.ui + ExportCabrillo.ui ) set (UDP_library_CXXSRCS diff --git a/ExportCabrillo.cpp b/ExportCabrillo.cpp new file mode 100644 index 000000000..9142e68ad --- /dev/null +++ b/ExportCabrillo.cpp @@ -0,0 +1,44 @@ +#include "ExportCabrillo.h" +#include "ui_exportCabrillo.h" +#include "SettingsGroup.hpp" + +#include +#include +#include + +ExportCabrillo::ExportCabrillo(QSettings *settings, QWidget *parent) : + QDialog(parent), + settings_ {settings}, + ui(new Ui::ExportCabrillo) +{ + ui->setupUi(this); + read_settings(); + setWindowTitle(QApplication::applicationName() + " - Export Cabrillo"); +} + +ExportCabrillo::~ExportCabrillo() +{ + if (isVisible ()) write_settings(); + delete ui; +} + +void ExportCabrillo::read_settings () +{ + SettingsGroup group {settings_, "ExportCabrillo"}; + restoreGeometry (settings_->value ("window/geometry").toByteArray ()); +} + +void ExportCabrillo::write_settings () +{ + SettingsGroup group {settings_, "ExportCabrillo"}; + settings_->setValue ("window/geometry", saveGeometry ()); +} + +void ExportCabrillo::on_pbSaveAs_clicked() +{ + QString fname; + QFileDialog saveAs(this); + saveAs.setFileMode(QFileDialog::AnyFile); + fname=saveAs.getSaveFileName(this, "Save File", "","Cabrillo Log (*.log)"); + qDebug() << "AA" << fname; +} diff --git a/ExportCabrillo.h b/ExportCabrillo.h new file mode 100644 index 000000000..1770e48d0 --- /dev/null +++ b/ExportCabrillo.h @@ -0,0 +1,29 @@ +#ifndef EXPORTCABRILLO_H +#define EXPORTCABRILLO_H + +#include +#include + +namespace Ui { +class ExportCabrillo; +} + +class ExportCabrillo : public QDialog +{ + Q_OBJECT + +public: + explicit ExportCabrillo(QSettings *settings, QWidget *parent = 0); + ~ExportCabrillo(); + +private slots: + void on_pbSaveAs_clicked(); + +private: + QSettings * settings_; + void read_settings(); + void write_settings(); + Ui::ExportCabrillo *ui; +}; + +#endif // EXPORTCABRILLO_H diff --git a/ExportCabrillo.ui b/ExportCabrillo.ui new file mode 100644 index 000000000..3b3f49b3b --- /dev/null +++ b/ExportCabrillo.ui @@ -0,0 +1,304 @@ + + + ExportCabrillo + + + + 0 + 0 + 330 + 407 + + + + Dialog + + + + + + + + Location: + + + + + + + SNJ + + + Qt::AlignCenter + + + + + + + Contest: + + + + + + + ARRL-RTTY + + + Qt::AlignCenter + + + + + + + Callsign: + + + + + + + + + + Qt::AlignCenter + + + + + + + Category-Operator: + + + + + + + SINGLE-OP + + + Qt::AlignCenter + + + + + + + Category-Transmitter: + + + + + + + ONE + + + Qt::AlignCenter + + + + + + + Category-Power: + + + + + + + LOW + + + Qt::AlignCenter + + + + + + + Category-Assisted: + + + + + + + NON-ASSISTED + + + Qt::AlignCenter + + + + + + + Category-Band: + + + + + + + ALL + + + Qt::AlignCenter + + + + + + + Claimed-Score: + + + + + + + + + + Qt::AlignCenter + + + + + + + Operators: + + + + + + + + + + Qt::AlignCenter + + + + + + + Club: + + + + + + + Qt::AlignCenter + + + + + + + Name: + + + + + + + + + + Qt::AlignCenter + + + + + + + Address: + + + + + + + Qt::AlignCenter + + + + + + + Address: + + + + + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Save As + + + + + + + + + buttonBox + accepted() + ExportCabrillo + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ExportCabrillo + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index 22cefdfd3..edb92cd57 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -5990,6 +5990,16 @@ void MainWindow::on_actionErase_cabrillo_log_triggered() } } +void MainWindow::on_actionExport_Cabrillo_log_triggered() +{ + if(!m_exportCabrillo) { + m_exportCabrillo.reset(new ExportCabrillo{m_settings}); + } + bool ret=m_exportCabrillo->exec(); + qDebug() << "aa" << ret; +} + + void MainWindow::on_actionErase_wsjtx_log_adi_triggered() { int ret = MessageBox::query_message (this, tr ("Confirm Erase"), diff --git a/mainwindow.h b/mainwindow.h index 607c832bd..1413b8a89 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -36,6 +36,7 @@ #include "astro.h" #include "MessageBox.hpp" #include "NetworkAccessManager.hpp" +#include "exportCabrillo.h" #define NUM_JT4_SYMBOLS 206 //(72+31)*2, embedded sync #define NUM_JT65_SYMBOLS 126 //63 data + 63 sync @@ -202,6 +203,7 @@ private slots: void on_actionErase_FoxQSO_txt_triggered(); void on_actionErase_cabrillo_log_triggered(); void on_actionErase_wsjtx_log_adi_triggered(); + void on_actionExport_Cabrillo_log_triggered(); void startTx2(); void startP1(); void stopTx(); @@ -359,6 +361,7 @@ private: QScopedPointer m_mouseCmnds; QScopedPointer m_msgAvgWidget; QScopedPointer m_colorHighlighting; + QScopedPointer m_exportCabrillo; Transceiver::TransceiverState m_rigState; Frequency m_lastDialFreq; QString m_lastBand; diff --git a/mainwindow.ui b/mainwindow.ui index b93653962..76bafeb0c 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -2625,6 +2625,8 @@ QPushButton[state="ok"] { + + @@ -3309,6 +3311,11 @@ QPushButton[state="ok"] { Contest Log + + + Export Cabrillo log + + diff --git a/wsjtx.pro b/wsjtx.pro index 5c2124af0..a0d267961 100644 --- a/wsjtx.pro +++ b/wsjtx.pro @@ -68,7 +68,7 @@ SOURCES += \ WSPRBandHopping.cpp MessageAggregator.cpp SampleDownloader.cpp qt_helpers.cpp\ MultiSettings.cpp PhaseEqualizationDialog.cpp IARURegions.cpp MessageBox.cpp \ EqualizationToolsDialog.cpp CallsignValidator.cpp ExchangeValidator.cpp \ - colorhighlighting.cpp + colorhighlighting.cpp ExportCabrillo.cpp HEADERS += qt_helpers.hpp \ pimpl_h.hpp pimpl_impl.hpp \ @@ -85,7 +85,7 @@ HEADERS += qt_helpers.hpp \ messageaveraging.h echoplot.h echograph.h fastgraph.h fastplot.h Modes.hpp WSPRBandHopping.hpp \ WsprTxScheduler.h SampleDownloader.hpp MultiSettings.hpp PhaseEqualizationDialog.hpp \ IARURegions.hpp MessageBox.hpp EqualizationToolsDialog.hpp CallsignValidator.hpp \ - ExchangeValidator.hpp colorhighlighting.h + ExchangeValidator.hpp colorhighlighting.h ExportCabrillo.h INCLUDEPATH += qmake_only @@ -97,8 +97,7 @@ HEADERS += OmniRigTransceiver.hpp FORMS += mainwindow.ui about.ui Configuration.ui widegraph.ui astro.ui \ logqso.ui wf_palette_design_dialog.ui messageaveraging.ui echograph.ui \ - fastgraph.ui \ - colorhighlighting.ui + fastgraph.ui colorhighlighting.ui ExportCabrillo.ui RC_FILE = wsjtx.rc RESOURCES = wsjtx.qrc