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

Translate edit actions in page context menu + added delete action.

This commit is contained in:
nowrep 2013-03-18 15:53:16 +01:00
parent a035a83d7a
commit e72610da0a
3 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,7 @@
Version 1.5.0
* development version
* added delete action in edit context menu on page
Version 1.4.1
* released 15 March 2013
* fixed websearchbar not respecting select all on click settings

View File

@ -352,6 +352,12 @@ void WebView::forward()
}
}
void WebView::editDelete()
{
QKeyEvent ev(QEvent::KeyPress, Qt::Key_Delete, Qt::NoModifier);
QApplication::sendEvent(this, &ev);
}
void WebView::selectAll()
{
triggerPageAction(QWebPage::SelectAll);
@ -768,9 +774,13 @@ void WebView::createContextMenu(QMenu* menu, const QWebHitTestResult &hitTest, c
m_actionsInitialized = true;
pageAction(QWebPage::Cut)->setIcon(QIcon::fromTheme("edit-cut"));
pageAction(QWebPage::Cut)->setText(tr("Cut"));
pageAction(QWebPage::Copy)->setIcon(QIcon::fromTheme("edit-copy"));
pageAction(QWebPage::Copy)->setText(tr("Copy"));
pageAction(QWebPage::Paste)->setIcon(QIcon::fromTheme("edit-paste"));
pageAction(QWebPage::Paste)->setText(tr("Paste"));
pageAction(QWebPage::SelectAll)->setIcon(QIcon::fromTheme("edit-select-all"));
pageAction(QWebPage::SelectAll)->setText(tr("Select All"));
m_actionReload = new QAction(qIconProvider->standardIcon(QStyle::SP_BrowserReload), tr("&Reload"), this);
m_actionStop = new QAction(qIconProvider->standardIcon(QStyle::SP_BrowserStop), tr("S&top"), this);
@ -826,6 +836,11 @@ void WebView::createContextMenu(QMenu* menu, const QWebHitTestResult &hitTest, c
menu->addAction(act);
if (act == pageAction(QWebPage::Paste)) {
QAction* a = menu->addAction(QIcon::fromTheme("edit-delete"), tr("Delete"), this, SLOT(editDelete()));
a->setEnabled(!selectedText().isEmpty());
}
++i;
}

View File

@ -76,6 +76,7 @@ public slots:
void back();
void forward();
void editDelete();
void selectAll();
void printPage(QWebFrame* frame = 0);
void sendPageByMail();