1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

[EnhancedMenu] Rename signals to ctrlTriggerd and shiftTriggered

This commit is contained in:
nowrep 2014-02-09 01:14:00 +01:00
parent bb6ead3ad4
commit 973014ae89
7 changed files with 28 additions and 28 deletions

View File

@ -1061,7 +1061,7 @@ void QupZilla::aboutToShowHistoryRecentMenu()
Action* act = new Action(_iconForUrl(url), title);
act->setData(url);
connect(act, SIGNAL(triggered()), MENU_RECEIVER, SLOT(loadActionUrl()));
connect(act, SIGNAL(middleClicked()), MENU_RECEIVER, SLOT(loadActionUrlInNewNotSelectedTab()));
connect(act, SIGNAL(ctrlTriggered()), MENU_RECEIVER, SLOT(loadActionUrlInNewNotSelectedTab()));
m_menuHistoryRecent->addAction(act);
}
@ -1086,7 +1086,7 @@ void QupZilla::aboutToShowHistoryMostMenu()
Action* act = new Action(_iconForUrl(entry.url), title);
act->setData(entry.url);
connect(act, SIGNAL(triggered()), MENU_RECEIVER, SLOT(loadActionUrl()));
connect(act, SIGNAL(middleClicked()), MENU_RECEIVER, SLOT(loadActionUrlInNewNotSelectedTab()));
connect(act, SIGNAL(ctrlTriggered()), MENU_RECEIVER, SLOT(loadActionUrlInNewNotSelectedTab()));
m_menuHistoryMost->addAction(act);
}

View File

@ -227,8 +227,8 @@ void BookmarksMenu::addBookmark(Menu* menu, BookmarkItem* bookmark)
act->setData(QVariant::fromValue<void*>(static_cast<void*>(bookmark)));
connect(act, SIGNAL(triggered()), this, SLOT(bookmarkActivated()));
connect(act, SIGNAL(middleClicked()), this, SLOT(bookmarkCtrlActivated()));
connect(act, SIGNAL(shiftClicked()), this, SLOT(bookmarkShiftActivated()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(bookmarkCtrlActivated()));
connect(act, SIGNAL(shiftTriggered()), this, SLOT(bookmarkShiftActivated()));
menu->addAction(act);
}

View File

@ -639,7 +639,7 @@ void BookmarksToolbar::aboutToShowFolderMenu()
Action* act = new Action(qIconProvider->iconFromImage(b.image), title);
act->setData(b.url);
connect(act, SIGNAL(triggered()), p_QupZilla, SLOT(loadActionUrl()));
connect(act, SIGNAL(middleClicked()), p_QupZilla, SLOT(loadActionUrlInNewNotSelectedTab()));
connect(act, SIGNAL(ctrlTriggered()), p_QupZilla, SLOT(loadActionUrlInNewNotSelectedTab()));
menu->addAction(act);
}
@ -705,7 +705,7 @@ void BookmarksToolbar::refreshMostVisited()
Action* act = new Action(_iconForUrl(entry.url), title);
act->setData(entry.url);
connect(act, SIGNAL(triggered()), p_QupZilla, SLOT(loadActionUrl()));
connect(act, SIGNAL(middleClicked()), p_QupZilla, SLOT(loadActionUrlInNewNotSelectedTab()));
connect(act, SIGNAL(ctrlTriggered()), p_QupZilla, SLOT(loadActionUrlInNewNotSelectedTab()));
m_menuMostVisited->addAction(act);
}

View File

@ -256,7 +256,7 @@ void NavigationBar::aboutToShowHistoryBackMenu()
Action* act = new Action(icon, title);
act->setData(i);
connect(act, SIGNAL(triggered()), this, SLOT(goAtHistoryIndex()));
connect(act, SIGNAL(middleClicked()), this, SLOT(goAtHistoryIndexInNewTab()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(goAtHistoryIndexInNewTab()));
m_menuBack->addAction(act);
}
@ -290,7 +290,7 @@ void NavigationBar::aboutToShowHistoryNextMenu()
Action* act = new Action(icon, title);
act->setData(i);
connect(act, SIGNAL(triggered()), this, SLOT(goAtHistoryIndex()));
connect(act, SIGNAL(middleClicked()), this, SLOT(goAtHistoryIndexInNewTab()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(goAtHistoryIndexInNewTab()));
m_menuForward->addAction(act);
}

View File

@ -60,12 +60,12 @@ void Menu::mouseReleaseEvent(QMouseEvent* e)
}
else if (e->button() == Qt::MiddleButton || (e->button() == Qt::LeftButton && e->modifiers() == Qt::ControlModifier)) {
closeAllMenus();
act->triggerMiddleClick();
act->emitCtrlTriggered();
e->accept();
}
else if (e->button() == Qt::LeftButton && e->modifiers() == Qt::ShiftModifier) {
closeAllMenus();
act->triggerShiftClick();
act->emitShiftTriggered();
e->accept();
}
}
@ -92,12 +92,12 @@ void Menu::keyPressEvent(QKeyEvent* e)
}
else if (e->modifiers() == Qt::ControlModifier) {
closeAllMenus();
act->triggerMiddleClick();
act->emitCtrlTriggered();
e->accept();
}
else if (e->modifiers() == Qt::ShiftModifier) {
closeAllMenus();
act->triggerShiftClick();
act->emitShiftTriggered();
e->accept();
}
}
@ -127,12 +127,12 @@ Action::Action(const QIcon &icon, const QString &text, QObject* parent)
{
}
void Action::triggerMiddleClick()
void Action::emitCtrlTriggered()
{
emit middleClicked();
emit ctrlTriggered();
}
void Action::triggerShiftClick()
void Action::emitShiftTriggered()
{
emit shiftClicked();
emit shiftTriggered();
}

View File

@ -53,12 +53,12 @@ public:
explicit Action(const QIcon &icon, const QString &text, QObject* parent = 0);
signals:
void middleClicked();
void shiftClicked();
void ctrlTriggered();
void shiftTriggered();
public slots:
void triggerMiddleClick();
void triggerShiftClick();
void emitCtrlTriggered();
void emitShiftTriggered();
};

View File

@ -933,7 +933,7 @@ void WebView::createPageContextMenu(QMenu* menu, const QPoint &pos)
frameMenu->addAction(tr("Show &only this frame"), this, SLOT(loadClickedFrame()));
Action* act = new Action(QIcon::fromTheme("tab-new", QIcon(":/icons/menu/tab-new.png")), tr("Show this frame in new &tab"));
connect(act, SIGNAL(triggered()), this, SLOT(loadClickedFrameInNewTab()));
connect(act, SIGNAL(middleClicked()), this, SLOT(loadClickedFrameInBgTab()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(loadClickedFrameInBgTab()));
frameMenu->addAction(act);
frameMenu->addSeparator();
frameMenu->addAction(qIconProvider->standardIcon(QStyle::SP_BrowserReload), tr("&Reload"), this, SLOT(reloadClickedFrame()));
@ -990,7 +990,7 @@ void WebView::createLinkContextMenu(QMenu* menu, const QWebHitTestResult &hitTes
Action* act = new Action(QIcon::fromTheme("tab-new", QIcon(":/icons/menu/tab-new.png")), tr("Open link in new &tab"));
act->setData(hitTest.linkUrl());
connect(act, SIGNAL(triggered()), this, SLOT(userDefinedOpenUrlInNewTab()));
connect(act, SIGNAL(middleClicked()), this, SLOT(userDefinedOpenUrlInBgTab()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInBgTab()));
menu->addAction(act);
menu->addAction(QIcon::fromTheme("window-new"), tr("Open link in new &window"), this, SLOT(openUrlInNewWindow()))->setData(hitTest.linkUrl());
menu->addSeparator();
@ -1016,7 +1016,7 @@ void WebView::createImageContextMenu(QMenu* menu, const QWebHitTestResult &hitTe
Action* act = new Action(tr("Show i&mage"));
act->setData(hitTest.imageUrl());
connect(act, SIGNAL(triggered()), this, SLOT(openActionUrl()));
connect(act, SIGNAL(middleClicked()), this, SLOT(userDefinedOpenUrlInNewTab()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInNewTab()));
menu->addAction(act);
menu->addAction(tr("Copy im&age"), this, SLOT(copyImageToClipboard()))->setData(hitTest.imageUrl());
menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy image ad&dress"), this, SLOT(copyLinkToClipboard()))->setData(hitTest.imageUrl());
@ -1049,13 +1049,13 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const QWebHitTestResult
Action* gtwact = new Action(QIcon(":icons/sites/translate.png"), tr("Google Translate"));
gtwact->setData(googleTranslateUrl);
connect(gtwact, SIGNAL(triggered()), this, SLOT(openUrlInSelectedTab()));
connect(gtwact, SIGNAL(middleClicked()), this, SLOT(openUrlInBackgroundTab()));
connect(gtwact, SIGNAL(ctrlTriggered()), this, SLOT(openUrlInBackgroundTab()));
menu->addAction(gtwact);
Action* dictact = new Action(QIcon::fromTheme("accessories-dictionary"), tr("Dictionary"));
dictact->setData(QUrl("http://" + (!langCode.isEmpty() ? langCode + "." : langCode) + "wiktionary.org/wiki/Special:Search?search=" + selectedText));
connect(dictact, SIGNAL(triggered()), this, SLOT(openUrlInSelectedTab()));
connect(dictact, SIGNAL(middleClicked()), this, SLOT(openUrlInBackgroundTab()));
connect(dictact, SIGNAL(ctrlTriggered()), this, SLOT(openUrlInBackgroundTab()));
menu->addAction(dictact);
// #379: Remove newlines
@ -1071,7 +1071,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const QWebHitTestResult
act->setData(guessedUrl);
connect(act, SIGNAL(triggered()), this, SLOT(openActionUrl()));
connect(act, SIGNAL(middleClicked()), this, SLOT(userDefinedOpenUrlInNewTab()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(userDefinedOpenUrlInNewTab()));
menu->addAction(act);
}
@ -1083,7 +1083,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const QWebHitTestResult
SearchEngine engine = mApp->searchEnginesManager()->activeEngine();
Action* act = new Action(engine.icon, tr("Search \"%1 ..\" with %2").arg(selectedText, engine.name));
connect(act, SIGNAL(triggered()), this, SLOT(searchSelectedText()));
connect(act, SIGNAL(middleClicked()), this, SLOT(searchSelectedTextInBackgroundTab()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(searchSelectedTextInBackgroundTab()));
menu->addAction(act);
// Search with ...
@ -1094,7 +1094,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const QWebHitTestResult
act->setData(QVariant::fromValue(en));
connect(act, SIGNAL(triggered()), this, SLOT(searchSelectedText()));
connect(act, SIGNAL(middleClicked()), this, SLOT(searchSelectedTextInBackgroundTab()));
connect(act, SIGNAL(ctrlTriggered()), this, SLOT(searchSelectedTextInBackgroundTab()));
swMenu->addAction(act);
}