mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-21 03:21:43 -06:00
Add command line option for setting table to browse after opening
Add a new command line option -t/--table for directly jumping to a table after opening the database. See issue #509.
This commit is contained in:
@@ -2271,12 +2271,17 @@ void MainWindow::editEncryption()
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::switchToBrowseDataTab()
|
||||
void MainWindow::switchToBrowseDataTab(QString tableToBrowse)
|
||||
{
|
||||
if(!ui->dbTreeWidget->selectionModel()->hasSelection())
|
||||
return;
|
||||
// If no table name was provided get the currently selected table fromt he structure tab
|
||||
if(tableToBrowse.isEmpty())
|
||||
{
|
||||
// Cancel here if there is no selection
|
||||
if(!ui->dbTreeWidget->selectionModel()->hasSelection())
|
||||
return;
|
||||
|
||||
QString tableToBrowse = ui->dbTreeWidget->model()->data(ui->dbTreeWidget->currentIndex().sibling(ui->dbTreeWidget->currentIndex().row(), 0)).toString();
|
||||
tableToBrowse = ui->dbTreeWidget->model()->data(ui->dbTreeWidget->currentIndex().sibling(ui->dbTreeWidget->currentIndex().row(), 0)).toString();
|
||||
}
|
||||
|
||||
resetBrowser(false);
|
||||
ui->comboBrowseTable->setCurrentIndex(ui->comboBrowseTable->findText(tableToBrowse));
|
||||
|
||||
Reference in New Issue
Block a user