forked from qt-creator/qt-creator
Debugger: Make Perspective status label global
After some discussion we agreed that the contents is ephemeral and does not need to survive perspective switching. Change-Id: I41de6a8f9478e4bd229c8b204ef7a3fa0a344b75 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -291,7 +291,7 @@ void ClangStaticAnalyzerTool::handleStateUpdate()
|
|||||||
message += tr("%n issues found (%1 suppressed).", 0, issuesFound)
|
message += tr("%n issues found (%1 suppressed).", 0, issuesFound)
|
||||||
.arg(issuesFound - issuesVisible);
|
.arg(issuesFound - issuesVisible);
|
||||||
}
|
}
|
||||||
AnalyzerManager::showPermanentStatusMessage(ClangStaticAnalyzerPerspectiveId, message);
|
AnalyzerManager::showPermanentStatusMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ void ActionDescription::startTool() const
|
|||||||
AnalyzerManager::showMode();
|
AnalyzerManager::showMode();
|
||||||
|
|
||||||
TaskHub::clearTasks(Constants::ANALYZERTASK_ID);
|
TaskHub::clearTasks(Constants::ANALYZERTASK_ID);
|
||||||
AnalyzerManager::showPermanentStatusMessage(perspectiveId(), QString());
|
AnalyzerManager::showPermanentStatusMessage(QString());
|
||||||
|
|
||||||
if (m_toolPreparer && !m_toolPreparer())
|
if (m_toolPreparer && !m_toolPreparer())
|
||||||
return;
|
return;
|
||||||
@@ -438,7 +438,7 @@ void AnalyzerManagerPrivate::createModeMainWindow()
|
|||||||
analyzeToolBarLayout->addWidget(new StyledSeparator);
|
analyzeToolBarLayout->addWidget(new StyledSeparator);
|
||||||
analyzeToolBarLayout->addWidget(m_mainWindow->toolBox());
|
analyzeToolBarLayout->addWidget(m_mainWindow->toolBox());
|
||||||
analyzeToolBarLayout->addWidget(m_mainWindow->controlsStack());
|
analyzeToolBarLayout->addWidget(m_mainWindow->controlsStack());
|
||||||
analyzeToolBarLayout->addWidget(m_mainWindow->statusLabelsStack());
|
analyzeToolBarLayout->addWidget(m_mainWindow->statusLabel());
|
||||||
analyzeToolBarLayout->addStretch();
|
analyzeToolBarLayout->addStretch();
|
||||||
|
|
||||||
auto dock = new QDockWidget(tr("Analyzer Toolbar"));
|
auto dock = new QDockWidget(tr("Analyzer Toolbar"));
|
||||||
@@ -680,14 +680,14 @@ void AnalyzerManager::enableMainWindow(bool on)
|
|||||||
d->m_mainWindow->setEnabled(on);
|
d->m_mainWindow->setEnabled(on);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerManager::showStatusMessage(Id perspective, const QString &message, int timeoutMS)
|
void AnalyzerManager::showStatusMessage(const QString &message, int timeoutMS)
|
||||||
{
|
{
|
||||||
d->m_mainWindow->showStatusMessage(perspective, message, timeoutMS);
|
d->m_mainWindow->showStatusMessage(message, timeoutMS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerManager::showPermanentStatusMessage(Id perspective, const QString &message)
|
void AnalyzerManager::showPermanentStatusMessage(const QString &message)
|
||||||
{
|
{
|
||||||
d->m_mainWindow->showStatusMessage(perspective, message, -1);
|
d->m_mainWindow->showStatusMessage(message, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerManager::showMode()
|
void AnalyzerManager::showMode()
|
||||||
|
|||||||
@@ -152,8 +152,8 @@ public:
|
|||||||
static void stopTool();
|
static void stopTool();
|
||||||
|
|
||||||
// Convenience functions.
|
// Convenience functions.
|
||||||
static void showStatusMessage(Core::Id perspective, const QString &message, int timeoutMS = 10000);
|
static void showStatusMessage(const QString &message, int timeoutMS = 10000);
|
||||||
static void showPermanentStatusMessage(Core::Id perspective, const QString &message);
|
static void showPermanentStatusMessage(const QString &message);
|
||||||
|
|
||||||
static void handleToolStarted();
|
static void handleToolStarted();
|
||||||
static void handleToolFinished();
|
static void handleToolFinished();
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace Internal {
|
|||||||
MainWindowBase::MainWindowBase()
|
MainWindowBase::MainWindowBase()
|
||||||
{
|
{
|
||||||
m_controlsStackWidget = new QStackedWidget;
|
m_controlsStackWidget = new QStackedWidget;
|
||||||
m_statusLabelsStackWidget = new QStackedWidget;
|
m_statusLabel = new Utils::StatusLabel;
|
||||||
m_toolBox = new QComboBox;
|
m_toolBox = new QComboBox;
|
||||||
|
|
||||||
setDockNestingEnabled(true);
|
setDockNestingEnabled(true);
|
||||||
@@ -72,18 +72,12 @@ void MainWindowBase::registerPerspective(Id perspectiveId, const Perspective &pe
|
|||||||
void MainWindowBase::registerToolbar(Id perspectiveId, QWidget *widget)
|
void MainWindowBase::registerToolbar(Id perspectiveId, QWidget *widget)
|
||||||
{
|
{
|
||||||
m_toolbarForPerspectiveId.insert(perspectiveId, widget);
|
m_toolbarForPerspectiveId.insert(perspectiveId, widget);
|
||||||
|
|
||||||
m_controlsStackWidget->addWidget(widget);
|
m_controlsStackWidget->addWidget(widget);
|
||||||
StatusLabel * const toolStatusLabel = new StatusLabel;
|
|
||||||
m_statusLabelForPerspectiveId[perspectiveId] = toolStatusLabel;
|
|
||||||
m_statusLabelsStackWidget->addWidget(toolStatusLabel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindowBase::showStatusMessage(Id perspective, const QString &message, int timeoutMS)
|
void MainWindowBase::showStatusMessage(const QString &message, int timeoutMS)
|
||||||
{
|
{
|
||||||
StatusLabel *statusLabel = m_statusLabelForPerspectiveId.value(perspective);
|
m_statusLabel->showStatusMessage(message, timeoutMS);
|
||||||
QTC_ASSERT(statusLabel, return);
|
|
||||||
statusLabel->showStatusMessage(message, timeoutMS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindowBase::resetCurrentPerspective()
|
void MainWindowBase::resetCurrentPerspective()
|
||||||
@@ -143,7 +137,6 @@ void MainWindowBase::loadPerspectiveHelper(Id perspectiveId, bool fromStoredSett
|
|||||||
|
|
||||||
QTC_CHECK(m_toolbarForPerspectiveId.contains(perspectiveId));
|
QTC_CHECK(m_toolbarForPerspectiveId.contains(perspectiveId));
|
||||||
m_controlsStackWidget->setCurrentWidget(m_toolbarForPerspectiveId.value(perspectiveId));
|
m_controlsStackWidget->setCurrentWidget(m_toolbarForPerspectiveId.value(perspectiveId));
|
||||||
m_statusLabelsStackWidget->setCurrentWidget(m_statusLabelForPerspectiveId.value(perspectiveId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindowBase::closeCurrentPerspective()
|
void MainWindowBase::closeCurrentPerspective()
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public:
|
|||||||
|
|
||||||
QComboBox *toolBox() const { return m_toolBox; }
|
QComboBox *toolBox() const { return m_toolBox; }
|
||||||
QStackedWidget *controlsStack() const { return m_controlsStackWidget; }
|
QStackedWidget *controlsStack() const { return m_controlsStackWidget; }
|
||||||
QStackedWidget *statusLabelsStack() const { return m_statusLabelsStackWidget; }
|
Utils::StatusLabel *statusLabel() const { return m_statusLabel; }
|
||||||
|
|
||||||
void registerPerspective(Core::Id perspectiveId, const Analyzer::Perspective &perspective);
|
void registerPerspective(Core::Id perspectiveId, const Analyzer::Perspective &perspective);
|
||||||
void registerToolbar(Core::Id perspectiveId, QWidget *widget);
|
void registerToolbar(Core::Id perspectiveId, QWidget *widget);
|
||||||
@@ -120,7 +120,7 @@ public:
|
|||||||
void resetCurrentPerspective();
|
void resetCurrentPerspective();
|
||||||
void restorePerspective(Core::Id perspectiveId);
|
void restorePerspective(Core::Id perspectiveId);
|
||||||
|
|
||||||
void showStatusMessage(Core::Id perspective, const QString &message, int timeoutMS);
|
void showStatusMessage(const QString &message, int timeoutMS);
|
||||||
|
|
||||||
QString lastSettingsName() const;
|
QString lastSettingsName() const;
|
||||||
void setLastSettingsName(const QString &lastSettingsName);
|
void setLastSettingsName(const QString &lastSettingsName);
|
||||||
@@ -134,11 +134,10 @@ private:
|
|||||||
QString m_lastSettingsName;
|
QString m_lastSettingsName;
|
||||||
QComboBox *m_toolBox;
|
QComboBox *m_toolBox;
|
||||||
QStackedWidget *m_controlsStackWidget;
|
QStackedWidget *m_controlsStackWidget;
|
||||||
QStackedWidget *m_statusLabelsStackWidget;
|
Utils::StatusLabel *m_statusLabel;
|
||||||
QHash<Core::Id, QDockWidget *> m_dockForDockId;
|
QHash<Core::Id, QDockWidget *> m_dockForDockId;
|
||||||
QHash<Core::Id, QWidget *> m_toolbarForPerspectiveId;
|
QHash<Core::Id, QWidget *> m_toolbarForPerspectiveId;
|
||||||
QHash<Core::Id, Analyzer::Perspective> m_perspectiveForPerspectiveId;
|
QHash<Core::Id, Analyzer::Perspective> m_perspectiveForPerspectiveId;
|
||||||
QHash<Core::Id, Utils::StatusLabel *> m_statusLabelForPerspectiveId;
|
|
||||||
|
|
||||||
// list of dock widgets to prevent memory leak
|
// list of dock widgets to prevent memory leak
|
||||||
typedef QPointer<QDockWidget> DockPtr;
|
typedef QPointer<QDockWidget> DockPtr;
|
||||||
|
|||||||
@@ -2212,7 +2212,7 @@ void DebuggerPluginPrivate::showStatusMessage(const QString &msg0, int timeout)
|
|||||||
showMessage(msg0, LogStatus);
|
showMessage(msg0, LogStatus);
|
||||||
QString msg = msg0;
|
QString msg = msg0;
|
||||||
msg.replace(QChar::LineFeed, QLatin1String("; "));
|
msg.replace(QChar::LineFeed, QLatin1String("; "));
|
||||||
m_mainWindow->showStatusMessage(m_mainWindow->currentPerspectiveId(), msg, timeout);
|
m_mainWindow->showStatusMessage(msg, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerPluginPrivate::coreShutdown()
|
void DebuggerPluginPrivate::coreShutdown()
|
||||||
@@ -3442,7 +3442,7 @@ QWidget *DebuggerPluginPrivate::createContents(IMode *mode)
|
|||||||
debugToolBarLayout->setSpacing(0);
|
debugToolBarLayout->setSpacing(0);
|
||||||
// debugToolBarLayout->addWidget(m_mainWindow->toolBox());
|
// debugToolBarLayout->addWidget(m_mainWindow->toolBox());
|
||||||
debugToolBarLayout->addWidget(m_mainWindow->controlsStack());
|
debugToolBarLayout->addWidget(m_mainWindow->controlsStack());
|
||||||
debugToolBarLayout->addWidget(m_mainWindow->statusLabelsStack());
|
debugToolBarLayout->addWidget(m_mainWindow->statusLabel());
|
||||||
debugToolBarLayout->addWidget(new Utils::StyledSeparator);
|
debugToolBarLayout->addWidget(new Utils::StyledSeparator);
|
||||||
debugToolBarLayout->addStretch();
|
debugToolBarLayout->addStretch();
|
||||||
debugToolBarLayout->addWidget(viewButton);
|
debugToolBarLayout->addWidget(viewButton);
|
||||||
|
|||||||
@@ -48,12 +48,7 @@ CallgrindRunControl::CallgrindRunControl(ProjectExplorer::RunConfiguration *runC
|
|||||||
connect(m_runner.parser(), &Callgrind::Parser::parserDataReady,
|
connect(m_runner.parser(), &Callgrind::Parser::parserDataReady,
|
||||||
this, &CallgrindRunControl::slotFinished);
|
this, &CallgrindRunControl::slotFinished);
|
||||||
connect(&m_runner, &Callgrind::CallgrindRunner::statusMessage,
|
connect(&m_runner, &Callgrind::CallgrindRunner::statusMessage,
|
||||||
this, &CallgrindRunControl::showStatusMessage);
|
this, &AnalyzerManager::showPermanentStatusMessage);
|
||||||
}
|
|
||||||
|
|
||||||
void CallgrindRunControl::showStatusMessage(const QString &msg)
|
|
||||||
{
|
|
||||||
AnalyzerManager::showPermanentStatusMessage(CallgrindPerspectiveId, msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList CallgrindRunControl::toolArguments() const
|
QStringList CallgrindRunControl::toolArguments() const
|
||||||
|
|||||||
@@ -68,11 +68,9 @@ protected:
|
|||||||
signals:
|
signals:
|
||||||
void parserDataReady(CallgrindRunControl *engine);
|
void parserDataReady(CallgrindRunControl *engine);
|
||||||
|
|
||||||
private slots:
|
|
||||||
void slotFinished();
|
|
||||||
void showStatusMessage(const QString &msg);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void slotFinished();
|
||||||
|
|
||||||
Valgrind::Callgrind::CallgrindRunner m_runner;
|
Valgrind::Callgrind::CallgrindRunner m_runner;
|
||||||
bool m_markAsPaused;
|
bool m_markAsPaused;
|
||||||
|
|
||||||
|
|||||||
@@ -822,7 +822,7 @@ void CallgrindTool::engineFinished()
|
|||||||
if (data)
|
if (data)
|
||||||
showParserResults(data);
|
showParserResults(data);
|
||||||
else
|
else
|
||||||
AnalyzerManager::showPermanentStatusMessage(CallgrindPerspectiveId, tr("Profiling aborted."));
|
AnalyzerManager::showPermanentStatusMessage(tr("Profiling aborted."));
|
||||||
|
|
||||||
setBusyCursor(false);
|
setBusyCursor(false);
|
||||||
}
|
}
|
||||||
@@ -841,7 +841,7 @@ void CallgrindTool::showParserResults(const ParseData *data)
|
|||||||
} else {
|
} else {
|
||||||
msg = tr("Parsing failed.");
|
msg = tr("Parsing failed.");
|
||||||
}
|
}
|
||||||
AnalyzerManager::showPermanentStatusMessage(CallgrindPerspectiveId, msg);
|
AnalyzerManager::showPermanentStatusMessage(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallgrindTool::editorOpened(IEditor *editor)
|
void CallgrindTool::editorOpened(IEditor *editor)
|
||||||
@@ -906,7 +906,7 @@ void CallgrindTool::loadExternalLogFile()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AnalyzerManager::showPermanentStatusMessage(CallgrindPerspectiveId, tr("Parsing Profile Data..."));
|
AnalyzerManager::showPermanentStatusMessage(tr("Parsing Profile Data..."));
|
||||||
QCoreApplication::processEvents();
|
QCoreApplication::processEvents();
|
||||||
|
|
||||||
Parser parser;
|
Parser parser;
|
||||||
|
|||||||
@@ -674,7 +674,7 @@ int MemcheckTool::updateUiAfterFinishedHelper()
|
|||||||
void MemcheckTool::engineFinished()
|
void MemcheckTool::engineFinished()
|
||||||
{
|
{
|
||||||
const int issuesFound = updateUiAfterFinishedHelper();
|
const int issuesFound = updateUiAfterFinishedHelper();
|
||||||
AnalyzerManager::showPermanentStatusMessage(MemcheckPerspectiveId, issuesFound > 0
|
AnalyzerManager::showPermanentStatusMessage(issuesFound > 0
|
||||||
? AnalyzerManager::tr("Memory Analyzer Tool finished, %n issues were found.", 0, issuesFound)
|
? AnalyzerManager::tr("Memory Analyzer Tool finished, %n issues were found.", 0, issuesFound)
|
||||||
: AnalyzerManager::tr("Memory Analyzer Tool finished, no issues were found."));
|
: AnalyzerManager::tr("Memory Analyzer Tool finished, no issues were found."));
|
||||||
}
|
}
|
||||||
@@ -682,7 +682,7 @@ void MemcheckTool::engineFinished()
|
|||||||
void MemcheckTool::loadingExternalXmlLogFileFinished()
|
void MemcheckTool::loadingExternalXmlLogFileFinished()
|
||||||
{
|
{
|
||||||
const int issuesFound = updateUiAfterFinishedHelper();
|
const int issuesFound = updateUiAfterFinishedHelper();
|
||||||
AnalyzerManager::showPermanentStatusMessage(MemcheckPerspectiveId, issuesFound > 0
|
AnalyzerManager::showPermanentStatusMessage(issuesFound > 0
|
||||||
? AnalyzerManager::tr("Log file processed, %n issues were found.", 0, issuesFound)
|
? AnalyzerManager::tr("Log file processed, %n issues were found.", 0, issuesFound)
|
||||||
: AnalyzerManager::tr("Log file processed, no issues were found."));
|
: AnalyzerManager::tr("Log file processed, no issues were found."));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user