Added custom repeat interval to CQ and HB messages
This commit is contained in:
parent
81af627836
commit
dd78a9fe70
@ -6990,21 +6990,23 @@ void MainWindow::buildRepeatMenu(QMenu *menu, QPushButton * button, int * interv
|
|||||||
{"Repeat every 15 minutes", 15},
|
{"Repeat every 15 minutes", 15},
|
||||||
{"Repeat every 30 minutes", 30},
|
{"Repeat every 30 minutes", 30},
|
||||||
{"Repeat every 60 minutes", 60},
|
{"Repeat every 60 minutes", 60},
|
||||||
{"Custom (Repeat every N minutes)", -1},
|
{"Repeat every N minutes (Custom Interval)", -1},
|
||||||
};
|
};
|
||||||
|
|
||||||
QActionGroup * group = new QActionGroup(menu);
|
QActionGroup * group = new QActionGroup(menu);
|
||||||
|
|
||||||
bool set = false;
|
bool isSet = false;
|
||||||
foreach(auto pair, items){
|
foreach(auto pair, items){
|
||||||
int minutes = pair.second;
|
int minutes = pair.second;
|
||||||
auto action = menu->addAction(pair.first);
|
auto action = menu->addAction(pair.first);
|
||||||
action->setData(minutes);
|
action->setData(minutes);
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
action->setChecked(*interval == minutes || (minutes == -1 && set == false));
|
bool isMatch = *interval == minutes;
|
||||||
if(*interval == minutes){
|
bool isCustom = (minutes == -1 && isSet == false);
|
||||||
set = true;
|
if(isMatch){
|
||||||
|
isSet = true;
|
||||||
}
|
}
|
||||||
|
action->setChecked(isMatch || isCustom);
|
||||||
group->addAction(action);
|
group->addAction(action);
|
||||||
|
|
||||||
connect(action, &QAction::toggled, this, [this, minutes, interval, button](bool checked){
|
connect(action, &QAction::toggled, this, [this, minutes, interval, button](bool checked){
|
||||||
|
Loading…
Reference in New Issue
Block a user