forked from qt-creator/qt-creator
ApplicationOutput: Tweak popup/flash behavior on output
- Change the option to switch between Flash and Popup on output - Never popup on starting a application Task-number: QTCREATORBUG-9120 Change-Id: If688822dad336e0f98a11bf2796483e79c0ae653 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -101,7 +101,7 @@ void TabWidget::slotContextMenuRequested(const QPoint &pos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
AppOutputPane::RunControlTab::RunControlTab(RunControl *rc, Core::OutputWindow *w) :
|
AppOutputPane::RunControlTab::RunControlTab(RunControl *rc, Core::OutputWindow *w) :
|
||||||
runControl(rc), window(w), asyncClosing(false)
|
runControl(rc), window(w), asyncClosing(false), behavivorOnOutput(Flash)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,8 +360,16 @@ void AppOutputPane::updateFromSettings()
|
|||||||
void AppOutputPane::appendMessage(RunControl *rc, const QString &out, Utils::OutputFormat format)
|
void AppOutputPane::appendMessage(RunControl *rc, const QString &out, Utils::OutputFormat format)
|
||||||
{
|
{
|
||||||
const int index = indexOf(rc);
|
const int index = indexOf(rc);
|
||||||
if (index != -1)
|
if (index != -1) {
|
||||||
m_runControlTabs.at(index).window->appendMessage(out, format);
|
Core::OutputWindow *window = m_runControlTabs.at(index).window;
|
||||||
|
window->appendMessage(out, format);
|
||||||
|
if (format != Utils::NormalMessageFormat) {
|
||||||
|
if (m_runControlTabs.at(index).behavivorOnOutput == Flash)
|
||||||
|
flash();
|
||||||
|
else
|
||||||
|
popup(NoModeSwitch);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppOutputPane::showTabFor(RunControl *rc)
|
void AppOutputPane::showTabFor(RunControl *rc)
|
||||||
@@ -369,6 +377,13 @@ void AppOutputPane::showTabFor(RunControl *rc)
|
|||||||
m_tabWidget->setCurrentIndex(tabWidgetIndexOf(indexOf(rc)));
|
m_tabWidget->setCurrentIndex(tabWidgetIndexOf(indexOf(rc)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AppOutputPane::setBehaviorOnOutput(RunControl *rc, AppOutputPane::BehavivorOnOutput mode)
|
||||||
|
{
|
||||||
|
const int index = indexOf(rc);
|
||||||
|
if (index != -1)
|
||||||
|
m_runControlTabs[index].behavivorOnOutput = mode;
|
||||||
|
}
|
||||||
|
|
||||||
void AppOutputPane::reRunRunControl()
|
void AppOutputPane::reRunRunControl()
|
||||||
{
|
{
|
||||||
const int index = currentIndex();
|
const int index = currentIndex();
|
||||||
|
|||||||
@@ -60,6 +60,11 @@ public:
|
|||||||
CloseTabWithPrompt
|
CloseTabWithPrompt
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum BehavivorOnOutput {
|
||||||
|
Flash,
|
||||||
|
Popup
|
||||||
|
};
|
||||||
|
|
||||||
AppOutputPane();
|
AppOutputPane();
|
||||||
virtual ~AppOutputPane();
|
virtual ~AppOutputPane();
|
||||||
|
|
||||||
@@ -81,6 +86,7 @@ public:
|
|||||||
|
|
||||||
void createNewOutputWindow(RunControl *rc);
|
void createNewOutputWindow(RunControl *rc);
|
||||||
void showTabFor(RunControl *rc);
|
void showTabFor(RunControl *rc);
|
||||||
|
void setBehaviorOnOutput(RunControl *rc, BehavivorOnOutput mode);
|
||||||
|
|
||||||
bool aboutToClose() const;
|
bool aboutToClose() const;
|
||||||
bool closeTabs(CloseTabMode mode);
|
bool closeTabs(CloseTabMode mode);
|
||||||
@@ -124,6 +130,7 @@ private:
|
|||||||
Core::OutputWindow *window;
|
Core::OutputWindow *window;
|
||||||
// Is the run control stopping asynchronously, close the tab once it finishes
|
// Is the run control stopping asynchronously, close the tab once it finishes
|
||||||
bool asyncClosing;
|
bool asyncClosing;
|
||||||
|
BehavivorOnOutput behavivorOnOutput;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool isRunning() const;
|
bool isRunning() const;
|
||||||
|
|||||||
@@ -1685,12 +1685,12 @@ void ProjectExplorerPlugin::showRunErrorMessage(const QString &errorMessage)
|
|||||||
void ProjectExplorerPlugin::startRunControl(RunControl *runControl, RunMode runMode)
|
void ProjectExplorerPlugin::startRunControl(RunControl *runControl, RunMode runMode)
|
||||||
{
|
{
|
||||||
d->m_outputPane->createNewOutputWindow(runControl);
|
d->m_outputPane->createNewOutputWindow(runControl);
|
||||||
if (runMode == NormalRunMode && d->m_projectExplorerSettings.showRunOutput)
|
d->m_outputPane->flash(); // one flash for starting
|
||||||
d->m_outputPane->popup(Core::IOutputPane::NoModeSwitch);
|
|
||||||
if ((runMode == DebugRunMode || runMode == DebugRunModeWithBreakOnMain)
|
|
||||||
&& d->m_projectExplorerSettings.showDebugOutput)
|
|
||||||
d->m_outputPane->popup(Core::IOutputPane::NoModeSwitch);
|
|
||||||
d->m_outputPane->showTabFor(runControl);
|
d->m_outputPane->showTabFor(runControl);
|
||||||
|
bool popup = (runMode == NormalRunMode && d->m_projectExplorerSettings.showRunOutput)
|
||||||
|
|| ((runMode == DebugRunMode || runMode == DebugRunModeWithBreakOnMain)
|
||||||
|
&& d->m_projectExplorerSettings.showDebugOutput);
|
||||||
|
d->m_outputPane->setBehaviorOnOutput(runControl, popup ? AppOutputPane::Popup : AppOutputPane::Flash);
|
||||||
connect(runControl, SIGNAL(finished()), this, SLOT(runControlFinished()));
|
connect(runControl, SIGNAL(finished()), this, SLOT(runControlFinished()));
|
||||||
runControl->start();
|
runControl->start();
|
||||||
emit updateRunActions();
|
emit updateRunActions();
|
||||||
|
|||||||
@@ -113,7 +113,16 @@
|
|||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QWidget" name="widget" native="true">
|
<widget class="QWidget" name="widget" native="true">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="margin">
|
<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>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@@ -152,14 +161,14 @@
|
|||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QCheckBox" name="showRunOutputCheckBox">
|
<widget class="QCheckBox" name="showRunOutputCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Open application output pane when running</string>
|
<string>Open application output pane on output when running</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QCheckBox" name="showDebugOutputCheckBox">
|
<widget class="QCheckBox" name="showDebugOutputCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Open application output pane when debugging</string>
|
<string>Open application output pane on output when debugging</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user