mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-22 04:11:16 -05:00
Add minimal routine to disable Tx after 5 minutes of no mouse movement.
This commit is contained in:
parent
6ba2fb7bf9
commit
aa0d4208ce
@ -929,6 +929,11 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
||||
ui->cbMenus->setChecked(false);
|
||||
}
|
||||
|
||||
mouseLastPos=QCursor::pos();
|
||||
m_mouseIdleSeconds=0;
|
||||
connect(&mouseTimer, &QTimer::timeout, this, &MainWindow::mouseTimerTick);
|
||||
mouseTimer.start(1000);
|
||||
|
||||
// this must be the last statement of constructor
|
||||
if (!m_valid) throw std::runtime_error {"Fatal initialization exception"};
|
||||
}
|
||||
@ -954,6 +959,22 @@ void MainWindow::initialize_fonts ()
|
||||
setDecodedTextFont (m_config.decoded_text_font ());
|
||||
}
|
||||
|
||||
void MainWindow::mouseTimerTick()
|
||||
{
|
||||
QPoint point = QCursor::pos();
|
||||
if(point != mouseLastPos)
|
||||
m_mouseIdleSeconds = 0;
|
||||
else
|
||||
m_mouseIdleSeconds++;
|
||||
mouseLastPos = point;
|
||||
//Here we should do what's necessary when mouseIdleSeconds gets too big.
|
||||
// qDebug() << m_mouseIdleSeconds;
|
||||
if(ui->cbAutoSeq->isChecked() and m_mouseIdleSeconds>300) {
|
||||
auto_tx_mode (false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::splash_done ()
|
||||
{
|
||||
m_splash && m_splash->close ();
|
||||
|
@ -442,7 +442,7 @@ private:
|
||||
qint32 m_Nslots=5;
|
||||
qint32 m_nFoxMsgTimes[5]={0,0,0,0,0};
|
||||
qint32 m_tAutoOn;
|
||||
// qint32 m_maxQSOs;
|
||||
qint32 m_mouseIdleSeconds;
|
||||
qint32 m_tFoxTx=0;
|
||||
qint32 m_tFoxTx0=0;
|
||||
qint32 m_maxStrikes=3; //Max # of repeats: 3 strikes and you're out
|
||||
@ -566,6 +566,9 @@ private:
|
||||
QTimer minuteTimer;
|
||||
QTimer splashTimer;
|
||||
QTimer p1Timer;
|
||||
QTimer mouseTimer;
|
||||
|
||||
QPoint mouseLastPos;
|
||||
|
||||
QString m_path;
|
||||
QString m_baseCall;
|
||||
@ -695,6 +698,7 @@ private:
|
||||
void cabLog();
|
||||
void useNextCall();
|
||||
void abortQSO();
|
||||
void mouseTimerTick();
|
||||
bool isWorked(int itype, QString key, float fMHz=0, QString="");
|
||||
|
||||
QString save_wave_file (QString const& name
|
||||
|
Loading…
Reference in New Issue
Block a user