summaryrefslogtreecommitdiff
path: root/src/bookmarks
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-09-11 10:45:14 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-09-14 08:51:10 +0300
commit9ff4588acd9702c268c2e70d44e962925bdde291 (patch)
tree635d0f8015eddf89388f10ba15b9a9b352e372f6 /src/bookmarks
parentAdd Bookmarks panel (diff)
downloadrekonq-9ff4588acd9702c268c2e70d44e962925bdde291.tar.xz
BookmarksPanel: add custom context menu
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/CMakeLists.txt1
-rw-r--r--src/bookmarks/bookmarkscontextmenu.cpp133
-rw-r--r--src/bookmarks/bookmarkscontextmenu.h54
3 files changed, 0 insertions, 188 deletions
diff --git a/src/bookmarks/CMakeLists.txt b/src/bookmarks/CMakeLists.txt
index db0d9377..38a14204 100644
--- a/src/bookmarks/CMakeLists.txt
+++ b/src/bookmarks/CMakeLists.txt
@@ -1,7 +1,6 @@
add_library(bookmarks STATIC
# bookmarkmanager.cpp bookmarkmanager.h
# bookmarkowner.cpp bookmarkowner.h
-# bookmarkscontextmenu.cpp bookmarkscontextmenu.h
# bookmarksmenu.cpp bookmarksmenu.h
# bookmarkstoolbar.cpp bookmarkstoolbar.h
# Bookmarks Model
diff --git a/src/bookmarks/bookmarkscontextmenu.cpp b/src/bookmarks/bookmarkscontextmenu.cpp
deleted file mode 100644
index a9683708..00000000
--- a/src/bookmarks/bookmarkscontextmenu.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/* ============================================================
- *
- * This file is a part of the rekonq project
- *
- * Copyright (C) 2010 by Yoann Laissus <yoann dot laissus at gmail dot com>
- * Copyright (c) 2011-2012 by Phaneendra Hegde <pnh.pes@gmail.com>
- *
- *
- * 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 2 of
- * the License or (at your option) version 3 or any later version
- * accepted by the membership of KDE e.V. (or its successor approved
- * by the membership of KDE e.V.), which shall act as a proxy
- * defined in Section 14 of version 3 of the license.
- *
- * 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/>.
- *
- * ============================================================ */
-
-// Self Includes
-#include "bookmarkscontextmenu.h"
-
-// Local Includes
-#include "bookmarkmanager.h"
-#include "bookmarkowner.h"
-
-// KDE Includes
-#include <KBookmarkManager>
-
-BookmarksContextMenu::BookmarksContextMenu(const KBookmark &bookmark, KBookmarkManager *manager, BookmarkOwner *owner,
- bool nullForced, QWidget *parent)
- : KBookmarkContextMenu(bookmark, manager, owner, parent), m_bmOwner(owner), m_nullForced(nullForced)
-{
-}
-
-void BookmarksContextMenu::addBookmarkActions()
-{
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::OPEN_IN_TAB));
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::OPEN_IN_WINDOW));
-
- addSeparator();
-
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::BOOKMARK_PAGE));
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::NEW_FOLDER));
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::NEW_SEPARATOR));
-
- addSeparator();
-
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::COPY));
-
- addSeparator();
-
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::EDIT));
-#ifdef HAVE_NEPOMUK
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::FANCYBOOKMARK));
-#endif
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::DELETE));
-}
-
-void BookmarksContextMenu::addFolderActions()
-{
- KBookmarkGroup group = bookmark().toGroup();
-
- if (bookmark().internalElement().attributeNode("toolbar").value() == "yes") {
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::UNSET_TOOLBAR_FOLDER));
- }
- else {
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::SET_TOOLBAR_FOLDER));
- }
-
- if (!group.first().isNull()) {
- KBookmark child = group.first();
-
- while (child.isGroup() || child.isSeparator()) { child = group.next(child); }
-
- if (!child.isNull()) {
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::OPEN_FOLDER));
- addSeparator();
- }
- }
-
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::BOOKMARK_PAGE));
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::NEW_FOLDER));
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::NEW_SEPARATOR));
-
- addSeparator();
-
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::EDIT));
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::DELETE));
-}
-
-void BookmarksContextMenu::addSeparatorActions()
-{
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::BOOKMARK_PAGE));
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::NEW_FOLDER));
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::NEW_SEPARATOR));
-
- addSeparator();
-
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::DELETE));
-}
-
-void BookmarksContextMenu::addNullActions()
-{
- KBookmarkManager *mngr = manager();
- if (mngr->toolbar().hasParent()) {
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::UNSET_TOOLBAR_FOLDER));
- }
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::BOOKMARK_PAGE));
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::NEW_FOLDER));
- addAction(m_bmOwner->createAction(bookmark(), BookmarkOwner::NEW_SEPARATOR));
-}
-
-void BookmarksContextMenu::addActions()
-{
- if (bookmark().isNull() || m_nullForced) { addNullActions(); }
- else if (bookmark().isSeparator()) {
- addSeparatorActions();
- }
- else if (bookmark().isGroup()) {
- addFolderActions();
- }
- else {
- addBookmarkActions();
- }
-}
diff --git a/src/bookmarks/bookmarkscontextmenu.h b/src/bookmarks/bookmarkscontextmenu.h
deleted file mode 100644
index 2c122be4..00000000
--- a/src/bookmarks/bookmarkscontextmenu.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ============================================================
-*
-* This file is a part of the rekonq project
-*
-* Copyright (C) 2010 by Yoann Laissus <yoann dot laissus at gmail dot com>
-*
-*
-* 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 2 of
-* the License or (at your option) version 3 or any later version
-* accepted by the membership of KDE e.V. (or its successor approved
-* by the membership of KDE e.V.), which shall act as a proxy
-* defined in Section 14 of version 3 of the license.
-*
-* 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/>.
-*
-* ============================================================ */
-
-
-#ifndef BOOKMARKS_CONTEXT_MENU_H
-#define BOOKMARKS_CONTEXT_MENU_H
-
-// Forward Declarations
-class BookmarkOwner;
-
-
-class BookmarksContextMenu : public KBookmarkContextMenu
-{
-public:
- BookmarksContextMenu(const KBookmark &bookmark,
- KBookmarkManager *manager,
- BookmarkOwner *owner,
- bool nullForced = false,
- QWidget *parent = 0);
- virtual void addActions();
-
-private:
- void addFolderActions();
- void addBookmarkActions();
- void addSeparatorActions();
- void addNullActions();
-
- BookmarkOwner *m_bmOwner;
- bool m_nullForced;
-};
-
-#endif // BOOKMARKS_CONTEXT_MENU_H