From 2199b8b057914d860570cab270ceb381e81cc9ed Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Tue, 2 Oct 2018 14:10:16 -0400 Subject: [PATCH] Deselect callsign after 1 hour --- mainwindow.cpp | 7 +++++++ mainwindow.h | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index d4a2f85..f59cdcf 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -905,6 +905,10 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, beaconTimer.setSingleShot(false); connect(&beaconTimer, &QTimer::timeout, this, &MainWindow::checkBeacon); + selectedCallTimer.setSingleShot(true); + selectedCallTimer.setInterval(1000*60*60); + connect(&selectedCallTimer, &QTimer::timeout, this, &MainWindow::clearCallsignSelected); + connect(m_wideGraph.data (), SIGNAL(setFreq3(int,int)),this, SLOT(setFreq4(int,int))); @@ -7972,12 +7976,15 @@ void MainWindow::on_tableWidgetRXAll_cellDoubleClicked(int row, int col){ } void MainWindow::on_tableWidgetRXAll_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/){ + selectedCallTimer.stop(); + on_extFreeTextMsgEdit_currentTextChanged(ui->extFreeTextMsgEdit->toPlainText()); auto placeholderText = QString("Type your outgoing messages here."); auto selectedCall = callsignSelected(); if(!selectedCall.isEmpty()){ placeholderText = QString("Type your outgoing directed message to %1 here.").arg(selectedCall); + selectedCallTimer.start(); } ui->extFreeTextMsgEdit->setPlaceholderText(placeholderText); diff --git a/mainwindow.h b/mainwindow.h index 0aec186..527313f 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -382,6 +382,7 @@ private slots: void on_measure_check_box_stateChanged (int); void expiry_warning_message (); void not_GA_warning_message (); + void clearCallsignSelected(); private: Q_SIGNAL void initializeAudioOutputStream (QAudioDeviceInfo, @@ -644,6 +645,7 @@ private: QTimer splashTimer; QTimer p1Timer; QTimer beaconTimer; + QTimer selectedCallTimer; QString m_path; QString m_baseCall; @@ -876,7 +878,6 @@ private: bool isMyCallIncluded(QString const &text); bool isAllCallIncluded(QString const &text); QString callsignSelected(); - void clearCallsignSelected(); bool isRecentOffset(int offset); void markOffsetRecent(int offset); bool isDirectedOffset(int offset, bool *pIsAllCall);