mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
Added shortcut for Paste&Search.
- merged pejakm-master and Mikino89-master
This commit is contained in:
commit
c6cbaa286b
Binary file not shown.
|
@ -32,6 +32,7 @@ WebSearchBar::WebSearchBar(QupZilla* mainClass, QWidget* parent)
|
|||
, p_QupZilla(mainClass)
|
||||
, m_menu(new QMenu(this))
|
||||
, m_pasteAndGoAction(0)
|
||||
, m_clearAction(0)
|
||||
{
|
||||
setObjectName("websearchbar");
|
||||
m_buttonSearch = new ClickableLabel(this);
|
||||
|
@ -195,11 +196,16 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event)
|
|||
Q_UNUSED(event)
|
||||
|
||||
if (!m_pasteAndGoAction) {
|
||||
m_pasteAndGoAction = new QAction(tr("Paste And &Go"), this);
|
||||
// m_pasteAndGoAction->setShortcut(QKeySequence("Ctrl+Shift+V"));
|
||||
m_pasteAndGoAction = new QAction(QIcon::fromTheme("edit-paste"), tr("Paste And &Search"), this);
|
||||
m_pasteAndGoAction->setShortcut(QKeySequence("Ctrl+Shift+V"));
|
||||
connect(m_pasteAndGoAction, SIGNAL(triggered()), this, SLOT(pasteAndGo()));
|
||||
}
|
||||
|
||||
if (!m_clearAction) {
|
||||
m_clearAction = new QAction(QIcon::fromTheme("edit-clear"), tr("Clear All"), this);
|
||||
connect(m_clearAction, SIGNAL(triggered()), this, SLOT(clear()));
|
||||
}
|
||||
|
||||
QMenu* tempMenu = createStandardContextMenu();
|
||||
m_menu->clear();
|
||||
|
||||
|
@ -209,8 +215,32 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event)
|
|||
tempMenu->removeAction(act);
|
||||
m_menu->addAction(act);
|
||||
|
||||
if (i == 5) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
act->setIcon(QIcon::fromTheme("edit-undo"));
|
||||
break;
|
||||
case 1:
|
||||
act->setIcon(QIcon::fromTheme("edit-redo"));
|
||||
break;
|
||||
case 3:
|
||||
act->setIcon(QIcon::fromTheme("edit-cut"));
|
||||
break;
|
||||
case 4:
|
||||
act->setIcon(QIcon::fromTheme("edit-copy"));
|
||||
break;
|
||||
case 5:
|
||||
act->setIcon(QIcon::fromTheme("edit-paste"));
|
||||
m_menu->addAction(act);
|
||||
m_menu->addAction(m_pasteAndGoAction);
|
||||
break;
|
||||
case 6:
|
||||
act->setIcon(QIcon::fromTheme("edit-delete"));
|
||||
m_menu->addAction(act);
|
||||
m_menu->addAction(m_clearAction);
|
||||
break;
|
||||
case 8:
|
||||
act->setIcon(QIcon::fromTheme("edit-select-all"));
|
||||
break;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
|
@ -260,6 +290,14 @@ void WebSearchBar::dropEvent(QDropEvent* event)
|
|||
void WebSearchBar::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
switch (event->key()) {
|
||||
case Qt::Key_V:
|
||||
if (event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) {
|
||||
pasteAndGo();
|
||||
event->accept();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case Qt::Key_Return:
|
||||
case Qt::Key_Enter:
|
||||
if (event->modifiers() == Qt::AltModifier) {
|
||||
|
|
|
@ -85,7 +85,7 @@ private:
|
|||
|
||||
QMenu* m_menu;
|
||||
QAction* m_pasteAndGoAction;
|
||||
|
||||
QAction* m_clearAction;
|
||||
};
|
||||
|
||||
#endif // WEBSEARCHBAR_H
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -2259,6 +2259,10 @@
|
|||
<source>Minimum Logical Font Size</source>
|
||||
<translation>Minimálna logická veľkosť</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open new tabs after active tab</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
|
@ -3920,6 +3924,14 @@ Po pridaní či odobratí ciest k certifikátom je nutné reštartovať prehliad
|
|||
<source>Manage Search Engines</source>
|
||||
<translation>Spravovať vyhľadávače</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Paste And &Search</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Clear All</source>
|
||||
<translation type="unfinished">Všetko vymazať</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WebView</name>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user