Added heartbeat and CQ to control menu
This commit is contained in:
parent
b55f8ba5c5
commit
55c365b834
@ -1410,22 +1410,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
|||||||
connect(ui->hbMacroButton, &QPushButton::customContextMenuRequested, this, [this](QPoint const &point){
|
connect(ui->hbMacroButton, &QPushButton::customContextMenuRequested, this, [this](QPoint const &point){
|
||||||
QMenu * menu = new QMenu(ui->hbMacroButton);
|
QMenu * menu = new QMenu(ui->hbMacroButton);
|
||||||
|
|
||||||
auto hide = menu->addAction("Show Heartbeats and ACKs");
|
buildHeartbeatMenu(menu);
|
||||||
hide->setCheckable(true);
|
|
||||||
hide->setChecked(!m_hbHidden);
|
|
||||||
connect(hide, &QAction::triggered, this, [this](bool checked){
|
|
||||||
m_hbHidden = !checked;
|
|
||||||
displayBandActivity();
|
|
||||||
});
|
|
||||||
|
|
||||||
menu->addSeparator();
|
|
||||||
|
|
||||||
buildRepeatMenu(menu, ui->hbMacroButton, &m_hbInterval);
|
|
||||||
|
|
||||||
menu->addSeparator();
|
|
||||||
|
|
||||||
auto now = menu->addAction("Send Heartbeat Now");
|
|
||||||
connect(now, &QAction::triggered, this, &MainWindow::sendHeartbeat);
|
|
||||||
|
|
||||||
menu->popup(ui->hbMacroButton->mapToGlobal(point));
|
menu->popup(ui->hbMacroButton->mapToGlobal(point));
|
||||||
});
|
});
|
||||||
@ -1434,12 +1419,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
|||||||
connect(ui->cqMacroButton, &QPushButton::customContextMenuRequested, this, [this](QPoint const &point){
|
connect(ui->cqMacroButton, &QPushButton::customContextMenuRequested, this, [this](QPoint const &point){
|
||||||
QMenu * menu = new QMenu(ui->cqMacroButton);
|
QMenu * menu = new QMenu(ui->cqMacroButton);
|
||||||
|
|
||||||
buildRepeatMenu(menu, ui->cqMacroButton, &m_cqInterval);
|
buildCQMenu(menu);
|
||||||
|
|
||||||
menu->addSeparator();
|
|
||||||
|
|
||||||
auto now = menu->addAction("Send CQ Message Now");
|
|
||||||
connect(now, &QAction::triggered, this, &MainWindow::sendCQ);
|
|
||||||
|
|
||||||
menu->popup(ui->cqMacroButton->mapToGlobal(point));
|
menu->popup(ui->cqMacroButton->mapToGlobal(point));
|
||||||
});
|
});
|
||||||
@ -2391,6 +2371,20 @@ void MainWindow::on_menuControl_aboutToShow(){
|
|||||||
ui->actionEnable_Active->setChecked(ui->activeButton->isChecked());
|
ui->actionEnable_Active->setChecked(ui->activeButton->isChecked());
|
||||||
ui->actionEnable_Auto_Reply->setChecked(ui->autoReplyButton->isChecked());
|
ui->actionEnable_Auto_Reply->setChecked(ui->autoReplyButton->isChecked());
|
||||||
ui->actionEnable_Selcall->setChecked(ui->selcalButton->isChecked());
|
ui->actionEnable_Selcall->setChecked(ui->selcalButton->isChecked());
|
||||||
|
|
||||||
|
QMenu * heartbeatMenu = new QMenu(this->menuBar());
|
||||||
|
buildHeartbeatMenu(heartbeatMenu);
|
||||||
|
ui->actionHeartbeat->setMenu(heartbeatMenu);
|
||||||
|
#if __APPLE__
|
||||||
|
rebuildMacQAction(ui->menuControl, ui->actionHeartbeat);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QMenu * cqMenu = new QMenu(this->menuBar());
|
||||||
|
buildCQMenu(cqMenu);
|
||||||
|
ui->actionCQ->setMenu(cqMenu);
|
||||||
|
#if __APPLE__
|
||||||
|
rebuildMacQAction(ui->menuControl, ui->actionCQ);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionEnable_Spotting_toggled(bool checked){
|
void MainWindow::on_actionEnable_Spotting_toggled(bool checked){
|
||||||
@ -6600,6 +6594,34 @@ void MainWindow::on_clearAction_triggered(QObject * sender){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::buildHeartbeatMenu(QMenu *menu){
|
||||||
|
auto hide = menu->addAction("Show Heartbeats and ACKs");
|
||||||
|
hide->setCheckable(true);
|
||||||
|
hide->setChecked(!m_hbHidden);
|
||||||
|
connect(hide, &QAction::triggered, this, [this](bool checked){
|
||||||
|
m_hbHidden = !checked;
|
||||||
|
displayBandActivity();
|
||||||
|
});
|
||||||
|
|
||||||
|
menu->addSeparator();
|
||||||
|
|
||||||
|
buildRepeatMenu(menu, ui->hbMacroButton, &m_hbInterval);
|
||||||
|
|
||||||
|
menu->addSeparator();
|
||||||
|
|
||||||
|
auto now = menu->addAction("Send Heartbeat Now");
|
||||||
|
connect(now, &QAction::triggered, this, &MainWindow::sendHeartbeat);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::buildCQMenu(QMenu *menu){
|
||||||
|
buildRepeatMenu(menu, ui->cqMacroButton, &m_cqInterval);
|
||||||
|
|
||||||
|
menu->addSeparator();
|
||||||
|
|
||||||
|
auto now = menu->addAction("Send CQ Message Now");
|
||||||
|
connect(now, &QAction::triggered, this, &MainWindow::sendCQ);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::buildRepeatMenu(QMenu *menu, QPushButton * button, int * interval){
|
void MainWindow::buildRepeatMenu(QMenu *menu, QPushButton * button, int * interval){
|
||||||
QList<QPair<QString, int>> items = {
|
QList<QPair<QString, int>> items = {
|
||||||
{"On demand / do not repeat", 0},
|
{"On demand / do not repeat", 0},
|
||||||
|
@ -274,6 +274,8 @@ private slots:
|
|||||||
void on_rbGenMsg_clicked(bool checked);
|
void on_rbGenMsg_clicked(bool checked);
|
||||||
void on_rbFreeText_clicked(bool checked);
|
void on_rbFreeText_clicked(bool checked);
|
||||||
void on_clearAction_triggered(QObject * sender);
|
void on_clearAction_triggered(QObject * sender);
|
||||||
|
void buildHeartbeatMenu(QMenu *menu);
|
||||||
|
void buildCQMenu(QMenu *menu);
|
||||||
void buildRepeatMenu(QMenu *menu, QPushButton * button, int * interval);
|
void buildRepeatMenu(QMenu *menu, QPushButton * button, int * interval);
|
||||||
void sendHeartbeat();
|
void sendHeartbeat();
|
||||||
void on_hbMacroButton_toggled(bool checked);
|
void on_hbMacroButton_toggled(bool checked);
|
||||||
|
@ -4734,6 +4734,9 @@ list. The list can be maintained in Settings (F2).</string>
|
|||||||
<addaction name="actionEnable_Active"/>
|
<addaction name="actionEnable_Active"/>
|
||||||
<addaction name="actionEnable_Auto_Reply"/>
|
<addaction name="actionEnable_Auto_Reply"/>
|
||||||
<addaction name="actionEnable_Selcall"/>
|
<addaction name="actionEnable_Selcall"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionHeartbeat"/>
|
||||||
|
<addaction name="actionCQ"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menuFile"/>
|
<addaction name="menuFile"/>
|
||||||
<addaction name="menuConfig"/>
|
<addaction name="menuConfig"/>
|
||||||
@ -5587,6 +5590,16 @@ list. The list can be maintained in Settings (F2).</string>
|
|||||||
<string>F11</string>
|
<string>F11</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionHeartbeat">
|
||||||
|
<property name="text">
|
||||||
|
<string>Heartbeat...</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionCQ">
|
||||||
|
<property name="text">
|
||||||
|
<string>CQ...</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
Loading…
Reference in New Issue
Block a user