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