gui: mainwindow: Add checkbox to remove current database

Tá an tiomantas seo le fáil i:
Albert S. 2022-08-14 10:41:31 +02:00
tuismitheoir d900d58f26
tiomantas 47d0440ffb
D'athraigh 2 comhad le 18 breiseanna agus 0 scriosta

Féach ar an gComhad

@ -408,6 +408,17 @@ void MainWindow::initSettingsTabs()
void MainWindow::saveSettings()
{
if(ui->chkRemoveOldDb->isChecked())
{
bool result = QFile::remove(Common::databasePath());
if(!result)
{
QMessageBox::critical(this, "Error removing database",
"Failed to remove old database. Settings not saved.");
return;
}
}
QSettings settings;
QString pdfViewerCmd = ui->txtSettingPdfPreviewerCmd->text();

Féach ar an gComhad

@ -532,6 +532,13 @@
<item>
<widget class="QLineEdit" name="txtSettingDatabasePath"/>
</item>
<item>
<widget class="QCheckBox" name="chkRemoveOldDb">
<property name="text">
<string>Remove old database on save</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>