forked from qt-creator/qt-creator
		
	Implement setting the maemo gdb debugger location using the prefs.
This commit is contained in:
		
							
								
								
									
										162
									
								
								src/plugins/qt4projectmanager/qt-maemo/maemogdbsettingspage.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										162
									
								
								src/plugins/qt4projectmanager/qt-maemo/maemogdbsettingspage.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,162 @@
 | 
			
		||||
/**************************************************************************
 | 
			
		||||
**
 | 
			
		||||
** 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("ZZ.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);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,92 @@
 | 
			
		||||
/**************************************************************************
 | 
			
		||||
**
 | 
			
		||||
** 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
 | 
			
		||||
							
								
								
									
										104
									
								
								src/plugins/qt4projectmanager/qt-maemo/maemogdbwidget.ui
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										104
									
								
								src/plugins/qt4projectmanager/qt-maemo/maemogdbwidget.ui
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,104 @@
 | 
			
		||||
<?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,6 +31,7 @@
 | 
			
		||||
#include "qtversionmanager.h"
 | 
			
		||||
 | 
			
		||||
#include "maemodeviceconfigurations.h"
 | 
			
		||||
#include "maemogdbsettingspage.h"
 | 
			
		||||
#include "maemorunfactories.h"
 | 
			
		||||
#include "maemosettingspage.h"
 | 
			
		||||
#include "maemotoolchain.h"
 | 
			
		||||
@@ -63,6 +64,7 @@ MaemoManager::MaemoManager()
 | 
			
		||||
    , m_runControlFactory(new MaemoRunControlFactory(this))
 | 
			
		||||
    , m_runConfigurationFactory(new MaemoRunConfigurationFactory(this))
 | 
			
		||||
    , m_settingsPage(new MaemoSettingsPage(this))
 | 
			
		||||
    , m_gdbSettingsPage(new MaemoGdbSettingsPage(this))
 | 
			
		||||
    , m_qemuCommand(0)
 | 
			
		||||
{
 | 
			
		||||
    Q_ASSERT(!m_instance);
 | 
			
		||||
@@ -77,6 +79,7 @@ MaemoManager::MaemoManager()
 | 
			
		||||
    ExtensionSystem::PluginManager::instance()->addObject(m_runControlFactory);
 | 
			
		||||
    ExtensionSystem::PluginManager::instance()->addObject(m_runConfigurationFactory);
 | 
			
		||||
    ExtensionSystem::PluginManager::instance()->addObject(m_settingsPage);
 | 
			
		||||
    ExtensionSystem::PluginManager::instance()->addObject(m_gdbSettingsPage);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
MaemoManager::~MaemoManager()
 | 
			
		||||
@@ -84,6 +87,7 @@ MaemoManager::~MaemoManager()
 | 
			
		||||
    ExtensionSystem::PluginManager::instance()->removeObject(m_runControlFactory);
 | 
			
		||||
    ExtensionSystem::PluginManager::instance()->removeObject(m_runConfigurationFactory);
 | 
			
		||||
    ExtensionSystem::PluginManager::instance()->removeObject(m_settingsPage);
 | 
			
		||||
    ExtensionSystem::PluginManager::instance()->removeObject(m_gdbSettingsPage);
 | 
			
		||||
 | 
			
		||||
    m_instance = 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -53,6 +53,7 @@ namespace Qt4ProjectManager {
 | 
			
		||||
    class QtVersion;
 | 
			
		||||
namespace Internal {
 | 
			
		||||
 | 
			
		||||
class MaemoGdbSettingsPage;
 | 
			
		||||
class MaemoRunControlFactory;
 | 
			
		||||
class MaemoRunConfigurationFactory;
 | 
			
		||||
class MaemoSettingsPage;
 | 
			
		||||
@@ -75,6 +76,7 @@ public:
 | 
			
		||||
    void setQemuSimulatorStarterEnabled(bool state);
 | 
			
		||||
 | 
			
		||||
    MaemoSettingsPage *settingsPage() const { return m_settingsPage; }
 | 
			
		||||
    MaemoGdbSettingsPage *gdbSettingsPage() const { return m_gdbSettingsPage; }
 | 
			
		||||
 | 
			
		||||
public slots:
 | 
			
		||||
    void triggered();
 | 
			
		||||
@@ -89,6 +91,7 @@ private:
 | 
			
		||||
    MaemoRunControlFactory *m_runControlFactory;
 | 
			
		||||
    MaemoRunConfigurationFactory *m_runConfigurationFactory;
 | 
			
		||||
    MaemoSettingsPage *m_settingsPage;
 | 
			
		||||
    MaemoGdbSettingsPage *m_gdbSettingsPage;
 | 
			
		||||
 | 
			
		||||
    QIcon icon;
 | 
			
		||||
    int m_runCount;
 | 
			
		||||
 
 | 
			
		||||
@@ -45,6 +45,7 @@
 | 
			
		||||
 | 
			
		||||
#include <QtCore/QDebug>
 | 
			
		||||
#include <QtCore/QProcess>
 | 
			
		||||
#include <QtCore/QString>
 | 
			
		||||
#include <QtCore/QStringBuilder>
 | 
			
		||||
 | 
			
		||||
namespace Qt4ProjectManager {
 | 
			
		||||
@@ -289,9 +290,19 @@ 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())
 | 
			
		||||
        return tc->targetRoot() + "/bin/gdb";
 | 
			
		||||
    return QString();
 | 
			
		||||
        gdbPath = tc->targetRoot() + QLatin1String("/bin/gdb");
 | 
			
		||||
 | 
			
		||||
    if (!useMadde) {
 | 
			
		||||
        gdbPath = settings->value(QLatin1String("MaemoDebugger/gdb"),
 | 
			
		||||
            gdbPath).toString();
 | 
			
		||||
    }
 | 
			
		||||
    return QDir::toNativeSeparators(gdbPath);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QString MaemoRunConfiguration::maddeRoot() const
 | 
			
		||||
@@ -328,11 +339,13 @@ const QString MaemoRunConfiguration::dumperLib() const
 | 
			
		||||
 | 
			
		||||
QString MaemoRunConfiguration::executable() const
 | 
			
		||||
{
 | 
			
		||||
    TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()->targetInformation(m_proFilePath);
 | 
			
		||||
    TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()
 | 
			
		||||
        ->targetInformation(m_proFilePath);
 | 
			
		||||
    if (!ti.valid)
 | 
			
		||||
        return QString();
 | 
			
		||||
 | 
			
		||||
    return QDir::cleanPath(ti.workingDir + QLatin1Char('/') + ti.target);
 | 
			
		||||
    return QDir::toNativeSeparators(QDir::cleanPath(ti.workingDir
 | 
			
		||||
        + QLatin1Char('/') + ti.target));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QString MaemoRunConfiguration::simulatorSshPort() const
 | 
			
		||||
 
 | 
			
		||||
@@ -142,7 +142,7 @@ private:
 | 
			
		||||
    mutable QString m_simulatorGdbServerPort;
 | 
			
		||||
    mutable bool m_cachedSimulatorInformationValid;
 | 
			
		||||
 | 
			
		||||
    QString m_gdbPath;
 | 
			
		||||
    mutable QString m_gdbPath;
 | 
			
		||||
 | 
			
		||||
    MaemoDeviceConfig m_devConfig;
 | 
			
		||||
    QStringList m_arguments;
 | 
			
		||||
 
 | 
			
		||||
@@ -35,6 +35,7 @@
 | 
			
		||||
#include "maemorunconfigurationwidget.h"
 | 
			
		||||
 | 
			
		||||
#include "maemodeviceconfigurations.h"
 | 
			
		||||
#include "maemogdbsettingspage.h"
 | 
			
		||||
#include "maemomanager.h"
 | 
			
		||||
#include "maemorunconfiguration.h"
 | 
			
		||||
#include "maemosettingspage.h"
 | 
			
		||||
@@ -65,22 +66,33 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
 | 
			
		||||
    mainLayout->setFormAlignment(Qt::AlignLeft | Qt::AlignVCenter);
 | 
			
		||||
    m_configNameLineEdit = new QLineEdit(m_runConfiguration->displayName());
 | 
			
		||||
    mainLayout->addRow(tr("Run configuration name:"), m_configNameLineEdit);
 | 
			
		||||
 | 
			
		||||
    QWidget *devConfWidget = new QWidget;
 | 
			
		||||
    QHBoxLayout *devConfLayout = new QHBoxLayout(devConfWidget);
 | 
			
		||||
    m_devConfBox = new QComboBox;
 | 
			
		||||
    m_devConfBox->setSizeAdjustPolicy(QComboBox::AdjustToContents);
 | 
			
		||||
    devConfLayout->setMargin(0);
 | 
			
		||||
    devConfLayout->addWidget(m_devConfBox);
 | 
			
		||||
    QLabel *addDevConfLabel
 | 
			
		||||
        = new QLabel(tr("<a href=\"#\">Manage device configurations</a>"));
 | 
			
		||||
    QLabel *addDevConfLabel= new QLabel(tr("<a href=\"%1\">Manage device configurations</a>")
 | 
			
		||||
        .arg(QLatin1String("deviceconfig")));
 | 
			
		||||
    devConfLayout->addWidget(addDevConfLabel);
 | 
			
		||||
 | 
			
		||||
    mainLayout->addRow(new QLabel(tr("Device Configuration:")), devConfWidget);
 | 
			
		||||
    m_executableLabel = new QLabel(m_runConfiguration->executable());
 | 
			
		||||
    mainLayout->addRow(tr("Executable:"), m_executableLabel);
 | 
			
		||||
    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());
 | 
			
		||||
    mainLayout->addRow(tr("Debugger:"), m_debuggerLabel);
 | 
			
		||||
    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());
 | 
			
		||||
@@ -101,7 +113,11 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
 | 
			
		||||
    connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
 | 
			
		||||
        SLOT(updateTargetInformation()));
 | 
			
		||||
    connect(addDevConfLabel, SIGNAL(linkActivated(QString)), this,
 | 
			
		||||
        SLOT(showSettingsDialog()));
 | 
			
		||||
        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)
 | 
			
		||||
@@ -119,6 +135,11 @@ 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());
 | 
			
		||||
@@ -152,11 +173,15 @@ void MaemoRunConfigurationWidget::resetDeviceConfigurations()
 | 
			
		||||
    setSimInfoVisible(devConf);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void MaemoRunConfigurationWidget::showSettingsDialog()
 | 
			
		||||
void MaemoRunConfigurationWidget::showSettingsDialog(const QString &link)
 | 
			
		||||
{
 | 
			
		||||
    MaemoSettingsPage *settingsPage = MaemoManager::instance().settingsPage();
 | 
			
		||||
    Core::ICore::instance()->showOptionsDialog(settingsPage->category(),
 | 
			
		||||
        settingsPage->id());
 | 
			
		||||
    if (link == QLatin1String("debugger")) {
 | 
			
		||||
        MaemoGdbSettingsPage *page = MaemoManager::instance().gdbSettingsPage();
 | 
			
		||||
        Core::ICore::instance()->showOptionsDialog(page->category(), page->id());
 | 
			
		||||
    } else if (link == QLatin1String("deviceconfig")) {
 | 
			
		||||
        MaemoSettingsPage *page = MaemoManager::instance().settingsPage();
 | 
			
		||||
        Core::ICore::instance()->showOptionsDialog(page->category(), page->id());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
} // namespace Internal
 | 
			
		||||
 
 | 
			
		||||
@@ -61,8 +61,9 @@ private slots:
 | 
			
		||||
    void argumentsEdited(const QString &args);
 | 
			
		||||
    void deviceConfigurationChanged(const QString &name);
 | 
			
		||||
    void resetDeviceConfigurations();
 | 
			
		||||
    void showSettingsDialog();
 | 
			
		||||
    void showSettingsDialog(const QString &link);
 | 
			
		||||
 | 
			
		||||
    void updateGdbLocation();
 | 
			
		||||
    void updateSimulatorPath();
 | 
			
		||||
    void updateTargetInformation();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,33 +1,41 @@
 | 
			
		||||
INCLUDEPATH += $$PWD/../../../libs/3rdparty/botan/build
 | 
			
		||||
INCLUDEPATH += $$PWD/../../../libs/3rdparty/net7ssh/src
 | 
			
		||||
LIBS += -l$$qtLibraryTarget(Net7ssh) -l$$qtLibraryTarget(Botan)
 | 
			
		||||
HEADERS += $$PWD/maemorunconfiguration.h \
 | 
			
		||||
    $$PWD/maemomanager.h \
 | 
			
		||||
    $$PWD/maemotoolchain.h \
 | 
			
		||||
 | 
			
		||||
HEADERS += \
 | 
			
		||||
    $$PWD/maemoconfigtestdialog.h \
 | 
			
		||||
    $$PWD/maemoconstants.h \
 | 
			
		||||
    $$PWD/maemodeviceconfigurations.h \
 | 
			
		||||
    $$PWD/maemogdbsettingspage.h \
 | 
			
		||||
    $$PWD/maemomanager.h \
 | 
			
		||||
    $$PWD/maemorunconfiguration.h \
 | 
			
		||||
    $$PWD/maemorunconfigurationwidget.h \
 | 
			
		||||
    $$PWD/maemoruncontrol.h \
 | 
			
		||||
    $$PWD/maemorunfactories.h \
 | 
			
		||||
    $$PWD/maemosettingspage.h \
 | 
			
		||||
    $$PWD/maemosettingswidget.h \
 | 
			
		||||
    $$PWD/maemosshconnection.h \
 | 
			
		||||
    $$PWD/maemosshthread.h \
 | 
			
		||||
    $$PWD/maemoruncontrol.h \
 | 
			
		||||
    $$PWD/maemorunconfigurationwidget.h \
 | 
			
		||||
    $$PWD/maemorunfactories.h \
 | 
			
		||||
    $$PWD/maemoconstants.h \
 | 
			
		||||
    $$PWD/maemoconfigtestdialog.h
 | 
			
		||||
    $$PWD/maemotoolchain.h
 | 
			
		||||
 | 
			
		||||
SOURCES += $$PWD/maemorunconfiguration.cpp \
 | 
			
		||||
    $$PWD/maemomanager.cpp \
 | 
			
		||||
    $$PWD/maemotoolchain.cpp \
 | 
			
		||||
SOURCES += \
 | 
			
		||||
    $$PWD/maemoconfigtestdialog.cpp \
 | 
			
		||||
    $$PWD/maemodeviceconfigurations.cpp \
 | 
			
		||||
    $$PWD/maemogdbsettingspage.cpp \
 | 
			
		||||
    $$PWD/maemomanager.cpp \
 | 
			
		||||
    $$PWD/maemorunconfiguration.cpp \
 | 
			
		||||
    $$PWD/maemorunconfigurationwidget.cpp \
 | 
			
		||||
    $$PWD/maemoruncontrol.cpp \
 | 
			
		||||
    $$PWD/maemorunfactories.cpp \
 | 
			
		||||
    $$PWD/maemosettingspage.cpp \
 | 
			
		||||
    $$PWD/maemosettingswidget.cpp \
 | 
			
		||||
    $$PWD/maemosshconnection.cpp \
 | 
			
		||||
    $$PWD/maemosshthread.cpp \
 | 
			
		||||
    $$PWD/maemoruncontrol.cpp \
 | 
			
		||||
    $$PWD/maemorunconfigurationwidget.cpp \
 | 
			
		||||
    $$PWD/maemorunfactories.cpp \
 | 
			
		||||
    $$PWD/maemoconfigtestdialog.cpp
 | 
			
		||||
    $$PWD/maemotoolchain.cpp
 | 
			
		||||
 | 
			
		||||
FORMS += \
 | 
			
		||||
    $$PWD/maemoconfigtestdialog.ui \
 | 
			
		||||
    $$PWD/maemogdbwidget.ui \
 | 
			
		||||
    $$PWD/maemosettingswidget.ui
 | 
			
		||||
 | 
			
		||||
FORMS += $$PWD/maemosettingswidget.ui \
 | 
			
		||||
    $$PWD/maemoconfigtestdialog.ui
 | 
			
		||||
RESOURCES += $$PWD/qt-maemo.qrc
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user