1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Added 'Open in private window' option in bookmarks toolbar

This commit is contained in:
Vladislav Tronko 2016-02-25 22:14:53 +02:00
parent 96bc812c50
commit 7c5cf9b2c4
2 changed files with 11 additions and 0 deletions

View File

@ -70,6 +70,7 @@ void BookmarksToolbar::contextMenuRequested(const QPoint &pos)
QMenu menu; QMenu menu;
QAction* actNewTab = menu.addAction(IconProvider::newTabIcon(), tr("Open in new tab")); QAction* actNewTab = menu.addAction(IconProvider::newTabIcon(), tr("Open in new tab"));
QAction* actNewWindow = menu.addAction(IconProvider::newWindowIcon(), tr("Open in new window")); QAction* actNewWindow = menu.addAction(IconProvider::newWindowIcon(), tr("Open in new window"));
QAction* actNewPrivateWindow = menu.addAction(IconProvider::privateBrowsingIcon(), tr("Open in new private window"));
menu.addSeparator(); menu.addSeparator();
QAction* actEdit = menu.addAction(tr("Edit")); QAction* actEdit = menu.addAction(tr("Edit"));
QAction* actDelete = menu.addAction(QIcon::fromTheme("edit-delete"), tr("Delete")); QAction* actDelete = menu.addAction(QIcon::fromTheme("edit-delete"), tr("Delete"));
@ -85,6 +86,7 @@ void BookmarksToolbar::contextMenuRequested(const QPoint &pos)
connect(actNewTab, SIGNAL(triggered()), this, SLOT(openBookmarkInNewTab())); connect(actNewTab, SIGNAL(triggered()), this, SLOT(openBookmarkInNewTab()));
connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewWindow())); connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewWindow()));
connect(actNewPrivateWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewPrivateWindow()));
connect(actEdit, SIGNAL(triggered()), this, SLOT(editBookmark())); connect(actEdit, SIGNAL(triggered()), this, SLOT(editBookmark()));
connect(actDelete, SIGNAL(triggered()), this, SLOT(deleteBookmark())); connect(actDelete, SIGNAL(triggered()), this, SLOT(deleteBookmark()));
@ -92,6 +94,7 @@ void BookmarksToolbar::contextMenuRequested(const QPoint &pos)
actDelete->setEnabled(m_clickedBookmark && m_bookmarks->canBeModified(m_clickedBookmark)); actDelete->setEnabled(m_clickedBookmark && m_bookmarks->canBeModified(m_clickedBookmark));
actNewTab->setEnabled(m_clickedBookmark && m_clickedBookmark->isUrl()); actNewTab->setEnabled(m_clickedBookmark && m_clickedBookmark->isUrl());
actNewWindow->setEnabled(m_clickedBookmark && m_clickedBookmark->isUrl()); actNewWindow->setEnabled(m_clickedBookmark && m_clickedBookmark->isUrl());
actNewPrivateWindow->setEnabled(m_clickedBookmark && m_clickedBookmark->isUrl());
menu.exec(mapToGlobal(pos)); menu.exec(mapToGlobal(pos));
@ -165,6 +168,13 @@ void BookmarksToolbar::openBookmarkInNewWindow()
} }
} }
void BookmarksToolbar::openBookmarkInNewPrivateWindow()
{
if (m_clickedBookmark) {
BookmarksTools::openBookmarkInNewPrivateWindow(m_clickedBookmark);
}
}
void BookmarksToolbar::editBookmark() void BookmarksToolbar::editBookmark()
{ {
if (m_clickedBookmark) { if (m_clickedBookmark) {

View File

@ -46,6 +46,7 @@ private slots:
void openBookmarkInNewTab(); void openBookmarkInNewTab();
void openBookmarkInNewWindow(); void openBookmarkInNewWindow();
void openBookmarkInNewPrivateWindow();
void editBookmark(); void editBookmark();
void deleteBookmark(); void deleteBookmark();