gui: mainwindow: Add checkbox to remove current database
This commit is contained in:
parent
d900d58f26
commit
47d0440ffb
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user