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,7 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<author></author>
|
|
||||||
<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">
|
||||||
@@ -9,46 +7,33 @@
|
|||||||
<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" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
<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" >
|
|
||||||
<number>9</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<property name="margin">
|
||||||
<widget class="QLineEdit" name="scriptEdit" />
|
<number>9</number>
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="scriptButton" >
|
|
||||||
<property name="minimumSize" >
|
|
||||||
<size>
|
|
||||||
<width>21</width>
|
|
||||||
<height>23</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<item>
|
||||||
<string>...</string>
|
<widget class="Core::Utils::PathChooser" name="scriptFile" native="true"/>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -90,7 +75,8 @@
|
|||||||
<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>
|
||||||
@@ -113,10 +99,10 @@
|
|||||||
</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>
|
||||||
@@ -131,7 +117,8 @@
|
|||||||
<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>
|
||||||
@@ -140,7 +127,7 @@
|
|||||||
<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>
|
||||||
@@ -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