forked from qt-creator/qt-creator
re-organizize gdb location selection again
This commit is contained in:
@@ -88,11 +88,15 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
|
|||||||
{
|
{
|
||||||
QWidget *w = new QWidget(parent);
|
QWidget *w = new QWidget(parent);
|
||||||
m_ui.setupUi(w);
|
m_ui.setupUi(w);
|
||||||
m_ui.gdbLocationEdit->setText(m_settings->m_gdbCmd);
|
m_ui.gdbLocationChooser->setExpectedKind(Core::Utils::PathChooser::Command);
|
||||||
|
m_ui.gdbLocationChooser->setPromptDialogTitle(tr("Choose Gdb Location"));
|
||||||
|
m_ui.gdbLocationChooser->setPath(m_settings->m_gdbCmd);
|
||||||
|
m_ui.scriptFileChooser->setExpectedKind(Core::Utils::PathChooser::File);
|
||||||
|
m_ui.scriptFileChooser->setPromptDialogTitle(tr("Choose Location of Startup Script File"));
|
||||||
|
m_ui.scriptFileChooser->setPath(m_settings->m_scriptFile);
|
||||||
m_ui.environmentEdit->setText(m_settings->m_gdbEnv);
|
m_ui.environmentEdit->setText(m_settings->m_gdbEnv);
|
||||||
m_ui.autoStartBox->setChecked(m_settings->m_autoRun);
|
m_ui.autoStartBox->setChecked(m_settings->m_autoRun);
|
||||||
m_ui.autoQuitBox->setChecked(m_settings->m_autoQuit);
|
m_ui.autoQuitBox->setChecked(m_settings->m_autoQuit);
|
||||||
m_ui.gdbStartupScriptEdit->setText(m_settings->m_scriptFile);
|
|
||||||
|
|
||||||
// FIXME
|
// FIXME
|
||||||
m_ui.autoStartBox->hide();
|
m_ui.autoStartBox->hide();
|
||||||
@@ -100,32 +104,22 @@ QWidget *GdbOptionPage::createPage(QWidget *parent)
|
|||||||
m_ui.environmentEdit->hide();
|
m_ui.environmentEdit->hide();
|
||||||
m_ui.labelEnvironment->hide();
|
m_ui.labelEnvironment->hide();
|
||||||
|
|
||||||
connect(m_ui.browseForGdbButton, SIGNAL(clicked()),
|
connect(m_ui.gdbLocationChooser, SIGNAL(changed()),
|
||||||
this, SLOT(browseForGdb()));
|
this, SLOT(onGdbLocationChanged()));
|
||||||
connect(m_ui.browseForScriptButton, SIGNAL(clicked()),
|
connect(m_ui.scriptFileChooser, SIGNAL(changed()),
|
||||||
this, SLOT(browseForScript()));
|
this, SLOT(onScriptFileChanged()));
|
||||||
|
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbOptionPage::browseForGdb()
|
void GdbOptionPage::onGdbLocationChanged()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getOpenFileName(m_ui.browseForGdbButton,
|
m_settings->m_gdbCmd = m_ui.gdbLocationChooser->path();
|
||||||
"Browse for gdb executable");
|
|
||||||
if (fileName.isEmpty())
|
|
||||||
return;
|
|
||||||
m_settings->m_gdbCmd = fileName;
|
|
||||||
m_ui.gdbLocationEdit->setText(fileName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbOptionPage::browseForScript()
|
void GdbOptionPage::onScriptFileChanged()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getOpenFileName(m_ui.browseForGdbButton,
|
m_settings->m_scriptFile = m_ui.scriptFileChooser->path();
|
||||||
"Browse for gdb startup script");
|
|
||||||
if (fileName.isEmpty())
|
|
||||||
return;
|
|
||||||
m_settings->m_scriptFile = fileName;
|
|
||||||
m_ui.gdbStartupScriptEdit->setText(fileName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbOptionPage::finished(bool accepted)
|
void GdbOptionPage::finished(bool accepted)
|
||||||
@@ -133,11 +127,11 @@ void GdbOptionPage::finished(bool accepted)
|
|||||||
if (!accepted)
|
if (!accepted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_settings->m_gdbCmd = m_ui.gdbLocationEdit->text();
|
m_settings->m_gdbCmd = m_ui.gdbLocationChooser->path();
|
||||||
m_settings->m_gdbEnv = m_ui.environmentEdit->text();
|
m_settings->m_gdbEnv = m_ui.environmentEdit->text();
|
||||||
m_settings->m_autoRun = m_ui.autoStartBox->isChecked();
|
m_settings->m_autoRun = m_ui.autoStartBox->isChecked();
|
||||||
m_settings->m_autoQuit = m_ui.autoQuitBox->isChecked();
|
m_settings->m_autoQuit = m_ui.autoQuitBox->isChecked();
|
||||||
m_settings->m_scriptFile = m_ui.gdbStartupScriptEdit->text();
|
m_settings->m_scriptFile = m_ui.scriptFileChooser->path();
|
||||||
|
|
||||||
Core::ICore *coreIFace = m_pm->getObject<Core::ICore>();
|
Core::ICore *coreIFace = m_pm->getObject<Core::ICore>();
|
||||||
if (!coreIFace || !coreIFace->settings())
|
if (!coreIFace || !coreIFace->settings())
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ public:
|
|||||||
void finished(bool accepted);
|
void finished(bool accepted);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void browseForGdb();
|
void onGdbLocationChanged();
|
||||||
void browseForScript();
|
void onScriptFileChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ExtensionSystem::PluginManager *m_pm;
|
ExtensionSystem::PluginManager *m_pm;
|
||||||
|
|||||||
@@ -32,10 +32,7 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QLineEdit" name="gdbLocationEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1" colspan="2">
|
|
||||||
<widget class="QLineEdit" name="environmentEdit"/>
|
<widget class="QLineEdit" name="environmentEdit"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
@@ -46,9 +43,6 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Gdb Location:</string>
|
<string>Gdb Location:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
|
||||||
<cstring>gdbLocationEdit</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
@@ -61,40 +55,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="QPushButton" name="browseForGdbButton">
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../coreplugin/core.qrc">
|
|
||||||
<normaloff>:/qworkbench/images/fileopen.png</normaloff>:/qworkbench/images/fileopen.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLineEdit" name="gdbStartupScriptEdit"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="2">
|
|
||||||
<widget class="QToolButton" name="browseForScriptButton">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>21</width>
|
|
||||||
<height>23</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../coreplugin/core.qrc">
|
|
||||||
<normaloff>:/qworkbench/images/fileopen.png</normaloff>:/qworkbench/images/fileopen.png</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="labelGdbStartupScript">
|
<widget class="QLabel" name="labelGdbStartupScript">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@@ -105,6 +65,12 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="Core::Utils::PathChooser" name="scriptFileChooser" native="true"/>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="Core::Utils::PathChooser" name="gdbLocationChooser" native="true"/>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -137,6 +103,14 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>Core::Utils::PathChooser</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header location="global">utils/pathchooser.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../coreplugin/core.qrc"/>
|
<include location="../coreplugin/core.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user