diff options
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp index ca3fd31..7861ff0 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/populatedialog.cpp @@ -51,7 +51,9 @@ void PopulateDialog::init() pluginTitles << plugin->getTitle(); widgetCover = new WidgetCover(this); + widgetCover->initWithInterruptContainer(tr("Abort")); widgetCover->setVisible(false); + connect(widgetCover, SIGNAL(cancelClicked()), POPULATE_MANAGER, SLOT(interrupt())); ui->scrollArea->setAutoFillBackground(false); ui->scrollArea->viewport()->setAutoFillBackground(false); @@ -71,6 +73,7 @@ void PopulateDialog::init() connect(ui->databaseCombo, SIGNAL(currentTextChanged(QString)), this, SLOT(refreshTables())); connect(ui->tableCombo, SIGNAL(currentTextChanged(QString)), this, SLOT(refreshColumns())); connect(POPULATE_MANAGER, SIGNAL(populatingFinished()), widgetCover, SLOT(hide())); + connect(POPULATE_MANAGER, SIGNAL(finishedStep(int)), widgetCover, SLOT(setProgress(int))); connect(POPULATE_MANAGER, SIGNAL(populatingSuccessful()), this, SLOT(finished())); } @@ -317,10 +320,20 @@ void PopulateDialog::accept() QString table = ui->tableCombo->currentText(); qint64 rows = ui->rowsSpin->value(); + started = true; + widgetCover->displayProgress(rows, "%v / %m"); widgetCover->show(); POPULATE_MANAGER->populate(db, table, engines, rows); } +void PopulateDialog::reject() +{ + if (started) + POPULATE_MANAGER->interrupt(); + + QDialog::reject(); +} + PopulateDialog::ColumnEntry::ColumnEntry(QCheckBox* check, QComboBox* combo, QToolButton* button) : check(check), combo(combo), button(button) { |
