forked from qt-creator/qt-creator
MessageManager: Allow more control when showing Pane
Change-Id: I7169473818cf726545a85cdc686655b0d4dbf3e7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -38,6 +38,19 @@ MessageManager *MessageManager::instance()
|
|||||||
return m_instance;
|
return m_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MessageManager::showOutputPane(Core::MessageManager::PrintToOutputPaneFlags flags)
|
||||||
|
{
|
||||||
|
if (!m_messageOutputWindow)
|
||||||
|
return;
|
||||||
|
if (flags & Flash) {
|
||||||
|
m_messageOutputWindow->flash();
|
||||||
|
} else if (flags & Silent) {
|
||||||
|
// Do nothing
|
||||||
|
} else {
|
||||||
|
m_messageOutputWindow->popup(IOutputPane::Flag(int(flags)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MessageManager::MessageManager()
|
MessageManager::MessageManager()
|
||||||
{
|
{
|
||||||
m_instance = this;
|
m_instance = this;
|
||||||
@@ -60,24 +73,11 @@ void MessageManager::init()
|
|||||||
ExtensionSystem::PluginManager::addObject(m_messageOutputWindow);
|
ExtensionSystem::PluginManager::addObject(m_messageOutputWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessageManager::showOutputPane()
|
|
||||||
{
|
|
||||||
if (m_messageOutputWindow)
|
|
||||||
m_messageOutputWindow->popup(IOutputPane::ModeSwitch);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MessageManager::write(const QString &text, PrintToOutputPaneFlags flags)
|
void MessageManager::write(const QString &text, PrintToOutputPaneFlags flags)
|
||||||
{
|
{
|
||||||
if (!m_messageOutputWindow)
|
if (!m_messageOutputWindow)
|
||||||
return;
|
return;
|
||||||
if (flags & Flash) {
|
showOutputPane(flags);
|
||||||
m_messageOutputWindow->flash();
|
|
||||||
} else if (flags & Silent) {
|
|
||||||
// Do nothing
|
|
||||||
} else {
|
|
||||||
m_messageOutputWindow->popup(IOutputPane::Flag(int(flags)));
|
|
||||||
}
|
|
||||||
|
|
||||||
m_messageOutputWindow->append(text + QLatin1Char('\n'));
|
m_messageOutputWindow->append(text + QLatin1Char('\n'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,6 @@ class CORE_EXPORT MessageManager : public QObject
|
|||||||
public:
|
public:
|
||||||
static MessageManager *instance();
|
static MessageManager *instance();
|
||||||
|
|
||||||
static void showOutputPane();
|
|
||||||
|
|
||||||
enum PrintToOutputPaneFlag {
|
enum PrintToOutputPaneFlag {
|
||||||
NoModeSwitch = IOutputPane::NoModeSwitch,
|
NoModeSwitch = IOutputPane::NoModeSwitch,
|
||||||
ModeSwitch = IOutputPane::ModeSwitch,
|
ModeSwitch = IOutputPane::ModeSwitch,
|
||||||
@@ -55,6 +53,8 @@ public:
|
|||||||
|
|
||||||
Q_DECLARE_FLAGS(PrintToOutputPaneFlags, PrintToOutputPaneFlag)
|
Q_DECLARE_FLAGS(PrintToOutputPaneFlags, PrintToOutputPaneFlag)
|
||||||
|
|
||||||
|
static void showOutputPane(Core::MessageManager::PrintToOutputPaneFlags flags = NoModeSwitch);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
static void write(const QString &text,
|
static void write(const QString &text,
|
||||||
Core::MessageManager::PrintToOutputPaneFlags flags = NoModeSwitch);
|
Core::MessageManager::PrintToOutputPaneFlags flags = NoModeSwitch);
|
||||||
|
|||||||
Reference in New Issue
Block a user