Commit 1ef9dc31 authored by goro's avatar goro
Browse files

PathChooser migration for GDB macros page

parent f1e67fa3
......@@ -87,7 +87,6 @@ public:
void finished(bool accepted);
private slots:
void onScriptButton();
void onAddButton();
void onDelButton();
void currentItemChanged(QTreeWidgetItem *item);
......
......@@ -109,6 +109,8 @@ QWidget *TypeMacroPage::createPage(QWidget *parent)
m_widget = new QWidget(parent);
m_ui.setupUi(m_widget);
m_ui.scriptFile->setPromptDialogTitle(tr("Select Gdb Script"));
m_ui.scriptFile->setExpectedKind(Core::Utils::PathChooser::File);
connect(m_ui.addButton, SIGNAL(clicked()),
this, SLOT(onAddButton()));
......@@ -116,8 +118,8 @@ QWidget *TypeMacroPage::createPage(QWidget *parent)
connect(m_ui.delButton, SIGNAL(clicked()),
this, SLOT(onDelButton()));
connect(m_ui.scriptButton, SIGNAL(clicked()),
this, SLOT(onScriptButton()));
connect(m_ui.scriptFile, SIGNAL(validChanged()),
this, SLOT(updateButtonState()));
connect(m_ui.treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
this, SLOT(currentItemChanged(QTreeWidgetItem *)));
......@@ -139,7 +141,7 @@ QWidget *TypeMacroPage::createPage(QWidget *parent)
++i;
}
m_ui.scriptEdit->setText(m_settings->m_scriptFile);
m_ui.scriptFile->setPath(m_settings->m_scriptFile);
updateButtonState();
......@@ -152,7 +154,7 @@ void TypeMacroPage::finished(bool accepted)
return;
m_settings->m_typeMacros.clear();
m_settings->m_scriptFile = m_ui.scriptEdit->text();
m_settings->m_scriptFile = m_ui.scriptFile->path();
for (int i = 0; i < m_ui.treeWidget->topLevelItemCount(); ++i) {
QTreeWidgetItem *item = m_ui.treeWidget->topLevelItem(i);
......@@ -172,13 +174,6 @@ void TypeMacroPage::finished(bool accepted)
}
}
void TypeMacroPage::onScriptButton()
{
QString fileName = QFileDialog::getOpenFileName(m_widget, tr("Select Gdb Script"));
m_ui.scriptEdit->setText(fileName);
updateButtonState();
}
void TypeMacroPage::onAddButton()
{
if (m_ui.typeEdit->text().isEmpty() || m_ui.macroEdit->text().isEmpty())
......
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TypeMacroPage</class>
<widget class="QWidget" name="TypeMacroPage" >
<property name="geometry" >
<widget class="QWidget" name="TypeMacroPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>519</width>
<height>238</height>
<height>263</height>
</rect>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>9</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Script File</string>
</property>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>9</number>
</property>
<item>
<widget class="QLineEdit" name="scriptEdit" />
</item>
<item>
<widget class="QToolButton" name="scriptButton" >
<property name="minimumSize" >
<size>
<width>21</width>
<height>23</height>
</size>
</property>
<property name="text" >
<string>...</string>
</property>
</widget>
<widget class="Core::Utils::PathChooser" name="scriptFile" native="true"/>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QGridLayout" >
<property name="margin" >
<layout class="QGridLayout">
<property name="margin">
<number>0</number>
</property>
<property name="spacing" >
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0" colspan="2" >
<widget class="QTreeWidget" name="treeWidget" >
<property name="rootIsDecorated" >
<item row="0" column="0" colspan="2">
<widget class="QTreeWidget" name="treeWidget">
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<column>
<property name="text" >
<property name="text">
<string>Type</string>
</property>
</column>
<column>
<property name="text" >
<property name="text">
<string>Macro</string>
</property>
</column>
</widget>
</item>
<item row="1" column="2" >
<widget class="QToolButton" name="addButton" >
<property name="minimumSize" >
<item row="1" column="2">
<widget class="QToolButton" name="addButton">
<property name="minimumSize">
<size>
<width>21</width>
<height>23</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>+</string>
</property>
<property name="icon" >
<iconset resource="gdbdebugger.qrc" >:/gdbdebugger/images/newitem.png</iconset>
<property name="icon">
<iconset resource="debugger.qrc">
<normaloff>:/gdbdebugger/images/newitem.png</normaloff>:/gdbdebugger/images/newitem.png</iconset>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Macro Name:</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Parse as:</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLineEdit" name="macroEdit" />
<item row="2" column="1">
<widget class="QLineEdit" name="macroEdit"/>
</item>
<item row="0" column="2" >
<layout class="QVBoxLayout" >
<property name="margin" >
<item row="0" column="2">
<layout class="QVBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="spacing" >
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="delButton" >
<property name="minimumSize" >
<widget class="QToolButton" name="delButton">
<property name="minimumSize">
<size>
<width>21</width>
<height>23</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>-</string>
</property>
<property name="icon" >
<iconset resource="gdbdebugger.qrc" >:/gdbdebugger/images/delete.png</iconset>
<property name="icon">
<iconset resource="debugger.qrc">
<normaloff>:/gdbdebugger/images/delete.png</normaloff>:/gdbdebugger/images/delete.png</iconset>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
......@@ -150,25 +137,25 @@
</item>
</layout>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="typeEdit" />
<item row="1" column="1">
<widget class="QLineEdit" name="typeEdit"/>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Type:</string>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QComboBox" name="parseAsBox" >
<item row="3" column="1">
<widget class="QComboBox" name="parseAsBox">
<item>
<property name="text" >
<property name="text">
<string>ASCII (char *)</string>
</property>
</item>
<item>
<property name="text" >
<property name="text">
<string>Unicode (short)</string>
</property>
</item>
......@@ -178,9 +165,16 @@
</item>
</layout>
</widget>
<pixmapfunction></pixmapfunction>
<customwidgets>
<customwidget>
<class>Core::Utils::PathChooser</class>
<extends>QWidget</extends>
<header location="global">utils/pathchooser.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="gdbdebugger.qrc" />
<include location="debugger.qrc"/>
</resources>
<connections/>
</ui>
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