Commit bb17a05f authored by kh1's avatar kh1
Browse files

Remove maemo gdb settings page, since we now have a unified one.

Reviewed-by: ck
parent fa76824a
/**************************************************************************
**
** 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 "maemogdbsettingspage.h"
#include "ui_maemogdbwidget.h"
#include <coreplugin/icore.h>
#include <debugger/debuggerconstants.h>
#include <QtCore/QSettings>
#include <QtCore/QTextStream>
using namespace Qt4ProjectManager::Internal;
// -- MaemoGdbWidget
MaemoGdbWidget::MaemoGdbWidget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::MaemoGdbWidget)
{
ui->setupUi(this);
QSettings *settings = Core::ICore::instance()->settings();
ui->gdbChooser->setPath(settings->value(QLatin1String("MaemoDebugger/gdb"),
QLatin1String("")).toString());
const bool checked = settings->value(QLatin1String("MaemoDebugger/useMaddeGdb"),
true).toBool();
ui->useMaddeGdb->setChecked(checked);
toogleGdbPathChooser(checked ? Qt::Checked : Qt::Unchecked);
ui->gdbChooser->setExpectedKind(Utils::PathChooser::Command);
connect(ui->useMaddeGdb, SIGNAL(stateChanged(int)), this,
SLOT(toogleGdbPathChooser(int)));
}
MaemoGdbWidget::~MaemoGdbWidget()
{
delete ui;
}
void MaemoGdbWidget::saveSettings()
{
QSettings *settings = Core::ICore::instance()->settings();
settings->setValue(QLatin1String("MaemoDebugger/useMaddeGdb"),
ui->useMaddeGdb->isChecked());
settings->setValue(QLatin1String("MaemoDebugger/gdb"), ui->gdbChooser->path());
}
QString MaemoGdbWidget::searchKeywords() const
{
QString rc;
QTextStream(&rc) << ui->gdbLabel->text() << ui->useMaddeGdb->text();
rc.remove(QLatin1Char('&'));
return rc;
}
void MaemoGdbWidget::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
void MaemoGdbWidget::toogleGdbPathChooser(int state)
{
bool enable = false;
if (state == Qt::Unchecked)
enable = true;
ui->gdbLabel->setEnabled(enable);
ui->gdbChooser->setEnabled(enable);
}
// -- MaemoGdbSettingsPage
MaemoGdbSettingsPage::MaemoGdbSettingsPage(QObject *parent)
: Core::IOptionsPage(parent)
{
}
MaemoGdbSettingsPage::~MaemoGdbSettingsPage()
{
}
QString MaemoGdbSettingsPage::id() const
{
return QLatin1String("Y.Maemo");
}
QString MaemoGdbSettingsPage::displayName() const
{
return tr("Maemo");
}
QString MaemoGdbSettingsPage::category() const
{
return QLatin1String(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
}
QString MaemoGdbSettingsPage::displayCategory() const
{
return QCoreApplication::translate("Debugger",
Debugger::Constants::DEBUGGER_SETTINGS_TR_CATEGORY);
}
QIcon MaemoGdbSettingsPage::categoryIcon() const
{
return QIcon(QLatin1String(Debugger::Constants::DEBUGGER_COMMON_SETTINGS_CATEGORY_ICON));
}
QWidget *MaemoGdbSettingsPage::createPage(QWidget *parent)
{
m_widget = new MaemoGdbWidget(parent);
if (m_searchKeywords.isEmpty())
m_searchKeywords = m_widget->searchKeywords();
return m_widget;
}
void MaemoGdbSettingsPage::apply()
{
m_widget->saveSettings();
emit updateGdbLocation();
}
void MaemoGdbSettingsPage::finish()
{
}
bool MaemoGdbSettingsPage::matches(const QString &s) const
{
return m_searchKeywords.contains(s, Qt::CaseInsensitive);
}
/**************************************************************************
**
** 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 MAEMOGDBSETTINGSPAGE_H
#define MAEMOGDBSETTINGSPAGE_H
#include <coreplugin/dialogs/ioptionspage.h>
#include <QtGui/QWidget>
namespace Qt4ProjectManager{
namespace Internal {
namespace Ui {
class MaemoGdbWidget;
}
class MaemoGdbWidget : public QWidget {
Q_OBJECT
public:
MaemoGdbWidget(QWidget *parent = 0);
~MaemoGdbWidget();
void saveSettings();
QString searchKeywords() const;
protected:
void changeEvent(QEvent *e);
private slots:
void toogleGdbPathChooser(int state);
private:
Ui::MaemoGdbWidget *ui;
};
class MaemoGdbSettingsPage : public Core::IOptionsPage
{
Q_OBJECT
public:
MaemoGdbSettingsPage(QObject *parent);
~MaemoGdbSettingsPage();
virtual QString id() const;
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;
signals:
void updateGdbLocation();
private:
MaemoGdbWidget *m_widget;
QString m_searchKeywords;
};
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // MAEMOGDBSETTINGSPAGE_H
<?xml version="1.0" encoding="utf-8"?>
<ui version="4.0">
<class>Qt4ProjectManager::Internal::MaemoGdbWidget</class>
<widget class="QWidget" name="Qt4ProjectManager::Internal::MaemoGdbWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>429</width>
<height>175</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="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="useMaddeGdb">
<property name="text">
<string>Use MADDE gdb</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="gdbLabel">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Maemo ARM gdb location:</string>
</property>
</widget>
</item>
<item>
<widget class="Utils::PathChooser" name="gdbChooser" native="true">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</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>
......@@ -31,7 +31,6 @@
#include "qtversionmanager.h"
#include "maemodeviceconfigurations.h"
#include "maemogdbsettingspage.h"
#include "maemopackagecreationfactory.h"
#include "maemorunfactories.h"
#include "maemosettingspage.h"
......@@ -67,7 +66,6 @@ MaemoManager::MaemoManager()
, m_runConfigurationFactory(new MaemoRunConfigurationFactory(this))
, m_packageCreationFactory(new MaemoPackageCreationFactory(this))
, m_settingsPage(new MaemoSettingsPage(this))
, m_gdbSettingsPage(new MaemoGdbSettingsPage(this))
, m_qemuCommand(0)
{
Q_ASSERT(!m_instance);
......@@ -85,7 +83,6 @@ MaemoManager::MaemoManager()
pluginManager->addObject(m_runConfigurationFactory);
pluginManager->addObject(m_packageCreationFactory);
pluginManager->addObject(m_settingsPage);
pluginManager->addObject(m_gdbSettingsPage);
Ne7SshObject::instance();
}
......@@ -98,7 +95,6 @@ MaemoManager::~MaemoManager()
pluginManager->removeObject(m_runConfigurationFactory);
pluginManager->removeObject(m_packageCreationFactory);
pluginManager->removeObject(m_settingsPage);
pluginManager->removeObject(m_gdbSettingsPage);
Ne7SshObject::removeInstance();
m_instance = 0;
......
......@@ -53,7 +53,6 @@ namespace Qt4ProjectManager {
class QtVersion;
namespace Internal {
class MaemoGdbSettingsPage;
class MaemoPackageCreationFactory;
class MaemoRunControlFactory;
class MaemoRunConfigurationFactory;
......@@ -77,7 +76,6 @@ public:
void setQemuSimulatorStarterEnabled(bool state);
MaemoSettingsPage *settingsPage() const { return m_settingsPage; }
MaemoGdbSettingsPage *gdbSettingsPage() const { return m_gdbSettingsPage; }
public slots:
void triggered();
......@@ -93,7 +91,6 @@ private:
MaemoRunConfigurationFactory *m_runConfigurationFactory;
MaemoPackageCreationFactory *m_packageCreationFactory;
MaemoSettingsPage *m_settingsPage;
MaemoGdbSettingsPage *m_gdbSettingsPage;
QIcon icon;
int m_runCount;
......
......@@ -288,19 +288,9 @@ const MaemoToolChain *MaemoRunConfiguration::toolchain() const
const QString MaemoRunConfiguration::gdbCmd() const
{
QSettings *settings = Core::ICore::instance()->settings();
bool useMadde = settings->value(QLatin1String("MaemoDebugger/useMaddeGdb"),
true).toBool();
QString gdbPath;
if (const MaemoToolChain *tc = toolchain())
gdbPath = tc->targetRoot() + QLatin1String("/bin/gdb");
if (!useMadde) {
gdbPath = settings->value(QLatin1String("MaemoDebugger/gdb"),
gdbPath).toString();
}
return QDir::toNativeSeparators(gdbPath);
return QDir::toNativeSeparators(tc->targetRoot() + QLatin1String("/bin/gdb"));
return QString();
}
QString MaemoRunConfiguration::maddeRoot() const
......
......@@ -35,7 +35,6 @@
#include "maemorunconfigurationwidget.h"
#include "maemodeviceconfigurations.h"
#include "maemogdbsettingspage.h"
#include "maemomanager.h"
#include "maemorunconfiguration.h"
#include "maemosettingspage.h"
......@@ -75,7 +74,13 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
devConfLayout->addWidget(m_devConfBox);
QLabel *addDevConfLabel= new QLabel(tr("<a href=\"%1\">Manage device configurations</a>")
.arg(QLatin1String("deviceconfig")));
addDevConfLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
devConfLayout->addWidget(addDevConfLabel);
QLabel *debuggerConfLabel = new QLabel(tr("<a href=\"%1\">Set Debugger</a>")
.arg(QLatin1String("debugger")));
debuggerConfLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
devConfLayout->addWidget(debuggerConfLabel);
mainLayout->addRow(new QLabel(tr("Device Configuration:")), devConfWidget);
m_executableLabel = new QLabel(m_runConfiguration->executable());
......@@ -83,16 +88,6 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
m_argsLineEdit = new QLineEdit(m_runConfiguration->arguments().join(" "));
mainLayout->addRow(tr("Arguments:"), m_argsLineEdit);
QWidget *debuggerWidget = new QWidget;
QHBoxLayout *debuggerLayout = new QHBoxLayout(debuggerWidget);
debuggerLayout->setMargin(0);
m_debuggerLabel = new QLabel(m_runConfiguration->gdbCmd());
debuggerLayout->addWidget(m_debuggerLabel);
QLabel *debuggerConfLabel = new QLabel(tr("<a href=\"%1\">Set Maemo Debugger</a>")
.arg(QLatin1String("debugger")));
debuggerLayout->addWidget(debuggerConfLabel);
mainLayout->addRow(tr("Debugger:"), debuggerWidget);
mainLayout->addItem(new QSpacerItem(10, 10));
m_simNameLabel = new QLabel(tr("Simulator:"));
m_simValueLabel = new QLabel(m_runConfiguration->visibleSimulatorParameter());
......@@ -116,8 +111,6 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
SLOT(showSettingsDialog(QString)));
connect(debuggerConfLabel, SIGNAL(linkActivated(QString)), this,
SLOT(showSettingsDialog(QString)));
connect(MaemoManager::instance().gdbSettingsPage(), SIGNAL(updateGdbLocation()),
this, SLOT(updateGdbLocation()));
}
void MaemoRunConfigurationWidget::configNameEdited(const QString &text)
......@@ -135,11 +128,6 @@ void MaemoRunConfigurationWidget::updateTargetInformation()
m_executableLabel->setText(m_runConfiguration->executable());
}
void MaemoRunConfigurationWidget::updateGdbLocation()
{
m_debuggerLabel->setText(m_runConfiguration->gdbCmd());
}
void MaemoRunConfigurationWidget::updateSimulatorPath()
{
m_simValueLabel->setText(m_runConfiguration->visibleSimulatorParameter());
......@@ -175,12 +163,12 @@ void MaemoRunConfigurationWidget::resetDeviceConfigurations()
void MaemoRunConfigurationWidget::showSettingsDialog(const QString &link)
{
if (link == QLatin1String("debugger")) {
MaemoGdbSettingsPage *page = MaemoManager::instance().gdbSettingsPage();
Core::ICore::instance()->showOptionsDialog(page->category(), page->id());
} else if (link == QLatin1String("deviceconfig")) {
if (link == QLatin1String("deviceconfig")) {
MaemoSettingsPage *page = MaemoManager::instance().settingsPage();
Core::ICore::instance()->showOptionsDialog(page->category(), page->id());
} else if (link == QLatin1String("debugger")) {
Core::ICore::instance()->showOptionsDialog(QLatin1String("O.Debugger"),
QLatin1String("M.Gdb"));
}
}
......
......@@ -63,7 +63,6 @@ private slots:
void resetDeviceConfigurations();
void showSettingsDialog(const QString &link);
void updateGdbLocation();
void updateSimulatorPath();
void updateTargetInformation();
......
......@@ -6,7 +6,6 @@ HEADERS += \
$$PWD/maemoconfigtestdialog.h \
$$PWD/maemoconstants.h \
$$PWD/maemodeviceconfigurations.h \
$$PWD/maemogdbsettingspage.h \
$$PWD/maemomanager.h \
$$PWD/maemorunconfiguration.h \
$$PWD/maemorunconfigurationwidget.h \
......@@ -24,7 +23,6 @@ HEADERS += \
SOURCES += \
$$PWD/maemoconfigtestdialog.cpp \
$$PWD/maemodeviceconfigurations.cpp \
$$PWD/maemogdbsettingspage.cpp \
$$PWD/maemomanager.cpp \
$$PWD/maemorunconfiguration.cpp \
$$PWD/maemorunconfigurationwidget.cpp \
......@@ -41,7 +39,6 @@ SOURCES += \
FORMS += \
$$PWD/maemoconfigtestdialog.ui \
$$PWD/maemogdbwidget.ui \
$$PWD/maemosettingswidget.ui
RESOURCES += $$PWD/qt-maemo.qrc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment