mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 10:20:17 -06:00
Add placeholder File → Remote submenu + basic Preferences options
This commit is contained in:
@@ -184,7 +184,7 @@ void MainWindow::init()
|
||||
// Add keyboard shortcut for "Edit Cell" dock
|
||||
ui->viewMenu->actions().at(3)->setShortcut(QKeySequence(tr("Ctrl+E")));
|
||||
|
||||
// If we're not compiling in SQLCipher, hide it's FAQ link in the help menu
|
||||
// If we're not compiling in SQLCipher, hide its FAQ link in the help menu
|
||||
#ifndef ENABLE_SQLCIPHER
|
||||
ui->actionSqlCipherFaq->setVisible(false);
|
||||
#endif
|
||||
@@ -1674,6 +1674,10 @@ void MainWindow::reloadSettings()
|
||||
// Refresh view
|
||||
populateStructure();
|
||||
populateTable();
|
||||
|
||||
// Hide or show the File → Remote menu as needed
|
||||
QAction *remoteMenuAction = ui->menuRemote->menuAction();
|
||||
remoteMenuAction->setVisible(Settings::getSettingsValue("MainWindow", "remotemenu").toBool());
|
||||
}
|
||||
|
||||
void MainWindow::httpresponse(QNetworkReply *reply)
|
||||
@@ -2052,6 +2056,16 @@ void MainWindow::on_butSavePlot_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionOpen_Remote_triggered()
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl("https://dbhub.io"));
|
||||
}
|
||||
|
||||
void MainWindow::on_actionSave_Remote_triggered()
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl("https://dbhub.io"));
|
||||
}
|
||||
|
||||
void MainWindow::on_actionWiki_triggered()
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl("https://github.com/sqlitebrowser/sqlitebrowser/wiki"));
|
||||
|
||||
@@ -199,6 +199,8 @@ private slots:
|
||||
void exportTableToJson();
|
||||
void fileSave();
|
||||
void fileRevert();
|
||||
void on_actionOpen_Remote_triggered();
|
||||
void on_actionSave_Remote_triggered();
|
||||
void exportDatabaseToSQL();
|
||||
void importDatabaseFromSQL();
|
||||
void openPreferences();
|
||||
|
||||
@@ -845,11 +845,20 @@
|
||||
<addaction name="fileExportCSVAction"/>
|
||||
<addaction name="fileExportJsonAction"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuRemote">
|
||||
<property name="title">
|
||||
<string>Remote</string>
|
||||
</property>
|
||||
<addaction name="actionOpen_Remote"/>
|
||||
<addaction name="actionSave_Remote"/>
|
||||
</widget>
|
||||
<addaction name="fileNewAction"/>
|
||||
<addaction name="fileOpenAction"/>
|
||||
<addaction name="fileAttachAction"/>
|
||||
<addaction name="fileCloseAction"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menuRemote"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="fileSaveAction"/>
|
||||
<addaction name="fileRevertAction"/>
|
||||
<addaction name="fileCompactAction"/>
|
||||
@@ -1958,6 +1967,16 @@
|
||||
<enum>QAction::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionOpen_Remote">
|
||||
<property name="text">
|
||||
<string>Open from Remote</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSave_Remote">
|
||||
<property name="text">
|
||||
<string>Save to Remote</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
||||
@@ -59,6 +59,7 @@ void PreferencesDialog::loadSettings()
|
||||
ui->comboDefaultLocation->setCurrentIndex(Settings::getSettingsValue("db", "savedefaultlocation").toInt());
|
||||
ui->locationEdit->setText(Settings::getSettingsValue("db", "defaultlocation").toString());
|
||||
ui->checkUpdates->setChecked(Settings::getSettingsValue("checkversion", "enabled").toBool());
|
||||
ui->checkUseRemotes->setChecked(Settings::getSettingsValue("MainWindow", "remotemenu").toBool());
|
||||
ui->checkHideSchemaLinebreaks->setChecked(Settings::getSettingsValue("db", "hideschemalinebreaks").toBool());
|
||||
ui->foreignKeysCheckBox->setChecked(Settings::getSettingsValue("db", "foreignkeys").toBool());
|
||||
ui->spinPrefetchSize->setValue(Settings::getSettingsValue("db", "prefetchsize").toInt());
|
||||
@@ -137,6 +138,7 @@ void PreferencesDialog::saveSettings()
|
||||
|
||||
Settings::setSettingsValue("db", "defaultfieldtype", ui->defaultFieldTypeComboBox->currentIndex());
|
||||
|
||||
Settings::setSettingsValue("MainWindow", "remotemenu", ui->checkUseRemotes->isChecked());
|
||||
Settings::setSettingsValue("checkversion", "enabled", ui->checkUpdates->isChecked());
|
||||
|
||||
Settings::setSettingsValue("databrowser", "font", ui->comboDataBrowserFont->currentText());
|
||||
|
||||
@@ -26,120 +26,180 @@
|
||||
<attribute name="title">
|
||||
<string>&General</string>
|
||||
</attribute>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<item row="1" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboDefaultLocation">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Remember last location</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Always use this location</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Remember last location for session only</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="locationEdit">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>316</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="setLocationButton">
|
||||
<widget class="QWidget" name="formLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>32</x>
|
||||
<y>20</y>
|
||||
<width>503</width>
|
||||
<height>251</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Default &location</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>locationEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboDefaultLocation">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
<string>Remember last location</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Default &location</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>locationEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Lan&guage</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>languageComboBox</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="languageComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="minimumContentsLength">
|
||||
<number>35</number>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>15</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="labelUpdates">
|
||||
<property name="text">
|
||||
<string>Automatic &updates</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>checkUpdates</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="checkUpdates">
|
||||
<property name="text">
|
||||
<string>enabled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Always use this location</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Remember last location for session only</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="locationEdit">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>316</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="setLocationButton">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Lan&guage</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>languageComboBox</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelUseRemotes">
|
||||
<property name="text">
|
||||
<string>Show remote options</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="labelUpdates">
|
||||
<property name="text">
|
||||
<string>Automatic &updates</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>checkUpdates</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="checkUpdates">
|
||||
<property name="text">
|
||||
<string>enabled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="languageComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="minimumContentsLength">
|
||||
<number>35</number>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>15</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkUseRemotes">
|
||||
<property name="text">
|
||||
<string>enabled</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelRemoteServer">
|
||||
<property name="text">
|
||||
<string>Remote server</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboRemoteServer">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>dbhub.io</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
@@ -1012,12 +1072,10 @@
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>comboDefaultLocation</tabstop>
|
||||
<tabstop>locationEdit</tabstop>
|
||||
<tabstop>setLocationButton</tabstop>
|
||||
<tabstop>languageComboBox</tabstop>
|
||||
<tabstop>checkUpdates</tabstop>
|
||||
<tabstop>encodingComboBox</tabstop>
|
||||
<tabstop>foreignKeysCheckBox</tabstop>
|
||||
<tabstop>checkHideSchemaLinebreaks</tabstop>
|
||||
|
||||
@@ -101,6 +101,10 @@ QVariant Settings::getSettingsDefaultValue(const QString& group, const QString&
|
||||
if(group == "MainWindow" && name == "windowState")
|
||||
return "";
|
||||
|
||||
// Enable the File → Remote menu by default
|
||||
if(group == "MainWindow" && name == "remotemenu")
|
||||
return true;
|
||||
|
||||
// SQLLogDock/Log?
|
||||
if(group == "SQLLogDock" && name == "Log")
|
||||
return "Application";
|
||||
|
||||
Reference in New Issue
Block a user