mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Add feedback when .wallop message is sent
This does the following: - Opens a message-tab called "SUP" when a .wallop message is sent. - Throws a validation error if another message is directly send into this "SUP" channel as another .wallop should be used.
This commit is contained in:
@@ -550,6 +550,9 @@ namespace BlackGui
|
||||
const bool isBroadcast = textMessage.isBroadcastMessage();
|
||||
if (isBroadcast) { cs.markAsBroadcastCallsign(); }
|
||||
|
||||
const bool isWallopMessage = textMessage.isWallopMessage();
|
||||
if(isWallopMessage) { cs.markAsWallopCallsign(); }
|
||||
|
||||
const QWidget *tab = this->findTextMessageTabByCallsign(cs);
|
||||
if (!tab) { tab = this->addNewTextMessageTab(cs); }
|
||||
Q_ASSERT_X(tab, Q_FUNC_INFO, "Missing tab");
|
||||
@@ -725,6 +728,10 @@ namespace BlackGui
|
||||
{
|
||||
CLogMessage(this).validationError(u"Incorrect message channel");
|
||||
return {};
|
||||
} else if (ui->tw_TextMessages->tabText(index) == "SUP")
|
||||
{
|
||||
CLogMessage(this).validationError(u"Message cannot be send to SUP channel. To send another wallop message use .wallop instead");
|
||||
return{};
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user