diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-08-24 03:01:46 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-08-24 03:01:47 +0200 |
commit | 2474c78debe48c7b81d0b4e1795342cdedfdd3a3 (patch) | |
tree | c232f21d8acbc498eaddbeccb61fc812f514ffea /src/assistant | |
parent | cfaad49b7cc69df057153cb86681556addbe6906 (diff) | |
parent | 6a5fb1ef73fc7a917efe3670fcdfa7aa6e09df86 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: I43a657af3d3c5853bd062f14e3b96b87cdadea94
Diffstat (limited to 'src/assistant')
-rw-r--r-- | src/assistant/assistant/mainwindow.cpp | 2 | ||||
-rw-r--r-- | src/assistant/assistant/preferencesdialog.cpp | 55 | ||||
-rw-r--r-- | src/assistant/assistant/preferencesdialog.h | 4 |
3 files changed, 26 insertions, 35 deletions
diff --git a/src/assistant/assistant/mainwindow.cpp b/src/assistant/assistant/mainwindow.cpp index 2b9c87bbf..fc5fe5b3f 100644 --- a/src/assistant/assistant/mainwindow.cpp +++ b/src/assistant/assistant/mainwindow.cpp @@ -842,7 +842,7 @@ void MainWindow::showPreferences() m_centralWidget, &CentralWidget::updateBrowserFont); connect(&dia, &PreferencesDialog::updateUserInterface, m_centralWidget, &CentralWidget::updateUserInterface); - dia.showDialog(); + dia.exec(); } void MainWindow::syncContents() diff --git a/src/assistant/assistant/preferencesdialog.cpp b/src/assistant/assistant/preferencesdialog.cpp index 7955e08df..67f91326c 100644 --- a/src/assistant/assistant/preferencesdialog.cpp +++ b/src/assistant/assistant/preferencesdialog.cpp @@ -142,31 +142,6 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) setFont(helpEngine.appFont()); } -PreferencesDialog::~PreferencesDialog() -{ - if (m_appFontChanged) { - helpEngine.setAppFont(m_appFontPanel->selectedFont()); - helpEngine.setUseAppFont(m_appFontPanel->isChecked()); - helpEngine.setAppWritingSystem(m_appFontPanel->writingSystem()); - emit updateApplicationFont(); - } - - if (m_browserFontChanged) { - helpEngine.setBrowserFont(m_browserFontPanel->selectedFont()); - helpEngine.setUseBrowserFont(m_browserFontPanel->isChecked()); - helpEngine.setBrowserWritingSystem(m_browserFontPanel->writingSystem()); - emit updateBrowserFont(); - } - - QString homePage = m_ui.homePageLineEdit->text(); - if (homePage.isEmpty()) - homePage = QLatin1String("help"); - helpEngine.setHomePage(homePage); - - int option = m_ui.helpStartComboBox->currentIndex(); - helpEngine.setStartOption(option); -} - FilterSetup PreferencesDialog::readOriginalSetup() const { FilterSetup filterSetup; @@ -195,12 +170,6 @@ FilterSetup PreferencesDialog::readOriginalSetup() const return filterSetup; } -void PreferencesDialog::showDialog() -{ - if (exec() != Accepted) - m_appFontChanged = m_browserFontChanged = false; -} - void PreferencesDialog::updateFilterPage() { if (m_hideFiltersTab) @@ -563,6 +532,30 @@ void PreferencesDialog::applyChanges() helpEngine.setShowTabs(m_ui.showTabs->isChecked()); if (m_showTabs != m_ui.showTabs->isChecked()) emit updateUserInterface(); + + if (m_appFontChanged) { + helpEngine.setAppFont(m_appFontPanel->selectedFont()); + helpEngine.setUseAppFont(m_appFontPanel->isChecked()); + helpEngine.setAppWritingSystem(m_appFontPanel->writingSystem()); + emit updateApplicationFont(); + m_appFontChanged = false; + } + + if (m_browserFontChanged) { + helpEngine.setBrowserFont(m_browserFontPanel->selectedFont()); + helpEngine.setUseBrowserFont(m_browserFontPanel->isChecked()); + helpEngine.setBrowserWritingSystem(m_browserFontPanel->writingSystem()); + emit updateBrowserFont(); + m_browserFontChanged = false; + } + + QString homePage = m_ui.homePageLineEdit->text(); + if (homePage.isEmpty()) + homePage = QLatin1String("help"); + helpEngine.setHomePage(homePage); + + const int option = m_ui.helpStartComboBox->currentIndex(); + helpEngine.setStartOption(option); } void PreferencesDialog::updateFontSettingsPage() diff --git a/src/assistant/assistant/preferencesdialog.h b/src/assistant/assistant/preferencesdialog.h index 89c30c568..1ff39e326 100644 --- a/src/assistant/assistant/preferencesdialog.h +++ b/src/assistant/assistant/preferencesdialog.h @@ -29,6 +29,7 @@ #ifndef PREFERENCESDIALOG_H #define PREFERENCESDIALOG_H +#include <QtCore/QVersionNumber> #include <QtWidgets/QDialog> #include <QtHelp/QHelpFilterData> #include "ui_preferencesdialog.h" @@ -60,9 +61,6 @@ class PreferencesDialog : public QDialog public: PreferencesDialog(QWidget *parent = nullptr); - ~PreferencesDialog() override; - - void showDialog(); private slots: void filterSelected(QListWidgetItem *item); |