Ripping out notification system for something better later

This commit is contained in:
Jordan Sherer 2019-07-04 01:59:36 -04:00
parent 925aade1a2
commit 9dc708900e
5 changed files with 5 additions and 337 deletions

View File

@ -463,15 +463,6 @@ private:
void delete_selected_macros (QModelIndexList);
Q_SLOT void on_save_path_select_push_button_clicked (bool);
Q_SLOT void on_azel_path_select_push_button_clicked (bool);
Q_SLOT void on_sound_cq_path_select_push_button_clicked();
Q_SLOT void on_sound_cq_path_test_push_button_clicked();
Q_SLOT void on_sound_cq_path_reset_push_button_clicked();
Q_SLOT void on_sound_dm_path_select_push_button_clicked();
Q_SLOT void on_sound_dm_path_test_push_button_clicked();
Q_SLOT void on_sound_dm_path_reset_push_button_clicked();
Q_SLOT void on_sound_am_path_select_push_button_clicked();
Q_SLOT void on_sound_am_path_test_push_button_clicked();
Q_SLOT void on_sound_am_path_reset_push_button_clicked();
Q_SLOT void on_calibration_intercept_spin_box_valueChanged (double);
Q_SLOT void on_calibration_slope_ppm_spin_box_valueChanged (double);
Q_SLOT void handle_transceiver_update (TransceiverState const&, unsigned sequence_number);
@ -520,10 +511,6 @@ private:
QDir default_azel_directory_;
QDir azel_directory_;
QString sound_cq_path_; // cq message sound file
QString sound_dm_path_; // directed message sound file
QString sound_am_path_; // alert message sound file
QFont font_;
QFont next_font_;
@ -846,9 +833,6 @@ QStringListModel * Configuration::macros () {return &m_->macros_;}
QStringListModel const * Configuration::macros () const {return &m_->macros_;}
QDir Configuration::save_directory () const {return m_->save_directory_;}
QDir Configuration::azel_directory () const {return m_->azel_directory_;}
QString Configuration::sound_cq_path() const {return m_->sound_cq_path_;}
QString Configuration::sound_dm_path() const {return m_->sound_dm_path_;}
QString Configuration::sound_am_path() const {return m_->sound_am_path_;}
QString Configuration::rig_name () const {return m_->rig_params_.rig_name;}
bool Configuration::pwrBandTxMemory () const {return m_->pwrBandTxMemory_;}
bool Configuration::pwrBandTuneMemory () const {return m_->pwrBandTuneMemory_;}
@ -1437,9 +1421,6 @@ void Configuration::impl::initialize_models ()
ui_->PTT_method_button_group->button (rig_params_.ptt_type)->setChecked (true);
ui_->save_path_display_label->setText (save_directory_.absolutePath ());
ui_->azel_path_display_label->setText (azel_directory_.absolutePath ());
ui_->sound_cq_path_display_label->setText(sound_cq_path_);
ui_->sound_dm_path_display_label->setText(sound_dm_path_);
ui_->sound_am_path_display_label->setText(sound_am_path_);
ui_->reset_activity_check_box->setChecked (reset_activity_);
ui_->checkForUpdates_checkBox->setChecked (check_for_updates_);
ui_->CW_id_after_73_check_box->setChecked (id_after_73_);
@ -1656,9 +1637,6 @@ void Configuration::impl::read_settings ()
RxBandwidth_ = settings_->value ("RxBandwidth", 2500).toInt ();
save_directory_ = settings_->value ("SaveDir", default_save_directory_.absolutePath ()).toString ();
azel_directory_ = settings_->value ("AzElDir", default_azel_directory_.absolutePath ()).toString ();
sound_cq_path_ = settings_->value ("SoundCQPath", "").toString ();
sound_dm_path_ = settings_->value ("SoundDMPath", "").toString ();
sound_am_path_ = settings_->value ("SoundAMPath", "").toString ();
{
//
@ -1874,9 +1852,6 @@ void Configuration::impl::write_settings ()
settings_->setValue ("PTTport", rig_params_.ptt_port);
settings_->setValue ("SaveDir", save_directory_.absolutePath ());
settings_->setValue ("AzElDir", azel_directory_.absolutePath ());
settings_->setValue ("SoundCQPath", sound_cq_path_);
settings_->setValue ("SoundDMPath", sound_dm_path_);
settings_->setValue ("SoundAMPath", sound_am_path_);
if (default_audio_input_device_selected_)
{
@ -2481,9 +2456,6 @@ void Configuration::impl::accept ()
data_mode_ = static_cast<DataMode> (ui_->TX_mode_button_group->checkedId ());
save_directory_ = ui_->save_path_display_label->text ();
azel_directory_ = ui_->azel_path_display_label->text ();
sound_cq_path_ = ui_->sound_cq_path_display_label->text();
sound_dm_path_ = ui_->sound_dm_path_display_label->text();
sound_am_path_ = ui_->sound_am_path_display_label->text();
enable_VHF_features_ = ui_->enable_VHF_features_check_box->isChecked ();
decode_at_52s_ = ui_->decode_at_52s_check_box->isChecked ();
single_decode_ = ui_->single_decode_check_box->isChecked ();
@ -3131,99 +3103,6 @@ void Configuration::impl::on_azel_path_select_push_button_clicked (bool /* check
}
}
void Configuration::impl::on_sound_cq_path_select_push_button_clicked(){
QStringList filters;
filters << "Audio files (*.wav)"
<< "Any files (*)";
QFileDialog fd {this, tr ("Sound File"), ui_->sound_cq_path_display_label->text ()};
fd.setNameFilters(filters);
if (fd.exec ()) {
if (fd.selectedFiles ().size ()) {
if(rig_params_.ptt_type == TransceiverFactory::PTT_method_VOX){
QMessageBox::warning(this, "Notifications Sounds Warning", "You have enabled notification sounds while using VOX. To avoid transmitting these notification sounds, please make sure your rig is using a different sound card than your system.");
}
ui_->sound_cq_path_display_label->setText(fd.selectedFiles().at(0));
}
}
}
void Configuration::impl::on_sound_cq_path_test_push_button_clicked(){
auto path = ui_->sound_cq_path_display_label->text();
if(path.isEmpty()){
return;
}
QSound::play(path);
}
void Configuration::impl::on_sound_cq_path_reset_push_button_clicked(){
ui_->sound_cq_path_display_label->clear();
}
void Configuration::impl::on_sound_dm_path_select_push_button_clicked(){
QStringList filters;
filters << "Audio files (*.wav)"
<< "Any files (*)";
QFileDialog fd {this, tr ("Sound File"), ui_->sound_dm_path_display_label->text ()};
fd.setNameFilters(filters);
if (fd.exec ()) {
if (fd.selectedFiles ().size ()) {
if(rig_params_.ptt_type == TransceiverFactory::PTT_method_VOX){
QMessageBox::warning(this, "Notifications Sounds Warning", "You have enabled notification sounds while using VOX. To avoid transmitting these notification sounds, please make sure your rig is using a different sound card than your system.");
}
ui_->sound_dm_path_display_label->setText(fd.selectedFiles().at(0));
}
}
}
void Configuration::impl::on_sound_dm_path_test_push_button_clicked(){
auto path = ui_->sound_dm_path_display_label->text();
if(path.isEmpty()){
return;
}
QSound::play(path);
}
void Configuration::impl::on_sound_dm_path_reset_push_button_clicked(){
ui_->sound_dm_path_display_label->clear();
}
void Configuration::impl::on_sound_am_path_select_push_button_clicked(){
QStringList filters;
filters << "Audio files (*.wav)"
<< "Any files (*)";
QFileDialog fd {this, tr ("Sound File"), ui_->sound_am_path_display_label->text ()};
fd.setNameFilters(filters);
if (fd.exec ()) {
if (fd.selectedFiles ().size ()) {
if(rig_params_.ptt_type == TransceiverFactory::PTT_method_VOX){
QMessageBox::warning(this, "Notifications Sounds Warning", "You have enabled notification sounds while using VOX. To avoid transmitting these notification sounds, please make sure your rig is using a different sound card than your system.");
}
ui_->sound_am_path_display_label->setText(fd.selectedFiles().at(0));
}
}
}
void Configuration::impl::on_sound_am_path_test_push_button_clicked(){
auto path = ui_->sound_am_path_display_label->text();
if(path.isEmpty()){
return;
}
QSound::play(path);
}
void Configuration::impl::on_sound_am_path_reset_push_button_clicked(){
ui_->sound_am_path_display_label->clear();
}
void Configuration::impl::on_calibration_intercept_spin_box_valueChanged (double)
{
rig_active_ = false; // force reset

View File

@ -198,9 +198,6 @@ public:
QStringListModel const * macros () const;
QDir save_directory () const;
QDir azel_directory () const;
QString sound_cq_path() const;
QString sound_dm_path() const;
QString sound_am_path() const;
QString rig_name () const;
Type2MsgGen type_2_msg_gen () const;
QColor color_table_background() const;

View File

@ -2972,203 +2972,6 @@ QListView::item:hover {
</item>
</layout>
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>&amp;Notifications</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_16">
<item>
<widget class="QGroupBox" name="groupBox_13">
<property name="title">
<string>Notification Sounds</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_17">
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QGridLayout" name="gridLayout_19">
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<item row="6" column="3">
<widget class="QPushButton" name="sound_am_path_test_push_button">
<property name="text">
<string>Test</string>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QPushButton" name="sound_dm_path_reset_push_button">
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QPushButton" name="sound_am_path_reset_push_button">
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="sound_cq_path_label">
<property name="text">
<string>CQ Message Received:</string>
</property>
<property name="buddy">
<cstring>azel_path_select_push_button</cstring>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="sound_am_path_display_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="sound_am_path_label">
<property name="text">
<string>Relay/Alert Message Received:</string>
</property>
<property name="buddy">
<cstring>azel_path_select_push_button</cstring>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QPushButton" name="sound_dm_path_select_push_button">
<property name="text">
<string>Select</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="sound_dm_path_display_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QPushButton" name="sound_am_path_select_push_button">
<property name="text">
<string>Select</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="sound_dm_path_label">
<property name="text">
<string>Directed Message Received:</string>
</property>
<property name="buddy">
<cstring>azel_path_select_push_button</cstring>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QPushButton" name="sound_dm_path_test_push_button">
<property name="text">
<string>Test</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="sound_cq_path_display_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="sound_cq_path_select_push_button">
<property name="text">
<string>Select</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QPushButton" name="sound_cq_path_test_push_button">
<property name="text">
<string>Test</string>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QPushButton" name="sound_cq_path_reset_push_button">
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label_20">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Notification sounds are played over the default system soundcard. Special care must be taken while using VOX to ensure notification sounds are not transmitted.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="colors_tab">
<attribute name="title">
<string>&amp;UI</string>
@ -4254,15 +4057,6 @@ soundcard changes</string>
<tabstop>add_macro_line_edit</tabstop>
<tabstop>delete_macro_push_button</tabstop>
<tabstop>macros_list_view</tabstop>
<tabstop>sound_am_path_test_push_button</tabstop>
<tabstop>sound_dm_path_reset_push_button</tabstop>
<tabstop>sound_am_path_reset_push_button</tabstop>
<tabstop>sound_dm_path_select_push_button</tabstop>
<tabstop>sound_am_path_select_push_button</tabstop>
<tabstop>sound_dm_path_test_push_button</tabstop>
<tabstop>sound_cq_path_select_push_button</tabstop>
<tabstop>sound_cq_path_test_push_button</tabstop>
<tabstop>sound_cq_path_reset_push_button</tabstop>
<tabstop>font_push_button</tabstop>
<tabstop>tabWidget</tabstop>
<tabstop>scrollArea_8</tabstop>

View File

@ -4367,8 +4367,7 @@ void MainWindow::readFromStdout() //readFromStdout
// it is not processed elsewhere, so we need to just log it here.
logCallActivity(cd, true);
// play cq notification
playSoundNotification(m_config.sound_cq_path());
// TODO: jsherer - notification for cq?
} else {
// convert HEARTBEAT to a directed command and process...
@ -4595,7 +4594,7 @@ void MainWindow::readFromStdout() //readFromStdout
// See MainWindow::postDecode for displaying the latest decodes
}
void MainWindow::playSoundNotification(const QString &path){
void MainWindow::playSoundFile(const QString &path){
if(path.isEmpty()){
return;
}
@ -10485,8 +10484,7 @@ void MainWindow::processCommandActivity() {
// if we've received a message to be displayed, we should bump the repeat buttons...
resetAutomaticIntervalTransmissions(true, false);
// and we should play the sound notification if there is one...
playSoundNotification(m_config.sound_dm_path());
// TODO: jsherer - notification for direct message?
}
}
@ -11212,7 +11210,7 @@ void MainWindow::processAlertReplyForCommand(CommandDetail d, QString from, QStr
}
});
playSoundNotification(m_config.sound_am_path());
// TODO: jsherer - notification for alert?
msgBox->setModal(false);
msgBox->show();

View File

@ -134,7 +134,7 @@ public slots:
void msgAvgDecode2();
void fastPick(int x0, int x1, int y);
void playSoundNotification(const QString &path);
void playSoundFile(const QString &path);
bool hasExistingMessageBufferToMe(int *pOffset);
bool hasExistingMessageBuffer(int offset, bool drift, int *pPrevOffset);
void logCallActivity(CallDetail d, bool spot=true);