diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index fe2e59295..3eed81615 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -62,6 +62,7 @@ #ifdef Q_OS_MAC #include "macmenureceiver.h" #include +#include #endif #include #include @@ -114,6 +115,7 @@ MainApplication::MainApplication(int &argc, char** argv) #endif #ifdef Q_OS_MAC , m_macMenuReceiver(0) + , m_macDockMenu(0) #endif { #if defined(QZ_WS_X11) && !defined(NO_SYSTEM_DATAPATH) @@ -639,6 +641,17 @@ QupZilla* MainApplication::makeNewWindow(Qz::BrowserWindow type, const QUrl &sta } #ifdef Q_OS_MAC +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) { @@ -1213,4 +1226,7 @@ QString MainApplication::tempPath() const MainApplication::~MainApplication() { delete m_uaManager; +#ifdef Q_OS_MAC + delete m_macDockMenu; +#endif } diff --git a/src/lib/app/mainapplication.h b/src/lib/app/mainapplication.h index 41f113ff6..2b13dd09c 100644 --- a/src/lib/app/mainapplication.h +++ b/src/lib/app/mainapplication.h @@ -54,6 +54,7 @@ class HTML5PermissionsManager; class Speller; #ifdef Q_OS_MAC class MacMenuReceiver; +class QMenu; #endif class QT_QUPZILLA_EXPORT MainApplication : public QtSingleApplication @@ -130,6 +131,7 @@ public: #ifdef Q_OS_MAC MacMenuReceiver* macMenuReceiver(); + QMenu* macDockMenu(); bool event(QEvent* e); #endif @@ -205,6 +207,7 @@ private: #endif #ifdef Q_OS_MAC MacMenuReceiver* m_macMenuReceiver; + QMenu* m_macDockMenu; #endif }; diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/qupzilla.cpp index a6a5d9fe6..b14fa52f4 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/qupzilla.cpp @@ -628,6 +628,12 @@ void QupZilla::setupMenu() m_superMenu->addSeparator(); m_superMenu->addAction(new ActionCopy(m_actionQuit, this)); +#else + ActionCopy* copyActionPrivateBrowsing = new ActionCopy(m_actionPrivateBrowsing); + copyActionPrivateBrowsing->setText(copyActionPrivateBrowsing->text().remove(QLatin1Char('&'))); + mApp->macDockMenu()->addAction(copyActionPrivateBrowsing); + mApp->macDockMenu()->addAction(m_menuFile->actions().at(1)); + mApp->macDockMenu()->addAction(m_menuFile->actions().at(0)); #endif }