Commit a5e447b4 authored by Tobias Hunger's avatar Tobias Hunger

MessageManager: Allow more control when showing Pane

Change-Id: I7169473818cf726545a85cdc686655b0d4dbf3e7
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 139792ee
......@@ -38,6 +38,19 @@ MessageManager *MessageManager::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()
{
m_instance = this;
......@@ -60,24 +73,11 @@ void MessageManager::init()
ExtensionSystem::PluginManager::addObject(m_messageOutputWindow);
}
void MessageManager::showOutputPane()
{
if (m_messageOutputWindow)
m_messageOutputWindow->popup(IOutputPane::ModeSwitch);
}
void MessageManager::write(const QString &text, 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)));
}
showOutputPane(flags);
m_messageOutputWindow->append(text + QLatin1Char('\n'));
}
......@@ -42,8 +42,6 @@ class CORE_EXPORT MessageManager : public QObject
public:
static MessageManager *instance();
static void showOutputPane();
enum PrintToOutputPaneFlag {
NoModeSwitch = IOutputPane::NoModeSwitch,
ModeSwitch = IOutputPane::ModeSwitch,
......@@ -55,6 +53,8 @@ public:
Q_DECLARE_FLAGS(PrintToOutputPaneFlags, PrintToOutputPaneFlag)
static void showOutputPane(Core::MessageManager::PrintToOutputPaneFlags flags = NoModeSwitch);
public slots:
static void write(const QString &text,
Core::MessageManager::PrintToOutputPaneFlags flags = NoModeSwitch);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment