diff --git a/src/mumble/MainWindow.cpp b/src/mumble/MainWindow.cpp index e6bb2661efd..13de6d314cf 100644 --- a/src/mumble/MainWindow.cpp +++ b/src/mumble/MainWindow.cpp @@ -364,12 +364,10 @@ void MainWindow::setupGui() { else if (! g.s.bMinimalView && ! g.s.qbaMainWindowGeometry.isNull()) restoreGeometry(g.s.qbaMainWindowGeometry); - Settings::WindowLayout wlTmp = g.s.wlWindowLayout; if (g.s.bMinimalView && ! g.s.qbaMinimalViewState.isNull()) restoreState(g.s.qbaMinimalViewState); else if (! g.s.bMinimalView && ! g.s.qbaMainWindowState.isNull()) restoreState(g.s.qbaMainWindowState); - g.s.wlWindowLayout = wlTmp; setupView(false); @@ -564,6 +562,14 @@ void MainWindow::updateTransmitModeComboBox() { } } +QMenu *MainWindow::createPopupMenu() { + if (g.s.wlWindowLayout == Settings::LayoutCustom) { + return QMainWindow::createPopupMenu(); + } + + return NULL; +} + Channel *MainWindow::getContextMenuChannel() { if (cContextChannel) return cContextChannel.data(); @@ -882,9 +888,7 @@ void MainWindow::setOnTop(bool top) { void MainWindow::setupView(bool toggle_minimize) { bool showit = ! g.s.bMinimalView; - // Update window layout - Settings::WindowLayout wlTmp = g.s.wlWindowLayout; - switch (wlTmp) { + switch (g.s.wlWindowLayout) { case Settings::LayoutClassic: removeDockWidget(qdwLog); addDockWidget(Qt::LeftDockWidgetArea, qdwLog); @@ -908,11 +912,9 @@ void MainWindow::setupView(bool toggle_minimize) { qdwChat->show(); break; default: - wlTmp = Settings::LayoutCustom; break; } qteChat->updateGeometry(); - g.s.wlWindowLayout = wlTmp; QRect geom = frameGeometry(); @@ -3032,22 +3034,6 @@ void MainWindow::on_qteLog_highlighted(const QUrl &url) { } } -void MainWindow::on_qdwChat_dockLocationChanged(Qt::DockWidgetArea) { - g.s.wlWindowLayout = Settings::LayoutCustom; -} - -void MainWindow::on_qdwLog_dockLocationChanged(Qt::DockWidgetArea) { - g.s.wlWindowLayout = Settings::LayoutCustom; -} - -void MainWindow::on_qdwChat_visibilityChanged(bool) { - g.s.wlWindowLayout = Settings::LayoutCustom; -} - -void MainWindow::on_qdwLog_visibilityChanged(bool) { - g.s.wlWindowLayout = Settings::LayoutCustom; -} - void MainWindow::context_triggered() { QAction *a = qobject_cast(sender()); diff --git a/src/mumble/MainWindow.h b/src/mumble/MainWindow.h index d8c2634f1c9..801fe3aad82 100644 --- a/src/mumble/MainWindow.h +++ b/src/mumble/MainWindow.h @@ -187,6 +187,8 @@ class MainWindow : public QMainWindow, public MessageHandler, public Ui::MainWin void showEvent(QShowEvent *e) Q_DECL_OVERRIDE; void changeEvent(QEvent* e) Q_DECL_OVERRIDE; + QMenu *createPopupMenu() Q_DECL_OVERRIDE; + bool handleSpecialContextMenu(const QUrl &url, const QPoint &pos_, bool focus = false); Channel* getContextMenuChannel(); ClientUser* getContextMenuUser(); @@ -259,10 +261,6 @@ class MainWindow : public QMainWindow, public MessageHandler, public Ui::MainWin void on_qteLog_customContextMenuRequested(const QPoint &pos); void on_qteLog_anchorClicked(const QUrl &); void on_qteLog_highlighted(const QUrl & link); - void on_qdwChat_dockLocationChanged(Qt::DockWidgetArea); - void on_qdwLog_dockLocationChanged(Qt::DockWidgetArea); - void on_qdwChat_visibilityChanged(bool); - void on_qdwLog_visibilityChanged(bool); void on_PushToTalk_triggered(bool, QVariant); void on_PushToMute_triggered(bool, QVariant); void on_VolumeUp_triggered(bool, QVariant);