1378 lines
47 KiB
Diff
1378 lines
47 KiB
Diff
--- a/CMakeLists.txt 2022-08-14 21:30:30.000000000 +0200
|
|
+++ b/CMakeLists.txt 2022-08-14 21:41:32.823917728 +0200
|
|
@@ -152,12 +152,8 @@
|
|
src/FileDialog.h
|
|
src/ColumnDisplayFormatDialog.h
|
|
src/FilterLineEdit.h
|
|
- src/RemoteDatabase.h
|
|
src/ForeignKeyEditorDelegate.h
|
|
src/PlotDock.h
|
|
- src/RemoteDock.h
|
|
- src/RemoteModel.h
|
|
- src/RemotePushDialog.h
|
|
src/FindReplaceDialog.h
|
|
src/ExtendedScintilla.h
|
|
src/FileExtensionManager.h
|
|
@@ -170,9 +166,6 @@
|
|
src/ProxyDialog.h
|
|
src/SelectItemsPopup.h
|
|
src/TableBrowser.h
|
|
- src/RemoteLocalFilesModel.h
|
|
- src/RemoteCommitsModel.h
|
|
- src/RemoteNetwork.h
|
|
)
|
|
|
|
set(SQLB_SRC
|
|
@@ -208,12 +201,8 @@
|
|
src/FileDialog.cpp
|
|
src/ColumnDisplayFormatDialog.cpp
|
|
src/FilterLineEdit.cpp
|
|
- src/RemoteDatabase.cpp
|
|
src/ForeignKeyEditorDelegate.cpp
|
|
src/PlotDock.cpp
|
|
- src/RemoteDock.cpp
|
|
- src/RemoteModel.cpp
|
|
- src/RemotePushDialog.cpp
|
|
src/FindReplaceDialog.cpp
|
|
src/ExtendedScintilla.cpp
|
|
src/FileExtensionManager.cpp
|
|
@@ -231,9 +220,6 @@
|
|
src/sql/parser/ParserDriver.cpp
|
|
src/sql/parser/sqlite3_lexer.cpp
|
|
src/sql/parser/sqlite3_parser.cpp
|
|
- src/RemoteLocalFilesModel.cpp
|
|
- src/RemoteCommitsModel.cpp
|
|
- src/RemoteNetwork.cpp
|
|
)
|
|
|
|
set(SQLB_FORMS
|
|
@@ -252,8 +238,6 @@
|
|
src/ExportSqlDialog.ui
|
|
src/ColumnDisplayFormatDialog.ui
|
|
src/PlotDock.ui
|
|
- src/RemoteDock.ui
|
|
- src/RemotePushDialog.ui
|
|
src/FindReplaceDialog.ui
|
|
src/FileExtensionManager.ui
|
|
src/CondFormatManager.ui
|
|
--- a/src/MainWindow.cpp 2020-10-17 05:19:03.000000000 +0200
|
|
+++ b/src/MainWindow.cpp 2022-08-14 21:52:00.006584753 +0200
|
|
@@ -21,7 +21,6 @@
|
|
#include "SqlUiLexer.h"
|
|
#include "FileDialog.h"
|
|
#include "FilterTableHeader.h"
|
|
-#include "RemoteDock.h"
|
|
#include "FindReplaceDialog.h"
|
|
#include "RunSql.h"
|
|
#include "ExtendedTableWidget.h"
|
|
@@ -94,7 +93,6 @@
|
|
db(),
|
|
editDock(new EditDialog(this)),
|
|
plotDock(new PlotDock(this)),
|
|
- remoteDock(new RemoteDock(this)),
|
|
findReplaceDialog(new FindReplaceDialog(this)),
|
|
execute_sql_worker(nullptr),
|
|
isProjectModified(false)
|
|
@@ -116,7 +114,6 @@
|
|
// Load window settings
|
|
tabifyDockWidget(ui->dockLog, ui->dockPlot);
|
|
tabifyDockWidget(ui->dockLog, ui->dockSchema);
|
|
- tabifyDockWidget(ui->dockLog, ui->dockRemote);
|
|
|
|
#ifdef Q_OS_MACX
|
|
// Add OpenGL Context for macOS
|
|
@@ -125,26 +122,6 @@
|
|
ogl->setHidden(true);
|
|
#endif
|
|
|
|
- // Automatic update check
|
|
-#ifdef CHECKNEWVERSION
|
|
- connect(&RemoteNetwork::get(), &RemoteNetwork::networkReady, [this]() {
|
|
- // Check for a new version if automatic update check aren't disabled in the settings dialog
|
|
- if(Settings::getValue("checkversion", "enabled").toBool())
|
|
- {
|
|
- RemoteNetwork::get().fetch(QUrl("https://download.sqlitebrowser.org/currentrelease"), RemoteNetwork::RequestTypeCustom,
|
|
- QString(), [this](const QByteArray& reply) {
|
|
- QList<QByteArray> info = reply.split('\n');
|
|
- if(info.size() >= 2)
|
|
- {
|
|
- QString version = info.at(0).trimmed();
|
|
- QString url = info.at(1).trimmed();
|
|
- checkNewVersion(version, url);
|
|
- }
|
|
- });
|
|
- }
|
|
- });
|
|
-#endif
|
|
-
|
|
// Connect SQL logging and database state setting to main window
|
|
connect(&db, &DBBrowserDB::dbChanged, this, &MainWindow::dbState, Qt::QueuedConnection);
|
|
connect(&db, &DBBrowserDB::sqlExecuted, this, &MainWindow::logSql, Qt::QueuedConnection);
|
|
@@ -195,7 +172,6 @@
|
|
// Create docks
|
|
ui->dockEdit->setWidget(editDock);
|
|
ui->dockPlot->setWidget(plotDock);
|
|
- ui->dockRemote->setWidget(remoteDock);
|
|
|
|
// Set up edit dock
|
|
editDock->setReadOnly(true);
|
|
@@ -291,10 +267,6 @@
|
|
ui->viewMenu->actions().at(3)->setShortcut(QKeySequence(tr("Ctrl+E")));
|
|
ui->viewMenu->actions().at(3)->setIcon(QIcon(":/icons/log_dock"));
|
|
|
|
- // Add menu item for plot dock
|
|
- ui->viewMenu->insertAction(ui->viewDBToolbarAction, ui->dockRemote->toggleViewAction());
|
|
- ui->viewMenu->actions().at(4)->setIcon(QIcon(":/icons/log_dock"));
|
|
-
|
|
// Set checked state if toolbar is visible
|
|
ui->viewDBToolbarAction->setChecked(!ui->toolbarDB->isHidden());
|
|
ui->viewExtraDBToolbarAction->setChecked(!ui->toolbarExtraDB->isHidden());
|
|
@@ -345,7 +317,6 @@
|
|
ui->dockPlot->hide();
|
|
ui->dockSchema->hide();
|
|
ui->dockEdit->hide();
|
|
- ui->dockRemote->hide();
|
|
});
|
|
QAction* atBottomLayoutAction = layoutMenu->addAction(tr("Dock Windows at Bottom"));
|
|
connect(atBottomLayoutAction, &QAction::triggered, [=]() {
|
|
@@ -432,7 +403,6 @@
|
|
connect(editDock, &EditDialog::requestUrlOrFileOpen, this, &MainWindow::openUrlOrFile);
|
|
connect(ui->dbTreeWidget->selectionModel(), &QItemSelectionModel::currentChanged, this, &MainWindow::changeTreeSelection);
|
|
connect(ui->dockEdit, &QDockWidget::visibilityChanged, this, &MainWindow::toggleEditDock);
|
|
- connect(remoteDock, SIGNAL(openFile(QString)), this, SLOT(fileOpen(QString)));
|
|
connect(ui->actionDropQualifiedCheck, &QAction::toggled, dbStructureModel, &DbStructureModel::setDropQualifiedNames);
|
|
connect(ui->actionEnquoteNamesCheck, &QAction::toggled, dbStructureModel, &DbStructureModel::setDropEnquotedNames);
|
|
connect(&db, &DBBrowserDB::databaseInUseChanged, this, &MainWindow::updateDatabaseBusyStatus);
|
|
@@ -502,7 +472,6 @@
|
|
ui->dockLog->setWindowTitle(ui->dockLog->windowTitle().remove('&'));
|
|
ui->dockPlot->setWindowTitle(ui->dockPlot->windowTitle().remove('&'));
|
|
ui->dockSchema->setWindowTitle(ui->dockSchema->windowTitle().remove('&'));
|
|
- ui->dockRemote->setWindowTitle(ui->dockRemote->windowTitle().remove('&'));
|
|
}
|
|
|
|
bool MainWindow::fileOpen(const QString& fileName, bool openFromProject, bool readOnly)
|
|
@@ -563,9 +532,6 @@
|
|
else if(ui->mainTab->currentWidget() == ui->pragmas)
|
|
loadPragmas();
|
|
|
|
- // Update remote dock
|
|
- remoteDock->fileOpened(wFile);
|
|
-
|
|
retval = true;
|
|
} else {
|
|
QMessageBox::warning(this, qApp->applicationName(), tr("Could not open database file.\nReason: %1").arg(db.lastError()));
|
|
@@ -608,7 +574,6 @@
|
|
statusEncodingLabel->setText(db.getPragma("encoding"));
|
|
statusEncryptionLabel->setVisible(false);
|
|
statusReadOnlyLabel->setVisible(false);
|
|
- remoteDock->fileOpened(":memory:");
|
|
populateTable();
|
|
if(ui->tabSqlAreas->count() == 0)
|
|
openSqlTab(true);
|
|
@@ -717,9 +682,6 @@
|
|
for(int i=0; i < ui->tabSqlAreas->count(); i++)
|
|
qobject_cast<SqlExecutionArea*>(ui->tabSqlAreas->widget(i))->getEditor()->reloadKeywords();
|
|
|
|
- // Clear remote dock
|
|
- remoteDock->fileOpened(QString());
|
|
-
|
|
return true;
|
|
}
|
|
|
|
@@ -1777,8 +1739,6 @@
|
|
|
|
if(!enable)
|
|
ui->actionSqlResultsSave->setEnabled(false);
|
|
-
|
|
- remoteDock->enableButtons();
|
|
}
|
|
|
|
void MainWindow::resizeEvent(QResizeEvent*)
|
|
@@ -2183,15 +2143,6 @@
|
|
populateStructure();
|
|
populateTable();
|
|
|
|
- // Hide or show the remote dock as needed
|
|
- bool showRemoteActions = Settings::getValue("remote", "active").toBool();
|
|
- ui->viewMenu->actions().at(4)->setVisible(showRemoteActions);
|
|
- if(!showRemoteActions)
|
|
- ui->dockRemote->setHidden(true);
|
|
-
|
|
- // Reload remote dock settings
|
|
- remoteDock->reloadSettings();
|
|
-
|
|
sqlb::setIdentifierQuoting(static_cast<sqlb::escapeQuoting>(Settings::getValue("editor", "identifier_quotes").toInt()));
|
|
|
|
ui->tabSqlAreas->setTabsClosable(Settings::getValue("editor", "close_button_on_tabs").toBool());
|
|
@@ -3469,5 +3420,4 @@
|
|
addDockWidget(area, ui->dockLog);
|
|
tabifyDockWidget(ui->dockLog, ui->dockPlot);
|
|
tabifyDockWidget(ui->dockLog, ui->dockSchema);
|
|
- tabifyDockWidget(ui->dockLog, ui->dockRemote);
|
|
}
|
|
--- a/src/PreferencesDialog.ui 2020-10-17 05:19:03.000000000 +0200
|
|
+++ b/src/PreferencesDialog.ui 2022-08-14 22:55:21.783368128 +0200
|
|
@@ -122,26 +122,29 @@
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
- <item row="4" column="0">
|
|
- <widget class="QLabel" name="labelToolbarStyle">
|
|
+ <item row="2" column="0">
|
|
+ <widget class="QLabel" name="labelAppStyle">
|
|
<property name="text">
|
|
- <string>Toolbar style</string>
|
|
+ <string>Application style</string>
|
|
</property>
|
|
<property name="buddy">
|
|
- <cstring>toolbarStyleComboMain</cstring>
|
|
+ <cstring>toolbarStyleComboStructure</cstring>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
- <item row="6" column="1">
|
|
- <widget class="QComboBox" name="toolbarStyleComboMain">
|
|
+ <item row="2" column="1">
|
|
+ <widget class="QComboBox" name="appStyleCombo">
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
|
<horstretch>0</horstretch>
|
|
<verstretch>0</verstretch>
|
|
</sizepolicy>
|
|
</property>
|
|
+ <property name="toolTip">
|
|
+ <string>When this value is changed, all the other color preferences are also set to matching colors.</string>
|
|
+ </property>
|
|
<property name="currentIndex">
|
|
- <number>2</number>
|
|
+ <number>0</number>
|
|
</property>
|
|
<property name="sizeAdjustPolicy">
|
|
<enum>QComboBox::AdjustToContents</enum>
|
|
@@ -157,33 +160,57 @@
|
|
</property>
|
|
<item>
|
|
<property name="text">
|
|
- <string>Only display the icon</string>
|
|
- </property>
|
|
- </item>
|
|
- <item>
|
|
- <property name="text">
|
|
- <string>Only display the text</string>
|
|
- </property>
|
|
- </item>
|
|
- <item>
|
|
- <property name="text">
|
|
- <string>The text appears beside the icon</string>
|
|
- </property>
|
|
- </item>
|
|
- <item>
|
|
- <property name="text">
|
|
- <string>The text appears under the icon</string>
|
|
+ <string>Follow the desktop style</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
- <string>Follow the style</string>
|
|
+ <string>Dark style</string>
|
|
</property>
|
|
</item>
|
|
</widget>
|
|
</item>
|
|
- <item row="7" column="1">
|
|
- <widget class="QComboBox" name="toolbarStyleComboStructure">
|
|
+ <item row="3" column="0">
|
|
+ <widget class="QLabel" name="label_27">
|
|
+ <property name="toolTip">
|
|
+ <string>This sets the font size for all UI elements which do not have their own font size option.</string>
|
|
+ </property>
|
|
+ <property name="text">
|
|
+ <string>Font size</string>
|
|
+ </property>
|
|
+ <property name="buddy">
|
|
+ <cstring>spinGeneralFontSize</cstring>
|
|
+ </property>
|
|
+ </widget>
|
|
+ </item>
|
|
+ <item row="3" column="1">
|
|
+ <widget class="QSpinBox" name="spinGeneralFontSize"/>
|
|
+ </item>
|
|
+ <item row="4" column="0">
|
|
+ <widget class="QLabel" name="labelToolbarStyle">
|
|
+ <property name="text">
|
|
+ <string>Toolbar style</string>
|
|
+ </property>
|
|
+ <property name="buddy">
|
|
+ <cstring>toolbarStyleComboMain</cstring>
|
|
+ </property>
|
|
+ </widget>
|
|
+ </item>
|
|
+ <item row="6" column="0">
|
|
+ <widget class="QLabel" name="labelMainToolBar">
|
|
+ <property name="text">
|
|
+ <string>Main Window</string>
|
|
+ </property>
|
|
+ <property name="indent">
|
|
+ <number>20</number>
|
|
+ </property>
|
|
+ <property name="buddy">
|
|
+ <cstring>toolbarStyleComboMain</cstring>
|
|
+ </property>
|
|
+ </widget>
|
|
+ </item>
|
|
+ <item row="6" column="1">
|
|
+ <widget class="QComboBox" name="toolbarStyleComboMain">
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
|
<horstretch>0</horstretch>
|
|
@@ -232,8 +259,21 @@
|
|
</item>
|
|
</widget>
|
|
</item>
|
|
- <item row="8" column="1">
|
|
- <widget class="QComboBox" name="toolbarStyleComboBrowse">
|
|
+ <item row="7" column="0">
|
|
+ <widget class="QLabel" name="labelStructureToolBar">
|
|
+ <property name="text">
|
|
+ <string>Database Structure</string>
|
|
+ </property>
|
|
+ <property name="indent">
|
|
+ <number>20</number>
|
|
+ </property>
|
|
+ <property name="buddy">
|
|
+ <cstring>toolbarStyleComboStructure</cstring>
|
|
+ </property>
|
|
+ </widget>
|
|
+ </item>
|
|
+ <item row="7" column="1">
|
|
+ <widget class="QComboBox" name="toolbarStyleComboStructure">
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
|
<horstretch>0</horstretch>
|
|
@@ -241,7 +281,7 @@
|
|
</sizepolicy>
|
|
</property>
|
|
<property name="currentIndex">
|
|
- <number>0</number>
|
|
+ <number>2</number>
|
|
</property>
|
|
<property name="sizeAdjustPolicy">
|
|
<enum>QComboBox::AdjustToContents</enum>
|
|
@@ -282,8 +322,21 @@
|
|
</item>
|
|
</widget>
|
|
</item>
|
|
- <item row="9" column="1">
|
|
- <widget class="QComboBox" name="toolbarStyleComboSql">
|
|
+ <item row="8" column="0">
|
|
+ <widget class="QLabel" name="labelBrowseToolBar">
|
|
+ <property name="text">
|
|
+ <string>Browse Data</string>
|
|
+ </property>
|
|
+ <property name="indent">
|
|
+ <number>20</number>
|
|
+ </property>
|
|
+ <property name="buddy">
|
|
+ <cstring>toolbarStyleComboBrowse</cstring>
|
|
+ </property>
|
|
+ </widget>
|
|
+ </item>
|
|
+ <item row="8" column="1">
|
|
+ <widget class="QComboBox" name="toolbarStyleComboBrowse">
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
|
<horstretch>0</horstretch>
|
|
@@ -332,99 +385,6 @@
|
|
</item>
|
|
</widget>
|
|
</item>
|
|
- <item row="11" column="0">
|
|
- <widget class="QLabel" name="labelUseRemotes">
|
|
- <property name="text">
|
|
- <string>Show remote options</string>
|
|
- </property>
|
|
- <property name="buddy">
|
|
- <cstring>checkUseRemotes</cstring>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
- <item row="11" column="1">
|
|
- <widget class="QCheckBox" name="checkUseRemotes">
|
|
- <property name="text">
|
|
- <string>enabled</string>
|
|
- </property>
|
|
- <property name="checked">
|
|
- <bool>true</bool>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
- <item row="12" 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="12" column="1">
|
|
- <widget class="QCheckBox" name="checkUpdates">
|
|
- <property name="text">
|
|
- <string>enabled</string>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
- <item row="13" column="0">
|
|
- <widget class="QLabel" name="label_16">
|
|
- <property name="text">
|
|
- <string>DB file extensions</string>
|
|
- </property>
|
|
- <property name="buddy">
|
|
- <cstring>buttonManageFileExtension</cstring>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
- <item row="13" column="1">
|
|
- <widget class="QPushButton" name="buttonManageFileExtension">
|
|
- <property name="text">
|
|
- <string>Manage</string>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
- <item row="6" column="0">
|
|
- <widget class="QLabel" name="labelMainToolBar">
|
|
- <property name="text">
|
|
- <string>Main Window</string>
|
|
- </property>
|
|
- <property name="indent">
|
|
- <number>20</number>
|
|
- </property>
|
|
- <property name="buddy">
|
|
- <cstring>toolbarStyleComboMain</cstring>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
- <item row="7" column="0">
|
|
- <widget class="QLabel" name="labelStructureToolBar">
|
|
- <property name="text">
|
|
- <string>Database Structure</string>
|
|
- </property>
|
|
- <property name="indent">
|
|
- <number>20</number>
|
|
- </property>
|
|
- <property name="buddy">
|
|
- <cstring>toolbarStyleComboStructure</cstring>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
- <item row="8" column="0">
|
|
- <widget class="QLabel" name="labelBrowseToolBar">
|
|
- <property name="text">
|
|
- <string>Browse Data</string>
|
|
- </property>
|
|
- <property name="indent">
|
|
- <number>20</number>
|
|
- </property>
|
|
- <property name="buddy">
|
|
- <cstring>toolbarStyleComboBrowse</cstring>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
<item row="9" column="0">
|
|
<widget class="QLabel" name="labelSqlToolBar">
|
|
<property name="text">
|
|
@@ -438,8 +398,8 @@
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
- <item row="10" column="1">
|
|
- <widget class="QComboBox" name="toolbarStyleComboEditCell">
|
|
+ <item row="9" column="1">
|
|
+ <widget class="QComboBox" name="toolbarStyleComboSql">
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
|
<horstretch>0</horstretch>
|
|
@@ -501,17 +461,14 @@
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
- <item row="2" column="1">
|
|
- <widget class="QComboBox" name="appStyleCombo">
|
|
+ <item row="10" column="1">
|
|
+ <widget class="QComboBox" name="toolbarStyleComboEditCell">
|
|
<property name="sizePolicy">
|
|
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
|
<horstretch>0</horstretch>
|
|
<verstretch>0</verstretch>
|
|
</sizepolicy>
|
|
</property>
|
|
- <property name="toolTip">
|
|
- <string>When this value is changed, all the other color preferences are also set to matching colors.</string>
|
|
- </property>
|
|
<property name="currentIndex">
|
|
<number>0</number>
|
|
</property>
|
|
@@ -529,42 +486,48 @@
|
|
</property>
|
|
<item>
|
|
<property name="text">
|
|
- <string>Follow the desktop style</string>
|
|
+ <string>Only display the icon</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
- <string>Dark style</string>
|
|
+ <string>Only display the text</string>
|
|
+ </property>
|
|
+ </item>
|
|
+ <item>
|
|
+ <property name="text">
|
|
+ <string>The text appears beside the icon</string>
|
|
+ </property>
|
|
+ </item>
|
|
+ <item>
|
|
+ <property name="text">
|
|
+ <string>The text appears under the icon</string>
|
|
+ </property>
|
|
+ </item>
|
|
+ <item>
|
|
+ <property name="text">
|
|
+ <string>Follow the style</string>
|
|
</property>
|
|
</item>
|
|
</widget>
|
|
</item>
|
|
- <item row="2" column="0">
|
|
- <widget class="QLabel" name="labelAppStyle">
|
|
+ <item row="11" column="0">
|
|
+ <widget class="QLabel" name="label_16">
|
|
<property name="text">
|
|
- <string>Application style</string>
|
|
+ <string>DB file extensions</string>
|
|
</property>
|
|
<property name="buddy">
|
|
- <cstring>toolbarStyleComboStructure</cstring>
|
|
+ <cstring>buttonManageFileExtension</cstring>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
- <item row="3" column="0">
|
|
- <widget class="QLabel" name="label_27">
|
|
- <property name="toolTip">
|
|
- <string>This sets the font size for all UI elements which do not have their own font size option.</string>
|
|
- </property>
|
|
+ <item row="11" column="1">
|
|
+ <widget class="QPushButton" name="buttonManageFileExtension">
|
|
<property name="text">
|
|
- <string>Font size</string>
|
|
- </property>
|
|
- <property name="buddy">
|
|
- <cstring>spinGeneralFontSize</cstring>
|
|
+ <string>Manage</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
- <item row="3" column="1">
|
|
- <widget class="QSpinBox" name="spinGeneralFontSize"/>
|
|
- </item>
|
|
</layout>
|
|
</widget>
|
|
<widget class="QWidget" name="tab">
|
|
@@ -1660,236 +1623,6 @@
|
|
</item>
|
|
</layout>
|
|
</widget>
|
|
- <widget class="QWidget" name="tabRemote">
|
|
- <attribute name="title">
|
|
- <string>Remote</string>
|
|
- </attribute>
|
|
- <layout class="QVBoxLayout" name="verticalLayout_8">
|
|
- <item>
|
|
- <widget class="QTabWidget" name="tabCertificates">
|
|
- <property name="currentIndex">
|
|
- <number>0</number>
|
|
- </property>
|
|
- <widget class="QWidget" name="tab_6">
|
|
- <attribute name="title">
|
|
- <string>Your certificates</string>
|
|
- </attribute>
|
|
- <layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
- <item>
|
|
- <widget class="QTableWidget" name="tableClientCerts">
|
|
- <property name="minimumSize">
|
|
- <size>
|
|
- <width>550</width>
|
|
- <height>0</height>
|
|
- </size>
|
|
- </property>
|
|
- <property name="selectionMode">
|
|
- <enum>QAbstractItemView::ExtendedSelection</enum>
|
|
- </property>
|
|
- <property name="selectionBehavior">
|
|
- <enum>QAbstractItemView::SelectRows</enum>
|
|
- </property>
|
|
- <property name="horizontalScrollMode">
|
|
- <enum>QAbstractItemView::ScrollPerPixel</enum>
|
|
- </property>
|
|
- <attribute name="horizontalHeaderHighlightSections">
|
|
- <bool>false</bool>
|
|
- </attribute>
|
|
- <column>
|
|
- <property name="text">
|
|
- <string>File</string>
|
|
- </property>
|
|
- </column>
|
|
- <column>
|
|
- <property name="text">
|
|
- <string>Subject CN</string>
|
|
- </property>
|
|
- <property name="toolTip">
|
|
- <string>Subject Common Name</string>
|
|
- </property>
|
|
- </column>
|
|
- <column>
|
|
- <property name="text">
|
|
- <string>Issuer CN</string>
|
|
- </property>
|
|
- <property name="toolTip">
|
|
- <string>Issuer Common Name</string>
|
|
- </property>
|
|
- </column>
|
|
- <column>
|
|
- <property name="text">
|
|
- <string>Valid from</string>
|
|
- </property>
|
|
- </column>
|
|
- <column>
|
|
- <property name="text">
|
|
- <string>Valid to</string>
|
|
- </property>
|
|
- </column>
|
|
- <column>
|
|
- <property name="text">
|
|
- <string>Serial number</string>
|
|
- </property>
|
|
- </column>
|
|
- </widget>
|
|
- </item>
|
|
- <item>
|
|
- <layout class="QVBoxLayout" name="verticalLayout_7">
|
|
- <item>
|
|
- <widget class="QToolButton" name="buttonClientCertAdd">
|
|
- <property name="icon">
|
|
- <iconset resource="icons/icons.qrc">
|
|
- <normaloff>:/icons/trigger_create</normaloff>:/icons/trigger_create</iconset>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
- <item>
|
|
- <widget class="QToolButton" name="buttonClientCertRemove">
|
|
- <property name="text">
|
|
- <string>...</string>
|
|
- </property>
|
|
- <property name="icon">
|
|
- <iconset resource="icons/icons.qrc">
|
|
- <normaloff>:/icons/trigger_delete</normaloff>:/icons/trigger_delete</iconset>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
- <item>
|
|
- <spacer name="verticalSpacer_2">
|
|
- <property name="orientation">
|
|
- <enum>Qt::Vertical</enum>
|
|
- </property>
|
|
- <property name="sizeHint" stdset="0">
|
|
- <size>
|
|
- <width>20</width>
|
|
- <height>40</height>
|
|
- </size>
|
|
- </property>
|
|
- </spacer>
|
|
- </item>
|
|
- </layout>
|
|
- </item>
|
|
- </layout>
|
|
- </widget>
|
|
- <widget class="QWidget" name="tab_7">
|
|
- <attribute name="title">
|
|
- <string>CA certificates</string>
|
|
- </attribute>
|
|
- <layout class="QHBoxLayout" name="horizontalLayout_6">
|
|
- <item>
|
|
- <widget class="QTableWidget" name="tableCaCerts">
|
|
- <property name="minimumSize">
|
|
- <size>
|
|
- <width>550</width>
|
|
- <height>0</height>
|
|
- </size>
|
|
- </property>
|
|
- <property name="selectionMode">
|
|
- <enum>QAbstractItemView::SingleSelection</enum>
|
|
- </property>
|
|
- <property name="selectionBehavior">
|
|
- <enum>QAbstractItemView::SelectRows</enum>
|
|
- </property>
|
|
- <property name="horizontalScrollMode">
|
|
- <enum>QAbstractItemView::ScrollPerPixel</enum>
|
|
- </property>
|
|
- <attribute name="horizontalHeaderHighlightSections">
|
|
- <bool>false</bool>
|
|
- </attribute>
|
|
- <column>
|
|
- <property name="text">
|
|
- <string>Subject CN</string>
|
|
- </property>
|
|
- <property name="toolTip">
|
|
- <string>Common Name</string>
|
|
- </property>
|
|
- </column>
|
|
- <column>
|
|
- <property name="text">
|
|
- <string>Subject O</string>
|
|
- </property>
|
|
- <property name="toolTip">
|
|
- <string>Organization</string>
|
|
- </property>
|
|
- </column>
|
|
- <column>
|
|
- <property name="text">
|
|
- <string>Valid from</string>
|
|
- </property>
|
|
- </column>
|
|
- <column>
|
|
- <property name="text">
|
|
- <string>Valid to</string>
|
|
- </property>
|
|
- </column>
|
|
- <column>
|
|
- <property name="text">
|
|
- <string>Serial number</string>
|
|
- </property>
|
|
- </column>
|
|
- </widget>
|
|
- </item>
|
|
- </layout>
|
|
- </widget>
|
|
- </widget>
|
|
- </item>
|
|
- <item>
|
|
- <layout class="QFormLayout" name="formLayout_5">
|
|
- <item row="1" column="0">
|
|
- <widget class="QLabel" name="label_23">
|
|
- <property name="text">
|
|
- <string>Clone databases into</string>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
- <item row="1" column="1">
|
|
- <layout class="QHBoxLayout" name="horizontalLayout_4">
|
|
- <item>
|
|
- <widget class="QLineEdit" name="editRemoteCloneDirectory">
|
|
- <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="buttonRemoteBrowseCloneDirectory">
|
|
- <property name="text">
|
|
- <string>...</string>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
- </layout>
|
|
- </item>
|
|
- <item row="0" column="0">
|
|
- <widget class="QLabel" name="label_21">
|
|
- <property name="text">
|
|
- <string>Proxy</string>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
- <item row="0" column="1">
|
|
- <widget class="QToolButton" name="buttonProxy">
|
|
- <property name="text">
|
|
- <string>Configure</string>
|
|
- </property>
|
|
- </widget>
|
|
- </item>
|
|
- </layout>
|
|
- </item>
|
|
- </layout>
|
|
- </widget>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
@@ -1925,8 +1658,6 @@
|
|
<tabstop>toolbarStyleComboBrowse</tabstop>
|
|
<tabstop>toolbarStyleComboSql</tabstop>
|
|
<tabstop>toolbarStyleComboEditCell</tabstop>
|
|
- <tabstop>checkUseRemotes</tabstop>
|
|
- <tabstop>checkUpdates</tabstop>
|
|
<tabstop>buttonManageFileExtension</tabstop>
|
|
<tabstop>encodingComboBox</tabstop>
|
|
<tabstop>foreignKeysCheckBox</tabstop>
|
|
@@ -1967,20 +1698,28 @@
|
|
<tabstop>buttonRemoveExtension</tabstop>
|
|
<tabstop>checkRegexDisabled</tabstop>
|
|
<tabstop>checkAllowLoadExtension</tabstop>
|
|
- <tabstop>tabCertificates</tabstop>
|
|
- <tabstop>tableClientCerts</tabstop>
|
|
- <tabstop>buttonClientCertAdd</tabstop>
|
|
- <tabstop>buttonClientCertRemove</tabstop>
|
|
- <tabstop>buttonProxy</tabstop>
|
|
- <tabstop>editRemoteCloneDirectory</tabstop>
|
|
- <tabstop>buttonRemoteBrowseCloneDirectory</tabstop>
|
|
- <tabstop>tableCaCerts</tabstop>
|
|
</tabstops>
|
|
<resources>
|
|
<include location="icons/icons.qrc"/>
|
|
</resources>
|
|
<connections>
|
|
<connection>
|
|
+ <sender>buttonBox</sender>
|
|
+ <signal>clicked(QAbstractButton*)</signal>
|
|
+ <receiver>PreferencesDialog</receiver>
|
|
+ <slot>on_buttonBox_clicked(QAbstractButton*)</slot>
|
|
+ <hints>
|
|
+ <hint type="sourcelabel">
|
|
+ <x>394</x>
|
|
+ <y>584</y>
|
|
+ </hint>
|
|
+ <hint type="destinationlabel">
|
|
+ <x>385</x>
|
|
+ <y>306</y>
|
|
+ </hint>
|
|
+ </hints>
|
|
+ </connection>
|
|
+ <connection>
|
|
<sender>buttonAddExtension</sender>
|
|
<signal>clicked()</signal>
|
|
<receiver>PreferencesDialog</receiver>
|
|
@@ -1997,18 +1736,18 @@
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
- <sender>buttonRemoveExtension</sender>
|
|
- <signal>clicked()</signal>
|
|
- <receiver>PreferencesDialog</receiver>
|
|
- <slot>removeExtension()</slot>
|
|
+ <sender>checkAutoCompletion</sender>
|
|
+ <signal>toggled(bool)</signal>
|
|
+ <receiver>checkCompleteUpper</receiver>
|
|
+ <slot>setEnabled(bool)</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
- <x>732</x>
|
|
- <y>125</y>
|
|
+ <x>733</x>
|
|
+ <y>444</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
- <x>245</x>
|
|
- <y>137</y>
|
|
+ <x>733</x>
|
|
+ <y>474</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
@@ -2029,130 +1768,34 @@
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
- <sender>setLocationButton</sender>
|
|
+ <sender>buttonRemoveExtension</sender>
|
|
<signal>clicked()</signal>
|
|
<receiver>PreferencesDialog</receiver>
|
|
- <slot>chooseLocation()</slot>
|
|
+ <slot>removeExtension()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>732</x>
|
|
- <y>106</y>
|
|
- </hint>
|
|
- <hint type="destinationlabel">
|
|
- <x>294</x>
|
|
- <y>202</y>
|
|
- </hint>
|
|
- </hints>
|
|
- </connection>
|
|
- <connection>
|
|
- <sender>checkUseRemotes</sender>
|
|
- <signal>toggled(bool)</signal>
|
|
- <receiver>PreferencesDialog</receiver>
|
|
- <slot>activateRemoteTab(bool)</slot>
|
|
- <hints>
|
|
- <hint type="sourcelabel">
|
|
- <x>301</x>
|
|
- <y>503</y>
|
|
- </hint>
|
|
- <hint type="destinationlabel">
|
|
- <x>382</x>
|
|
- <y>572</y>
|
|
- </hint>
|
|
- </hints>
|
|
- </connection>
|
|
- <connection>
|
|
- <sender>buttonClientCertAdd</sender>
|
|
- <signal>clicked()</signal>
|
|
- <receiver>PreferencesDialog</receiver>
|
|
- <slot>addClientCertificate()</slot>
|
|
- <hints>
|
|
- <hint type="sourcelabel">
|
|
- <x>722</x>
|
|
- <y>110</y>
|
|
- </hint>
|
|
- <hint type="destinationlabel">
|
|
- <x>596</x>
|
|
- <y>243</y>
|
|
- </hint>
|
|
- </hints>
|
|
- </connection>
|
|
- <connection>
|
|
- <sender>buttonClientCertRemove</sender>
|
|
- <signal>clicked()</signal>
|
|
- <receiver>PreferencesDialog</receiver>
|
|
- <slot>removeClientCertificate()</slot>
|
|
- <hints>
|
|
- <hint type="sourcelabel">
|
|
- <x>722</x>
|
|
- <y>139</y>
|
|
+ <y>125</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
- <x>597</x>
|
|
- <y>295</y>
|
|
+ <x>245</x>
|
|
+ <y>137</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
- <sender>buttonRemoteBrowseCloneDirectory</sender>
|
|
+ <sender>setLocationButton</sender>
|
|
<signal>clicked()</signal>
|
|
<receiver>PreferencesDialog</receiver>
|
|
- <slot>chooseRemoteCloneDirectory()</slot>
|
|
+ <slot>chooseLocation()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>732</x>
|
|
- <y>538</y>
|
|
- </hint>
|
|
- <hint type="destinationlabel">
|
|
- <x>595</x>
|
|
- <y>41</y>
|
|
- </hint>
|
|
- </hints>
|
|
- </connection>
|
|
- <connection>
|
|
- <sender>checkAutoCompletion</sender>
|
|
- <signal>toggled(bool)</signal>
|
|
- <receiver>checkCompleteUpper</receiver>
|
|
- <slot>setEnabled(bool)</slot>
|
|
- <hints>
|
|
- <hint type="sourcelabel">
|
|
- <x>733</x>
|
|
- <y>444</y>
|
|
- </hint>
|
|
- <hint type="destinationlabel">
|
|
- <x>733</x>
|
|
- <y>474</y>
|
|
- </hint>
|
|
- </hints>
|
|
- </connection>
|
|
- <connection>
|
|
- <sender>buttonBox</sender>
|
|
- <signal>clicked(QAbstractButton*)</signal>
|
|
- <receiver>PreferencesDialog</receiver>
|
|
- <slot>on_buttonBox_clicked(QAbstractButton*)</slot>
|
|
- <hints>
|
|
- <hint type="sourcelabel">
|
|
- <x>394</x>
|
|
- <y>584</y>
|
|
- </hint>
|
|
- <hint type="destinationlabel">
|
|
- <x>385</x>
|
|
- <y>306</y>
|
|
- </hint>
|
|
- </hints>
|
|
- </connection>
|
|
- <connection>
|
|
- <sender>buttonProxy</sender>
|
|
- <signal>clicked()</signal>
|
|
- <receiver>PreferencesDialog</receiver>
|
|
- <slot>configureProxy()</slot>
|
|
- <hints>
|
|
- <hint type="sourcelabel">
|
|
- <x>225</x>
|
|
- <y>506</y>
|
|
+ <y>106</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
- <x>385</x>
|
|
- <y>306</y>
|
|
+ <x>294</x>
|
|
+ <y>202</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
--- a/src/PreferencesDialog.cpp 2020-10-17 05:19:03.000000000 +0200
|
|
+++ b/src/PreferencesDialog.cpp 2022-08-14 22:56:21.444573088 +0200
|
|
@@ -4,7 +4,6 @@
|
|
#include "Settings.h"
|
|
#include "Application.h"
|
|
#include "MainWindow.h"
|
|
-#include "RemoteNetwork.h"
|
|
#include "FileExtensionManager.h"
|
|
#include "ProxyDialog.h"
|
|
|
|
@@ -23,7 +22,6 @@
|
|
{
|
|
ui->setupUi(this);
|
|
ui->treeSyntaxHighlighting->setColumnHidden(0, true);
|
|
- ui->tableClientCerts->setColumnHidden(0, true);
|
|
|
|
ui->fr_bin_bg->installEventFilter(this);
|
|
ui->fr_bin_fg->installEventFilter(this);
|
|
@@ -35,11 +33,6 @@
|
|
connect(ui->comboDataBrowserFont, static_cast<void (QFontComboBox::*)(int)>(&QFontComboBox::currentIndexChanged), this, &PreferencesDialog::updatePreviewFont);
|
|
connect(ui->spinDataBrowserFontSize, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &PreferencesDialog::updatePreviewFont);
|
|
|
|
-#ifndef CHECKNEWVERSION
|
|
- ui->labelUpdates->setVisible(false);
|
|
- ui->checkUpdates->setVisible(false);
|
|
-#endif
|
|
-
|
|
loadSettings();
|
|
|
|
connect(ui->appStyleCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(adjustColorsToStyle(int)));
|
|
@@ -76,7 +69,6 @@
|
|
ui->encodingComboBox->setCurrentIndex(ui->encodingComboBox->findText(Settings::getValue("db", "defaultencoding").toString(), Qt::MatchFixedString));
|
|
ui->comboDefaultLocation->setCurrentIndex(Settings::getValue("db", "savedefaultlocation").toInt());
|
|
ui->locationEdit->setText(QDir::toNativeSeparators(Settings::getValue("db", "defaultlocation").toString()));
|
|
- ui->checkUpdates->setChecked(Settings::getValue("checkversion", "enabled").toBool());
|
|
|
|
ui->checkHideSchemaLinebreaks->setChecked(Settings::getValue("db", "hideschemalinebreaks").toBool());
|
|
ui->foreignKeysCheckBox->setChecked(Settings::getValue("db", "foreignkeys").toBool());
|
|
@@ -130,47 +122,6 @@
|
|
}
|
|
}
|
|
|
|
- // Remote settings
|
|
- ui->checkUseRemotes->setChecked(Settings::getValue("remote", "active").toBool());
|
|
- {
|
|
- auto ca_certs = RemoteNetwork::get().caCertificates();
|
|
- ui->tableCaCerts->setRowCount(ca_certs.size());
|
|
- for(int i=0;i<ca_certs.size();i++)
|
|
- {
|
|
- QSslCertificate cert = ca_certs.at(i);
|
|
-
|
|
- QTableWidgetItem* cert_cn = new QTableWidgetItem(cert.subjectInfo(QSslCertificate::CommonName).at(0));
|
|
- cert_cn->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
|
- ui->tableCaCerts->setItem(i, 0, cert_cn);
|
|
-
|
|
- QTableWidgetItem* cert_o = new QTableWidgetItem(cert.subjectInfo(QSslCertificate::Organization).at(0));
|
|
- cert_o->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
|
- ui->tableCaCerts->setItem(i, 1, cert_o);
|
|
-
|
|
- QTableWidgetItem* cert_from = new QTableWidgetItem(cert.effectiveDate().toString());
|
|
- cert_from->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
|
- ui->tableCaCerts->setItem(i, 2, cert_from);
|
|
-
|
|
- QTableWidgetItem* cert_to = new QTableWidgetItem(cert.expiryDate().toString());
|
|
- cert_to->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
|
- ui->tableCaCerts->setItem(i, 3, cert_to);
|
|
-
|
|
- QTableWidgetItem* cert_serialno = new QTableWidgetItem(QString(cert.serialNumber()));
|
|
- cert_serialno->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
|
- ui->tableCaCerts->setItem(i, 4, cert_serialno);
|
|
- }
|
|
- }
|
|
- {
|
|
- QStringList client_certs = Settings::getValue("remote", "client_certificates").toStringList();
|
|
- for(const QString& file : client_certs)
|
|
- {
|
|
- auto certs = QSslCertificate::fromPath(file);
|
|
- for(const QSslCertificate& cert : certs)
|
|
- addClientCertToTable(file, cert);
|
|
- }
|
|
- }
|
|
- ui->editRemoteCloneDirectory->setText(QDir::toNativeSeparators(Settings::getValue("remote", "clonedirectory").toString()));
|
|
-
|
|
// Gracefully handle the preferred Editor font not being available
|
|
matchingFont = ui->comboEditorFont->findText(Settings::getValue("editor", "font").toString(), Qt::MatchExactly);
|
|
if (matchingFont == -1)
|
|
@@ -216,8 +167,6 @@
|
|
Settings::setValue("db", "defaultfieldtype", ui->defaultFieldTypeComboBox->currentIndex());
|
|
Settings::setValue("db", "fontsize", ui->spinStructureFontSize->value());
|
|
|
|
- Settings::setValue("checkversion", "enabled", ui->checkUpdates->isChecked());
|
|
-
|
|
Settings::setValue("databrowser", "font", ui->comboDataBrowserFont->currentText());
|
|
Settings::setValue("databrowser", "fontsize", ui->spinDataBrowserFontSize->value());
|
|
Settings::setValue("databrowser", "image_preview", ui->checkShowImagesInline->isChecked());
|
|
@@ -261,61 +210,6 @@
|
|
Settings::setValue("extensions", "disableregex", ui->checkRegexDisabled->isChecked());
|
|
Settings::setValue("extensions", "enable_load_extension", ui->checkAllowLoadExtension->isChecked());
|
|
|
|
- // Save remote settings
|
|
- Settings::setValue("remote", "active", ui->checkUseRemotes->isChecked());
|
|
- QStringList old_client_certs = Settings::getValue("remote", "client_certificates").toStringList();
|
|
- QStringList new_client_certs;
|
|
- for(int i=0;i<ui->tableClientCerts->rowCount();i++)
|
|
- {
|
|
- // Loop through the new list of client certs
|
|
-
|
|
- // If this certificate was already imported, remove it from the list of old certificates. All remaining certificates on this
|
|
- // list will be deleted later on.
|
|
- QString path = ui->tableClientCerts->item(i, 0)->text();
|
|
- if(old_client_certs.contains(path))
|
|
- {
|
|
- // This is a cert that is already imported
|
|
- old_client_certs.removeAll(path);
|
|
- new_client_certs.push_back(path);
|
|
- } else {
|
|
- // This is a new certificate. Copy file to a safe place.
|
|
-
|
|
- // Generate unique destination file name
|
|
- QString copy_to = QStandardPaths::writableLocation(
|
|
-#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
|
|
- QStandardPaths::AppDataLocation
|
|
-#else
|
|
- QStandardPaths::GenericDataLocation
|
|
-#endif
|
|
- ).append("/").append(QFileInfo(path).fileName());
|
|
- int suffix = 0;
|
|
- do
|
|
- {
|
|
- suffix++;
|
|
- } while(QFile::exists(copy_to + QString::number(suffix)));
|
|
-
|
|
- // Copy file
|
|
- copy_to.append(QString::number(suffix));
|
|
- QDir().mkpath(QStandardPaths::writableLocation(
|
|
-#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
|
|
- QStandardPaths::AppDataLocation
|
|
-#else
|
|
- QStandardPaths::GenericDataLocation
|
|
-#endif
|
|
- ));
|
|
- QFile::copy(path, copy_to);
|
|
-
|
|
- new_client_certs.push_back(copy_to);
|
|
- }
|
|
- }
|
|
- for(const QString& file : old_client_certs)
|
|
- {
|
|
- // Now only the deleted client certs are still in the old list. Delete the cert files associated with them.
|
|
- QFile::remove(file);
|
|
- }
|
|
- Settings::setValue("remote", "client_certificates", new_client_certs);
|
|
- Settings::setValue("remote", "clonedirectory", ui->editRemoteCloneDirectory->text());
|
|
-
|
|
// Warn about restarting to change language
|
|
QVariant newLanguage = ui->languageComboBox->itemData(ui->languageComboBox->currentIndex());
|
|
if (newLanguage != Settings::getValue("General", "language"))
|
|
@@ -552,96 +446,6 @@
|
|
}
|
|
}
|
|
|
|
-void PreferencesDialog::activateRemoteTab(bool active)
|
|
-{
|
|
- ui->tabWidget->setTabEnabled(ui->tabWidget->indexOf(ui->tabRemote), active);
|
|
-}
|
|
-
|
|
-void PreferencesDialog::addClientCertificate()
|
|
-{
|
|
- // Get certificate file to import and abort here if no file gets selected
|
|
- // NOTE: We assume here that this file contains both, certificate and private key!
|
|
- QString path = FileDialog::getOpenFileName(OpenCertificateFile, this, tr("Import certificate file"), "*.pem");
|
|
- if(path.isEmpty())
|
|
- return;
|
|
-
|
|
- // Open file and check if any certificates were imported
|
|
- auto certs = QSslCertificate::fromPath(path);
|
|
- if(certs.size() == 0)
|
|
- {
|
|
- QMessageBox::warning(this, qApp->applicationName(), tr("No certificates found in this file."));
|
|
- return;
|
|
- }
|
|
-
|
|
- // Add certificates to list
|
|
- for(int i=0;i<certs.size();i++)
|
|
- addClientCertToTable(path, certs.at(i));
|
|
-}
|
|
-
|
|
-void PreferencesDialog::removeClientCertificate()
|
|
-{
|
|
- // Any row selected?
|
|
- int row = ui->tableClientCerts->currentRow();
|
|
- if(row == -1)
|
|
- return;
|
|
-
|
|
- // Double check
|
|
- if(QMessageBox::question(this, qApp->applicationName(), tr("Are you sure you want do remove this certificate? All certificate "
|
|
- "data will be deleted from the application settings!"),
|
|
- QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)
|
|
- {
|
|
- ui->tableClientCerts->removeRow(row);
|
|
- }
|
|
-}
|
|
-
|
|
-void PreferencesDialog::addClientCertToTable(const QString& path, const QSslCertificate& cert)
|
|
-{
|
|
- // Do nothing if the file doesn't even exist
|
|
- if(!QFile::exists(path))
|
|
- return;
|
|
-
|
|
- // Add new row
|
|
- int row = ui->tableClientCerts->rowCount();
|
|
- ui->tableClientCerts->setRowCount(row + 1);
|
|
-
|
|
- // Fill row with data
|
|
- QTableWidgetItem* cert_file = new QTableWidgetItem(path);
|
|
- cert_file->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
|
- ui->tableClientCerts->setItem(row, 0, cert_file);
|
|
-
|
|
- QTableWidgetItem* cert_subject_cn = new QTableWidgetItem(cert.subjectInfo(QSslCertificate::CommonName).at(0));
|
|
- cert_subject_cn->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
|
- ui->tableClientCerts->setItem(row, 1, cert_subject_cn);
|
|
-
|
|
- QTableWidgetItem* cert_issuer_cn = new QTableWidgetItem(cert.issuerInfo(QSslCertificate::CommonName).at(0));
|
|
- cert_issuer_cn->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
|
- ui->tableClientCerts->setItem(row, 2, cert_issuer_cn);
|
|
-
|
|
- QTableWidgetItem* cert_from = new QTableWidgetItem(cert.effectiveDate().toString());
|
|
- cert_from->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
|
- ui->tableClientCerts->setItem(row, 3, cert_from);
|
|
-
|
|
- QTableWidgetItem* cert_to = new QTableWidgetItem(cert.expiryDate().toString());
|
|
- cert_to->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
|
- ui->tableClientCerts->setItem(row, 4, cert_to);
|
|
-
|
|
- QTableWidgetItem* cert_serialno = new QTableWidgetItem(QString(cert.serialNumber()));
|
|
- cert_serialno->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
|
|
- ui->tableClientCerts->setItem(row, 5, cert_serialno);
|
|
-}
|
|
-
|
|
-void PreferencesDialog::chooseRemoteCloneDirectory()
|
|
-{
|
|
- QString s = FileDialog::getExistingDirectory(
|
|
- NoSpecificType,
|
|
- this,
|
|
- tr("Choose a directory"),
|
|
- QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
|
-
|
|
- if(!s.isEmpty() && QDir().mkpath(s))
|
|
- ui->editRemoteCloneDirectory->setText(s);
|
|
-}
|
|
-
|
|
void PreferencesDialog::updatePreviewFont()
|
|
{
|
|
if (ui->spinDataBrowserFontSize->value() != 0) {
|
|
--- a/src/PreferencesDialog.h 2020-10-17 05:19:03.000000000 +0200
|
|
+++ b/src/PreferencesDialog.h 2022-08-14 22:21:28.542303353 +0200
|
|
@@ -25,8 +25,7 @@
|
|
TabDatabase,
|
|
TabDataBrowser,
|
|
TabSql,
|
|
- TabExtensions,
|
|
- TabRemote
|
|
+ TabExtensions
|
|
};
|
|
|
|
explicit PreferencesDialog(QWidget* parent = nullptr, Tabs tab = TabGeneral);
|
|
@@ -40,10 +39,6 @@
|
|
void showColourDialog(QTreeWidgetItem* item, int column);
|
|
void addExtension();
|
|
void removeExtension();
|
|
- void activateRemoteTab(bool active);
|
|
- void addClientCertificate();
|
|
- void removeClientCertificate();
|
|
- void chooseRemoteCloneDirectory();
|
|
void updatePreviewFont();
|
|
void adjustColorsToStyle(int style);
|
|
void configureProxy();
|
|
@@ -62,7 +57,6 @@
|
|
void loadColorSetting(QFrame *frame, const std::string& name);
|
|
void setColorSetting(QFrame* frame, const QColor &color);
|
|
void saveColorSetting(QFrame* frame, const std::string& name);
|
|
- void addClientCertToTable(const QString& path, const QSslCertificate& cert);
|
|
|
|
protected:
|
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
|
--- a/src/Application.cpp 2020-10-17 05:19:03.000000000 +0200
|
|
+++ b/src/Application.cpp 2022-08-14 22:29:25.051927278 +0200
|
|
@@ -10,7 +10,6 @@
|
|
|
|
#include "Application.h"
|
|
#include "MainWindow.h"
|
|
-#include "RemoteNetwork.h"
|
|
#include "Settings.h"
|
|
#include "version.h"
|
|
#include "sqlitedb.h"
|
|
@@ -247,9 +246,6 @@
|
|
|
|
void Application::reloadSettings()
|
|
{
|
|
- // Network settings
|
|
- RemoteNetwork::get().reloadSettings();
|
|
-
|
|
// Font settings
|
|
QFont f = font();
|
|
f.setPointSize(Settings::getValue("General", "fontsize").toInt());
|
|
--- a/src/MainWindow.ui 2020-10-17 05:19:03.000000000 +0200
|
|
+++ b/src/MainWindow.ui 2022-08-16 13:34:03.380363035 +0200
|
|
@@ -174,8 +174,8 @@
|
|
<rect>
|
|
<x>0</x>
|
|
<y>0</y>
|
|
- <width>692</width>
|
|
- <height>489</height>
|
|
+ <width>299</width>
|
|
+ <height>506</height>
|
|
</rect>
|
|
</property>
|
|
<layout class="QFormLayout" name="formLayout">
|
|
@@ -744,7 +744,7 @@
|
|
<x>0</x>
|
|
<y>0</y>
|
|
<width>1037</width>
|
|
- <height>21</height>
|
|
+ <height>20</height>
|
|
</rect>
|
|
</property>
|
|
<widget class="QMenu" name="fileMenu">
|
|
@@ -1065,15 +1065,6 @@
|
|
</layout>
|
|
</widget>
|
|
</widget>
|
|
- <widget class="QDockWidget" name="dockRemote">
|
|
- <property name="windowTitle">
|
|
- <string>&Remote</string>
|
|
- </property>
|
|
- <attribute name="dockWidgetArea">
|
|
- <number>2</number>
|
|
- </attribute>
|
|
- <widget class="QWidget" name="dockWidgetContents_5"/>
|
|
- </widget>
|
|
<widget class="QToolBar" name="toolbarProject">
|
|
<property name="windowTitle">
|
|
<string>Project Toolbar</string>
|