mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Add keyboard shortcuts for switching the currently browsed table
Add two new keyboard shortcuts for switching the currently selected table in the Browse Data tab. These work as long as the table widget is active. For now I have set them to Ctrl+PageUp and Ctrl+PageDown. See issue #536.
This commit is contained in:
@@ -225,6 +225,22 @@ void MainWindow::init()
|
||||
connect(ui->dockEdit, SIGNAL(visibilityChanged(bool)), this, SLOT(toggleEditDock(bool)));
|
||||
connect(&m_remoteDb, SIGNAL(openFile(QString)), this, SLOT(fileOpen(QString)));
|
||||
|
||||
// Lambda function for keyboard shortcuts for selecting next/previous table in Browse Data tab
|
||||
connect(ui->dataTable, &ExtendedTableWidget::switchTable, [this](bool next) {
|
||||
int index = ui->comboBrowseTable->currentIndex();
|
||||
int num_items = ui->comboBrowseTable->count();
|
||||
if(next)
|
||||
{
|
||||
if(++index >= num_items)
|
||||
index = 0;
|
||||
} else {
|
||||
if(--index < 0)
|
||||
index = num_items - 1;
|
||||
}
|
||||
ui->comboBrowseTable->setCurrentIndex(index);
|
||||
populateTable();
|
||||
});
|
||||
|
||||
// Set other window settings
|
||||
setAcceptDrops(true);
|
||||
setWindowTitle(QApplication::applicationName());
|
||||
|
||||
Reference in New Issue
Block a user