forked from qt-creator/qt-creator
OutputPane: Add an id() for the settings
It was using the displayName for the key in the settings (visibility and shortcut), which is annoying when changing the language. Change-Id: Iffa784347c59389599c90f468dcba15834599c39 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -74,6 +74,7 @@ TestResultsPane::TestResultsPane(QObject *parent) :
|
||||
IOutputPane(parent),
|
||||
m_context(new IContext(this))
|
||||
{
|
||||
setId("TestResults");
|
||||
setDisplayName(Tr::tr("Test Results"));
|
||||
m_outputWidget = new QStackedWidget;
|
||||
QWidget *visualOutputWidget = new QWidget;
|
||||
|
||||
@@ -170,6 +170,7 @@ void DashboardWidget::updateUi()
|
||||
AxivionOutputPane::AxivionOutputPane(QObject *parent)
|
||||
: Core::IOutputPane(parent)
|
||||
{
|
||||
setId("Axivion");
|
||||
setDisplayName(Tr::tr("Axivion"));
|
||||
|
||||
m_outputWidget = new QStackedWidget;
|
||||
|
||||
@@ -363,6 +363,7 @@ SearchResultWindow *SearchResultWindow::m_instance = nullptr;
|
||||
SearchResultWindow::SearchResultWindow(QWidget *newSearchPanel)
|
||||
: d(new SearchResultWindowPrivate(this, newSearchPanel))
|
||||
{
|
||||
setId("SearchResults");
|
||||
setDisplayName(Tr::tr("Search Results"));
|
||||
m_instance = this;
|
||||
readSettings();
|
||||
|
||||
@@ -33,6 +33,7 @@ public:
|
||||
|
||||
virtual QWidget *outputWidget(QWidget *parent) = 0;
|
||||
virtual QList<QWidget *> toolBarWidgets() const;
|
||||
Utils::Id id() const;
|
||||
QString displayName() const;
|
||||
virtual const QList<OutputWindow *> outputWindows() const { return {}; }
|
||||
virtual void ensureWindowVisible(OutputWindow *) { }
|
||||
@@ -81,6 +82,7 @@ signals:
|
||||
void fontChanged(const QFont &font);
|
||||
|
||||
protected:
|
||||
void setId(const Utils::Id &id);
|
||||
void setDisplayName(const QString &name);
|
||||
|
||||
void setupFilterUi(const Utils::Key &historyKey);
|
||||
@@ -106,6 +108,7 @@ private:
|
||||
Utils::Id filterCaseSensitivityActionId() const;
|
||||
Utils::Id filterInvertedActionId() const;
|
||||
|
||||
Utils::Id m_id;
|
||||
QString m_displayName;
|
||||
Core::CommandButton * const m_zoomInButton;
|
||||
Core::CommandButton * const m_zoomOutButton;
|
||||
|
||||
@@ -20,6 +20,7 @@ const char zoomSettingsKey[] = "Core/MessageOutput/Zoom";
|
||||
|
||||
MessageOutputWindow::MessageOutputWindow()
|
||||
{
|
||||
setId("GeneralMessages");
|
||||
setDisplayName(Tr::tr("General Messages"));
|
||||
m_widget = new OutputWindow(Context(Constants::C_GENERAL_OUTPUT_PANE), zoomSettingsKey);
|
||||
m_widget->setReadOnly(true);
|
||||
|
||||
@@ -103,6 +103,23 @@ QList<QWidget *> IOutputPane::toolBarWidgets() const
|
||||
return widgets << m_zoomInButton << m_zoomOutButton;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the ID of the output pane.
|
||||
*/
|
||||
Id IOutputPane::id() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the ID of the output pane to \a id.
|
||||
This is used for persisting the visibility state.
|
||||
*/
|
||||
void IOutputPane::setId(const Utils::Id &id)
|
||||
{
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the translated display name of the output pane.
|
||||
*/
|
||||
@@ -481,9 +498,7 @@ void OutputPaneManager::initialize()
|
||||
|
||||
minTitleWidth = qMax(minTitleWidth, titleFm.horizontalAdvance(outPane->displayName()));
|
||||
|
||||
QString suffix = outPane->displayName().simplified();
|
||||
suffix.remove(QLatin1Char(' '));
|
||||
data.id = baseId.withSuffix(suffix);
|
||||
data.id = baseId.withSuffix(outPane->id().toString());
|
||||
data.action = new QAction(outPane->displayName(), m_instance);
|
||||
Command *cmd = ActionManager::registerAction(data.action, data.id);
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace Debugger::Internal {
|
||||
|
||||
Console::Console()
|
||||
{
|
||||
setId("QMLDebuggerConsole");
|
||||
setDisplayName(Tr::tr("QML Debugger Console"));
|
||||
m_consoleItemModel = new ConsoleItemModel(this);
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ AppOutputPane::AppOutputPane() :
|
||||
Tr::tr("Show the output that generated this issue in Application Output."),
|
||||
Tr::tr("A")))
|
||||
{
|
||||
setId("ApplicationOutput");
|
||||
setDisplayName(Tr::tr("Application Output"));
|
||||
ExtensionSystem::PluginManager::addObject(m_handler);
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) :
|
||||
m_cancelBuildButton(new QToolButton),
|
||||
m_settingsButton(new QToolButton)
|
||||
{
|
||||
setId("CompileOutput");
|
||||
setDisplayName(QCoreApplication::translate("QtC::ProjectExplorer", "Compile Output"));
|
||||
Core::Context context(C_COMPILE_OUTPUT);
|
||||
m_outputWindow = new Core::OutputWindow(context, SETTINGS_KEY);
|
||||
|
||||
@@ -168,6 +168,7 @@ static QToolButton *createFilterButton(const QIcon &icon, const QString &toolTip
|
||||
|
||||
TaskWindow::TaskWindow() : d(std::make_unique<TaskWindowPrivate>())
|
||||
{
|
||||
setId("Issues");
|
||||
setDisplayName(Tr::tr("Issues"));
|
||||
d->m_model = new Internal::TaskModel(this);
|
||||
d->m_filter = new Internal::TaskFilterModel(d->m_model);
|
||||
|
||||
@@ -120,6 +120,7 @@ SerialOutputPane::SerialOutputPane(Settings &settings) :
|
||||
m_closeAllTabsAction(new QAction(Tr::tr("Close All Tabs"), this)),
|
||||
m_closeOtherTabsAction(new QAction(Tr::tr("Close Other Tabs"), this))
|
||||
{
|
||||
setId("Serial Terminal");
|
||||
setDisplayName(Tr::tr(Constants::OUTPUT_PANE_TITLE));
|
||||
createToolButtons();
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ static SquishOutputPane *m_instance = nullptr;
|
||||
|
||||
SquishOutputPane::SquishOutputPane()
|
||||
{
|
||||
setId("Squish");
|
||||
setDisplayName(Tr::tr("Squish"));
|
||||
m_instance = this;
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ TerminalPane::TerminalPane(QObject *parent)
|
||||
: IOutputPane(parent)
|
||||
, m_selfContext("Terminal.Pane")
|
||||
{
|
||||
setId("Terminal");
|
||||
setDisplayName(Tr::tr("Terminal"));
|
||||
setupContext(m_selfContext, &m_tabWidget);
|
||||
setZoomButtonsEnabled(true);
|
||||
|
||||
@@ -26,6 +26,7 @@ TodoOutputPane::TodoOutputPane(TodoItemsModel *todoItemsModel, const Settings *s
|
||||
m_todoItemsModel(todoItemsModel),
|
||||
m_settings(settings)
|
||||
{
|
||||
setId("To-DoEntries");
|
||||
setDisplayName(Tr::tr("To-Do Entries"));
|
||||
createTreeView();
|
||||
createScopeButtons();
|
||||
|
||||
@@ -283,6 +283,7 @@ static VcsOutputWindowPrivate *d = nullptr;
|
||||
|
||||
VcsOutputWindow::VcsOutputWindow()
|
||||
{
|
||||
setId("VersionControl");
|
||||
setDisplayName(Tr::tr("Version Control"));
|
||||
d = new VcsOutputWindowPrivate;
|
||||
Q_ASSERT(d->passwordRegExp.isValid());
|
||||
|
||||
Reference in New Issue
Block a user