Commit 7a38a435 authored by hjk's avatar hjk

debugger: attempt to use Utils::PathChooser when changeing breakpoint file

names

Also remove the dead fields from breakcondition.ui

Reviewed-by: Friedemann Kleint
parent 702b5903
...@@ -14,63 +14,43 @@ ...@@ -14,63 +14,43 @@
<item> <item>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelFileName">
<property name="text">
<string>File name:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditFileName"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelLineNumber">
<property name="text">
<string>Line number:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditLineNumber"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelFunction"> <widget class="QLabel" name="labelFunction">
<property name="text"> <property name="text">
<string>Function:</string> <string>Function:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="lineEditFunction"/> <widget class="QLineEdit" name="lineEditFunction"/>
</item> </item>
<item row="3" column="0"> <item row="1" column="0">
<widget class="QLabel" name="labelCondition"> <widget class="QLabel" name="labelCondition">
<property name="text"> <property name="text">
<string>Condition:</string> <string>Condition:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="1" column="1">
<widget class="QLineEdit" name="lineEditCondition"/> <widget class="QLineEdit" name="lineEditCondition"/>
</item> </item>
<item row="4" column="0"> <item row="2" column="0">
<widget class="QLabel" name="labelIgnoreCount"> <widget class="QLabel" name="labelIgnoreCount">
<property name="text"> <property name="text">
<string>Ignore count:</string> <string>Ignore count:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="2" column="1">
<widget class="QLineEdit" name="lineEditIgnoreCount"/> <widget class="QLineEdit" name="lineEditIgnoreCount"/>
</item> </item>
<item row="5" column="0"> <item row="3" column="0">
<widget class="QLabel" name="labelThreadSpec"> <widget class="QLabel" name="labelThreadSpec">
<property name="text"> <property name="text">
<string>Thread specification:</string> <string>Thread specification:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="3" column="1">
<widget class="QLineEdit" name="lineEditThreadSpec"/> <widget class="QLineEdit" name="lineEditThreadSpec"/>
</item> </item>
</layout> </layout>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QLineEdit" name="lineEditFileName"/> <widget class="Utils::PathChooser" name="pathChooserFileName"/>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="labelLineNumber"> <widget class="QLabel" name="labelLineNumber">
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "ui_breakcondition.h" #include "ui_breakcondition.h"
#include "ui_breakbyfunction.h" #include "ui_breakbyfunction.h"
#include <utils/pathchooser.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/savedaction.h> #include <utils/savedaction.h>
...@@ -72,7 +73,8 @@ public: ...@@ -72,7 +73,8 @@ public:
comboBoxType->insertItem(1, tr("Function Name")); comboBoxType->insertItem(1, tr("Function Name"));
comboBoxType->insertItem(2, tr("Function \"main()\"")); comboBoxType->insertItem(2, tr("Function \"main()\""));
comboBoxType->insertItem(3, tr("Address")); comboBoxType->insertItem(3, tr("Address"));
lineEditFileName->setText(data->fileName); pathChooserFileName->lineEdit()->setText(data->fileName);
pathChooserFileName->setExpectedKind(Utils::PathChooser::File);
lineEditLineNumber->setText(QByteArray::number(data->lineNumber)); lineEditLineNumber->setText(QByteArray::number(data->lineNumber));
lineEditFunction->setText(data->funcName); lineEditFunction->setText(data->funcName);
lineEditCondition->setText(data->condition); lineEditCondition->setText(data->condition);
...@@ -96,7 +98,7 @@ public slots: ...@@ -96,7 +98,7 @@ public slots:
const bool isFunctionVisible = index == 1; const bool isFunctionVisible = index == 1;
const bool isAddressVisible = index == 3; const bool isAddressVisible = index == 3;
labelFileName->setEnabled(isLineVisible); labelFileName->setEnabled(isLineVisible);
lineEditFileName->setEnabled(isLineVisible); pathChooserFileName->setEnabled(isLineVisible);
labelLineNumber->setEnabled(isLineVisible); labelLineNumber->setEnabled(isLineVisible);
lineEditLineNumber->setEnabled(isLineVisible); lineEditLineNumber->setEnabled(isLineVisible);
labelUseFullPath->setEnabled(isLineVisible); labelUseFullPath->setEnabled(isLineVisible);
...@@ -381,16 +383,16 @@ bool BreakWindow::editBreakpoint(BreakpointData *data) ...@@ -381,16 +383,16 @@ bool BreakWindow::editBreakpoint(BreakpointData *data)
if (dialog.exec() == QDialog::Rejected) if (dialog.exec() == QDialog::Rejected)
return false; return false;
bool ok = false; bool ok = false;
data->lineNumber = dialog.lineEditLineNumber->text().toInt();
data->useFullPath = dialog.checkBoxUseFullPath->isChecked();
if (!dialog.lineEditAddress->text().isEmpty()) if (!dialog.lineEditAddress->text().isEmpty())
data->address = dialog.lineEditAddress->text().toULongLong(&ok, 0); data->address = dialog.lineEditAddress->text().toULongLong(&ok, 0);
if (!dialog.lineEditFunction->text().isEmpty()) if (!dialog.lineEditFunction->text().isEmpty())
data->funcName = dialog.lineEditFunction->text(); data->funcName = dialog.lineEditFunction->text();
if (!dialog.lineEditFunction->text().isEmpty()) if (!dialog.lineEditFunction->text().isEmpty())
data->funcName = dialog.lineEditFunction->text(); data->funcName = dialog.lineEditFunction->text();
if (!dialog.lineEditFileName->text().isEmpty()) if (!dialog.pathChooserFileName->path().isEmpty())
data->fileName = dialog.lineEditFileName->text(); data->fileName = dialog.pathChooserFileName->lineEdit()->text();
data->lineNumber = dialog.lineEditLineNumber->text().toInt();
data->useFullPath = dialog.checkBoxUseFullPath->isChecked();
if (!dialog.lineEditCondition->text().isEmpty()) if (!dialog.lineEditCondition->text().isEmpty())
data->condition = dialog.lineEditCondition->text().toUtf8(); data->condition = dialog.lineEditCondition->text().toUtf8();
if (!dialog.lineEditIgnoreCount->text().isEmpty()) if (!dialog.lineEditIgnoreCount->text().isEmpty())
...@@ -429,10 +431,6 @@ void BreakWindow::editBreakpoints(const QModelIndexList &list) ...@@ -429,10 +431,6 @@ void BreakWindow::editBreakpoints(const QModelIndexList &list)
dlg.setWindowTitle(tr("Edit Breakpoint Properties")); dlg.setWindowTitle(tr("Edit Breakpoint Properties"));
ui.lineEditFunction->hide(); ui.lineEditFunction->hide();
ui.labelFunction->hide(); ui.labelFunction->hide();
ui.lineEditFileName->hide();
ui.labelFileName->hide();
ui.lineEditLineNumber->hide();
ui.labelLineNumber->hide();
QAbstractItemModel *m = model(); QAbstractItemModel *m = model();
ui.lineEditCondition->setText( ui.lineEditCondition->setText(
m->data(idx, BreakpointConditionRole).toString()); m->data(idx, BreakpointConditionRole).toString());
...@@ -448,7 +446,7 @@ void BreakWindow::editBreakpoints(const QModelIndexList &list) ...@@ -448,7 +446,7 @@ void BreakWindow::editBreakpoints(const QModelIndexList &list)
foreach (const QModelIndex &idx, list) { foreach (const QModelIndex &idx, list) {
//m->setData(idx.sibling(idx.row(), 1), ui.lineEditFunction->text()); //m->setData(idx.sibling(idx.row(), 1), ui.lineEditFunction->text());
//m->setData(idx.sibling(idx.row(), 2), ui.lineEditFileName->text()); //m->setData(idx.sibling(idx.row(), 2), ui.pathChooserFileName->text());
//m->setData(idx.sibling(idx.row(), 3), ui.lineEditLineNumber->text()); //m->setData(idx.sibling(idx.row(), 3), ui.lineEditLineNumber->text());
m->setData(idx, ui.lineEditCondition->text(), BreakpointConditionRole); m->setData(idx, ui.lineEditCondition->text(), BreakpointConditionRole);
m->setData(idx, ui.lineEditIgnoreCount->text(), BreakpointIgnoreCountRole); m->setData(idx, ui.lineEditIgnoreCount->text(), BreakpointIgnoreCountRole);
......
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