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