From 1ee1e8837f82cafb56fbffa1e4fe83dc2e41bced Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 31 Oct 2020 16:42:48 +0100 Subject: [PATCH] Use Qt's dialog where applicable (#1843) --- CHANGELOG.md | 2 ++ src/common/FlagsEnum.hpp | 9 ++++++ .../commands/CommandController.cpp | 6 +++- src/singletons/WindowManager.cpp | 8 +++-- src/singletons/WindowManager.hpp | 1 + src/widgets/AccountSwitchPopup.cpp | 5 ++-- src/widgets/BasePopup.cpp | 2 +- src/widgets/BaseWindow.cpp | 6 ++-- src/widgets/BaseWindow.hpp | 1 + src/widgets/Notebook.cpp | 2 +- src/widgets/Window.cpp | 14 +++++---- src/widgets/dialogs/ColorPickerDialog.cpp | 2 +- src/widgets/dialogs/ColorPickerDialog.hpp | 4 +-- src/widgets/dialogs/QualityPopup.cpp | 7 ++++- src/widgets/dialogs/QualityPopup.hpp | 4 +-- src/widgets/dialogs/SelectChannelDialog.cpp | 4 ++- src/widgets/dialogs/SettingsDialog.cpp | 15 +++++++--- src/widgets/dialogs/SettingsDialog.hpp | 5 ++-- src/widgets/dialogs/UserInfoPopup.cpp | 23 ++++++++++----- src/widgets/dialogs/UserInfoPopup.hpp | 2 +- src/widgets/helper/ChannelView.cpp | 6 ++-- src/widgets/helper/DebugPopup.hpp | 4 +-- src/widgets/settingspages/AboutPage.cpp | 29 ++++++++++++------- src/widgets/settingspages/GeneralPageView.cpp | 8 ++--- .../settingspages/HighlightingPage.cpp | 4 +-- src/widgets/splits/Split.cpp | 2 +- src/widgets/splits/SplitHeader.cpp | 5 ++-- 27 files changed, 118 insertions(+), 62 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 312c807f2..f38ed1788 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ - Minor: Improve UX of the "Login expired!" message (#2029) - Minor: PageUp and PageDown now scroll in the selected split (#2070, #2081) - Minor: Allow highlights to be excluded from `/mentions`. Excluded highlights will not trigger tab highlights either. (#1793, #2036) +- Minor: Flag all popup dialogs as actual dialogs so they get the relevant window manager hints (#1843) +- Bugfix: Fix crash occurring when pressing Escape in the Color Picker Dialog (#1843) - Bugfix: Fix bug preventing users from setting the highlight color of the second entry in the "User" highlights tab (#1898) - Bugfix: Fix bug where the "check user follow state" event could trigger a network request requesting the user to follow or unfollow a user. By itself its quite harmless as it just repeats to Twitch the same follow state we had, so no follows should have been lost by this but it meant there was a rogue network request that was fired that could cause a crash (#1906) - Bugfix: /usercard command will now respect the "Automatically close user popup" setting (#1918) diff --git a/src/common/FlagsEnum.hpp b/src/common/FlagsEnum.hpp index 9df975872..c7ade164b 100644 --- a/src/common/FlagsEnum.hpp +++ b/src/common/FlagsEnum.hpp @@ -59,6 +59,15 @@ public: return static_cast(this->value_) & static_cast(flag); } + FlagsEnum operator|(T flag) + { + FlagsEnum xd; + xd.value_ = this->value_; + xd.set(flag, true); + + return xd; + } + bool hasAny(FlagsEnum flags) const { return static_cast(this->value_) & static_cast(flags.value_); diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index b8eb127ae..124d01a9a 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -14,8 +14,10 @@ #include "singletons/Paths.hpp" #include "singletons/Settings.hpp" #include "singletons/Theme.hpp" +#include "singletons/WindowManager.hpp" #include "util/CombinePath.hpp" #include "util/Twitch.hpp" +#include "widgets/Window.hpp" #include "widgets/dialogs/UserInfoPopup.hpp" #include @@ -405,7 +407,9 @@ void CommandController::initialize(Settings &, Paths &paths) return ""; } - auto *userPopup = new UserInfoPopup(getSettings()->autoCloseUserPopup); + auto *userPopup = new UserInfoPopup( + getSettings()->autoCloseUserPopup, + static_cast(&(getApp()->windows->getMainWindow()))); userPopup->setData(words[1], channel); userPopup->move(QCursor::pos()); userPopup->show(); diff --git a/src/singletons/WindowManager.cpp b/src/singletons/WindowManager.cpp index 07a4e7b04..168df28c9 100644 --- a/src/singletons/WindowManager.cpp +++ b/src/singletons/WindowManager.cpp @@ -49,10 +49,12 @@ namespace { using SplitNode = SplitContainer::Node; using SplitDirection = SplitContainer::Direction; -void WindowManager::showSettingsDialog(SettingsDialogPreference preference) +void WindowManager::showSettingsDialog(QWidget *parent, + SettingsDialogPreference preference) { - QTimer::singleShot( - 80, [preference] { SettingsDialog::showDialog(preference); }); + QTimer::singleShot(80, [parent, preference] { + SettingsDialog::showDialog(parent, preference); + }); } void WindowManager::showAccountSelectPopup(QPoint point) diff --git a/src/singletons/WindowManager.hpp b/src/singletons/WindowManager.hpp index c22896e30..a7936b9c3 100644 --- a/src/singletons/WindowManager.hpp +++ b/src/singletons/WindowManager.hpp @@ -30,6 +30,7 @@ public: static IndirectChannel decodeChannel(const SplitDescriptor &descriptor); void showSettingsDialog( + QWidget *parent, SettingsDialogPreference preference = SettingsDialogPreference()); // Show the account selector widget at point diff --git a/src/widgets/AccountSwitchPopup.cpp b/src/widgets/AccountSwitchPopup.cpp index 15f5ab4d1..a836e32ee 100644 --- a/src/widgets/AccountSwitchPopup.cpp +++ b/src/widgets/AccountSwitchPopup.cpp @@ -30,8 +30,9 @@ AccountSwitchPopup::AccountSwitchPopup(QWidget *parent) hbox->addWidget(manageAccountsButton); vbox->addLayout(hbox); - connect(manageAccountsButton, &QPushButton::clicked, []() { - SettingsDialog::showDialog(SettingsDialogPreference::Accounts); // + connect(manageAccountsButton, &QPushButton::clicked, [this]() { + SettingsDialog::showDialog(this, + SettingsDialogPreference::Accounts); // }); this->getLayoutContainer()->setLayout(vbox); diff --git a/src/widgets/BasePopup.cpp b/src/widgets/BasePopup.cpp index f8c5c5e62..04391d656 100644 --- a/src/widgets/BasePopup.cpp +++ b/src/widgets/BasePopup.cpp @@ -3,7 +3,7 @@ namespace chatterino { BasePopup::BasePopup(FlagsEnum _flags, QWidget *parent) - : BaseWindow(std::move(_flags), parent) + : BaseWindow(_flags | Dialog, parent) { } diff --git a/src/widgets/BaseWindow.cpp b/src/widgets/BaseWindow.cpp index 175e35f95..607ef3a0e 100644 --- a/src/widgets/BaseWindow.cpp +++ b/src/widgets/BaseWindow.cpp @@ -45,9 +45,9 @@ namespace chatterino { BaseWindow::BaseWindow(FlagsEnum _flags, QWidget *parent) - : BaseWidget(parent, - Qt::Window | (_flags.has(TopMost) ? Qt::WindowStaysOnTopHint - : Qt::WindowFlags())) + : BaseWidget(parent, (_flags.has(Dialog) ? Qt::Dialog : Qt::Window) | + (_flags.has(TopMost) ? Qt::WindowStaysOnTopHint + : Qt::WindowFlags())) , enableCustomFrame_(_flags.has(EnableCustomFrame)) , frameless_(_flags.has(Frameless)) , flags_(_flags) diff --git a/src/widgets/BaseWindow.hpp b/src/widgets/BaseWindow.hpp index deba207f5..913e66511 100644 --- a/src/widgets/BaseWindow.hpp +++ b/src/widgets/BaseWindow.hpp @@ -30,6 +30,7 @@ public: DisableCustomScaling = 8, FramelessDraggable = 16, DontFocus = 32, + Dialog = 64, }; enum ActionOnFocusLoss { Nothing, Delete, Close, Hide }; diff --git a/src/widgets/Notebook.cpp b/src/widgets/Notebook.cpp index 103f6470c..bfc65d3d2 100644 --- a/src/widgets/Notebook.cpp +++ b/src/widgets/Notebook.cpp @@ -652,7 +652,7 @@ void SplitNotebook::addCustomButtons() settingsBtn->setIcon(NotebookButton::Settings); QObject::connect(settingsBtn, &NotebookButton::leftClicked, - [] { getApp()->windows->showSettingsDialog(); }); + [this] { getApp()->windows->showSettingsDialog(this); }); // account auto userBtn = this->addCustomButton(); diff --git a/src/widgets/Window.cpp b/src/widgets/Window.cpp index 1affbdba7..511464563 100644 --- a/src/widgets/Window.cpp +++ b/src/widgets/Window.cpp @@ -158,8 +158,9 @@ void Window::addCustomTitlebarButtons() return; // settings - this->addTitleBarButton(TitleBarButtonStyle::Settings, - [] { getApp()->windows->showSettingsDialog(); }); + this->addTitleBarButton(TitleBarButtonStyle::Settings, [this] { + getApp()->windows->showSettingsDialog(this); // + }); // updates auto update = this->addTitleBarButton(TitleBarButtonStyle::None, [] {}); @@ -291,7 +292,9 @@ void Window::addShortcuts() { /// Initialize program-wide hotkeys // Open settings - createWindowShortcut(this, "CTRL+P", [] { SettingsDialog::showDialog(); }); + createWindowShortcut(this, "CTRL+P", [this] { + SettingsDialog::showDialog(this); // + }); // Switch tab createWindowShortcut(this, "CTRL+T", [this] { @@ -398,8 +401,9 @@ void Window::addMenuBar() QMenu *menu = mainMenu->addMenu(QString()); QAction *prefs = menu->addAction(QString()); prefs->setMenuRole(QAction::PreferencesRole); - connect(prefs, &QAction::triggered, this, - [] { SettingsDialog::showDialog(); }); + connect(prefs, &QAction::triggered, this, [this] { + SettingsDialog::showDialog(this); // + }); // Window menu. QMenu *windowMenu = mainMenu->addMenu(QString("Window")); diff --git a/src/widgets/dialogs/ColorPickerDialog.cpp b/src/widgets/dialogs/ColorPickerDialog.cpp index bc7ee041a..6b4a77c7d 100644 --- a/src/widgets/dialogs/ColorPickerDialog.cpp +++ b/src/widgets/dialogs/ColorPickerDialog.cpp @@ -123,7 +123,7 @@ QColor ColorPickerDialog::selectedColor() const void ColorPickerDialog::closeEvent(QCloseEvent *) { - this->closed.invoke(); + this->closed.invoke(this->selectedColor()); } void ColorPickerDialog::themeChangedEvent() diff --git a/src/widgets/dialogs/ColorPickerDialog.hpp b/src/widgets/dialogs/ColorPickerDialog.hpp index 6f4f0c372..f325c59ba 100644 --- a/src/widgets/dialogs/ColorPickerDialog.hpp +++ b/src/widgets/dialogs/ColorPickerDialog.hpp @@ -27,7 +27,7 @@ public: * You can connect to the ::closed signal of this instance to get notified * when the dialog is closed. */ - ColorPickerDialog(const QColor &initial, QWidget *parent = nullptr); + ColorPickerDialog(const QColor &initial, QWidget *parent); ~ColorPickerDialog(); @@ -42,7 +42,7 @@ public: */ QColor selectedColor() const; - pajlada::Signals::NoArgSignal closed; + pajlada::Signals::Signal closed; protected: void closeEvent(QCloseEvent *); diff --git a/src/widgets/dialogs/QualityPopup.cpp b/src/widgets/dialogs/QualityPopup.cpp index 40c7ff0d5..134913752 100644 --- a/src/widgets/dialogs/QualityPopup.cpp +++ b/src/widgets/dialogs/QualityPopup.cpp @@ -1,10 +1,15 @@ #include "QualityPopup.hpp" +#include "Application.hpp" +#include "singletons/WindowManager.hpp" #include "util/StreamLink.hpp" +#include "widgets/Window.hpp" namespace chatterino { QualityPopup::QualityPopup(const QString &_channelName, QStringList options) - : channelName_(_channelName) + : BasePopup({}, + static_cast(&(getApp()->windows->getMainWindow()))) + , channelName_(_channelName) { this->ui_.okButton.setText("OK"); this->ui_.cancelButton.setText("Cancel"); diff --git a/src/widgets/dialogs/QualityPopup.hpp b/src/widgets/dialogs/QualityPopup.hpp index 0225ae4b3..cb5f06205 100644 --- a/src/widgets/dialogs/QualityPopup.hpp +++ b/src/widgets/dialogs/QualityPopup.hpp @@ -1,6 +1,6 @@ #pragma once -#include "widgets/BaseWindow.hpp" +#include "widgets/BasePopup.hpp" #include #include @@ -9,7 +9,7 @@ namespace chatterino { -class QualityPopup : public BaseWindow +class QualityPopup : public BasePopup { public: QualityPopup(const QString &_channelName, QStringList options); diff --git a/src/widgets/dialogs/SelectChannelDialog.cpp b/src/widgets/dialogs/SelectChannelDialog.cpp index df786bade..f84f33550 100644 --- a/src/widgets/dialogs/SelectChannelDialog.cpp +++ b/src/widgets/dialogs/SelectChannelDialog.cpp @@ -26,7 +26,9 @@ namespace chatterino { SelectChannelDialog::SelectChannelDialog(QWidget *parent) - : BaseWindow(BaseWindow::EnableCustomFrame, parent) + : BaseWindow( + {BaseWindow::Flags::EnableCustomFrame, BaseWindow::Flags::Dialog}, + parent) , selectedChannel_(Channel::getEmpty()) { this->setWindowTitle("Select a channel to join"); diff --git a/src/widgets/dialogs/SettingsDialog.cpp b/src/widgets/dialogs/SettingsDialog.cpp index 89e5d3e7b..b24290ba8 100644 --- a/src/widgets/dialogs/SettingsDialog.cpp +++ b/src/widgets/dialogs/SettingsDialog.cpp @@ -24,8 +24,10 @@ namespace chatterino { -SettingsDialog::SettingsDialog() - : BaseWindow(BaseWindow::DisableCustomScaling) +SettingsDialog::SettingsDialog(QWidget *parent) + : BaseWindow( + {BaseWindow::Flags::DisableCustomScaling, BaseWindow::Flags::Dialog}, + parent) { this->setWindowTitle("Chatterino Settings"); this->resize(815, 600); @@ -41,6 +43,10 @@ SettingsDialog::SettingsDialog() this->ui_.search->setFocus(); this->ui_.search->selectAll(); }); + + // Disable the ? button in the titlebar until we decide to use it + this->setWindowFlags(this->windowFlags() & + ~Qt::WindowContextHelpButtonHint); } void SettingsDialog::initUi() @@ -238,9 +244,10 @@ SettingsDialogTab *SettingsDialog::tab(SettingsTabId id) return nullptr; } -void SettingsDialog::showDialog(SettingsDialogPreference preferredTab) +void SettingsDialog::showDialog(QWidget *parent, + SettingsDialogPreference preferredTab) { - static SettingsDialog *instance = new SettingsDialog(); + static SettingsDialog *instance = new SettingsDialog(parent); static bool hasShownBefore = false; if (hasShownBefore) instance->refresh(); diff --git a/src/widgets/dialogs/SettingsDialog.hpp b/src/widgets/dialogs/SettingsDialog.hpp index fa7449ab0..c5b79e095 100644 --- a/src/widgets/dialogs/SettingsDialog.hpp +++ b/src/widgets/dialogs/SettingsDialog.hpp @@ -31,10 +31,11 @@ enum class SettingsDialogPreference { class SettingsDialog : public BaseWindow { - SettingsDialog(); + SettingsDialog(QWidget *parent); public: - static void showDialog(SettingsDialogPreference preferredTab = + static void showDialog(QWidget *parent, + SettingsDialogPreference preferredTab = SettingsDialogPreference::NoPreference); protected: diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index d9dfbebc9..06e9533e3 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -104,13 +104,22 @@ namespace { } // namespace -UserInfoPopup::UserInfoPopup(bool closeAutomatically) - : BaseWindow( - closeAutomatically - ? FlagsEnum{BaseWindow::EnableCustomFrame, - BaseWindow::Frameless, - BaseWindow::FramelessDraggable} - : BaseWindow::EnableCustomFrame) +#ifdef Q_OS_LINUX +FlagsEnum userInfoPopupFlags{BaseWindow::Dialog, + BaseWindow::EnableCustomFrame}; +FlagsEnum userInfoPopupFlagsCloseAutomatically{ + BaseWindow::EnableCustomFrame}; +#else +FlagsEnum userInfoPopupFlags{BaseWindow::EnableCustomFrame}; +FlagsEnum userInfoPopupFlagsCloseAutomatically{ + BaseWindow::EnableCustomFrame, BaseWindow::Frameless, + BaseWindow::FramelessDraggable}; +#endif + +UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent) + : BaseWindow(closeAutomatically ? userInfoPopupFlagsCloseAutomatically + : userInfoPopupFlags, + parent) , hack_(new bool) { this->setWindowTitle("Usercard"); diff --git a/src/widgets/dialogs/UserInfoPopup.hpp b/src/widgets/dialogs/UserInfoPopup.hpp index aa69b7829..2f5c2b82d 100644 --- a/src/widgets/dialogs/UserInfoPopup.hpp +++ b/src/widgets/dialogs/UserInfoPopup.hpp @@ -18,7 +18,7 @@ class UserInfoPopup final : public BaseWindow Q_OBJECT public: - UserInfoPopup(bool closeAutomatically); + UserInfoPopup(bool closeAutomatically, QWidget *parent); ~UserInfoPopup(); void setData(const QString &name, const ChannelPtr &channel); diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index e751432b2..45d28fc49 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1937,7 +1937,8 @@ void ChannelView::hideEvent(QHideEvent *) void ChannelView::showUserInfoPopup(const QString &userName) { - auto *userPopup = new UserInfoPopup(getSettings()->autoCloseUserPopup); + auto *userPopup = + new UserInfoPopup(getSettings()->autoCloseUserPopup, this); userPopup->setData(userName, this->hasSourceChannel() ? this->sourceChannel_ : this->underlyingChannel_); @@ -1997,7 +1998,8 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link, break; case Link::OpenAccountsPage: { - SettingsDialog::showDialog(SettingsDialogPreference::Accounts); + SettingsDialog::showDialog(this, + SettingsDialogPreference::Accounts); } break; diff --git a/src/widgets/helper/DebugPopup.hpp b/src/widgets/helper/DebugPopup.hpp index ad3c624f0..39f576eed 100644 --- a/src/widgets/helper/DebugPopup.hpp +++ b/src/widgets/helper/DebugPopup.hpp @@ -1,10 +1,10 @@ #pragma once -#include +#include "widgets/BasePopup.hpp" namespace chatterino { -class DebugPopup : public QWidget +class DebugPopup : public BasePopup { public: DebugPopup(); diff --git a/src/widgets/settingspages/AboutPage.cpp b/src/widgets/settingspages/AboutPage.cpp index 4880aace5..b802f256a 100644 --- a/src/widgets/settingspages/AboutPage.cpp +++ b/src/widgets/settingspages/AboutPage.cpp @@ -4,6 +4,7 @@ #include "common/Version.hpp" #include "util/LayoutCreator.hpp" #include "util/RemoveScrollAreaBackground.hpp" +#include "widgets/BasePopup.hpp" #include "widgets/helper/SignalLabel.hpp" #include @@ -230,17 +231,25 @@ void AboutPage::addLicense(QFormLayout *form, const QString &name, auto *a = new QLabel("" + name + ""); a->setOpenExternalLinks(true); auto *b = new QLabel("show license"); - QObject::connect(b, &QLabel::linkActivated, [licenseLink, name] { - auto *edit = new QTextEdit; + QObject::connect( + b, &QLabel::linkActivated, [parent = this, name, licenseLink] { + auto window = + new BasePopup(BaseWindow::Flags::EnableCustomFrame, parent); + window->setWindowTitle("Chatterino - License for " + name); + window->setAttribute(Qt::WA_DeleteOnClose); + auto layout = new QVBoxLayout(); + auto *edit = new QTextEdit; - edit->setWindowTitle( - QString("Chatterino - showing %1's license").arg(name)); - QFile file(licenseLink); - file.open(QIODevice::ReadOnly); - edit->setText(file.readAll()); - edit->setReadOnly(true); - edit->show(); - }); + QFile file(licenseLink); + file.open(QIODevice::ReadOnly); + edit->setText(file.readAll()); + edit->setReadOnly(true); + + layout->addWidget(edit); + + window->getLayoutContainer()->setLayout(layout); + window->show(); + }); form->addRow(a, b); } diff --git a/src/widgets/settingspages/GeneralPageView.cpp b/src/widgets/settingspages/GeneralPageView.cpp index a179ce9e8..6d8439c53 100644 --- a/src/widgets/settingspages/GeneralPageView.cpp +++ b/src/widgets/settingspages/GeneralPageView.cpp @@ -165,13 +165,11 @@ ColorButton *GeneralPageView::addColorButton( layout->addWidget(colorButton); this->addLayout(layout); QObject::connect( - colorButton, &ColorButton::clicked, [&setting, colorButton]() { - auto dialog = new ColorPickerDialog(QColor(setting)); + colorButton, &ColorButton::clicked, [this, &setting, colorButton]() { + auto dialog = new ColorPickerDialog(QColor(setting), this); dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->show(); - dialog->closed.connect([&setting, colorButton, &dialog] { - QColor selected = dialog->selectedColor(); - + dialog->closed.connect([&setting, colorButton](QColor selected) { if (selected.isValid()) { setting = selected.name(QColor::HexArgb); diff --git a/src/widgets/settingspages/HighlightingPage.cpp b/src/widgets/settingspages/HighlightingPage.cpp index bc21a39f7..96682fc13 100644 --- a/src/widgets/settingspages/HighlightingPage.cpp +++ b/src/widgets/settingspages/HighlightingPage.cpp @@ -244,9 +244,7 @@ void HighlightingPage::tableCellClicked(const QModelIndex &clicked, auto dialog = new ColorPickerDialog(initial, this); dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->show(); - dialog->closed.connect([=] { - QColor selected = dialog->selectedColor(); - + dialog->closed.connect([=](QColor selected) { if (selected.isValid()) { view->getModel()->setData(clicked, selected, diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index c11861357..30f4d75a7 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -57,7 +57,7 @@ namespace { const QString &title, const QString &description) { auto window = - new BaseWindow(BaseWindow::Flags::EnableCustomFrame, parent); + new BasePopup(BaseWindow::Flags::EnableCustomFrame, parent); window->setWindowTitle("Chatterino - " + title); window->setAttribute(Qt::WA_DeleteOnClose); auto layout = new QVBoxLayout(); diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index e9d24d407..b9fe90235 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -240,8 +240,8 @@ void SplitHeader::initializeLayout() if (getSettings()->moderationActions.empty()) { getApp()->windows->showSettingsDialog( - SettingsDialogPreference:: - ModerationActions); + this, SettingsDialogPreference:: + ModerationActions); this->split_->setModerationMode(true); } else @@ -258,6 +258,7 @@ void SplitHeader::initializeLayout() case Qt::RightButton: case Qt::MiddleButton: getApp()->windows->showSettingsDialog( + this, SettingsDialogPreference::ModerationActions); break; }