Renamed macros to saved messages. Added menu and buttons for quick access to all messages configured
This commit is contained in:
parent
8b94c01ff6
commit
fe1509c94b
180
Configuration.ui
180
Configuration.ui
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>692</width>
|
||||
<width>750</width>
|
||||
<height>735</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -1573,7 +1573,7 @@ radio interface behave as expected.</string>
|
||||
</widget>
|
||||
<widget class="QWidget" name="audio_tab">
|
||||
<attribute name="title">
|
||||
<string>A&udio</string>
|
||||
<string>&Audio</string>
|
||||
</attribute>
|
||||
<attribute name="toolTip">
|
||||
<string>Audio interface settings</string>
|
||||
@ -1844,88 +1844,6 @@ both here.</string>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tx_macros_tab">
|
||||
<attribute name="title">
|
||||
<string>Tx &Macros</string>
|
||||
</attribute>
|
||||
<attribute name="toolTip">
|
||||
<string>Canned free text messages setup</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="add_macro_push_button">
|
||||
<property name="text">
|
||||
<string>&Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="add_macro_line_edit"/>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="delete_macro_push_button">
|
||||
<property name="text">
|
||||
<string>&Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<widget class="QListView" name="macros_list_view">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::ActionsContextMenu</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Drag and drop items to rearrange order
|
||||
Right click for item specific actions
|
||||
Click, SHIFT+Click and, CRTL+Click to select items</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QListView {
|
||||
show-decoration-selected: 1; /* make the selection span the entire width of the view */
|
||||
}
|
||||
|
||||
QListView::item:alternate {
|
||||
background: #EEEEEE;
|
||||
}
|
||||
|
||||
QListView::item:selected {
|
||||
border: 1px solid #6a6ea9;
|
||||
}
|
||||
|
||||
QListView::item:selected:!active {
|
||||
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0 #ABAFE5, stop: 1 #8588B2);
|
||||
}
|
||||
|
||||
QListView::item:selected:active {
|
||||
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0 #6a6ea9, stop: 1 #888dd9);
|
||||
}
|
||||
|
||||
QListView::item:hover {
|
||||
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0 #FAFBFE, stop: 1 #DCDEF1);
|
||||
}</string>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::InternalMove</enum>
|
||||
</property>
|
||||
<property name="defaultDropAction">
|
||||
<enum>Qt::MoveAction</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
<property name="uniformItemSizes">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="reporting_tab">
|
||||
<attribute name="title">
|
||||
<string>Reportin&g</string>
|
||||
@ -2340,7 +2258,7 @@ for assessing propagation and system performance.</string>
|
||||
</widget>
|
||||
<widget class="QWidget" name="frequencies_tab">
|
||||
<attribute name="title">
|
||||
<string>Frequencies</string>
|
||||
<string>&Frequencies</string>
|
||||
</attribute>
|
||||
<attribute name="toolTip">
|
||||
<string>Default frequencies and band specific station details setup</string>
|
||||
@ -2572,9 +2490,91 @@ Right click for insert and delete options.</string>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tx_macros_tab">
|
||||
<attribute name="title">
|
||||
<string>Saved &Messages</string>
|
||||
</attribute>
|
||||
<attribute name="toolTip">
|
||||
<string>Canned free text messages setup</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="add_macro_push_button">
|
||||
<property name="text">
|
||||
<string>&Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="add_macro_line_edit"/>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="delete_macro_push_button">
|
||||
<property name="text">
|
||||
<string>&Delete</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<widget class="QListView" name="macros_list_view">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::ActionsContextMenu</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Drag and drop items to rearrange order
|
||||
Right click for item specific actions
|
||||
Click, SHIFT+Click and, CRTL+Click to select items</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QListView {
|
||||
show-decoration-selected: 1; /* make the selection span the entire width of the view */
|
||||
}
|
||||
|
||||
QListView::item:alternate {
|
||||
background: #EEEEEE;
|
||||
}
|
||||
|
||||
QListView::item:selected {
|
||||
border: 1px solid #6a6ea9;
|
||||
}
|
||||
|
||||
QListView::item:selected:!active {
|
||||
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0 #ABAFE5, stop: 1 #8588B2);
|
||||
}
|
||||
|
||||
QListView::item:selected:active {
|
||||
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0 #6a6ea9, stop: 1 #888dd9);
|
||||
}
|
||||
|
||||
QListView::item:hover {
|
||||
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
|
||||
stop: 0 #FAFBFE, stop: 1 #DCDEF1);
|
||||
}</string>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::InternalMove</enum>
|
||||
</property>
|
||||
<property name="defaultDropAction">
|
||||
<enum>Qt::MoveAction</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
<property name="uniformItemSizes">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Notifications</string>
|
||||
<string>&Notifications</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_16">
|
||||
<item>
|
||||
@ -2724,7 +2724,7 @@ Right click for insert and delete options.</string>
|
||||
</widget>
|
||||
<widget class="QWidget" name="colors_tab">
|
||||
<attribute name="title">
|
||||
<string>UI</string>
|
||||
<string>&UI</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_15">
|
||||
<item>
|
||||
@ -3690,11 +3690,11 @@ soundcard changes</string>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="PTT_method_button_group"/>
|
||||
<buttongroup name="CAT_stop_bits_button_group"/>
|
||||
<buttongroup name="TX_audio_source_button_group"/>
|
||||
<buttongroup name="CAT_data_bits_button_group"/>
|
||||
<buttongroup name="TX_mode_button_group"/>
|
||||
<buttongroup name="TX_audio_source_button_group"/>
|
||||
<buttongroup name="split_mode_button_group"/>
|
||||
<buttongroup name="CAT_handshake_button_group"/>
|
||||
<buttongroup name="CAT_stop_bits_button_group"/>
|
||||
<buttongroup name="CAT_data_bits_button_group"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
@ -1205,6 +1205,9 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
||||
restoreAction->setDisabled(m_lastTxMessage.isEmpty());
|
||||
menu->addAction(restoreAction);
|
||||
|
||||
auto savedMenu = menu->addMenu("Saved messages...");
|
||||
buildSavedMessagesMenu(savedMenu);
|
||||
|
||||
auto relayMenu = menu->addMenu("Relay via...");
|
||||
relayMenu->setDisabled(ui->extFreeTextMsgEdit->toPlainText().isEmpty() || m_callActivity.isEmpty());
|
||||
buildRelayMenu(relayMenu);
|
||||
@ -7544,6 +7547,14 @@ void MainWindow::on_qthMacroButton_clicked(){
|
||||
addMessageText(QString("QTH %1").arg(qth));
|
||||
}
|
||||
|
||||
void MainWindow::on_qtcMacroButton_clicked(){
|
||||
QString qtc = m_config.my_station();
|
||||
if(qtc.isEmpty()){
|
||||
return;
|
||||
}
|
||||
addMessageText(QString("QTC %1").arg(qtc));
|
||||
}
|
||||
|
||||
void MainWindow::setSortBy(QString key, QString value){
|
||||
m_sortCache[key] = QVariant(value);
|
||||
displayBandActivity();
|
||||
@ -7981,6 +7992,33 @@ void MainWindow::buildEditMenu(QMenu *menu, QTextEdit *edit){
|
||||
connect(paste, &QAction::triggered, edit, &QTextEdit::paste);
|
||||
}
|
||||
|
||||
void MainWindow::buildSavedMessagesMenu(QMenu *menu){
|
||||
foreach(QString macro, m_config.macros()->stringList()){
|
||||
QAction *action = menu->addAction(macro);
|
||||
connect(action, &QAction::triggered, this, [this, macro](){ addMessageText(macro); });
|
||||
}
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
auto editAction = new QAction(QIcon::fromTheme("edit-edit"), QString("&Edit Saved Messages"), menu);
|
||||
menu->addAction(editAction);
|
||||
connect(editAction, &QAction::triggered, this, [this](){
|
||||
openSettings(5);
|
||||
});
|
||||
|
||||
auto saveAction = new QAction(QString("&Save Current Message"), menu);
|
||||
saveAction->setDisabled(ui->extFreeTextMsgEdit->toPlainText().isEmpty());
|
||||
menu->addAction(saveAction);
|
||||
connect(saveAction, &QAction::triggered, this, [this](){
|
||||
auto macros = m_config.macros();
|
||||
if(macros->insertRow(macros->rowCount())){
|
||||
auto index = macros->index(macros->rowCount()-1);
|
||||
macros->setData(index, ui->extFreeTextMsgEdit->toPlainText());
|
||||
writeSettings();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void MainWindow::on_queryButton_pressed(){
|
||||
QMenu *menu = ui->queryButton->menu();
|
||||
if(!menu){
|
||||
@ -7995,28 +8033,13 @@ void MainWindow::on_queryButton_pressed(){
|
||||
}
|
||||
|
||||
void MainWindow::on_macrosMacroButton_pressed(){
|
||||
if(m_config.macros()->stringList().isEmpty()){
|
||||
openSettings(3);
|
||||
return;
|
||||
}
|
||||
|
||||
QMenu *menu = ui->macrosMacroButton->menu();
|
||||
if(!menu){
|
||||
menu = new QMenu(ui->macrosMacroButton);
|
||||
}
|
||||
menu->clear();
|
||||
|
||||
foreach(QString macro, m_config.macros()->stringList()){
|
||||
QAction *action = menu->addAction(macro);
|
||||
connect(action, &QAction::triggered, this, [this, macro](){ addMessageText(macro); });
|
||||
}
|
||||
|
||||
menu->addSeparator();
|
||||
auto action = new QAction(QIcon::fromTheme("edit-edit"), QString("Edit"), menu);
|
||||
menu->addAction(action);
|
||||
connect(action, &QAction::triggered, this, [this](){
|
||||
openSettings(3);
|
||||
});
|
||||
buildSavedMessagesMenu(menu);
|
||||
|
||||
ui->macrosMacroButton->setMenu(menu);
|
||||
ui->macrosMacroButton->showMenu();
|
||||
@ -9120,6 +9143,8 @@ void MainWindow::updateButtonDisplay(){
|
||||
|
||||
ui->cqMacroButton->setDisabled(isTransmitting);
|
||||
ui->replyMacroButton->setDisabled(isTransmitting || emptyCallsign);
|
||||
ui->qthMacroButton->setDisabled(isTransmitting || m_config.my_station().isEmpty());
|
||||
ui->qtcMacroButton->setDisabled(isTransmitting || m_config.my_qth().isEmpty());
|
||||
ui->macrosMacroButton->setDisabled(isTransmitting);
|
||||
ui->queryButton->setDisabled(isTransmitting || emptyCallsign);
|
||||
ui->deselectButton->setDisabled(isTransmitting || emptyCallsign);
|
||||
|
@ -267,12 +267,14 @@ private slots:
|
||||
void on_cqMacroButton_clicked();
|
||||
void on_replyMacroButton_clicked();
|
||||
void on_qthMacroButton_clicked();
|
||||
void on_qtcMacroButton_clicked();
|
||||
void setSortBy(QString key, QString value);
|
||||
QString getSortBy(QString key, QString defaultValue);
|
||||
void buildSortByMenu(QMenu * menu, QString key, QString defaultValue, QList<QPair<QString, QString> > values);
|
||||
void buildBandActivitySortByMenu(QMenu * menu);
|
||||
void buildCallActivitySortByMenu(QMenu * menu);
|
||||
void buildQueryMenu(QMenu *, QString callsign);
|
||||
void buildSavedMessagesMenu(QMenu *menu);
|
||||
void buildRelayMenu(QMenu *menu);
|
||||
QAction* buildRelayAction(QString call);
|
||||
void buildEditMenu(QMenu *, QTextEdit *);
|
||||
|
@ -1311,9 +1311,6 @@ background:yellow;
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Send your station location message</p></body></html></string>
|
||||
</property>
|
||||
@ -1347,10 +1344,10 @@ background:yellow;
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Send a macro</p></body></html></string>
|
||||
<string><html><head/><body><p>Send a saved message</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Macros</string>
|
||||
<string>Saved</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1397,11 +1394,46 @@ background:yellow;
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Deselect the current callsign for directed messaging</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Deselect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5">
|
||||
<widget class="QPushButton" name="qtcMacroButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Send your station message</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>QTC</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="6">
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QFrame" name="frame_5">
|
||||
|
Loading…
Reference in New Issue
Block a user