2013-02-07 14:01:01 +01:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2014-01-11 16:11:42 +01:00
|
|
|
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
|
|
|
|
* Copyright (C) 2013-2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
|
2013-02-07 14:01:01 +01:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
|
|
|
#include "macmenureceiver.h"
|
|
|
|
#include "mainapplication.h"
|
2014-02-19 22:07:21 +01:00
|
|
|
#include "browserwindow.h"
|
2013-02-07 14:01:01 +01:00
|
|
|
#include "settings.h"
|
|
|
|
|
|
|
|
#include <QAction>
|
|
|
|
#include <QMenu>
|
|
|
|
|
|
|
|
MacMenuReceiver::MacMenuReceiver(QObject* parent)
|
|
|
|
: QObject(parent)
|
2013-02-08 15:21:00 +01:00
|
|
|
, m_macMenuBar(0)
|
2013-02-08 14:07:51 +01:00
|
|
|
, m_bookmarksMenuChanged(true)
|
2013-02-09 01:17:58 +01:00
|
|
|
, m_menuBookmarksAction(0)
|
2013-02-07 14:01:01 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-02-07 22:48:10 +01:00
|
|
|
void MacMenuReceiver::setEnabledSelectedMenuActions(QMenu* menu, const QList<int> indexList)
|
|
|
|
{
|
|
|
|
if (!menu || mApp->windowCount() == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// we mean all actions by empty list
|
|
|
|
if (indexList.isEmpty()) {
|
2013-03-06 09:05:41 +01:00
|
|
|
foreach (QAction* act, menu->actions()) {
|
2013-02-07 22:48:10 +01:00
|
|
|
act->setEnabled(true);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-03-06 09:05:41 +01:00
|
|
|
foreach (int index, indexList) {
|
2013-02-09 01:17:58 +01:00
|
|
|
Q_ASSERT(index >= 0 && index < menu->actions().size());
|
2013-02-07 22:48:10 +01:00
|
|
|
menu->actions().at(index)->setEnabled(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-07 14:01:01 +01:00
|
|
|
void MacMenuReceiver::setDisabledSelectedMenuActions(QMenu* menu, const QList<int> indexList)
|
|
|
|
{
|
|
|
|
if (!menu) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// we mean all actions by empty list
|
|
|
|
if (indexList.isEmpty()) {
|
2013-03-06 09:05:41 +01:00
|
|
|
foreach (QAction* act, menu->actions()) {
|
2013-02-07 14:01:01 +01:00
|
|
|
act->setDisabled(true);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-03-06 09:05:41 +01:00
|
|
|
foreach (int index, indexList) {
|
2013-02-09 01:17:58 +01:00
|
|
|
Q_ASSERT(index >= 0 && index < menu->actions().size());
|
2013-02-07 14:01:01 +01:00
|
|
|
menu->actions().at(index)->setDisabled(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-09 12:40:20 +01:00
|
|
|
bool MacMenuReceiver::callSlot(const char* member, bool makeIfNoWindow, QGenericArgument val0, QGenericArgument val1)
|
2013-02-07 14:01:01 +01:00
|
|
|
{
|
2014-02-19 22:07:21 +01:00
|
|
|
BrowserWindow* qzWindow = mApp->getWindow();
|
2013-02-07 14:01:01 +01:00
|
|
|
if (!qzWindow) {
|
|
|
|
if (!makeIfNoWindow) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else {
|
2014-03-10 00:47:07 +01:00
|
|
|
qzWindow = mApp->createWindow(Qz::BW_MacFirstWindow);
|
2013-02-07 14:01:01 +01:00
|
|
|
mApp->processEvents();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool success = QMetaObject::invokeMethod(qzWindow, member, val0, val1);
|
|
|
|
|
|
|
|
if (!success) {
|
2014-02-25 19:36:13 +01:00
|
|
|
qCritical("Warning: try to invoke \'BrowserWindow::%s()\' with incorrect parameter(s) or no such slot.", member);
|
2013-02-07 14:01:01 +01:00
|
|
|
// this should never happen, for now:
|
|
|
|
// we just ignore it!
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::goNext()
|
|
|
|
{
|
|
|
|
callSlot("goNext");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MacMenuReceiver::goBack()
|
|
|
|
{
|
|
|
|
callSlot("goBack");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::goHome()
|
|
|
|
{
|
|
|
|
callSlot("goHome", true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::stop()
|
|
|
|
{
|
|
|
|
callSlot("stop");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::reload()
|
|
|
|
{
|
|
|
|
callSlot("reload");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::reloadByPassCache()
|
|
|
|
{
|
|
|
|
callSlot("reloadByPassCache");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::aboutQupZilla()
|
|
|
|
{
|
|
|
|
callSlot("aboutQupZilla", true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::addTab()
|
|
|
|
{
|
|
|
|
if (!callSlot("addTab")) {
|
2014-03-10 00:47:07 +01:00
|
|
|
mApp->createWindow(Qz::BW_MacFirstWindow);
|
2013-02-07 14:01:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::savePageScreen()
|
|
|
|
{
|
|
|
|
callSlot("savePageScreen");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::searchOnPage()
|
|
|
|
{
|
|
|
|
callSlot("searchOnPage");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::showCookieManager()
|
|
|
|
{
|
|
|
|
callSlot("showCookieManager");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::showHistoryManager()
|
|
|
|
{
|
|
|
|
callSlot("showHistoryManager");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::showBookmarksManager()
|
|
|
|
{
|
|
|
|
callSlot("showBookmarksManager");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::showDownloadManager()
|
|
|
|
{
|
|
|
|
callSlot("showDownloadManager");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::showMenubar()
|
|
|
|
{
|
|
|
|
callSlot("showMenubar");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::showNavigationToolbar()
|
|
|
|
{
|
|
|
|
callSlot("showNavigationToolbar");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::showStatusbar()
|
|
|
|
{
|
|
|
|
callSlot("showStatusbar");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::showClearPrivateData()
|
|
|
|
{
|
|
|
|
callSlot("showClearPrivateData");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::showPreferences()
|
|
|
|
{
|
|
|
|
callSlot("showPreferences", true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::showBookmarkImport()
|
|
|
|
{
|
|
|
|
callSlot("showBookmarkImport");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MacMenuReceiver::refreshHistory()
|
|
|
|
{
|
|
|
|
callSlot("refreshHistory");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::bookmarkAllTabs()
|
|
|
|
{
|
|
|
|
callSlot("bookmarkAllTabs");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::newWindow()
|
|
|
|
{
|
|
|
|
if (!callSlot("newWindow")) {
|
2014-03-10 00:47:07 +01:00
|
|
|
mApp->createWindow(Qz::BW_MacFirstWindow);
|
2013-02-07 14:01:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MacMenuReceiver::openLocation()
|
|
|
|
{
|
|
|
|
callSlot("openLocation", true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::openFile()
|
|
|
|
{
|
|
|
|
callSlot("openFile", true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::savePage()
|
|
|
|
{
|
|
|
|
callSlot("savePage");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::sendLink()
|
|
|
|
{
|
|
|
|
callSlot("sendLink");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::webSearch()
|
|
|
|
{
|
|
|
|
callSlot("webSearch");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MacMenuReceiver::editUndo()
|
|
|
|
{
|
|
|
|
callSlot("editUndo");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::editRedo()
|
|
|
|
{
|
|
|
|
callSlot("editRedo");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::editCut()
|
|
|
|
{
|
|
|
|
callSlot("editCut");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::editCopy()
|
|
|
|
{
|
|
|
|
callSlot("editCopy");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::editPaste()
|
|
|
|
{
|
|
|
|
callSlot("editPaste");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::editSelectAll()
|
|
|
|
{
|
|
|
|
callSlot("editSelectAll");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MacMenuReceiver::zoomIn()
|
|
|
|
{
|
|
|
|
callSlot("zoomIn");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::zoomOut()
|
|
|
|
{
|
|
|
|
callSlot("zoomOut");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::zoomReset()
|
|
|
|
{
|
|
|
|
callSlot("zoomReset");
|
|
|
|
}
|
|
|
|
|
2014-02-10 02:01:42 +01:00
|
|
|
void MacMenuReceiver::toggleFullScreen()
|
2013-02-07 14:01:01 +01:00
|
|
|
{
|
2014-02-10 02:01:42 +01:00
|
|
|
callSlot("toggleFullScreen");
|
2013-02-07 14:01:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::changeEncoding(QObject* obj)
|
|
|
|
{
|
|
|
|
if (!obj) {
|
|
|
|
obj = sender();
|
|
|
|
}
|
|
|
|
|
|
|
|
callSlot("changeEncoding", false, Q_ARG(QObject*, obj));
|
|
|
|
}
|
|
|
|
|
2013-02-09 13:00:45 +01:00
|
|
|
void MacMenuReceiver::triggerTabsOnTop(bool enable)
|
|
|
|
{
|
|
|
|
callSlot("triggerTabsOnTop", false, Q_ARG(bool, enable));
|
|
|
|
}
|
2013-02-07 14:01:01 +01:00
|
|
|
|
|
|
|
void MacMenuReceiver::closeWindow()
|
|
|
|
{
|
|
|
|
callSlot("closeWindow");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::quitApp()
|
|
|
|
{
|
|
|
|
if (!callSlot("quitApp")) {
|
|
|
|
mApp->quitApplication();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-27 11:01:52 +01:00
|
|
|
void MacMenuReceiver::printPage(QWebEngineFrame* frame)
|
2013-02-07 14:01:01 +01:00
|
|
|
{
|
2015-01-27 11:01:52 +01:00
|
|
|
callSlot("printPage", false, Q_ARG(QWebEngineFrame*, frame));
|
2013-02-07 14:01:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::showBookmarksToolbar()
|
|
|
|
{
|
|
|
|
callSlot("showBookmarksToolbar");
|
|
|
|
}
|
|
|
|
|
2015-01-27 11:01:52 +01:00
|
|
|
void MacMenuReceiver::showSource(QWebEngineFrame* frame, const QString &selectedHtml)
|
2013-02-07 14:01:01 +01:00
|
|
|
{
|
2015-01-27 11:01:52 +01:00
|
|
|
callSlot("showSource", false, Q_ARG(QWebEngineFrame*, frame), Q_ARG(const QString &, selectedHtml));
|
2013-02-07 14:01:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::bookmarkPage()
|
|
|
|
{
|
|
|
|
callSlot("bookmarkPage");
|
|
|
|
}
|
|
|
|
|
2013-02-07 15:01:25 +01:00
|
|
|
void MacMenuReceiver::closeTab()
|
|
|
|
{
|
|
|
|
callSlot("closeTab");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::restoreClosedTab(QObject* obj)
|
|
|
|
{
|
|
|
|
if (!obj) {
|
|
|
|
obj = sender();
|
|
|
|
}
|
|
|
|
|
|
|
|
callSlot("restoreClosedTab", false, Q_ARG(QObject*, obj));
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::restoreAllClosedTabs()
|
|
|
|
{
|
|
|
|
callSlot("restoreAllClosedTabs");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::clearClosedTabsList()
|
|
|
|
{
|
|
|
|
callSlot("clearClosedTabsList");
|
|
|
|
}
|
|
|
|
|
2013-02-07 14:01:01 +01:00
|
|
|
void MacMenuReceiver::showPageInfo()
|
|
|
|
{
|
|
|
|
callSlot("showPageInfo");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::showWebInspector(bool toggle)
|
|
|
|
{
|
|
|
|
callSlot("showWebInspector", false, Q_ARG(bool, toggle));
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::loadActionUrl(QObject* obj)
|
|
|
|
{
|
|
|
|
if (!obj) {
|
|
|
|
obj = sender();
|
|
|
|
}
|
|
|
|
|
|
|
|
callSlot("loadActionUrl", true, Q_ARG(QObject*, obj));
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::loadActionUrlInNewTab(QObject* obj)
|
|
|
|
{
|
|
|
|
if (!obj) {
|
|
|
|
obj = sender();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!callSlot("loadActionUrlInNewTab", false, Q_ARG(QObject*, obj))) {
|
2013-02-09 12:40:20 +01:00
|
|
|
callSlot("loadActionUrl", true, Q_ARG(QObject*, obj));
|
2013-02-07 14:01:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::loadActionUrlInNewNotSelectedTab(QObject* obj)
|
|
|
|
{
|
|
|
|
if (!obj) {
|
|
|
|
obj = sender();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!callSlot("loadActionUrlInNewNotSelectedTab", false, Q_ARG(QObject*, obj))) {
|
|
|
|
callSlot("loadActionUrl", true, Q_ARG(QObject*, obj));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// about to show/hide slots
|
2013-03-16 10:36:29 +01:00
|
|
|
void MacMenuReceiver::aboutToShowFileMenu(QMenu* menu)
|
2013-02-07 14:01:01 +01:00
|
|
|
{
|
2013-03-16 10:36:29 +01:00
|
|
|
menu = menu ? menu : qobject_cast<QMenu*>(sender());
|
2013-02-07 22:48:10 +01:00
|
|
|
setEnabledSelectedMenuActions(menu);
|
2013-02-07 14:01:01 +01:00
|
|
|
if (!callSlot("aboutToShowFileMenu")) {
|
2013-02-07 22:48:10 +01:00
|
|
|
setDisabledSelectedMenuActions(menu, QList<int>()
|
2013-02-07 14:01:01 +01:00
|
|
|
<< 4 << 5 << 7 << 8 << 9 << 10 << 12);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::aboutToHideFileMenu()
|
|
|
|
{
|
|
|
|
callSlot("aboutToHideFileMenu");
|
|
|
|
}
|
|
|
|
|
2013-03-16 10:36:29 +01:00
|
|
|
void MacMenuReceiver::aboutToShowHistoryMenu(QMenu* menu)
|
2013-02-07 14:01:01 +01:00
|
|
|
{
|
2013-03-16 10:36:29 +01:00
|
|
|
menu = menu ? menu : qobject_cast<QMenu*>(sender());
|
2013-02-07 22:48:10 +01:00
|
|
|
// 2=Home, 3=Show all History, 7=Closed Tabs
|
|
|
|
setEnabledSelectedMenuActions(menu, QList<int>() << 2 << 3 << 7);
|
2013-02-07 14:01:01 +01:00
|
|
|
if (!callSlot("aboutToShowHistoryMenu")) {
|
2013-02-07 22:48:10 +01:00
|
|
|
setDisabledSelectedMenuActions(menu, QList<int>()
|
2013-02-07 14:01:01 +01:00
|
|
|
<< 0 << 1 << 2 << 3 << 7);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::aboutToHideHistoryMenu()
|
|
|
|
{
|
|
|
|
callSlot("aboutToHideHistoryMenu");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::aboutToShowClosedTabsMenu()
|
|
|
|
{
|
|
|
|
callSlot("aboutToShowClosedTabsMenu");
|
|
|
|
}
|
|
|
|
|
2013-03-16 10:36:29 +01:00
|
|
|
void MacMenuReceiver::aboutToShowBookmarksMenu(QMenu* menu)
|
2013-02-07 14:01:01 +01:00
|
|
|
{
|
2013-03-16 10:36:29 +01:00
|
|
|
menu = menu ? menu : qobject_cast<QMenu*>(sender());
|
2013-02-07 22:48:10 +01:00
|
|
|
setEnabledSelectedMenuActions(menu, QList<int>() << 0 << 1 << 2);
|
2013-02-07 14:01:01 +01:00
|
|
|
if (!callSlot("aboutToShowBookmarksMenu")) {
|
2013-02-07 22:48:10 +01:00
|
|
|
setDisabledSelectedMenuActions(menu, QList<int>() << 0 << 1 << 2);
|
2013-02-07 14:01:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-16 10:36:29 +01:00
|
|
|
void MacMenuReceiver::aboutToShowViewMenu(QMenu* menu)
|
2013-02-07 14:01:01 +01:00
|
|
|
{
|
2013-03-16 10:36:29 +01:00
|
|
|
menu = menu ? menu : qobject_cast<QMenu*>(sender());
|
2013-02-07 22:48:10 +01:00
|
|
|
// 7,8,9=Zoom actions, 12=Character Encoding, 15=Fullscreen
|
|
|
|
setEnabledSelectedMenuActions(menu, QList<int>()
|
2013-02-09 12:40:20 +01:00
|
|
|
<< 0 << 1 << 2 << 7 << 8 << 9 << 11 << 12 << 15);
|
2013-02-07 22:48:10 +01:00
|
|
|
// for updating reload and stop actions
|
|
|
|
if (mApp->getWindow()) {
|
|
|
|
mApp->getWindow()->updateLoadingActions();
|
|
|
|
}
|
|
|
|
|
2013-02-07 14:01:01 +01:00
|
|
|
if (!callSlot("aboutToShowViewMenu")) {
|
2013-02-07 22:48:10 +01:00
|
|
|
setDisabledSelectedMenuActions(menu);
|
2013-02-07 14:01:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::aboutToHideViewMenu()
|
|
|
|
{
|
|
|
|
callSlot("aboutToHideViewMenu");
|
|
|
|
}
|
|
|
|
|
2013-03-16 10:36:29 +01:00
|
|
|
void MacMenuReceiver::aboutToShowEditMenu(QMenu* menu)
|
2013-02-07 14:01:01 +01:00
|
|
|
{
|
2013-03-16 10:36:29 +01:00
|
|
|
menu = menu ? menu : qobject_cast<QMenu*>(sender());
|
2013-02-07 22:48:10 +01:00
|
|
|
// 8=Find
|
|
|
|
setEnabledSelectedMenuActions(menu, QList<int>() << 8);
|
2013-02-07 14:01:01 +01:00
|
|
|
if (!callSlot("aboutToShowEditMenu")) {
|
2013-02-07 22:48:10 +01:00
|
|
|
setDisabledSelectedMenuActions(menu);
|
2013-02-07 14:01:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::aboutToHideEditMenu()
|
|
|
|
{
|
|
|
|
callSlot("aboutToHideEditMenu");
|
|
|
|
}
|
|
|
|
|
2013-03-16 10:36:29 +01:00
|
|
|
void MacMenuReceiver::aboutToShowToolsMenu(QMenu* menu)
|
2013-02-07 14:01:01 +01:00
|
|
|
{
|
2013-03-16 10:36:29 +01:00
|
|
|
menu = menu ? menu : qobject_cast<QMenu*>(sender());
|
2013-02-07 22:48:10 +01:00
|
|
|
// enable all
|
|
|
|
setEnabledSelectedMenuActions(menu);
|
2013-02-07 14:01:01 +01:00
|
|
|
if (!callSlot("aboutToShowToolsMenu")) {
|
2013-02-07 22:48:10 +01:00
|
|
|
setDisabledSelectedMenuActions(menu, QList<int>()
|
2013-02-07 14:01:01 +01:00
|
|
|
<< 0 << 1 << 3 << 4 << 6 << 7 << 8);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::aboutToHideToolsMenu()
|
|
|
|
{
|
|
|
|
callSlot("aboutToHideToolsMenu");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::aboutToShowEncodingMenu()
|
|
|
|
{
|
|
|
|
callSlot("aboutToShowEncodingMenu");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::aboutToShowHistoryRecentMenu()
|
|
|
|
{
|
|
|
|
callSlot("aboutToShowHistoryRecentMenu");
|
|
|
|
}
|
|
|
|
|
|
|
|
void MacMenuReceiver::aboutToShowHistoryMostMenu()
|
|
|
|
{
|
|
|
|
callSlot("aboutToShowHistoryMostMenu");
|
|
|
|
}
|