From b095fd4f7053ee4c562084362be43765ff619671 Mon Sep 17 00:00:00 2001 From: James Wierzba Date: Wed, 30 Mar 2016 09:56:57 -0600 Subject: [PATCH] - Add Select-All and Deselect-All options to ExportSQL dialog menu --- src/ExportSqlDialog.cpp | 15 +++++++++++ src/ExportSqlDialog.h | 2 ++ src/ExportSqlDialog.ui | 58 ++++++++++++++++++++++++++++++++++------- 3 files changed, 66 insertions(+), 9 deletions(-) diff --git a/src/ExportSqlDialog.cpp b/src/ExportSqlDialog.cpp index 173ba12a..71dceacb 100644 --- a/src/ExportSqlDialog.cpp +++ b/src/ExportSqlDialog.cpp @@ -54,6 +54,18 @@ ExportSqlDialog::~ExportSqlDialog() delete ui; } +void ExportSqlDialog::doSelectAll() +{ + for (int i = 0; i < ui->listTables->count(); ++i) + ui->listTables->item(i)->setSelected(true); +} + +void ExportSqlDialog::doDeselectAll() +{ + for (int i = 0; i < ui->listTables->count(); ++i) + ui->listTables->item(i)->setSelected(false); +} + void ExportSqlDialog::accept() { QList selectedItems = ui->listTables->selectedItems(); @@ -102,3 +114,6 @@ void ExportSqlDialog::accept() QDialog::accept(); } + + + diff --git a/src/ExportSqlDialog.h b/src/ExportSqlDialog.h index 51ee6141..02e7abae 100644 --- a/src/ExportSqlDialog.h +++ b/src/ExportSqlDialog.h @@ -19,6 +19,8 @@ public: private slots: virtual void accept(); + void doSelectAll(); + void doDeselectAll(); private: Ui::ExportSqlDialog* ui; diff --git a/src/ExportSqlDialog.ui b/src/ExportSqlDialog.ui index fdad1afd..ea09d5a9 100644 --- a/src/ExportSqlDialog.ui +++ b/src/ExportSqlDialog.ui @@ -7,7 +7,7 @@ 0 0 497 - 300 + 338 @@ -49,7 +49,31 @@ - + + + + QLayout::SetFixedSize + + + 10 + + + + + Select All + + + + + + + Deselect All + + + + + + &Options @@ -121,18 +145,34 @@ - buttonBox - rejected() + buttonDeselectAll + clicked() ExportSqlDialog - reject() + doDeselectAll() - 320 - 136 + 20 + 20 - 286 - 140 + 20 + 20 + + + + + buttonSelectAll + clicked() + ExportSqlDialog + doSelectAll() + + + 20 + 20 + + + 20 + 20