forked from qt-creator/qt-creator
RunControl: Show correct icon in application output
Add a virtual icon() method to runcontrol. Actually currently the icon only varies between modes of running. Task-Nr: QTCREATORBUG-1232
This commit is contained in:
@@ -169,6 +169,11 @@ QString AnalyzerRunControl::displayName() const
|
||||
return AnalyzerManager::instance()->currentTool()->displayName();
|
||||
}
|
||||
|
||||
QIcon AnalyzerRunControl::icon() const
|
||||
{
|
||||
return QIcon(QLatin1String(":/images/analyzer_start_small.png"));
|
||||
}
|
||||
|
||||
void AnalyzerRunControl::receiveStandardOutput(const QString &text)
|
||||
{
|
||||
appendMessage(text, ProjectExplorer::StdOutFormat);
|
||||
|
||||
@@ -91,6 +91,7 @@ public:
|
||||
StopResult stop();
|
||||
bool isRunning() const;
|
||||
QString displayName() const;
|
||||
QIcon icon() const;
|
||||
|
||||
private slots:
|
||||
void receiveStandardOutput(const QString &);
|
||||
|
||||
@@ -227,6 +227,11 @@ QString DebuggerRunControl::displayName() const
|
||||
return d->m_engine->startParameters().displayName;
|
||||
}
|
||||
|
||||
QIcon DebuggerRunControl::icon() const
|
||||
{
|
||||
return QIcon(ProjectExplorer::Constants::ICON_DEBUG_SMALL);
|
||||
}
|
||||
|
||||
void DebuggerRunControl::setCustomEnvironment(Utils::Environment env)
|
||||
{
|
||||
QTC_ASSERT(d->m_engine, return);
|
||||
|
||||
@@ -96,6 +96,7 @@ public:
|
||||
StopResult stop(); // Called from SnapshotWindow.
|
||||
bool isRunning() const;
|
||||
QString displayName() const;
|
||||
QIcon icon() const;
|
||||
|
||||
void setCustomEnvironment(Utils::Environment env);
|
||||
void startFailed();
|
||||
|
||||
@@ -122,6 +122,11 @@ bool LocalApplicationRunControl::isRunning() const
|
||||
return m_applicationLauncher.isRunning();
|
||||
}
|
||||
|
||||
QIcon LocalApplicationRunControl::icon() const
|
||||
{
|
||||
return QIcon(ProjectExplorer::Constants::ICON_RUN_SMALL);
|
||||
}
|
||||
|
||||
void LocalApplicationRunControl::slotAppendMessage(const QString &err,
|
||||
OutputFormat format)
|
||||
{
|
||||
|
||||
@@ -63,6 +63,7 @@ public:
|
||||
virtual void start();
|
||||
virtual StopResult stop();
|
||||
virtual bool isRunning() const;
|
||||
virtual QIcon icon() const;
|
||||
private slots:
|
||||
void processExited(int exitCode);
|
||||
void slotAppendMessage(const QString &err, ProjectExplorer::OutputFormat isError);
|
||||
|
||||
@@ -88,11 +88,8 @@ OutputPane::OutputPane() :
|
||||
m_reRunButton(new QToolButton),
|
||||
m_stopButton(new QToolButton)
|
||||
{
|
||||
m_runIcon.addFile(Constants::ICON_RUN);
|
||||
m_runIcon.addFile(Constants::ICON_RUN_SMALL);
|
||||
|
||||
// Rerun
|
||||
m_reRunButton->setIcon(m_runIcon);
|
||||
m_reRunButton->setIcon(QIcon(ProjectExplorer::Constants::ICON_RUN_SMALL));
|
||||
m_reRunButton->setToolTip(tr("Re-run this run-configuration"));
|
||||
m_reRunButton->setAutoRaise(true);
|
||||
m_reRunButton->setEnabled(false);
|
||||
@@ -396,7 +393,7 @@ void OutputPane::tabChanged(int i)
|
||||
RunControl *rc = m_runControlTabs.at(index).runControl;
|
||||
m_stopAction->setEnabled(rc->isRunning());
|
||||
m_reRunButton->setEnabled(!rc->isRunning());
|
||||
m_reRunButton->setIcon(m_runIcon);
|
||||
m_reRunButton->setIcon(rc->icon());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,7 +403,7 @@ void OutputPane::runControlStarted()
|
||||
if (current && current == sender()) {
|
||||
m_reRunButton->setEnabled(false);
|
||||
m_stopAction->setEnabled(true);
|
||||
m_reRunButton->setIcon(m_runIcon);
|
||||
m_reRunButton->setIcon(current->icon());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,7 +424,7 @@ void OutputPane::runControlFinished()
|
||||
if (current && current == sender()) {
|
||||
m_reRunButton->setEnabled(true);
|
||||
m_stopAction->setEnabled(false);
|
||||
m_reRunButton->setIcon(m_runIcon);
|
||||
m_reRunButton->setIcon(current->icon());
|
||||
}
|
||||
// Check for asynchronous close. Close the tab.
|
||||
if (m_runControlTabs.at(senderIndex).asyncClosing)
|
||||
|
||||
@@ -146,7 +146,6 @@ private:
|
||||
QAction *m_stopAction;
|
||||
QToolButton *m_reRunButton;
|
||||
QToolButton *m_stopButton;
|
||||
QIcon m_runIcon;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <QtCore/QMetaType>
|
||||
#include <QtCore/QWeakPointer>
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QIcon>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
@@ -252,6 +253,10 @@ public:
|
||||
virtual StopResult stop() = 0;
|
||||
virtual bool isRunning() const = 0;
|
||||
virtual QString displayName() const;
|
||||
/// \returns the icon to be shown in the outputwindow
|
||||
// TODO the icon differs currently only per "mode"
|
||||
// so this is more flexibel then it needs to be
|
||||
virtual QIcon icon() const = 0;
|
||||
|
||||
bool sameRunConfiguration(const RunControl *other) const;
|
||||
|
||||
|
||||
@@ -113,6 +113,11 @@ bool QmlRunControl::isRunning() const
|
||||
return m_applicationLauncher.isRunning();
|
||||
}
|
||||
|
||||
QIcon QmlRunControl::icon() const
|
||||
{
|
||||
return QIcon(ProjectExplorer::Constants::ICON_RUN_SMALL);
|
||||
}
|
||||
|
||||
void QmlRunControl::slotBringApplicationToForeground(qint64 pid)
|
||||
{
|
||||
bringApplicationToForeground(pid);
|
||||
|
||||
@@ -54,6 +54,7 @@ public:
|
||||
virtual void start();
|
||||
virtual StopResult stop();
|
||||
virtual bool isRunning() const;
|
||||
virtual QIcon icon() const;
|
||||
|
||||
private slots:
|
||||
void processExited(int exitCode);
|
||||
|
||||
@@ -140,6 +140,11 @@ bool MaemoRunControl::isRunning() const
|
||||
return m_running;
|
||||
}
|
||||
|
||||
QIcon MaemoRunControl::icon() const
|
||||
{
|
||||
return QIcon(ProjectExplorer::Constants::ICON_RUN_SMALL);
|
||||
}
|
||||
|
||||
void MaemoRunControl::handleError(const QString &errString)
|
||||
{
|
||||
stop();
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
virtual void start();
|
||||
virtual StopResult stop();
|
||||
virtual bool isRunning() const;
|
||||
virtual QIcon icon() const;
|
||||
|
||||
private slots:
|
||||
void startExecution();
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <symbianutils/symbiandevicemanager.h>
|
||||
|
||||
@@ -110,6 +111,11 @@ bool CodaRunControl::isRunning() const
|
||||
return m_state >= StateConnecting;
|
||||
}
|
||||
|
||||
QIcon CodaRunControl::icon() const
|
||||
{
|
||||
return QIcon(ProjectExplorer::Constants::ICON_DEBUG_SMALL);
|
||||
}
|
||||
|
||||
bool CodaRunControl::setupLauncher()
|
||||
{
|
||||
QTC_ASSERT(!m_codaDevice, return false);
|
||||
|
||||
@@ -63,6 +63,7 @@ public:
|
||||
virtual ~CodaRunControl();
|
||||
|
||||
virtual bool isRunning() const;
|
||||
virtual QIcon icon() const;
|
||||
|
||||
static QMessageBox *createCodaWaitingMessageBox(QWidget *parent = 0);
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qtoutputformatter.h"
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/detailswidget.h>
|
||||
|
||||
@@ -369,6 +371,11 @@ bool S60EmulatorRunControl::isRunning() const
|
||||
return m_applicationLauncher.isRunning();
|
||||
}
|
||||
|
||||
QIcon S60EmulatorRunControl::icon() const
|
||||
{
|
||||
return QIcon(ProjectExplorer::Constants::ICON_RUN_SMALL);
|
||||
}
|
||||
|
||||
void S60EmulatorRunControl::slotError(const QString & err)
|
||||
{
|
||||
appendMessage(err, ErrorMessageFormat);
|
||||
|
||||
@@ -146,6 +146,7 @@ public:
|
||||
void start();
|
||||
virtual StopResult stop();
|
||||
bool isRunning() const;
|
||||
QIcon icon() const;
|
||||
|
||||
private slots:
|
||||
void processExited(int exitCode);
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include <symbianutils/bluetoothlistener_gui.h>
|
||||
#include <symbianutils/launcher.h>
|
||||
#include <symbianutils/symbiandevicemanager.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
@@ -97,7 +98,11 @@ bool TrkRunControl::isRunning() const
|
||||
return m_launcher && (m_launcher->state() == trk::Launcher::Connecting
|
||||
|| m_launcher->state() == trk::Launcher::Connected
|
||||
|| m_launcher->state() == trk::Launcher::WaitingForTrk);
|
||||
}
|
||||
|
||||
QIcon TrkRunControl::icon() const
|
||||
{
|
||||
return QIcon(ProjectExplorer::Constants::ICON_DEBUG_SMALL);
|
||||
}
|
||||
|
||||
bool TrkRunControl::setupLauncher()
|
||||
|
||||
@@ -60,6 +60,7 @@ public:
|
||||
TrkRunControl(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode);
|
||||
~TrkRunControl();
|
||||
virtual bool isRunning() const;
|
||||
virtual QIcon icon() const;
|
||||
|
||||
static QMessageBox *createTrkWaitingMessageBox(const QString &port, QWidget *parent = 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user