Added a global message inbox for when there's no callsign selected

This commit is contained in:
Jordan Sherer 2019-02-16 15:56:18 -05:00
parent bb4b79d797
commit f0ceb0f7f4
3 changed files with 10 additions and 2 deletions

View File

@ -1390,7 +1390,8 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
displayActivity(true); displayActivity(true);
}); });
auto historyAction = new QAction(QString("Message Inbox..."), ui->tableWidgetCalls); auto historyAction = new QAction(QString("Show Message Inbox..."), ui->tableWidgetCalls);
connect(ui->actionShow_Message_Inbox, &QAction::triggered, historyAction, &QAction::trigger);
connect(historyAction, &QAction::triggered, this, [this](){ connect(historyAction, &QAction::triggered, this, [this](){
QString selectedCall = callsignSelected(); QString selectedCall = callsignSelected();
if(selectedCall.isEmpty()){ if(selectedCall.isEmpty()){

View File

@ -4722,6 +4722,7 @@ list. The list can be maintained in Settings (F2).</string>
<addaction name="actionShow_Fullscreen"/> <addaction name="actionShow_Fullscreen"/>
<addaction name="actionShow_Statusbar"/> <addaction name="actionShow_Statusbar"/>
<addaction name="actionShow_Tooltips"/> <addaction name="actionShow_Tooltips"/>
<addaction name="actionShow_Message_Inbox"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionReset_Window_Sizes"/> <addaction name="actionReset_Window_Sizes"/>
</widget> </widget>
@ -5638,6 +5639,11 @@ list. The list can be maintained in Settings (F2).</string>
<string>Set Offset...</string> <string>Set Offset...</string>
</property> </property>
</action> </action>
<action name="actionShow_Message_Inbox">
<property name="text">
<string>Show Message Inbox...</string>
</property>
</action>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
<customwidgets> <customwidgets>

View File

@ -3,6 +3,7 @@
#include "moc_messagewindow.cpp" #include "moc_messagewindow.cpp"
#include <QDateTime> #include <QDateTime>
#include <QMenu>
#include "Radio.hpp" #include "Radio.hpp"
#include "keyeater.h" #include "keyeater.h"
@ -49,7 +50,7 @@ MessageWindow::~MessageWindow()
} }
void MessageWindow::setCall(const QString &call){ void MessageWindow::setCall(const QString &call){
setWindowTitle(QString("Message History: %1").arg(call)); setWindowTitle(QString("Messages: %1").arg(call == "%" ? "All" : call));
} }
void MessageWindow::populateMessages(QList<QPair<int, Message> > msgs){ void MessageWindow::populateMessages(QList<QPair<int, Message> > msgs){