mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-26 14:18:38 -05:00
Starting to implement popup macros for Tx messages.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3055 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
b0bf6f8aee
commit
5862de5501
@ -92,6 +92,10 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
connect(&proc_jt9, SIGNAL(readyReadStandardError()),
|
||||
this, SLOT(readFromStderr()));
|
||||
|
||||
ui->tx5->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(ui->tx5, SIGNAL(customContextMenuRequested(const QPoint&)),
|
||||
this, SLOT(showMacros(const QPoint&)));
|
||||
|
||||
QTimer *guiTimer = new QTimer(this);
|
||||
connect(guiTimer, SIGNAL(timeout()), this, SLOT(guiUpdate()));
|
||||
guiTimer->start(100); //Don't change the 100 ms!
|
||||
@ -1896,3 +1900,26 @@ void MainWindow::on_actionErase_wsjtx_log_adi_triggered()
|
||||
f.remove();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::showMacros(const QPoint &pos)
|
||||
{
|
||||
QPoint globalPos = ui->tx5->mapToGlobal(pos);
|
||||
QMenu popupMenu;
|
||||
QAction* popup1 = new QAction("5W DIP 73 GL",ui->tx5);
|
||||
QAction* popup2 = new QAction("TNX 73 GL",ui->tx5);
|
||||
popupMenu.addAction(popup1);
|
||||
popupMenu.addAction(popup2);
|
||||
connect(popup1,SIGNAL(triggered()), this, SLOT(onPopup1()));
|
||||
connect(popup2,SIGNAL(triggered()), this, SLOT(onPopup2()));
|
||||
QAction* selectedItem = popupMenu.exec(globalPos);
|
||||
}
|
||||
|
||||
void MainWindow::onPopup1()
|
||||
{
|
||||
ui->tx5->setText("5W DIP 73 GL");
|
||||
}
|
||||
|
||||
void MainWindow::onPopup2()
|
||||
{
|
||||
ui->tx5->setText("TNX 73 GL");
|
||||
}
|
||||
|
@ -108,12 +108,14 @@ private slots:
|
||||
void bumpFqso(int n);
|
||||
void on_actionMonitor_OFF_at_startup_triggered();
|
||||
void dialFreqChanged2(double f);
|
||||
|
||||
void on_actionErase_ALL_TXT_triggered();
|
||||
|
||||
void on_actionErase_wsjtx_log_adi_triggered();
|
||||
|
||||
private:
|
||||
void showMacros(const QPoint& pos);
|
||||
void onPopup1();
|
||||
void onPopup2();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
||||
double m_dialFreq;
|
||||
|
Loading…
Reference in New Issue
Block a user