Skip to content

Commit b095fd4

Browse files
committed
- Add Select-All and Deselect-All options to ExportSQL dialog menu
1 parent f33a988 commit b095fd4

File tree

3 files changed

+66
-9
lines changed

3 files changed

+66
-9
lines changed

src/ExportSqlDialog.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ ExportSqlDialog::~ExportSqlDialog()
5454
delete ui;
5555
}
5656

57+
void ExportSqlDialog::doSelectAll()
58+
{
59+
for (int i = 0; i < ui->listTables->count(); ++i)
60+
ui->listTables->item(i)->setSelected(true);
61+
}
62+
63+
void ExportSqlDialog::doDeselectAll()
64+
{
65+
for (int i = 0; i < ui->listTables->count(); ++i)
66+
ui->listTables->item(i)->setSelected(false);
67+
}
68+
5769
void ExportSqlDialog::accept()
5870
{
5971
QList<QListWidgetItem*> selectedItems = ui->listTables->selectedItems();
@@ -102,3 +114,6 @@ void ExportSqlDialog::accept()
102114

103115
QDialog::accept();
104116
}
117+
118+
119+

src/ExportSqlDialog.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class ExportSqlDialog : public QDialog
1919

2020
private slots:
2121
virtual void accept();
22+
void doSelectAll();
23+
void doDeselectAll();
2224

2325
private:
2426
Ui::ExportSqlDialog* ui;

src/ExportSqlDialog.ui

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<x>0</x>
88
<y>0</y>
99
<width>497</width>
10-
<height>300</height>
10+
<height>338</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -49,7 +49,31 @@
4949
</property>
5050
</widget>
5151
</item>
52-
<item row="1" column="0" colspan="2">
52+
<item row="1" column="1">
53+
<layout class="QHBoxLayout" name="horizontalLayout">
54+
<property name="sizeConstraint">
55+
<enum>QLayout::SetFixedSize</enum>
56+
</property>
57+
<property name="topMargin">
58+
<number>10</number>
59+
</property>
60+
<item>
61+
<widget class="QPushButton" name="buttonSelectAll">
62+
<property name="text">
63+
<string>Select All</string>
64+
</property>
65+
</widget>
66+
</item>
67+
<item>
68+
<widget class="QPushButton" name="buttonDeselectAll">
69+
<property name="text">
70+
<string>Deselect All</string>
71+
</property>
72+
</widget>
73+
</item>
74+
</layout>
75+
</item>
76+
<item row="2" column="0" colspan="2">
5377
<widget class="QGroupBox" name="groupBox">
5478
<property name="title">
5579
<string>&amp;Options</string>
@@ -121,18 +145,34 @@
121145
</hints>
122146
</connection>
123147
<connection>
124-
<sender>buttonBox</sender>
125-
<signal>rejected()</signal>
148+
<sender>buttonDeselectAll</sender>
149+
<signal>clicked()</signal>
126150
<receiver>ExportSqlDialog</receiver>
127-
<slot>reject()</slot>
151+
<slot>doDeselectAll()</slot>
128152
<hints>
129153
<hint type="sourcelabel">
130-
<x>320</x>
131-
<y>136</y>
154+
<x>20</x>
155+
<y>20</y>
132156
</hint>
133157
<hint type="destinationlabel">
134-
<x>286</x>
135-
<y>140</y>
158+
<x>20</x>
159+
<y>20</y>
160+
</hint>
161+
</hints>
162+
</connection>
163+
<connection>
164+
<sender>buttonSelectAll</sender>
165+
<signal>clicked()</signal>
166+
<receiver>ExportSqlDialog</receiver>
167+
<slot>doSelectAll()</slot>
168+
<hints>
169+
<hint type="sourcelabel">
170+
<x>20</x>
171+
<y>20</y>
172+
</hint>
173+
<hint type="destinationlabel">
174+
<x>20</x>
175+
<y>20</y>
136176
</hint>
137177
</hints>
138178
</connection>

0 commit comments

Comments
 (0)