diff --git a/src/plugins/debugger/gdb/gdb.pri b/src/plugins/debugger/gdb/gdb.pri index 03d7123eef3d7b69c918b05b4fca08d9d9f23f2d..85b9ef944e0ea3b2485fe7bb13b920a7d2dd8ff1 100644 --- a/src/plugins/debugger/gdb/gdb.pri +++ b/src/plugins/debugger/gdb/gdb.pri @@ -3,9 +3,6 @@ HEADERS += \ $$PWD/gdbengine.h \ $$PWD/gdboptionspage.h \ $$PWD/gdbchooserwidget.h \ - $$PWD/trkoptions.h \ - $$PWD/trkoptionswidget.h \ - $$PWD/trkoptionspage.h \ $$PWD/abstractgdbadapter.h \ $$PWD/attachgdbadapter.h \ $$PWD/coregdbadapter.h \ @@ -22,9 +19,6 @@ SOURCES += \ $$PWD/pythongdbengine.cpp \ $$PWD/gdboptionspage.cpp \ $$PWD/gdbchooserwidget.cpp \ - $$PWD/trkoptions.cpp \ - $$PWD/trkoptionswidget.cpp \ - $$PWD/trkoptionspage.cpp \ $$PWD/abstractgdbadapter.cpp \ $$PWD/attachgdbadapter.cpp \ $$PWD/coregdbadapter.cpp \ @@ -34,7 +28,6 @@ SOURCES += \ $$PWD/trkgdbadapter.cpp \ $$PWD/s60debuggerbluetoothstarter.cpp -FORMS += $$PWD/gdboptionspage.ui \ -$$PWD/trkoptionswidget.ui +FORMS += $$PWD/gdboptionspage.ui RESOURCES += $$PWD/gdb.qrc diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 7164db24e606bf14685688a6d3cd4e045e4f09db..49cad1dc95940d97c1d2e211adada097a486e673 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -31,8 +31,6 @@ #include "gdbengine.h" #include "gdboptionspage.h" -#include "trkoptions.h" -#include "trkoptionspage.h" #include "debuggeruiswitcher.h" #include "debuggermainwindow.h" @@ -176,8 +174,6 @@ GdbEngine::GdbEngine(DebuggerManager *manager) : IDebuggerEngine(manager), m_gdbBinaryToolChainMap(DebuggerSettings::instance()->gdbBinaryToolChainMap()) { - m_trkOptions = QSharedPointer<TrkOptions>(new TrkOptions); - m_trkOptions->fromSettings(Core::ICore::instance()->settings()); m_gdbAdapter = 0; m_progress = 0; @@ -1714,22 +1710,19 @@ int GdbEngine::currentFrame() const return manager()->stackHandler()->currentIndex(); } +static inline QString msgNoBinaryForToolChain(int tc) +{ + const ProjectExplorer::ToolChain::ToolChainType toolChain = static_cast<ProjectExplorer::ToolChain::ToolChainType>(tc); + const QString toolChainName = ProjectExplorer::ToolChain::toolChainName(toolChain); + return GdbEngine::tr("There is no gdb binary available for '%1'").arg(toolChainName); +} + bool GdbEngine::checkConfiguration(int toolChain, QString *errorMessage, QString *settingsPage) const { - switch (toolChain) { - case ProjectExplorer::ToolChain::WINSCW: // S60 - case ProjectExplorer::ToolChain::GCCE: - case ProjectExplorer::ToolChain::RVCT_ARMV5: - case ProjectExplorer::ToolChain::RVCT_ARMV6: - case ProjectExplorer::ToolChain::RVCT_ARMV5_GNUPOC: - case ProjectExplorer::ToolChain::GCCE_GNUPOC: - if (!m_trkOptions->check(errorMessage)) { - if (settingsPage) - *settingsPage = TrkOptionsPage::settingsId(); - return false; - } - default: - break; + if (m_gdbBinaryToolChainMap->key(toolChain).isEmpty()) { + *errorMessage = msgNoBinaryForToolChain(toolChain); + *settingsPage = GdbOptionsPage::settingsId(); + return false; } return true; } @@ -1743,13 +1736,13 @@ AbstractGdbAdapter *GdbEngine::createAdapter(const DebuggerStartParametersPtr &s case ProjectExplorer::ToolChain::RVCT_ARMV6: case ProjectExplorer::ToolChain::RVCT_ARMV5_GNUPOC: case ProjectExplorer::ToolChain::GCCE_GNUPOC: - return new TrkGdbAdapter(this, m_trkOptions); + return new TrkGdbAdapter(this); default: break; } // @todo: remove testing hack if (sp->processArgs.size() == 3 && sp->processArgs.at(0) == _("@sym@")) - return new TrkGdbAdapter(this, m_trkOptions); + return new TrkGdbAdapter(this); switch (sp->startMode) { case AttachCore: return new CoreGdbAdapter(this); @@ -4044,10 +4037,8 @@ bool GdbEngine::startGdb(const QStringList &args, const QString &gdb, const QStr if (m_gdb.isEmpty()) m_gdb = gdb; if (m_gdb.isEmpty()) { - const ProjectExplorer::ToolChain::ToolChainType toolChain = static_cast<ProjectExplorer::ToolChain::ToolChainType>(m_startParameters->toolChainType); - const QString toolChainName = ProjectExplorer::ToolChain::toolChainName(toolChain); - const QString msg = tr("There is no gdb binary available for '%1'").arg(toolChainName); - handleAdapterStartFailed(msg, GdbOptionsPage::settingsId()); + handleAdapterStartFailed(msgNoBinaryForToolChain(m_startParameters->toolChainType), + GdbOptionsPage::settingsId()); return false; } debugMessage(_("STARTING GDB ") + m_gdb); @@ -4348,7 +4339,6 @@ void GdbEngine::handleAdapterCrashed(const QString &msg) void GdbEngine::addOptionPages(QList<Core::IOptionsPage *> *opts) const { opts->push_back(new GdbOptionsPage(m_gdbBinaryToolChainMap)); - opts->push_back(new TrkOptionsPage(m_trkOptions)); } QMessageBox *GdbEngine::showMessageBox(int icon, const QString &title, diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index 9bf587a1e2198fbbee839a99831d54354150f9d9..f0d6ffcdc32f9587f0a70ba726d9cf9baa7880c6 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -71,7 +71,6 @@ class CoreGdbAdapter; class PlainGdbAdapter; class RemoteGdbAdapter; class TrkGdbAdapter; -struct TrkOptions; enum DebuggingHelperState { @@ -125,7 +124,6 @@ private: ////////// General State ////////// Q_SLOT void setAutoDerefPointers(const QVariant &on); DebuggerStartParametersPtr m_startParameters; - QSharedPointer<TrkOptions> m_trkOptions; bool m_registerNamesListed; private: ////////// Gdb Process Management ////////// diff --git a/src/plugins/debugger/gdb/s60debuggerbluetoothstarter.cpp b/src/plugins/debugger/gdb/s60debuggerbluetoothstarter.cpp index 848c4a07af7609fc24ac91440f559e4e76e1bc07..610baf579853374226e4c14ffc20410d8789bc28 100644 --- a/src/plugins/debugger/gdb/s60debuggerbluetoothstarter.cpp +++ b/src/plugins/debugger/gdb/s60debuggerbluetoothstarter.cpp @@ -30,7 +30,6 @@ #include "s60debuggerbluetoothstarter.h" #include "bluetoothlistener.h" #include "debuggermanager.h" -#include "trkoptions.h" #include "trkdevice.h" namespace Debugger { diff --git a/src/plugins/debugger/gdb/trkgdbadapter.cpp b/src/plugins/debugger/gdb/trkgdbadapter.cpp index 1f0db8e88c5a4635aaae42ac3115e062b23f117f..2c9e28c23c31c84a2d72212ddd2184cd21539d57 100644 --- a/src/plugins/debugger/gdb/trkgdbadapter.cpp +++ b/src/plugins/debugger/gdb/trkgdbadapter.cpp @@ -30,8 +30,6 @@ #include "trkgdbadapter.h" #include "launcher.h" -#include "trkoptions.h" -#include "trkoptionspage.h" #include "symbiandevicemanager.h" #include "s60debuggerbluetoothstarter.h" #include "bluetoothlistener_gui.h" @@ -238,11 +236,9 @@ void Snapshot::insertMemory(const MemoryRange &range, const QByteArray &ba) // /////////////////////////////////////////////////////////////////////////// -TrkGdbAdapter::TrkGdbAdapter(GdbEngine *engine, const TrkOptionsPtr &options) : +TrkGdbAdapter::TrkGdbAdapter(GdbEngine *engine) : AbstractGdbAdapter(engine), - m_options(options), m_running(false), - m_deviceFromSymbianDeviceManager(false), m_gdbAckMode(true), m_verbose(0) { @@ -1682,7 +1678,7 @@ void TrkGdbAdapter::slotStartGdb() { QStringList gdbArgs; gdbArgs.append(QLatin1String("--nx")); // Do not read .gdbinit file - if (!m_engine->startGdb(gdbArgs, m_options->gdb, TrkOptionsPage::settingsId())) { + if (!m_engine->startGdb(gdbArgs, QString(), QString())) { cleanup(); return; } @@ -1714,8 +1710,7 @@ void TrkGdbAdapter::interruptInferior() void TrkGdbAdapter::trkDeviceRemoved(const SymbianUtils::SymbianDevice &dev) { - if (state() != DebuggerNotReady && m_deviceFromSymbianDeviceManager - && !m_trkDevice.isNull() && m_trkDevice->port() == dev.portName()) { + if (state() != DebuggerNotReady && !m_trkDevice.isNull() && m_trkDevice->port() == dev.portName()) { const QString message = QString::fromLatin1("Device '%1' has been disconnected.").arg(dev.friendlyName()); logMessage(message); emit adapterCrashed(message); @@ -1724,24 +1719,18 @@ void TrkGdbAdapter::trkDeviceRemoved(const SymbianUtils::SymbianDevice &dev) bool TrkGdbAdapter::initializeDevice(const QString &remoteChannel, QString *errorMessage) { - m_deviceFromSymbianDeviceManager = false; if (remoteChannel.isEmpty()) { - // Obtain device from settings page - m_trkDevice = TrkDevicePtr(new TrkDevice); - m_trkDevice->setPort(m_options->mode == TrkOptions::BlueTooth ? - m_options->blueToothDevice : m_options->serialPort); - m_trkDevice->setSerialFrame(m_options->mode != TrkOptions::BlueTooth); - } else { - // Run config: Acquire from device manager. - m_trkDevice = SymbianUtils::SymbianDeviceManager::instance()->acquireDevice(remoteChannel); - if (m_trkDevice.isNull()) { - *errorMessage = tr("Unable to acquire a device on '%1'. It appears to be in use.").arg(remoteChannel); - return false; - } - connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(const SymbianUtils::SymbianDevice)), - this, SLOT(trkDeviceRemoved(SymbianUtils::SymbianDevice))); - m_deviceFromSymbianDeviceManager = true; + *errorMessage = tr("Port specification missing."); + return false; } + // Run config: Acquire from device manager. + m_trkDevice = SymbianUtils::SymbianDeviceManager::instance()->acquireDevice(remoteChannel); + if (m_trkDevice.isNull()) { + *errorMessage = tr("Unable to acquire a device on '%1'. It appears to be in use.").arg(remoteChannel); + return false; + } + connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(const SymbianUtils::SymbianDevice)), + this, SLOT(trkDeviceRemoved(SymbianUtils::SymbianDevice))); connect(m_trkDevice.data(), SIGNAL(messageReceived(trk::TrkResult)), this, SLOT(handleTrkResult(trk::TrkResult))); connect(m_trkDevice.data(), SIGNAL(error(QString)), @@ -1796,7 +1785,7 @@ void TrkGdbAdapter::startAdapter() emit adapterStartFailed(QString(), QString()); } else { logMessage(message); - emit adapterStartFailed(message, TrkOptionsPage::settingsId()); + emit adapterStartFailed(message, QString()); } return; } @@ -1809,7 +1798,7 @@ void TrkGdbAdapter::startAdapter() QString msg = QString("Unable to start the gdb server at %1: %2.") .arg(m_gdbServerName).arg(m_gdbServer->errorString()); logMessage(msg); - emit adapterStartFailed(msg, TrkOptionsPage::settingsId()); + emit adapterStartFailed(msg, QString()); return; } @@ -2133,11 +2122,8 @@ void TrkGdbAdapter::cleanup() { if (!m_trkDevice.isNull()) { m_trkDevice->close(); - if (m_deviceFromSymbianDeviceManager) { - m_trkDevice->disconnect(this); - SymbianUtils::SymbianDeviceManager::instance()->releaseDevice(m_trkDevice->port()); - m_deviceFromSymbianDeviceManager = false; - } + m_trkDevice->disconnect(this); + SymbianUtils::SymbianDeviceManager::instance()->releaseDevice(m_trkDevice->port()); m_trkDevice = TrkDevicePtr(); } diff --git a/src/plugins/debugger/gdb/trkgdbadapter.h b/src/plugins/debugger/gdb/trkgdbadapter.h index 8c71c19b36cc916604ba253a69c41ede01765e55..a80a9556a3a65f7a21e379b82e6d9bd66f33b16a 100644 --- a/src/plugins/debugger/gdb/trkgdbadapter.h +++ b/src/plugins/debugger/gdb/trkgdbadapter.h @@ -34,7 +34,6 @@ #include "trkutils.h" #include "trkdevice.h" -#include "trkoptions.h" #include "launcher.h" #include <QtCore/QHash> @@ -143,9 +142,8 @@ public: typedef trk::TrkResult TrkResult; typedef trk::Callback<const TrkResult &> TrkCallback; typedef trk::Callback<const GdbResult &> GdbCallback; - typedef QSharedPointer<TrkOptions> TrkOptionsPtr; - TrkGdbAdapter(GdbEngine *engine, const TrkOptionsPtr &options); + TrkGdbAdapter(GdbEngine *engine); ~TrkGdbAdapter(); void setGdbServerName(const QString &name); QString gdbServerName() const { return m_gdbServerName; } @@ -162,8 +160,6 @@ signals: void output(const QString &msg); private: - const TrkOptionsPtr m_options; - QString m_gdbServerName; // 127.0.0.1:(2222+uid) bool m_running; @@ -264,7 +260,6 @@ private: Q_SLOT void trkDeviceRemoved(const SymbianUtils::SymbianDevice &); QSharedPointer<trk::TrkDevice> m_trkDevice; - bool m_deviceFromSymbianDeviceManager; QString m_adapterFailMessage; // diff --git a/src/plugins/debugger/gdb/trkoptions.cpp b/src/plugins/debugger/gdb/trkoptions.cpp deleted file mode 100644 index 6130828db9b3e4e6544b0dd10eabe36f777949a8..0000000000000000000000000000000000000000 --- a/src/plugins/debugger/gdb/trkoptions.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include "trkoptions.h" -#include <utils/synchronousprocess.h> - -#include <QtCore/QSettings> -#include <QtCore/QFileInfo> -#include <QtCore/QCoreApplication> - -#ifdef Q_OS_WIN -# define SERIALPORT_ROOT "COM" -enum { firstSerialPort = 1, lastSerialPort = 12 }; -enum { modeDefault = Debugger::Internal::TrkOptions::Serial }; -static const char *serialPortDefaultC = SERIALPORT_ROOT"1"; -static const char *gdbDefaultC = "gdb-arm-none-symbianelf.exe"; -#else -# define SERIALPORT_ROOT "/dev/ttyS" -enum { firstSerialPort = 0, lastSerialPort = 3 }; -enum { modeDefault = Debugger::Internal::TrkOptions::BlueTooth }; -static const char *serialPortDefaultC = SERIALPORT_ROOT"0"; -static const char *gdbDefaultC = "gdb-arm-none-symbianelf"; -#endif - -static const char *settingsGroupC = "S60Debugger"; -static const char *serialPortKeyC = "Port"; -static const char *modeKeyC = "Mode"; -static const char *blueToothDeviceKeyC = "BlueToothDevice"; -static const char *blueToothDeviceDefaultC = "/dev/rfcomm0"; -static const char *gdbKeyC = "gdb"; - -namespace Debugger { -namespace Internal { - -TrkOptions::TrkOptions() : - mode(modeDefault), - serialPort(QLatin1String(serialPortDefaultC)), - blueToothDevice(QLatin1String(blueToothDeviceDefaultC)), - gdb(QLatin1String(gdbDefaultC)) -{ -} - -void TrkOptions::fromSettings(const QSettings *s) -{ - const QString keyRoot = QLatin1String(settingsGroupC) + QLatin1Char('/'); - mode = s->value(keyRoot + QLatin1String(modeKeyC), modeDefault).toInt(); - serialPort = s->value(keyRoot + QLatin1String(serialPortKeyC), QLatin1String(serialPortDefaultC)).toString(); - gdb = s->value(keyRoot + QLatin1String(gdbKeyC),QLatin1String(gdbDefaultC)).toString(); - blueToothDevice = s->value(keyRoot + QLatin1String(blueToothDeviceKeyC), QLatin1String(blueToothDeviceDefaultC)).toString(); -} - -void TrkOptions::toSettings(QSettings *s) const -{ - s->beginGroup(QLatin1String(settingsGroupC)); - s->setValue(QLatin1String(modeKeyC), mode); - s->setValue(QLatin1String(serialPortKeyC), serialPort); - s->setValue(QLatin1String(blueToothDeviceKeyC), blueToothDevice); - s->setValue(QLatin1String(gdbKeyC), gdb); - s->endGroup(); -} - -bool TrkOptions::check(QString *errorMessage) const -{ - if (gdb.isEmpty()) { - *errorMessage = QCoreApplication::translate("TrkOptions", "No Symbian gdb executable specified."); - return false; - } - const QString expanded = Utils::SynchronousProcess::locateBinary(gdb); - if (expanded.isEmpty()) { - *errorMessage = QCoreApplication::translate("TrkOptions", "The Symbian gdb executable '%1' could not be found in the search path.").arg(gdb); - return false; - } - return true; -} - -bool TrkOptions::equals(const TrkOptions &o) const -{ - return mode == o.mode - && serialPort == o.serialPort - && blueToothDevice == o.blueToothDevice - && gdb == o.gdb; -} - -QStringList TrkOptions::serialPorts() -{ - QStringList rc; - const QString root = QLatin1String(SERIALPORT_ROOT); - for (int p = firstSerialPort; p != lastSerialPort; p++) - rc.push_back(root + QString::number(p)); - return rc; -} - -QStringList TrkOptions::blueToothDevices() -{ - QStringList rc; - rc.push_back(QLatin1String(blueToothDeviceDefaultC)); - return rc; -} - -} // namespace Internal -} // namespace Debugger diff --git a/src/plugins/debugger/gdb/trkoptions.h b/src/plugins/debugger/gdb/trkoptions.h deleted file mode 100644 index 71474f107fc8891deeec60bdb9e24576cf6bbd60..0000000000000000000000000000000000000000 --- a/src/plugins/debugger/gdb/trkoptions.h +++ /dev/null @@ -1,82 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#ifndef TRKOPTIONS_H -#define TRKOPTIONS_H - -#include <QtCore/QStringList> - -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - -namespace Debugger { -namespace Internal { - -/* Parameter to be used for debugging S60 via TRK. - * GDB is a Symbian-ARM Gdb. - * Communication happens either via BlueTooth (Linux only) or - * serial ports. */ - -struct TrkOptions -{ - // Matches the communication enumeration from the S60 devices listener. - enum Mode { Serial, BlueTooth }; - - TrkOptions(); - void fromSettings(const QSettings *s); - void toSettings(QSettings *s) const; - bool equals(const TrkOptions &o) const; - - bool check(QString *errorMessage) const; - - // Lists of choices for the devices - static QStringList serialPorts(); - static QStringList blueToothDevices(); - - int mode; - QString serialPort; - QString blueToothDevice; - QString gdb; -}; - -inline bool operator==(const TrkOptions &o1, const TrkOptions &o2) -{ - return o1.equals(o2); -} - -inline bool operator!=(const TrkOptions &o1, const TrkOptions &o2) -{ - return !o1.equals(o2); -} - -} // namespace Internal -} // namespace Debugger - -#endif // TRKOPTIONS_H diff --git a/src/plugins/debugger/gdb/trkoptionspage.cpp b/src/plugins/debugger/gdb/trkoptionspage.cpp deleted file mode 100644 index de56e0865c636178ae166dbeb8260723feed6fd1..0000000000000000000000000000000000000000 --- a/src/plugins/debugger/gdb/trkoptionspage.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include "trkoptionspage.h" -#include "trkoptionswidget.h" -#include "trkoptions.h" -#include "debuggerconstants.h" - -#include <coreplugin/icore.h> - -#include <QtCore/QCoreApplication> -#include <QtCore/QSettings> - -namespace Debugger { -namespace Internal { - -TrkOptionsPage::TrkOptionsPage(const TrkOptionsPtr &options) : - m_options(options) -{ -} - -TrkOptionsPage::~TrkOptionsPage() -{ -} - -QString TrkOptionsPage::settingsId() -{ - return QLatin1String("S.Trk"); -} - -QString TrkOptionsPage::displayName() const -{ - return tr("Symbian"); -} - -QString TrkOptionsPage::category() const -{ - return QLatin1String(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY); -} - -QString TrkOptionsPage::displayCategory() const -{ - return QCoreApplication::translate("Debugger", Debugger::Constants::DEBUGGER_SETTINGS_TR_CATEGORY); -} - -QIcon TrkOptionsPage::categoryIcon() const -{ - return QIcon(QLatin1String(Debugger::Constants::DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON)); -} - -QWidget *TrkOptionsPage::createPage(QWidget *parent) -{ - if (!m_widget) - m_widget = new TrkOptionsWidget(parent); - m_widget->setTrkOptions(*m_options); - if (m_searchKeywords.isEmpty()) - m_searchKeywords = m_widget->searchKeywords(); - return m_widget; -} - -void TrkOptionsPage::apply() -{ - if (!m_widget) - return; - const TrkOptions newOptions = m_widget->trkOptions(); - if (newOptions == *m_options) - return; - *m_options = newOptions; - m_options->toSettings(Core::ICore::instance()->settings()); -} - -void TrkOptionsPage::finish() -{ -} - -bool TrkOptionsPage::matches(const QString &s) const -{ - return m_searchKeywords.contains(s, Qt::CaseInsensitive); -} - -} // namespace Internal -} // namespace Designer diff --git a/src/plugins/debugger/gdb/trkoptionspage.h b/src/plugins/debugger/gdb/trkoptionspage.h deleted file mode 100644 index 8647c34a5478917ac22a4139c5b3b292003af108..0000000000000000000000000000000000000000 --- a/src/plugins/debugger/gdb/trkoptionspage.h +++ /dev/null @@ -1,75 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#ifndef TRKOPTIONSPAGE_H -#define TRKOPTIONSPAGE_H - -#include <QtGui/QWidget> -#include <QtCore/QSharedPointer> -#include <QtCore/QPointer> - -#include <coreplugin/dialogs/ioptionspage.h> - -namespace Debugger { -namespace Internal { - -class TrkOptionsWidget; -struct TrkOptions; - -class TrkOptionsPage : public Core::IOptionsPage -{ - Q_OBJECT - Q_DISABLE_COPY(TrkOptionsPage) -public: - typedef QSharedPointer<TrkOptions> TrkOptionsPtr; - - TrkOptionsPage(const TrkOptionsPtr &options); - virtual ~TrkOptionsPage(); - - virtual QString id() const { return settingsId(); } - virtual QString displayName() const; - virtual QString category() const; - virtual QString displayCategory() const; - virtual QIcon categoryIcon() const; - - virtual QWidget *createPage(QWidget *parent); - virtual void apply(); - virtual void finish(); - virtual bool matches(const QString &) const; - - static QString settingsId(); -private: - const TrkOptionsPtr m_options; - QPointer<TrkOptionsWidget> m_widget; - QString m_searchKeywords; -}; - -} // namespace Internal -} // namespace Designer -#endif // TRKOPTIONSPAGE_H diff --git a/src/plugins/debugger/gdb/trkoptionswidget.cpp b/src/plugins/debugger/gdb/trkoptionswidget.cpp deleted file mode 100644 index 0636abc44fe41c20ea08b23722915eeec038adb1..0000000000000000000000000000000000000000 --- a/src/plugins/debugger/gdb/trkoptionswidget.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include "trkoptionswidget.h" -#include "trkoptions.h" -#include "debuggerconstants.h" -#include "ui_trkoptionswidget.h" - -#include <QtCore/QTextStream> - -namespace Debugger { -namespace Internal { - -TrkOptionsWidget::TrkOptionsWidget(QWidget *parent) : - QWidget(parent), - ui(new Ui::TrkOptionsWidget) -{ - ui->setupUi(this); - ui->gdbChooser->setExpectedKind(Utils::PathChooser::Command); - ui->blueToothComboBox->addItems(TrkOptions::blueToothDevices()); - ui->serialComboBox->addItems(TrkOptions::serialPorts()); - connect(ui->commComboBox, SIGNAL(currentIndexChanged(int)), ui->commStackedWidget, SLOT(setCurrentIndex(int))); - // No bluetooth on Windows yet... -#ifdef Q_OS_WIN - ui->commGroupBox->setVisible(false); -#endif -} - -TrkOptionsWidget::~TrkOptionsWidget() -{ - delete ui; -} - -void TrkOptionsWidget::changeEvent(QEvent *e) -{ - QWidget::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} - -void TrkOptionsWidget::setTrkOptions(const TrkOptions &o) -{ - ui->commComboBox->setCurrentIndex(o.mode); - ui->commStackedWidget->setCurrentIndex(o.mode); - const int serialPortIndex = qMax(0, ui->serialComboBox->findText(o.serialPort)); - ui->serialComboBox->setCurrentIndex(serialPortIndex); - ui->gdbChooser->setPath(o.gdb); - const int blueToothIndex = qMax(0, ui->blueToothComboBox->findText(o.blueToothDevice)); - ui->blueToothComboBox->setCurrentIndex(blueToothIndex); -} - -TrkOptions TrkOptionsWidget::trkOptions() const -{ - TrkOptions rc; - rc.mode = ui->commComboBox->currentIndex(); - rc.gdb = ui->gdbChooser->path(); - rc.blueToothDevice = ui->blueToothComboBox->currentText(); - rc.serialPort = ui->serialComboBox->currentText(); - return rc; -} - -QString TrkOptionsWidget::searchKeywords() const -{ - QString rc; - QTextStream(&rc) << ui->gdbLabel->text() << ' ' << ui->serialLabel->text() - << ' ' << ui->blueToothLabel->text(); - rc.remove(QLatin1Char('&')); - return rc; -} - -} // namespace Internal -} // namespace Designer diff --git a/src/plugins/debugger/gdb/trkoptionswidget.h b/src/plugins/debugger/gdb/trkoptionswidget.h deleted file mode 100644 index 162ef15aa63108a2a79b565589b67787f7dd7b95..0000000000000000000000000000000000000000 --- a/src/plugins/debugger/gdb/trkoptionswidget.h +++ /dev/null @@ -1,64 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#ifndef TRKOPTIONSWIDGET_H -#define TRKOPTIONSWIDGET_H - -#include <QtGui/QWidget> - -namespace Debugger { -namespace Internal { - -struct TrkOptions; - -namespace Ui { - class TrkOptionsWidget; -} - -class TrkOptionsWidget : public QWidget { - Q_OBJECT -public: - TrkOptionsWidget(QWidget *parent = 0); - ~TrkOptionsWidget(); - - void setTrkOptions(const TrkOptions &); - TrkOptions trkOptions() const; - - QString searchKeywords() const; - -protected: - void changeEvent(QEvent *e); - -private: - Ui::TrkOptionsWidget *ui; -}; - -} // namespace Internal -} // namespace Designer -#endif // TRKOPTIONSWIDGET_H diff --git a/src/plugins/debugger/gdb/trkoptionswidget.ui b/src/plugins/debugger/gdb/trkoptionswidget.ui deleted file mode 100644 index 8aa52ef24af4db67dea7a4341296115a0fa2544e..0000000000000000000000000000000000000000 --- a/src/plugins/debugger/gdb/trkoptionswidget.ui +++ /dev/null @@ -1,142 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Debugger::Internal::TrkOptionsWidget</class> - <widget class="QWidget" name="Debugger::Internal::TrkOptionsWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>400</width> - <height>300</height> - </rect> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QGroupBox" name="gdbGroupBox"> - <property name="title"> - <string>Gdb</string> - </property> - <layout class="QFormLayout" name="formLayout"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="gdbLabel"> - <property name="text"> - <string>Symbian ARM gdb location:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="Utils::PathChooser" name="gdbChooser" native="true"/> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="commGroupBox"> - <property name="title"> - <string>Device Communication</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QComboBox" name="commComboBox"> - <item> - <property name="text"> - <string>Serial Port</string> - </property> - </item> - <item> - <property name="text"> - <string>Bluetooth</string> - </property> - </item> - </widget> - </item> - <item> - <widget class="QStackedWidget" name="commStackedWidget"> - <property name="currentIndex"> - <number>1</number> - </property> - <widget class="QWidget" name="serialPage"> - <layout class="QFormLayout" name="formLayout_2"> - <item row="0" column="0"> - <widget class="QLabel" name="serialLabel"> - <property name="text"> - <string>Port:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QComboBox" name="serialComboBox"/> - </item> - </layout> - </widget> - <widget class="QWidget" name="blueToothPage"> - <layout class="QFormLayout" name="formLayout_3"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="1"> - <widget class="QComboBox" name="blueToothComboBox"/> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="blueToothLabel"> - <property name="text"> - <string>Device:</string> - </property> - </widget> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </item> - <item> - <spacer name="commHorizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>182</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>Utils::PathChooser</class> - <extends>QWidget</extends> - <header location="global">utils/pathchooser.h</header> - <container>1</container> - </customwidget> - </customwidgets> - <resources/> - <connections/> -</ui>