mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 19:11:39 -06:00
dbhub: Open Preferences dialog on the correct tab
When opening the Preferences dialog from the Remote dock, we now show the Remote tab by default.
This commit is contained in:
@@ -203,7 +203,8 @@ public slots:
|
||||
void jumpToRow(const sqlb::ObjectIdentifier& table, QString column, const QByteArray& value);
|
||||
void switchToBrowseDataTab(QString tableToBrowse = QString());
|
||||
void populateStructure(const QString& old_table = QString());
|
||||
void openPreferences();
|
||||
void reloadSettings();
|
||||
|
||||
|
||||
private slots:
|
||||
void createTreeContextMenu(const QPoint & qPoint);
|
||||
@@ -257,7 +258,6 @@ private slots:
|
||||
void saveSqlResultsAsCsv();
|
||||
void saveSqlResultsAsView();
|
||||
void loadExtension();
|
||||
void reloadSettings();
|
||||
void checkNewVersion(const QString& versionstring, const QString& url);
|
||||
void on_actionWiki_triggered();
|
||||
void on_actionBug_report_triggered();
|
||||
@@ -297,6 +297,7 @@ private slots:
|
||||
void runSqlNewTab(const QString& query, const QString& title);
|
||||
void printDbStructure();
|
||||
void updateDatabaseBusyStatus(bool busy, const QString& user);
|
||||
void openPreferences();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <QKeyEvent>
|
||||
#include <QStandardPaths>
|
||||
|
||||
PreferencesDialog::PreferencesDialog(QWidget* parent)
|
||||
PreferencesDialog::PreferencesDialog(QWidget* parent, Tabs tab)
|
||||
: QDialog(parent),
|
||||
ui(new Ui::PreferencesDialog),
|
||||
m_dbFileExtensions(Settings::getValue("General", "DBFileExtensions").toString().split(";;"))
|
||||
@@ -43,6 +43,9 @@ PreferencesDialog::PreferencesDialog(QWidget* parent)
|
||||
|
||||
// Avoid different heights due to having check boxes or not
|
||||
ui->treeSyntaxHighlighting->setUniformRowHeights(true);
|
||||
|
||||
// Set current tab
|
||||
ui->tabWidget->setCurrentIndex(tab);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -19,7 +19,17 @@ class PreferencesDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PreferencesDialog(QWidget* parent = nullptr);
|
||||
enum Tabs
|
||||
{
|
||||
TabGeneral,
|
||||
TabDatabase,
|
||||
TabDataBrowser,
|
||||
TabSql,
|
||||
TabExtensions,
|
||||
TabRemote
|
||||
};
|
||||
|
||||
explicit PreferencesDialog(QWidget* parent = nullptr, Tabs tab = TabGeneral);
|
||||
~PreferencesDialog() override;
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "RemoteModel.h"
|
||||
#include "MainWindow.h"
|
||||
#include "RemotePushDialog.h"
|
||||
#include "PreferencesDialog.h"
|
||||
|
||||
RemoteDock::RemoteDock(MainWindow* parent)
|
||||
: QDialog(parent),
|
||||
@@ -32,9 +33,13 @@ RemoteDock::RemoteDock(MainWindow* parent)
|
||||
// just open them in a web browser
|
||||
connect(ui->labelNoCert, &QLabel::linkActivated, [this](const QString& link) {
|
||||
if(link == "#preferences")
|
||||
mainWindow->openPreferences();
|
||||
else
|
||||
{
|
||||
PreferencesDialog dialog(mainWindow, PreferencesDialog::TabRemote);
|
||||
if(dialog.exec())
|
||||
mainWindow->reloadSettings();
|
||||
} else {
|
||||
QDesktopServices::openUrl(QUrl(link));
|
||||
}
|
||||
});
|
||||
|
||||
// Initial setup
|
||||
|
||||
Reference in New Issue
Block a user