Skip to content

Commit 0df0e59

Browse files
author
Jim Hamill
committed
Sort connections + more
1 parent 03cb78f commit 0df0e59

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

DatabaseConnectionWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ bool DatabaseConnectionWidget::importDatabase()
141141

142142
// Create Progress Dialog
143143
QProgressDialog progress("Importing database...", "Abort", 0, splitter.getLength());
144-
progress.setWindowModality(Qt::WindowModal);
144+
progress.setWindowModality(Qt::ApplicationModal);
145145
progress.setValue(0);
146146
progress.show();
147147

MainWindow.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ void MainWindow::on_databaseConnectionsTabWidget_currentChanged(int index)
155155
}
156156
}
157157

158+
// Disable all tools by default
159+
ui->actionImport_Database->setEnabled(false);
160+
ui->actionExport_Database->setEnabled(false);
161+
ui->actionClear_Database->setEnabled(false);
162+
158163
// Enable tools if there's a database selected
159164
if (m_currentDatabase) {
160165
ui->actionImport_Database->setEnabled(true);
@@ -163,23 +168,13 @@ void MainWindow::on_databaseConnectionsTabWidget_currentChanged(int index)
163168
if (m_currentDatabase->getExtension()) {
164169
if (m_currentDatabase->getExtension()->hasCapability(EXPORT_DATABASE)) {
165170
ui->actionExport_Database->setEnabled(true);
166-
} else {
167-
ui->actionExport_Database->setEnabled(false);
168171
}
169172

170173
if (m_currentDatabase->getExtension()->hasCapability(CLEAR_DATABASE)) {
171174
ui->actionClear_Database->setEnabled(true);
172-
} else {
173-
ui->actionClear_Database->setEnabled(false);
174175
}
175176
}
176177
}
177-
178-
// Disable tools if there's no database selected
179-
else {
180-
ui->actionImport_Database->setEnabled(false);
181-
ui->actionExport_Database->setEnabled(false);
182-
}
183178
}
184179

185180
void MainWindow::on_actionClose_Connection_triggered()

OpenConnectionDialog.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ void OpenConnectionDialog::reloadConnections()
240240
ui->connectionsListWidget->addItem(connection->name);
241241
}
242242
settings.endArray();
243+
244+
ui->connectionsListWidget->sortItems();
243245
}
244246

245247
void OpenConnectionDialog::on_removeButton_clicked()

0 commit comments

Comments
 (0)