gui: mainwindow: Add checkbox to remove current database

This commit is contained in:
Albert S. 2022-08-14 10:41:31 +02:00
父節點 d900d58f26
當前提交 47d0440ffb
共有 2 個檔案被更改,包括 18 行新增0 行删除

查看文件

@ -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();

查看文件

@ -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>