OSDN Git Service

Reduce number of categories and minimum size of preferences
authorEike Ziller <eike.ziller@nokia.com>
Thu, 15 Sep 2011 17:20:50 +0000 (19:20 +0200)
committerEike Ziller <eike.ziller@nokia.com>
Thu, 29 Sep 2011 14:26:48 +0000 (16:26 +0200)
Merges the Project, Qt4 and Tool Chain categories into one Build & Run
category, which makes it finally possible to reduce the minimum height
of the preferences dialog.

Change-Id: I8d94aac9c9531200f5d8ca212a53d3edc5734138
Reviewed-on: http://codereview.qt-project.org/5023
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
14 files changed:
src/plugins/coreplugin/core.qrc
src/plugins/coreplugin/dialogs/settingsdialog.cpp
src/plugins/coreplugin/images/category_buildrun.png [new file with mode: 0644]
src/plugins/coreplugin/images/category_project.png [deleted file]
src/plugins/coreplugin/images/category_qt.png [deleted file]
src/plugins/debugger/debuggerplugin.cpp
src/plugins/debugger/gdb/gdbengine.cpp
src/plugins/projectexplorer/projectexplorerconstants.h
src/plugins/projectexplorer/toolchainoptionspage.cpp
src/plugins/qmlprojectmanager/qmlprojectplugin.cpp
src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.cpp
src/plugins/qt4projectmanager/qt4projectconfigwidget.cpp
src/plugins/qtsupport/qtoptionspage.cpp
src/plugins/qtsupport/qtsupportconstants.h

index 443831d..ec32fb3 100644 (file)
@@ -47,7 +47,6 @@
         <file>images/category_core.png</file>
         <file>images/category_texteditor.png</file>
         <file>images/category_help.png</file>
-        <file>images/category_project.png</file>
         <file>images/category_design.png</file>
         <file>images/category_qt.png</file>
         <file>editormanager/BinFiles.mimetypes.xml</file>
@@ -65,6 +64,7 @@
         <file>images/category_cpp.png</file>
         <file>images/category_vcs.png</file>
         <file>images/category_qml.png</file>
-       <file>images/filtericon.png</file>
+        <file>images/filtericon.png</file>
+        <file>images/category_buildrun.png</file>
     </qresource>
 </RCC>
index fcf8fb2..9a3828c 100644 (file)
@@ -393,7 +393,7 @@ void SettingsDialog::createGui()
     mainGridLayout->addWidget(buttonBox,        2, 0, 1, 2);
     mainGridLayout->setColumnStretch(1, 4);
     setLayout(mainGridLayout);
-    setMinimumSize(1070, 680);
+    setMinimumSize(1000, 550);
 }
 
 SettingsDialog::~SettingsDialog()
diff --git a/src/plugins/coreplugin/images/category_buildrun.png b/src/plugins/coreplugin/images/category_buildrun.png
new file mode 100644 (file)
index 0000000..8401b41
Binary files /dev/null and b/src/plugins/coreplugin/images/category_buildrun.png differ
diff --git a/src/plugins/coreplugin/images/category_project.png b/src/plugins/coreplugin/images/category_project.png
deleted file mode 100644 (file)
index a29396b..0000000
Binary files a/src/plugins/coreplugin/images/category_project.png and /dev/null differ
diff --git a/src/plugins/coreplugin/images/category_qt.png b/src/plugins/coreplugin/images/category_qt.png
deleted file mode 100644 (file)
index bbd4dc6..0000000
Binary files a/src/plugins/coreplugin/images/category_qt.png and /dev/null differ
index 23aee74..2eee044 100644 (file)
@@ -2511,7 +2511,7 @@ void DebuggerPluginPrivate::showQtDumperLibraryWarning(const QString &details)
     dialog.exec();
     if (dialog.clickedButton() == qtPref) {
         ICore::instance()->showOptionsDialog(
-            _(QtSupport::Constants::QT_SETTINGS_CATEGORY),
+            _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY),
             _(QtSupport::Constants::QTVERSION_SETTINGS_PAGE_ID));
     } else if (dialog.clickedButton() == helperOff) {
         action(UseDebuggingHelpers)->setValue(qVariantFromValue(false), false);
index 2f72297..86ba28d 100644 (file)
@@ -4504,16 +4504,16 @@ bool checkGdbConfiguration(const DebuggerStartParameters &sp, ConfigurationCheck
     const QString binary = gdbBinary(sp);
     if (gdbBinary(sp).isEmpty()) {
         check->errorDetails.push_back(msgNoGdbBinaryForToolChain(sp.toolChainAbi));
-        check->settingsCategory = _(ProjectExplorer::Constants::TOOLCHAIN_SETTINGS_CATEGORY);
-        check->settingsPage = _(ProjectExplorer::Constants::TOOLCHAIN_SETTINGS_CATEGORY);
+        check->settingsCategory = _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
+        check->settingsPage = _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
         return false;
     }
     if (sp.toolChainAbi.os() == Abi::WindowsOS &&  !QFileInfo(binary).isAbsolute()) {
     // See initialization below, we need an absolute path to be able to locate Python on Windows.
         check->errorDetails.push_back(GdbEngine::tr("The gdb location must be given as an "
                 "absolute path in the debugger settings (%1).").arg(binary));
-        check->settingsCategory = _(ProjectExplorer::Constants::TOOLCHAIN_SETTINGS_CATEGORY);
-        check->settingsPage = _(ProjectExplorer::Constants::TOOLCHAIN_SETTINGS_CATEGORY);
+        check->settingsCategory = _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
+        check->settingsPage = _(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
         return false;
     }
     return true;
index 002f7e4..e6bf167 100644 (file)
@@ -165,7 +165,6 @@ const char ICON_RUN_SMALL[]       = ":/projectexplorer/images/run_small.png";
 const char ICON_DEBUG_SMALL[]     = ":/projectexplorer/images/debugger_start_small.png";
 const char ICON_STOP[]            = ":/projectexplorer/images/stop.png";
 const char ICON_STOP_SMALL[]      = ":/projectexplorer/images/stop_small.png";
-const char ICON_TOOLCHAIN_SETTINGS_CATEGORY[] = ":projectexplorer/images/build.png"; // FIXME: Need an icon!
 const char ICON_WINDOW[]          = ":/projectexplorer/images/window.png";
 
 const char TASK_BUILD[]           = "ProjectExplorer.Task.Build";
@@ -181,10 +180,9 @@ const char RESOURCE_MIMETYPE[]    = "application/vnd.nokia.xml.qt.resource";
 
 // Settings page
 const char PROJECTEXPLORER_SETTINGS_CATEGORY[]  = "K.ProjectExplorer";
-const char PROJECTEXPLORER_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Projects");
-const char PROJECTEXPLORER_SETTINGS_CATEGORY_ICON[]  = ":/core/images/category_project.png";
-const char PROJECTEXPLORER_SETTINGS_ID[] = "ProjectExplorer.ProjectExplorer";
-const char TOOLCHAIN_SETTINGS_CATEGORY[] = "ProjectExplorer.Settings.ToolChains";
+const char PROJECTEXPLORER_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("ProjectExplorer", "Build & Run");
+const char PROJECTEXPLORER_SETTINGS_CATEGORY_ICON[]  = ":/core/images/category_buildrun.png";
+const char PROJECTEXPLORER_SETTINGS_ID[] = "A.ProjectExplorer.ProjectExplorer";
 const char TOOLCHAIN_SETTINGS_PAGE_ID[] = "M.ProjectExplorer.ToolChainOptions";
 
 // Task categories
index b2bf43d..ef44303 100644 (file)
@@ -467,17 +467,18 @@ QString ToolChainOptionsPage::displayName() const
 
 QString ToolChainOptionsPage::category() const
 {
-    return QLatin1String(Constants::TOOLCHAIN_SETTINGS_CATEGORY);
+    return QLatin1String(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
 }
 
 QString ToolChainOptionsPage::displayCategory() const
 {
-    return tr("Tool Chains");
+    return QCoreApplication::translate("ProjectExplorer",
+                                       Constants::PROJECTEXPLORER_SETTINGS_TR_CATEGORY);
 }
 
 QIcon ToolChainOptionsPage::categoryIcon() const
 {
-    return QIcon(QLatin1String(Constants::ICON_TOOLCHAIN_SETTINGS_CATEGORY));
+    return QIcon(Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON);
 }
 
 QWidget *ToolChainOptionsPage::createPage(QWidget *parent)
index 9e204d2..2e261a4 100644 (file)
@@ -49,6 +49,7 @@
 #include <texteditor/texteditoractionhandler.h>
 
 #include <projectexplorer/taskhub.h>
+#include <projectexplorer/projectexplorerconstants.h>
 
 #include <qtsupport/qtsupportconstants.h>
 
@@ -116,7 +117,7 @@ void QmlProjectPlugin::showQmlObserverToolWarning()
     dialog.exec();
     if (dialog.clickedButton() == qtPref) {
         Core::ICore::instance()->showOptionsDialog(
-                    QtSupport::Constants::QT_SETTINGS_CATEGORY,
+                    ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
                     QtSupport::Constants::QTVERSION_SETTINGS_PAGE_ID);
     }
 }
index f0da0a2..4aebcc0 100644 (file)
@@ -39,6 +39,7 @@
 #include <coreplugin/icore.h>
 #include <projectexplorer/environmentwidget.h>
 #include <projectexplorer/projectexplorer.h>
+#include <projectexplorer/projectexplorerconstants.h>
 #include <utils/debuggerlanguagechooser.h>
 #include <utils/detailswidget.h>
 #include <utils/environment.h>
@@ -279,7 +280,7 @@ void QmlProjectRunConfigurationWidget::qmlDebugServerPortChanged(uint port)
 void QmlProjectRunConfigurationWidget::manageQtVersions()
 {
     ICore *core = ICore::instance();
-    core->showOptionsDialog(QtSupport::Constants::QT_SETTINGS_CATEGORY,
+    core->showOptionsDialog(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
                             QtSupport::Constants::QTVERSION_SETTINGS_PAGE_ID);
 }
 
index 979b14f..57b008e 100644 (file)
@@ -180,13 +180,13 @@ void Qt4ProjectConfigWidget::updateShadowBuildUi()
 void Qt4ProjectConfigWidget::manageQtVersions()
 {
     Core::ICore *core = Core::ICore::instance();
-    core->showOptionsDialog(QtSupport::Constants::QT_SETTINGS_CATEGORY, QtSupport::Constants::QTVERSION_SETTINGS_PAGE_ID);
+    core->showOptionsDialog(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY, QtSupport::Constants::QTVERSION_SETTINGS_PAGE_ID);
 }
 
 void Qt4ProjectConfigWidget::manageToolChains()
 {
     Core::ICore *core = Core::ICore::instance();
-    core->showOptionsDialog(ProjectExplorer::Constants::TOOLCHAIN_SETTINGS_CATEGORY,
+    core->showOptionsDialog(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY,
                             ProjectExplorer::Constants::TOOLCHAIN_SETTINGS_PAGE_ID);
 }
 
index 487ab79..b9bdcc1 100644 (file)
@@ -50,6 +50,7 @@
 #include <utils/pathchooser.h>
 #include <projectexplorer/toolchainmanager.h>
 #include <projectexplorer/toolchain.h>
+#include <projectexplorer/projectexplorerconstants.h>
 #include <qtconcurrent/runextensions.h>
 
 #include <QtCore/QDir>
@@ -84,17 +85,18 @@ QString QtOptionsPage::displayName() const
 
 QString QtOptionsPage::category() const
 {
-    return QLatin1String(Constants::QT_SETTINGS_CATEGORY);
+    return QLatin1String(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY);
 }
 
 QString QtOptionsPage::displayCategory() const
 {
-    return QCoreApplication::translate("Qt4ProjectManager", Constants::QT_SETTINGS_TR_CATEGORY);
+    return QCoreApplication::translate("ProjectExplorer",
+                                       ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_TR_CATEGORY);
 }
 
 QIcon QtOptionsPage::categoryIcon() const
 {
-    return QIcon(QLatin1String(Constants::QT_SETTINGS_CATEGORY_ICON));
+    return QIcon(ProjectExplorer::Constants::PROJECTEXPLORER_SETTINGS_CATEGORY_ICON);
 }
 
 QWidget *QtOptionsPage::createPage(QWidget *parent)
index 802dabd..acf649c 100644 (file)
@@ -37,10 +37,8 @@ namespace QtSupport {
 namespace Constants {
 
 //Qt4 settings pages
-const char * const QT_SETTINGS_CATEGORY       = "L.Qt4";
-const char * const QT_SETTINGS_CATEGORY_ICON  = ":/core/images/category_qt.png";
 const char * const QT_SETTINGS_TR_CATEGORY    = QT_TRANSLATE_NOOP("Qt4ProjectManager", "Qt4");
-const char * const QTVERSION_SETTINGS_PAGE_ID = "Qt Versions";
+const char * const QTVERSION_SETTINGS_PAGE_ID = "B.Qt Versions";
 const char * const QTVERSION_SETTINGS_PAGE_NAME = QT_TRANSLATE_NOOP("Qt4ProjectManager", "Qt Versions");
 
 // QtVersions