diff --git a/src/lib/app/browserwindow.cpp b/src/lib/app/browserwindow.cpp index e14ea9b2d..5784647ab 100644 --- a/src/lib/app/browserwindow.cpp +++ b/src/lib/app/browserwindow.cpp @@ -546,15 +546,6 @@ void BrowserWindow::goBack() weView()->back(); } -QMenuBar* BrowserWindow::menuBar() const -{ -#ifdef Q_OS_MAC - return mApp->macMenuReceiver()->menuBar(); -#endif - - return QMainWindow::menuBar(); -} - TabbedWebView* BrowserWindow::weView() const { return weView(m_tabWidget->currentIndex()); diff --git a/src/lib/app/browserwindow.h b/src/lib/app/browserwindow.h index 0c1a68fd3..bea387d75 100644 --- a/src/lib/app/browserwindow.h +++ b/src/lib/app/browserwindow.h @@ -25,7 +25,6 @@ #include "restoremanager.h" #include "qzcommon.h" -class QMenuBar; class QLabel; class QVBoxLayout; class QSplitter; @@ -84,7 +83,6 @@ public: void createEncodingMenu(QMenu* menu); SideBar* addSideBar(); - virtual QMenuBar* menuBar() const; QByteArray saveState(int version = 0) const; bool restoreState(const QByteArray &state, int version = 0); diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 8ef0420fa..e5c1dd028 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -102,7 +102,6 @@ MainApplication::MainApplication(int &argc, char** argv) , m_registerQAppAssociation(0) #endif #ifdef Q_OS_MAC - , m_macMenuReceiver(0) , m_macDockMenu(0) #endif { @@ -1115,29 +1114,7 @@ RegisterQAppAssociation* MainApplication::associationManager() #endif #ifdef Q_OS_MAC -#include "macmenureceiver.h" - #include -#include - -extern void qt_mac_set_dock_menu(QMenu* menu); - -QMenu* MainApplication::macDockMenu() -{ - if (!m_macDockMenu) { - m_macDockMenu = new QMenu(0); - qt_mac_set_dock_menu(m_macDockMenu); - } - return m_macDockMenu; -} - -MacMenuReceiver* MainApplication::macMenuReceiver() -{ - if (!m_macMenuReceiver) { - m_macMenuReceiver = new MacMenuReceiver(this); - } - return m_macMenuReceiver; -} bool MainApplication::event(QEvent* e) { diff --git a/src/lib/app/mainapplication.h b/src/lib/app/mainapplication.h index 1580de1e7..e9c1eb1d1 100644 --- a/src/lib/app/mainapplication.h +++ b/src/lib/app/mainapplication.h @@ -31,6 +31,7 @@ class QNetworkDiskCache; class History; class AutoFill; +class MainMenu; class Bookmarks; class CookieJar; class AutoSaver; @@ -48,10 +49,6 @@ class HTML5PermissionsManager; class RegisterQAppAssociation; class DesktopNotificationsFactory; -#ifdef Q_OS_MAC -class MacMenuReceiver; -#endif - class QUPZILLA_EXPORT MainApplication : public QtSingleApplication { Q_OBJECT @@ -188,13 +185,7 @@ private: #ifdef Q_OS_MAC public: - MacMenuReceiver* macMenuReceiver(); - QMenu* macDockMenu(); bool event(QEvent* e); - -private: - MacMenuReceiver* m_macMenuReceiver; - QMenu* m_macDockMenu; #endif }; diff --git a/src/lib/app/mainmenu.cpp b/src/lib/app/mainmenu.cpp index 945d53aea..16c7d7856 100644 --- a/src/lib/app/mainmenu.cpp +++ b/src/lib/app/mainmenu.cpp @@ -39,6 +39,10 @@ #include #include +#ifdef Q_OS_MAC +extern void qt_mac_set_dock_menu(QMenu* menu); +#endif + MainMenu::MainMenu(BrowserWindow* window, QWidget* parent) : QMenu(parent) , m_window(window) @@ -631,6 +635,13 @@ void MainMenu::init() // Add standard actions to File Menu (as it won't be ever cleared) and Mac menubar should move them to "Application" menu m_menuFile->addAction(m_actions[QSL("Standard/About")]); m_menuFile->addAction(m_actions[QSL("Standard/Preferences")]); + + // Create Dock menu + QMenu* dockMenu = new QMenu(0); + dockMenu->addAction(m_actions[QSL("File/NewTab")]); + dockMenu->addAction(m_actions[QSL("File/NewWindow")]); + dockMenu->addAction(m_actions[QSL("File/NewPrivateWindow")]); + qt_mac_set_dock_menu(dockMenu); #endif #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)