|
|
@ -32,7 +32,6 @@ |
|
|
|
#include <limits> |
|
|
|
#include <limits> |
|
|
|
|
|
|
|
|
|
|
|
#include <QApplication> |
|
|
|
#include <QApplication> |
|
|
|
#include <QCloseEvent> |
|
|
|
|
|
|
|
#include <QDebug> |
|
|
|
#include <QDebug> |
|
|
|
#include <QDesktopServices> |
|
|
|
#include <QDesktopServices> |
|
|
|
#include <QDialogButtonBox> |
|
|
|
#include <QDialogButtonBox> |
|
|
@ -185,8 +184,6 @@ OptionsDialog::OptionsDialog(QWidget *parent) |
|
|
|
{ |
|
|
|
{ |
|
|
|
qDebug("-> Constructing Options"); |
|
|
|
qDebug("-> Constructing Options"); |
|
|
|
m_ui->setupUi(this); |
|
|
|
m_ui->setupUi(this); |
|
|
|
setAttribute(Qt::WA_DeleteOnClose); |
|
|
|
|
|
|
|
setModal(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if (defined(Q_OS_UNIX)) |
|
|
|
#if (defined(Q_OS_UNIX)) |
|
|
|
setWindowTitle(tr("Preferences")); |
|
|
|
setWindowTitle(tr("Preferences")); |
|
|
@ -575,10 +572,8 @@ OptionsDialog::OptionsDialog(QWidget *parent) |
|
|
|
|
|
|
|
|
|
|
|
m_ui->tabSelection->setCurrentRow(m_storeLastViewedPage); |
|
|
|
m_ui->tabSelection->setCurrentRow(m_storeLastViewedPage); |
|
|
|
|
|
|
|
|
|
|
|
resize(m_storeDialogSize); |
|
|
|
if (const QSize dialogSize = m_storeDialogSize; dialogSize.isValid()) |
|
|
|
show(); |
|
|
|
resize(dialogSize); |
|
|
|
// Have to be called after show(), because splitter width needed
|
|
|
|
|
|
|
|
loadSplitterState(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::initializeLanguageCombo() |
|
|
|
void OptionsDialog::initializeLanguageCombo() |
|
|
@ -649,6 +644,13 @@ void OptionsDialog::loadSplitterState() |
|
|
|
m_ui->hsplitter->setSizes(splitterSizes); |
|
|
|
m_ui->hsplitter->setSizes(splitterSizes); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::showEvent(QShowEvent *e) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QDialog::showEvent(e); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
loadSplitterState(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::saveOptions() |
|
|
|
void OptionsDialog::saveOptions() |
|
|
|
{ |
|
|
|
{ |
|
|
|
auto *pref = Preferences::instance(); |
|
|
|
auto *pref = Preferences::instance(); |
|
|
@ -1477,15 +1479,8 @@ void OptionsDialog::applySettings() |
|
|
|
saveOptions(); |
|
|
|
saveOptions(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::closeEvent(QCloseEvent *e) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
setAttribute(Qt::WA_DeleteOnClose); |
|
|
|
|
|
|
|
e->accept(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void OptionsDialog::on_buttonBox_rejected() |
|
|
|
void OptionsDialog::on_buttonBox_rejected() |
|
|
|
{ |
|
|
|
{ |
|
|
|
setAttribute(Qt::WA_DeleteOnClose); |
|
|
|
|
|
|
|
reject(); |
|
|
|
reject(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1667,7 +1662,6 @@ void OptionsDialog::on_addWatchedFolderButton_clicked() |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
auto dialog = new WatchedFolderOptionsDialog({}, this); |
|
|
|
auto dialog = new WatchedFolderOptionsDialog({}, this); |
|
|
|
dialog->setModal(true); |
|
|
|
|
|
|
|
dialog->setAttribute(Qt::WA_DeleteOnClose); |
|
|
|
dialog->setAttribute(Qt::WA_DeleteOnClose); |
|
|
|
connect(dialog, &QDialog::accepted, this, [this, dialog, dir, pref]() |
|
|
|
connect(dialog, &QDialog::accepted, this, [this, dialog, dir, pref]() |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1723,7 +1717,6 @@ void OptionsDialog::editWatchedFolderOptions(const QModelIndex &index) |
|
|
|
|
|
|
|
|
|
|
|
auto watchedFoldersModel = static_cast<WatchedFoldersModel *>(m_ui->scanFoldersView->model()); |
|
|
|
auto watchedFoldersModel = static_cast<WatchedFoldersModel *>(m_ui->scanFoldersView->model()); |
|
|
|
auto dialog = new WatchedFolderOptionsDialog(watchedFoldersModel->folderOptions(index.row()), this); |
|
|
|
auto dialog = new WatchedFolderOptionsDialog(watchedFoldersModel->folderOptions(index.row()), this); |
|
|
|
dialog->setModal(true); |
|
|
|
|
|
|
|
dialog->setAttribute(Qt::WA_DeleteOnClose); |
|
|
|
dialog->setAttribute(Qt::WA_DeleteOnClose); |
|
|
|
connect(dialog, &QDialog::accepted, this, [this, dialog, index, watchedFoldersModel]() |
|
|
|
connect(dialog, &QDialog::accepted, this, [this, dialog, index, watchedFoldersModel]() |
|
|
|
{ |
|
|
|
{ |
|
|
|