mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 18:40:13 -06:00
Save splitter sizes of the Execute SQL areas to disk under request
Saving cannot be done in the class destructor, since it seems that the sizes have already change in that moment. Now they are saved under request of the Main Window at the same time when the Main Window state is saved. See issue #1889.
This commit is contained in:
@@ -967,6 +967,8 @@ void MainWindow::closeEvent( QCloseEvent* event )
|
||||
Settings::setValue("SchemaDock", "dropQualifiedNames", ui->actionDropQualifiedCheck->isChecked());
|
||||
Settings::setValue("SchemaDock", "dropEnquotedNames", ui->actionEnquoteNamesCheck->isChecked());
|
||||
|
||||
SqlExecutionArea::saveState();
|
||||
|
||||
QMainWindow::closeEvent(event);
|
||||
} else {
|
||||
event->ignore();
|
||||
|
||||
@@ -57,10 +57,6 @@ SqlExecutionArea::SqlExecutionArea(DBBrowserDB& _db, QWidget* parent) :
|
||||
|
||||
SqlExecutionArea::~SqlExecutionArea()
|
||||
{
|
||||
// Save to disk last stored splitter sizes
|
||||
Settings::setValue("editor", "splitter1_sizes", Settings::getValue("editor", "splitter1_sizes"));
|
||||
Settings::setValue("editor", "splitter2_sizes", Settings::getValue("editor", "splitter1_sizes"));
|
||||
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@@ -306,3 +302,10 @@ void SqlExecutionArea::fileChanged(const QString& filename)
|
||||
ui->editEditor->setModified(true);
|
||||
}
|
||||
}
|
||||
|
||||
void SqlExecutionArea::saveState() {
|
||||
|
||||
// Save to disk last stored splitter sizes
|
||||
Settings::setValue("editor", "splitter1_sizes", Settings::getValue("editor", "splitter1_sizes"));
|
||||
Settings::setValue("editor", "splitter2_sizes", Settings::getValue("editor", "splitter1_sizes"));
|
||||
}
|
||||
|
||||
@@ -39,6 +39,9 @@ public:
|
||||
|
||||
bool inErrorState() const { return error_state; }
|
||||
|
||||
// Save window state to settings
|
||||
static void saveState();
|
||||
|
||||
public slots:
|
||||
void finishExecution(const QString& result, const bool ok);
|
||||
void saveAsCsv();
|
||||
|
||||
Reference in New Issue
Block a user