mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
ExportCsvDialog: Set table selection to current table in Browse Data tab
When called while the Browse Data tab of the main window is selected also select the current table or view in the ExportCsvDialog. Sort the table names in the combobox of the ExportCsvDialog.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include <QMessageBox>
|
||||
#include <QFileDialog>
|
||||
|
||||
ExportCsvDialog::ExportCsvDialog(DBBrowserDB* db, QWidget* parent, const QString& query)
|
||||
ExportCsvDialog::ExportCsvDialog(DBBrowserDB* db, QWidget* parent, const QString& query, const QString& selection)
|
||||
: QDialog(parent),
|
||||
ui(new Ui::ExportCsvDialog),
|
||||
pdb(db),
|
||||
@@ -25,6 +25,13 @@ ExportCsvDialog::ExportCsvDialog(DBBrowserDB* db, QWidget* parent, const QString
|
||||
objectMap objects = pdb->getBrowsableObjects();
|
||||
for(objectMap::ConstIterator i=objects.begin();i!=objects.end();++i)
|
||||
ui->comboTable->addItem(QIcon(QString(":icons/%1").arg(i.value().gettype())), i.value().getname());
|
||||
|
||||
// Sort list of tables and select the table specified in the selection parameter or alternatively the first one
|
||||
ui->comboTable->model()->sort(0);
|
||||
if(selection.isEmpty())
|
||||
ui->comboTable->setCurrentIndex(0);
|
||||
else
|
||||
ui->comboTable->setCurrentIndex(ui->comboTable->findText(selection));
|
||||
} else {
|
||||
// Hide table combo box
|
||||
ui->labelTable->setVisible(false);
|
||||
|
||||
Reference in New Issue
Block a user