diff options
author | Orgad Shaneh <orgads@gmail.com> | 2012-07-15 21:45:29 +0300 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-07-17 13:15:29 +0200 |
commit | 187ac69a5f908efe6598bab3b3a489bbaafdc22d (patch) | |
tree | eae0eb6d667f1effd39441c2df1343a4b715c3ab /src | |
parent | 5e3998dd16b2c4149ac67e56ec109d917528d508 (diff) | |
download | qt-creator-187ac69a5f908efe6598bab3b3a489bbaafdc22d.tar.gz |
move ProfileChooser from Debugger to ProjectExplorer
Change-Id: I5a4dcd5b9101118de8c88b6d26af5a9dbb32ba54
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/debugger/debugger.pro | 2 | ||||
-rw-r--r-- | src/plugins/debugger/debugger.qbs | 2 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerdialogs.cpp | 22 | ||||
-rw-r--r-- | src/plugins/debugger/loadremotecoredialog.cpp | 14 | ||||
-rw-r--r-- | src/plugins/projectexplorer/profilechooser.cpp (renamed from src/plugins/debugger/debuggertoolchaincombobox.cpp) | 32 | ||||
-rw-r--r-- | src/plugins/projectexplorer/profilechooser.h (renamed from src/plugins/debugger/debuggertoolchaincombobox.h) | 21 | ||||
-rw-r--r-- | src/plugins/projectexplorer/projectexplorer.pro | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/projectexplorer.qbs | 2 | ||||
-rw-r--r-- | src/plugins/remotelinux/startgdbserverdialog.cpp | 6 |
9 files changed, 49 insertions, 54 deletions
diff --git a/src/plugins/debugger/debugger.pro b/src/plugins/debugger/debugger.pro index 7c7b8197fd..eea45580cc 100644 --- a/src/plugins/debugger/debugger.pro +++ b/src/plugins/debugger/debugger.pro @@ -68,7 +68,6 @@ HEADERS += \ watchdelegatewidgets.h \ debuggerruncontrolfactory.h \ debuggertooltipmanager.h \ - debuggertoolchaincombobox.h \ debuggersourcepathmappingwidget.h \ memoryview.h \ qtmessagelogwindow.h \ @@ -122,7 +121,6 @@ SOURCES += \ stackframe.cpp \ watchdelegatewidgets.cpp \ debuggertooltipmanager.cpp \ - debuggertoolchaincombobox.cpp \ debuggersourcepathmappingwidget.cpp \ memoryview.cpp \ qtmessagelogwindow.cpp \ diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index d0582de05d..9b98f2c53a 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -69,8 +69,6 @@ QtcPlugin { "debuggerstreamops.cpp", "debuggerstreamops.h", "debuggerstringutils.h", - "debuggertoolchaincombobox.cpp", - "debuggertoolchaincombobox.h", "debuggertooltipmanager.cpp", "debuggertooltipmanager.h", "disassembleragent.cpp", diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index 8ac8debb4a..b3cf1489f8 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -36,12 +36,12 @@ #include "debuggerconstants.h" #include "debuggerprofileinformation.h" #include "debuggerstringutils.h" -#include "debuggertoolchaincombobox.h" #include "cdb/cdbengine.h" #include "shared/hostutils.h" #include <coreplugin/icore.h> #include <projectexplorer/abi.h> +#include <projectexplorer/profilechooser.h> #include <projectexplorer/profileinformation.h> #include <utils/filterlineedit.h> #include <utils/historycompleter.h> @@ -196,7 +196,7 @@ public: QLabel *coreLabel; Utils::PathChooser *coreFileName; QLabel *profileLabel; - Debugger::ProfileChooser *profileComboBox; + ProfileChooser *profileComboBox; Utils::PathChooser *overrideStartScriptFileName; QLabel *overrideStartScriptLabel; QDialogButtonBox *buttonBox; @@ -226,7 +226,7 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent) d->overrideStartScriptLabel = new QLabel(tr("Override &start script:"), this); d->overrideStartScriptLabel->setBuddy(d->overrideStartScriptFileName); - d->profileComboBox = new Debugger::ProfileChooser(this); + d->profileComboBox = new ProfileChooser(this); d->profileComboBox->init(false); d->profileLabel = new QLabel(tr("&Target:"), this); d->profileLabel->setBuddy(d->profileComboBox); @@ -337,7 +337,7 @@ public: QLineEdit *pidLineEdit; Utils::FilterLineEdit *filterWidget; QLabel *profileLabel; - Debugger::ProfileChooser *profileComboBox; + ProfileChooser *profileComboBox; QTreeView *procView; QDialogButtonBox *buttonBox; @@ -364,7 +364,7 @@ AttachExternalDialog::AttachExternalDialog(QWidget *parent) d->filterWidget = new Utils::FilterLineEdit(this); d->filterWidget->setFocus(Qt::TabFocusReason); - d->profileComboBox = new Debugger::ProfileChooser(this); + d->profileComboBox = new ProfileChooser(this); d->profileComboBox->init(true); d->profileLabel = new QLabel(tr("&Target:"), this); d->profileLabel->setBuddy(d->profileComboBox); @@ -621,7 +621,7 @@ public: QLabel *workingDirectoryLabel; Utils::PathChooser *workingDirectory; QLabel *profileLabel; - Debugger::ProfileChooser *profileChooser; + ProfileChooser *profileChooser; QLabel *breakAtMainLabel; QCheckBox *breakAtMainCheckBox; QLabel *historyLabel; @@ -664,7 +664,7 @@ StartExternalDialog::StartExternalDialog(QWidget *parent) d->runInTerminalLabel = new QLabel(tr("Run in &terminal:"), this); d->runInTerminalLabel->setBuddy(d->runInTerminalCheckBox); - d->profileChooser = new Debugger::ProfileChooser(this); + d->profileChooser = new ProfileChooser(this); d->profileChooser->init(true); d->profileLabel = new QLabel(tr("&Target:"), this); d->profileLabel->setBuddy(d->profileChooser); @@ -963,7 +963,7 @@ class StartRemoteDialogPrivate { public: QLabel *profileLabel; - Debugger::ProfileChooser *profileChooser; + ProfileChooser *profileChooser; QLabel *executableLabel; Utils::PathChooser *executablePathChooser; QLabel *channelLabel; @@ -990,7 +990,7 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent, bool enableStartScript) setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowTitle(tr("Start Debugger")); - d->profileChooser = new Debugger::ProfileChooser(this); + d->profileChooser = new ProfileChooser(this); d->profileChooser->init(false); d->profileLabel = new QLabel(tr("Target:"), this); d->profileLabel->setBuddy(d->profileChooser); @@ -1210,7 +1210,7 @@ public: QLabel *portLabel; QSpinBox *portSpinBox; QLabel *profileLabel; - Debugger::ProfileChooser *profileChooser; + ProfileChooser *profileChooser; }; AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent) @@ -1220,7 +1220,7 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent) setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowTitle(tr("Start Debugger")); - d->profileChooser = new Debugger::ProfileChooser(this); + d->profileChooser = new ProfileChooser(this); d->profileLabel = new QLabel(tr("Target:"), this); d->profileLabel->setBuddy(d->profileChooser); diff --git a/src/plugins/debugger/loadremotecoredialog.cpp b/src/plugins/debugger/loadremotecoredialog.cpp index 259d286747..e0158db781 100644 --- a/src/plugins/debugger/loadremotecoredialog.cpp +++ b/src/plugins/debugger/loadremotecoredialog.cpp @@ -35,10 +35,10 @@ #include "debuggerconstants.h" #include "debuggercore.h" #include "debuggerstartparameters.h" -#include "debuggertoolchaincombobox.h" #include <coreplugin/icore.h> #include <projectexplorer/abi.h> +#include <projectexplorer/profilechooser.h> #include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/devicesupport/devicemanagermodel.h> #include <ssh/sshconnection.h> @@ -96,7 +96,7 @@ public: QTextBrowser *textBrowser; QPushButton *closeButton; //PathChooser *sysrootPathChooser; - ProfileChooser *toolchainComboBox; + ProfileChooser *profileChooser; QSettings *settings; QString remoteCommandLine; @@ -116,7 +116,7 @@ LoadRemoteCoreFileDialog::LoadRemoteCoreFileDialog(QWidget *parent) d->deviceComboBox = new QComboBox(this); - d->toolchainComboBox = new ProfileChooser(this); + d->profileChooser = new ProfileChooser(this); d->fileSystemModel = new SftpFileSystemModel(this); //executablePathChooser = new PathChooser(q); @@ -142,7 +142,7 @@ LoadRemoteCoreFileDialog::LoadRemoteCoreFileDialog(QWidget *parent) QFormLayout *formLayout = new QFormLayout(); formLayout->addRow(tr("Device:"), d->deviceComboBox); - formLayout->addRow(tr("Profile:"), d->toolchainComboBox); + formLayout->addRow(tr("Profile:"), d->profileChooser); QHBoxLayout *horizontalLayout2 = new QHBoxLayout(); horizontalLayout2->addStretch(1); @@ -168,7 +168,7 @@ LoadRemoteCoreFileDialog::LoadRemoteCoreFileDialog(QWidget *parent) connect(d->fileSystemView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(updateButtons())); - connect(d->toolchainComboBox, SIGNAL(activated(int)), SLOT(updateButtons())); + connect(d->profileChooser, SIGNAL(activated(int)), SLOT(updateButtons())); connect(d->loadCoreFileButton, SIGNAL(clicked()), SLOT(selectCoreFile())); connect(d->deviceComboBox, SIGNAL(currentIndexChanged(int)), SLOT(attachToDevice(int))); @@ -194,7 +194,7 @@ QString LoadRemoteCoreFileDialog::localCoreFileName() const Id LoadRemoteCoreFileDialog::profileId() const { - return d->toolchainComboBox->currentProfileId(); + return d->profileChooser->currentProfileId(); } void LoadRemoteCoreFileDialog::attachToDevice(int modelIndex) @@ -250,7 +250,7 @@ void LoadRemoteCoreFileDialog::selectCoreFile() d->fileSystemView->setEnabled(false); d->settings->setValue(QLatin1String("LastProfile"), - d->toolchainComboBox->currentProfileId().toString()); + d->profileChooser->currentProfileId().toString()); d->settings->setValue(QLatin1String("LastDevice"), d->deviceComboBox->currentIndex()); d->settings->setValue(QLatin1String("LastSftpRoot"), d->fileSystemModel->rootDirectory()); diff --git a/src/plugins/debugger/debuggertoolchaincombobox.cpp b/src/plugins/projectexplorer/profilechooser.cpp index 169a817d22..4fbeea2697 100644 --- a/src/plugins/debugger/debuggertoolchaincombobox.cpp +++ b/src/plugins/projectexplorer/profilechooser.cpp @@ -30,13 +30,12 @@ ** **************************************************************************/ -#include "debuggertoolchaincombobox.h" +#include "profilechooser.h" -#include "debuggerprofileinformation.h" +#include "profileinformation.h" +#include "profilemanager.h" +#include "abi.h" -#include <projectexplorer/profileinformation.h> -#include <projectexplorer/profilemanager.h> -#include <projectexplorer/abi.h> #include <utils/qtcassert.h> #include <QFileInfo> @@ -44,9 +43,7 @@ #include <QPair> #include <QtEvents> -using namespace ProjectExplorer; - -namespace Debugger { +namespace ProjectExplorer { ProfileChooser::ProfileChooser(QWidget *parent) : QComboBox(parent) @@ -56,29 +53,26 @@ ProfileChooser::ProfileChooser(QWidget *parent) : void ProfileChooser::init(bool hostAbiOnly) { const Abi hostAbi = Abi::hostAbi(); - foreach (const Profile *st, ProfileManager::instance()->profiles()) { - if (!st->isValid()) + foreach (const Profile *profile, ProfileManager::instance()->profiles()) { + if (!profile->isValid()) continue; - ToolChain *tc = ToolChainProfileInformation::toolChain(st); + ToolChain *tc = ToolChainProfileInformation::toolChain(profile); if (!tc) continue; const Abi abi = tc->targetAbi(); if (hostAbiOnly && hostAbi.os() != abi.os()) continue; - const QString debuggerCommand = DebuggerProfileInformation::debuggerCommand(st).toString(); - if (debuggerCommand.isEmpty()) - continue; - + const QString debuggerCommand = profile->value(Core::Id("Debugger.Information")).toString(); const QString completeBase = QFileInfo(debuggerCommand).completeBaseName(); - const QString name = tr("%1 (%2)").arg(st->displayName(), completeBase); - addItem(name, qVariantFromValue(st->id())); + const QString name = tr("%1 (%2)").arg(profile->displayName(), completeBase); + addItem(name, qVariantFromValue(profile->id())); QString debugger = QDir::toNativeSeparators(debuggerCommand); debugger.replace(QString(QLatin1Char(' ')), QLatin1String(" ")); QString toolTip = tr("<html><head/><body><table>" "<tr><td>ABI:</td><td><i>%1</i></td></tr>" "<tr><td>Debugger:</td><td>%2</td></tr>") - .arg(st->displayName(), QDir::toNativeSeparators(debugger)); + .arg(profile->displayName(), QDir::toNativeSeparators(debugger)); setItemData(count() - 1, toolTip, Qt::ToolTipRole); } setEnabled(count() > 1); @@ -110,4 +104,4 @@ Profile *ProfileChooser::profileAt(int index) const return ProfileManager::instance()->find(id); } -} // namespace Debugger +} // namespace ProjectExplorer diff --git a/src/plugins/debugger/debuggertoolchaincombobox.h b/src/plugins/projectexplorer/profilechooser.h index 164f5b11ae..69311af5ee 100644 --- a/src/plugins/debugger/debuggertoolchaincombobox.h +++ b/src/plugins/projectexplorer/profilechooser.h @@ -30,20 +30,21 @@ ** **************************************************************************/ -#ifndef DEBUGGERTOOLCHAINCOMBOBOX_H -#define DEBUGGERTOOLCHAINCOMBOBOX_H +#ifndef PROJECTEXPLORER_PROFILECHOOSER_H +#define PROJECTEXPLORER_PROFILECHOOSER_H -#include "debugger_global.h" +#include "projectexplorer_export.h" #include <QComboBox> namespace Core { class Id; } -namespace ProjectExplorer { class Profile; } -namespace Debugger { +namespace ProjectExplorer { + +class Profile; // Let the user pick a profile. -class DEBUGGER_EXPORT ProfileChooser : public QComboBox +class PROJECTEXPLORER_EXPORT ProfileChooser : public QComboBox { Q_OBJECT @@ -55,12 +56,12 @@ public: void setCurrentProfileId(Core::Id id); Core::Id currentProfileId() const; - ProjectExplorer::Profile *currentProfile() const; + Profile *currentProfile() const; private: - ProjectExplorer::Profile *profileAt(int index) const; + Profile *profileAt(int index) const; }; -} // namespace Debugger +} // namespace ProjectExplorer -#endif // DEBUGGERTOOLCHAINCOMBOBOX_H +#endif // PROJECTEXPLORER_PROFILECHOOSER_H diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro index 9f8c632f53..3fbbf4091e 100644 --- a/src/plugins/projectexplorer/projectexplorer.pro +++ b/src/plugins/projectexplorer/projectexplorer.pro @@ -21,6 +21,7 @@ HEADERS += projectexplorer.h \ projectexplorer_export.h \ projectwindow.h \ profile.h \ + profilechooser.h \ profileconfigwidget.h \ profileinformation.h \ profileinformationconfigwidget.h \ @@ -131,6 +132,7 @@ SOURCES += projectexplorer.cpp \ gcctoolchain.cpp \ projectwindow.cpp \ profile.cpp \ + profilechooser.cpp \ profileinformation.cpp \ profileinformationconfigwidget.cpp \ profilemanager.cpp \ diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index f5684dc478..f81ea1d2c2 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -110,6 +110,8 @@ QtcPlugin { "processstep.h", "profile.cpp", "profile.h", + "profilechooser.cpp", + "profilechooser.h", "profileconfigwidget.h", "profileinformation.cpp", "profileinformation.h", diff --git a/src/plugins/remotelinux/startgdbserverdialog.cpp b/src/plugins/remotelinux/startgdbserverdialog.cpp index 41b1a307ea..825541936c 100644 --- a/src/plugins/remotelinux/startgdbserverdialog.cpp +++ b/src/plugins/remotelinux/startgdbserverdialog.cpp @@ -37,8 +37,8 @@ #include "remotelinuxusedportsgatherer.h" #include <coreplugin/icore.h> -#include <debugger/debuggertoolchaincombobox.h> #include <extensionsystem/pluginmanager.h> +#include <projectexplorer/profilechooser.h> #include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/devicesupport/devicemanagermodel.h> #include <utils/pathchooser.h> @@ -105,7 +105,7 @@ public: QPushButton *attachProcessButton; QTextBrowser *textBrowser; QPushButton *closeButton; - Debugger::ProfileChooser *profileChooser; + ProfileChooser *profileChooser; RemoteLinuxUsedPortsGatherer gatherer; SshRemoteProcessRunner runner; @@ -121,7 +121,7 @@ StartGdbServerDialogPrivate::StartGdbServerDialogPrivate(StartGdbServerDialog *q deviceComboBox = new QComboBox(q); - profileChooser = new Debugger::ProfileChooser(q); + profileChooser = new ProfileChooser(q); // sysrootPathChooser = new PathChooser(q); // sysrootPathChooser->setExpectedKind(PathChooser::Directory); // sysrootPathChooser->setPromptDialogTitle(StartGdbServerDialog::tr("Select Sysroot")); |