gui: mainwindow: Add checkbox to remove current database
This commit is contained in:
förälder
d900d58f26
incheckning
47d0440ffb
@ -408,6 +408,17 @@ void MainWindow::initSettingsTabs()
|
|||||||
|
|
||||||
void MainWindow::saveSettings()
|
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;
|
QSettings settings;
|
||||||
|
|
||||||
QString pdfViewerCmd = ui->txtSettingPdfPreviewerCmd->text();
|
QString pdfViewerCmd = ui->txtSettingPdfPreviewerCmd->text();
|
||||||
|
@ -532,6 +532,13 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="txtSettingDatabasePath"/>
|
<widget class="QLineEdit" name="txtSettingDatabasePath"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="chkRemoveOldDb">
|
||||||
|
<property name="text">
|
||||||
|
<string>Remove old database on save</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Laddar…
Referens i nytt ärende
Block a user