#include "settingspages/bufferviewsettingspage.h"
#include "settingspages/chatmonitorsettingspage.h"
#include "settingspages/chatviewsettingspage.h"
+#include "settingspages/chatviewcolorsettingspage.h"
#include "settingspages/connectionsettingspage.h"
#include "settingspages/coreaccountsettingspage.h"
#include "settingspages/coreconnectionsettingspage.h"
_titleSetter(this),
_awayLog(0),
_layoutLoaded(false),
- _activeBufferViewIndex(-1)
+ _activeBufferViewIndex(-1),
+ _aboutToQuit(false)
{
setAttribute(Qt::WA_DeleteOnClose, false); // we delete the mainwin manually
show();
}
+QMenu *MainWin::createPopupMenu()
+{
+ QMenu *popupMenu = QMainWindow::createPopupMenu();
+ popupMenu->addSeparator();
+ ActionCollection *coll = QtUi::actionCollection("General");
+ popupMenu->addAction(coll->action("ToggleMenuBar"));
+ return popupMenu;
+}
+
void MainWin::updateIcon()
{
coll->addAction("ShowAwayLog", new Action(tr("Show Away Log"), coll,
this, SLOT(showAwayLog())));
coll->addAction("ToggleMenuBar", new Action(QIcon::fromTheme("show-menu"), tr("Show &Menubar"), coll,
- 0, 0, QKeySequence(Qt::CTRL + Qt::Key_M)))->setCheckable(true);
+ 0, 0))->setCheckable(true);
coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll,
0, 0))->setCheckable(true);
//Category: Interface
dlg->registerSettingsPage(new AppearanceSettingsPage(dlg));
dlg->registerSettingsPage(new ChatViewSettingsPage(dlg));
+ dlg->registerSettingsPage(new ChatViewColorSettingsPage(dlg));
dlg->registerSettingsPage(new ChatMonitorSettingsPage(dlg));
dlg->registerSettingsPage(new ItemViewSettingsPage(dlg));
dlg->registerSettingsPage(new BufferViewSettingsPage(dlg));
QtUiSettings s;
QtUiApplication *app = qobject_cast<QtUiApplication *> qApp;
Q_ASSERT(app);
- if (!app->isAboutToQuit() && QtUi::haveSystemTray() && s.value("MinimizeOnClose").toBool()) {
+ // On OSX it can happen that the closeEvent occurs twice. (Especially if packaged with Frameworks)
+ // This messes up MainWinState/MainWinHidden save/restore.
+ // It's a bug in Qt: https://bugreports.qt.io/browse/QTBUG-43344
+ if (!_aboutToQuit && !app->isAboutToQuit() && QtUi::haveSystemTray() && s.value("MinimizeOnClose").toBool()) {
QtUi::hideMainWidget();
event->ignore();
}
- else {
+ else if(!_aboutToQuit) {
+ _aboutToQuit = true;
event->accept();
quit();
}
+ else {
+ event->ignore();
+ }
}