mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 10:45:37 +08:00
Ref T384, overlay text messages added in frame
This commit is contained in:
@@ -63,6 +63,11 @@ namespace BlackGui
|
|||||||
ui->tvp_StatusMessages->setForceColumnsToMaxSize(false); // problems with multiline entries, with T138 we need multiline messages
|
ui->tvp_StatusMessages->setForceColumnsToMaxSize(false); // problems with multiline entries, with T138 we need multiline messages
|
||||||
ui->tvp_StatusMessages->menuAddItems(CStatusMessageView::MenuSave);
|
ui->tvp_StatusMessages->menuAddItems(CStatusMessageView::MenuSave);
|
||||||
ui->fr_Confirmation->setVisible(false);
|
ui->fr_Confirmation->setVisible(false);
|
||||||
|
|
||||||
|
ui->comp_OverlayTextMessage->showSettings(false);
|
||||||
|
ui->comp_OverlayTextMessage->showTextMessageEntry(true);
|
||||||
|
ui->comp_OverlayTextMessage->setAsUsedInOverlayMode();
|
||||||
|
|
||||||
this->setDefaultConfirmationButton(QMessageBox::Cancel);
|
this->setDefaultConfirmationButton(QMessageBox::Cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +150,7 @@ namespace BlackGui
|
|||||||
return s.popup(textMessage, ownAircraft);
|
return s.popup(textMessage, ownAircraft);
|
||||||
}
|
}
|
||||||
|
|
||||||
void COverlayMessages::showOverlayMessages(const BlackMisc::CStatusMessageList &messages, bool appendOldMessages, int timeOutMs)
|
void COverlayMessages::showOverlayMessages(const CStatusMessageList &messages, bool appendOldMessages, int timeOutMs)
|
||||||
{
|
{
|
||||||
if (messages.isEmpty()) { return; }
|
if (messages.isEmpty()) { return; }
|
||||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||||
@@ -212,7 +217,7 @@ namespace BlackGui
|
|||||||
void COverlayMessages::showOverlayTextMessage(const CTextMessage &textMessage, int timeOutMs)
|
void COverlayMessages::showOverlayTextMessage(const CTextMessage &textMessage, int timeOutMs)
|
||||||
{
|
{
|
||||||
if (textMessage.isEmpty()) { return; }
|
if (textMessage.isEmpty()) { return; }
|
||||||
if (!displayTextMessage(textMessage)) { return; }
|
if (!this->displayTextMessage(textMessage)) { return; }
|
||||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||||
|
|
||||||
if (this->hasPendingConfirmation())
|
if (this->hasPendingConfirmation())
|
||||||
@@ -240,6 +245,15 @@ namespace BlackGui
|
|||||||
this->display(timeOutMs);
|
this->display(timeOutMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void COverlayMessages::showOverlayInlineTextMessage(Components::TextMessageTab tab)
|
||||||
|
{
|
||||||
|
ui->sw_StatusMessagesComponent->setCurrentWidget(ui->pg_OverlayTextMessage);
|
||||||
|
ui->comp_OverlayTextMessage->setTab(tab);
|
||||||
|
this->setHeader("Text message");
|
||||||
|
this->showKill(false);
|
||||||
|
this->display();
|
||||||
|
}
|
||||||
|
|
||||||
void COverlayMessages::showOverlayImage(const CPixmap &image, int timeOutMs)
|
void COverlayMessages::showOverlayImage(const CPixmap &image, int timeOutMs)
|
||||||
{
|
{
|
||||||
this->showOverlayImage(image.toPixmap(), timeOutMs);
|
this->showOverlayImage(image.toPixmap(), timeOutMs);
|
||||||
|
|||||||
@@ -12,8 +12,9 @@
|
|||||||
#ifndef BLACKGUI_OVERLAYMESSAGES_H
|
#ifndef BLACKGUI_OVERLAYMESSAGES_H
|
||||||
#define BLACKGUI_OVERLAYMESSAGES_H
|
#define BLACKGUI_OVERLAYMESSAGES_H
|
||||||
|
|
||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/components/textmessagecomponenttab.h"
|
||||||
#include "blackgui/settings/textmessagesettings.h"
|
#include "blackgui/settings/textmessagesettings.h"
|
||||||
|
#include "blackgui/blackguiexport.h"
|
||||||
#include "blackmisc/pixmap.h"
|
#include "blackmisc/pixmap.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
#include "blackmisc/statusmessagelist.h"
|
#include "blackmisc/statusmessagelist.h"
|
||||||
@@ -30,7 +31,6 @@
|
|||||||
class QKeyEvent;
|
class QKeyEvent;
|
||||||
class QPaintEvent;
|
class QPaintEvent;
|
||||||
class QPixmap;
|
class QPixmap;
|
||||||
class QWidget;
|
|
||||||
|
|
||||||
namespace BlackMisc { namespace Network { class CTextMessage; } }
|
namespace BlackMisc { namespace Network { class CTextMessage; } }
|
||||||
namespace Ui { class COverlayMessages; }
|
namespace Ui { class COverlayMessages; }
|
||||||
@@ -98,6 +98,9 @@ namespace BlackGui
|
|||||||
//! Info message, based on text message
|
//! Info message, based on text message
|
||||||
void showOverlayTextMessage(const BlackMisc::Network::CTextMessage &textMessage, int timeOutMs = -1);
|
void showOverlayTextMessage(const BlackMisc::Network::CTextMessage &textMessage, int timeOutMs = -1);
|
||||||
|
|
||||||
|
//! Inline text message
|
||||||
|
void showOverlayInlineTextMessage(BlackGui::Components::TextMessageTab tab);
|
||||||
|
|
||||||
//! Image
|
//! Image
|
||||||
void showOverlayImage(const BlackMisc::CPixmap &image, int timeOutMs = -1);
|
void showOverlayImage(const BlackMisc::CPixmap &image, int timeOutMs = -1);
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="sw_StatusMessagesComponent">
|
<widget class="QStackedWidget" name="sw_StatusMessagesComponent">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>4</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="pg_StatusMessages">
|
<widget class="QWidget" name="pg_StatusMessages">
|
||||||
<layout class="QVBoxLayout" name="vl_PgStatusMessages">
|
<layout class="QVBoxLayout" name="vl_PgStatusMessages">
|
||||||
@@ -295,6 +295,32 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="pg_OverlayTextMessage">
|
||||||
|
<layout class="QVBoxLayout" name="vl_OverlayTextMessage">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::Components::CTextMessageComponent" name="comp_OverlayTextMessage">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -375,6 +401,12 @@
|
|||||||
<header>blackgui/components/statusmessageformsmall.h</header>
|
<header>blackgui/components/statusmessageformsmall.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::Components::CTextMessageComponent</class>
|
||||||
|
<extends>QFrame</extends>
|
||||||
|
<header>blackgui/components/textmessagecomponent.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>pb_Ok</tabstop>
|
<tabstop>pb_Ok</tabstop>
|
||||||
|
|||||||
@@ -12,13 +12,13 @@
|
|||||||
#ifndef BLACKGUI_OVERLAYMESSAGES_FRAME_H
|
#ifndef BLACKGUI_OVERLAYMESSAGES_FRAME_H
|
||||||
#define BLACKGUI_OVERLAYMESSAGES_FRAME_H
|
#define BLACKGUI_OVERLAYMESSAGES_FRAME_H
|
||||||
|
|
||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/components/textmessagecomponenttab.h"
|
||||||
#include "blackgui/overlaymessages.h"
|
#include "blackgui/overlaymessages.h"
|
||||||
#include "blackgui/guiutility.h"
|
#include "blackgui/guiutility.h"
|
||||||
#include "blackmisc/pixmap.h"
|
#include "blackgui/blackguiexport.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
|
||||||
#include "blackmisc/statusmessagelist.h"
|
|
||||||
#include "blackmisc/network/textmessage.h"
|
#include "blackmisc/network/textmessage.h"
|
||||||
|
#include "blackmisc/pixmap.h"
|
||||||
|
#include "blackmisc/statusmessagelist.h"
|
||||||
#include "blackmisc/variant.h"
|
#include "blackmisc/variant.h"
|
||||||
|
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
@@ -163,6 +163,14 @@ namespace BlackGui
|
|||||||
WIDGET::repaint();
|
WIDGET::repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! \copydoc BlackGui::COverlayMessages::showOverlayImage
|
||||||
|
void showOverlayInlineTextMessage(Components::TextMessageTab tab)
|
||||||
|
{
|
||||||
|
this->initInnerFrame();
|
||||||
|
m_overlayMessages->showOverlayInlineTextMessage(tab);
|
||||||
|
WIDGET::repaint();
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
COverlayMessages *m_overlayMessages = nullptr; //!< embedded QFrame with status messages
|
COverlayMessages *m_overlayMessages = nullptr; //!< embedded QFrame with status messages
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user