Added test button to notifications table
This commit is contained in:
parent
fed50180eb
commit
9a097e20c9
@ -1597,13 +1597,13 @@ void Configuration::impl::initialize_models ()
|
|||||||
on_notifications_check_box_toggled(enable_notifications_);
|
on_notifications_check_box_toggled(enable_notifications_);
|
||||||
|
|
||||||
QList<QPair<QString, QString>> notifyRows = {
|
QList<QPair<QString, QString>> notifyRows = {
|
||||||
{"notify_cq", "CQ Message Received"},
|
{"cq", "CQ Message Received"},
|
||||||
{"notify_hb", "HB Message Received"},
|
{"hb", "HB Message Received"},
|
||||||
{"notify_ack", "ACK Message Received"},
|
{"ack", "ACK Message Received"},
|
||||||
{"notify_directed", "Directed Message Received"},
|
{"directed", "Directed Message Received"},
|
||||||
{"notify_inbox", "Inbox Message Received"},
|
{"inbox", "Inbox Message Received"},
|
||||||
{"notify_call_new", "New Callsign Heard"},
|
{"call_new", "New Callsign Heard"},
|
||||||
{"notify_call_old", "Worked Callsign Heard"},
|
{"call_old", "Worked Callsign Heard"},
|
||||||
};
|
};
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -1663,6 +1663,18 @@ void Configuration::impl::initialize_models ()
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QPushButton *testPushButton = new QPushButton(this);
|
||||||
|
testPushButton->setSizePolicy(minimumPolicy);
|
||||||
|
testPushButton->setText("Test");
|
||||||
|
buttonLayout->addWidget(testPushButton);
|
||||||
|
|
||||||
|
connect(testPushButton, &QPushButton::pressed, this, [this, key, pathLabel](){
|
||||||
|
// hack for testing...
|
||||||
|
notifications_enabled_[key] = true;
|
||||||
|
notifications_paths_[key] = pathLabel->text();
|
||||||
|
emit this->self_->test_notify(key);
|
||||||
|
});
|
||||||
|
|
||||||
QPushButton *clearPushButton = new QPushButton(this);
|
QPushButton *clearPushButton = new QPushButton(this);
|
||||||
clearPushButton->setSizePolicy(minimumPolicy);
|
clearPushButton->setSizePolicy(minimumPolicy);
|
||||||
clearPushButton->setText("Clear");
|
clearPushButton->setText("Clear");
|
||||||
|
@ -91,6 +91,7 @@ public:
|
|||||||
|
|
||||||
bool notifications_enabled() const;
|
bool notifications_enabled() const;
|
||||||
QString notification_path(const QString &key) const;
|
QString notification_path(const QString &key) const;
|
||||||
|
Q_SIGNAL void test_notify(const QString &key);
|
||||||
|
|
||||||
// These query methods should be used after a call to exec() to
|
// These query methods should be used after a call to exec() to
|
||||||
// determine if either the audio input or audio output stream
|
// determine if either the audio input or audio output stream
|
||||||
|
@ -514,8 +514,9 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
|||||||
connect (this, &MainWindow::outAttenuationChanged, m_soundOutput, &SoundOutput::setAttenuation);
|
connect (this, &MainWindow::outAttenuationChanged, m_soundOutput, &SoundOutput::setAttenuation);
|
||||||
connect (&m_audioThread, &QThread::finished, m_soundOutput, &QObject::deleteLater);
|
connect (&m_audioThread, &QThread::finished, m_soundOutput, &QObject::deleteLater);
|
||||||
|
|
||||||
connect(this, &MainWindow::initializeNotificationAudioOutputStream, m_notification, &NotificationAudio::init);
|
connect (this, &MainWindow::initializeNotificationAudioOutputStream, m_notification, &NotificationAudio::init);
|
||||||
connect(this, &MainWindow::playNotification, m_notification, &NotificationAudio::play);
|
connect (&m_config, &Configuration::test_notify, this, &MainWindow::tryNotify);
|
||||||
|
connect (this, &MainWindow::playNotification, m_notification, &NotificationAudio::play);
|
||||||
connect (&m_notificationAudioThread, &QThread::finished, m_notification, &QObject::deleteLater);
|
connect (&m_notificationAudioThread, &QThread::finished, m_notification, &QObject::deleteLater);
|
||||||
|
|
||||||
// hook up Modulator slots and disposal
|
// hook up Modulator slots and disposal
|
||||||
@ -9503,9 +9504,7 @@ void MainWindow::postDecode (bool is_new, QString const& message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::tryNotify(const QString &key){
|
void MainWindow::tryNotify(const QString &key){
|
||||||
auto k = QString("notify_%1").arg(key);
|
auto path = m_config.notification_path(key);
|
||||||
|
|
||||||
auto path = m_config.notification_path(k);
|
|
||||||
if(path.isEmpty()){
|
if(path.isEmpty()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -166,6 +166,8 @@ public slots:
|
|||||||
QString createMessageTransmitQueue(QString const& text, bool reset);
|
QString createMessageTransmitQueue(QString const& text, bool reset);
|
||||||
void resetMessageTransmitQueue();
|
void resetMessageTransmitQueue();
|
||||||
QPair<QString, int> popMessageFrame();
|
QPair<QString, int> popMessageFrame();
|
||||||
|
void tryNotify(const QString &key);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void keyPressEvent (QKeyEvent *) override;
|
void keyPressEvent (QKeyEvent *) override;
|
||||||
void closeEvent(QCloseEvent *) override;
|
void closeEvent(QCloseEvent *) override;
|
||||||
@ -433,7 +435,6 @@ private slots:
|
|||||||
void checkStartupWarnings ();
|
void checkStartupWarnings ();
|
||||||
void clearCallsignSelected();
|
void clearCallsignSelected();
|
||||||
void refreshTextDisplay();
|
void refreshTextDisplay();
|
||||||
void tryNotify(const QString &key);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_SIGNAL void playNotification(const QString &name);
|
Q_SIGNAL void playNotification(const QString &name);
|
||||||
|
Loading…
Reference in New Issue
Block a user