From 034d22e994fca4f0efffe33c19af0f5402df0588 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Thu, 23 Dec 2021 20:05:34 -0800 Subject: [PATCH] Added clock and UTC toggle. --- wfmain.cpp | 16 ++++++++++++++-- wfmain.h | 2 ++ wfmain.ui | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index f8e38ed6..744df094 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -4566,8 +4566,15 @@ void wfmain::setRadioTimeDatePrep() if(!waitingToSetTimeDate) { // 1: Find the current time and date - QDateTime now = QDateTime::currentDateTime(); - now.setTime(QTime::currentTime()); + QDateTime now; + if(ui->useUTCChk->isChecked()) + { + now = QDateTime::currentDateTimeUtc(); + now.setTime(QTime::currentTime()); + } else { + now = QDateTime::currentDateTime(); + now.setTime(QTime::currentTime()); + } int second = now.time().second(); @@ -5505,6 +5512,11 @@ void wfmain::receiveStateInfo(rigstate* state) rigState = state; } +void wfmain::on_setClockBtn_clicked() +{ + setRadioTimeDatePrep(); +} + // --- DEBUG FUNCTION --- void wfmain::on_debugBtn_clicked() { diff --git a/wfmain.h b/wfmain.h index a22b7dc7..7c1a9f4a 100644 --- a/wfmain.h +++ b/wfmain.h @@ -506,6 +506,8 @@ private slots: void on_settingsList_currentRowChanged(int currentRow); + void on_setClockBtn_clicked(); + private: Ui::wfmain *ui; void closeEvent(QCloseEvent *event); diff --git a/wfmain.ui b/wfmain.ui index 3750d727..69277c69 100644 --- a/wfmain.ui +++ b/wfmain.ui @@ -2066,7 +2066,7 @@ - 4 + 2