KBookmarks
kbookmarkmenu.cpp
43 KBookmarkMenu::KBookmarkMenu(KBookmarkManager *mgr, KBookmarkOwner *_owner, QMenu *_parentMenu, KActionCollection *actionCollection)
58 KBookmarkMenu::KBookmarkMenu(KBookmarkManager *manager, KBookmarkOwner *_owner, QMenu *_parentMenu)
82 connect(m_parentMenu, &QWidget::customContextMenuRequested, this, &KBookmarkMenu::slotCustomContextMenu);
110 KBookmarkMenu::KBookmarkMenu(KBookmarkManager *mgr, KBookmarkOwner *_owner, QMenu *_parentMenu, const QString &parentAddress)
125 connect(m_parentMenu, &QWidget::customContextMenuRequested, this, &KBookmarkMenu::slotCustomContextMenu);
226 qCDebug(KBOOKMARKS_LOG) << "KBookmarkMenu::slotBookmarksChanged groupAddress: " << groupAddress;
228 // qCDebug(KBOOKMARKS_LOG) << "KBookmarkMenu::slotBookmarksChanged -> setting m_bDirty on " << groupAddress;
232 for (QList<KBookmarkMenu *>::iterator it = m_lstSubMenus.begin(), end = m_lstSubMenus.end(); it != end; ++it) {
243 for (QList<QAction *>::iterator it = m_actions.begin(), end = m_actions.end(); it != end; ++it) {
266 if (!m_pOwner || !m_pOwner->supportsTabs() || !KAuthorized::authorizeAction(QStringLiteral("bookmarks"))) {
274 paOpenFolderInTabs->setToolTip(tr("Open all bookmarks in this folder as a new tab", "@info:tooltip"));
284 if (!m_pOwner || !m_pOwner->enableOption(KBookmarkOwner::ShowAddBookmark) || !m_pOwner->supportsTabs() || (d->numberOfOpenTabs < 2)
298 d->bookmarksToFolderAction->setToolTip(tr("Add a folder of bookmarks for all open tabs", "@info:tooltip"));
300 connect(d->bookmarksToFolderAction, &QAction::triggered, this, &KBookmarkMenu::slotAddBookmarksList);
304 m_actionCollection->addAction(d->bookmarksToFolderAction->objectName(), d->bookmarksToFolderAction);
314 if (!m_pOwner || !m_pOwner->enableOption(KBookmarkOwner::ShowAddBookmark) || !KAuthorized::authorizeAction(QStringLiteral("bookmarks"))) {
341 || QStandardPaths::findExecutable(QStringLiteral(KEDITBOOKMARKS_BINARY)).isEmpty() || !KAuthorized::authorizeAction(QStringLiteral("bookmarks"))) {
345 d->editBookmarksAction = KStandardAction::editBookmarks(m_pManager, SLOT(slotEditBookmarks()), this);
349 d->editBookmarksAction->setToolTip(tr("Edit your bookmark collection in a separate window", "@info:tooltip"));
361 if (!m_pOwner || !m_pOwner->enableOption(KBookmarkOwner::ShowAddBookmark) || !KAuthorized::authorizeAction(QStringLiteral("bookmarks"))) {
368 d->newBookmarkFolderAction->setToolTip(tr("Create a new bookmark folder in this menu", "@info:tooltip"));
401 KBookmarkMenu *subMenu = new KBookmarkMenu(m_pManager, m_pOwner, actionMenu->menu(), bm.address());
442 dlg->addBookmark(m_pOwner->currentTitle(), m_pOwner->currentUrl(), m_pOwner->currentIcon(), parentBookmark);
445 parentBookmark.addBookmark(m_pOwner->currentTitle(), m_pOwner->currentUrl(), m_pOwner->currentIcon());
void append(const T &value)
void adjustSize()
Definition: kbookmarkowner.h:43
QAction * editBookmarksAction() const
Returns the action for editing bookmarks.
Definition: kbookmarkmenu.cpp:482
QAction * addAction(const QString &name, const QObject *receiver=nullptr, const char *member=nullptr)
KBookmark findByAddress(const QString &address)
Definition: kbookmarkmanager.cpp:571
QList< QAction * > actions() const const
virtual QUrl currentUrl() const
This function is called whenever the user wants to add the current page to the bookmarks list.
Definition: kbookmarkowner.h:75
Definition: kbookmark.h:27
void customContextMenuRequested(const QPoint &pos)
KBookmarkGroup createNewFolder(const QString &name, KBookmark parent=KBookmark())
Shows a dialog to create a new folder.
Definition: kbookmarkdialog.cpp:304
void emitChanged()
Saves the bookmark file and notifies everyone.
Definition: kbookmarkmanager.cpp:602
virtual bool supportsTabs() const
This function returns whether the owner supports tabs.
Definition: kbookmarkowner.h:102
Definition: kbookmarkcontextmenu.h:24
void changed(const QString &groupAddress, const QString &caller)
Signals that the group (or any of its children) with the address groupAddress (e.g.
QIcon fromTheme(const QString &name)
QAction * bookmarkTabsAsFolderAction() const
Returns the action for adding all current tabs as bookmarks.
Definition: kbookmarkmenu.cpp:472
Definition: kbookmarkmenu.h:50
CustomContextMenu
QWidget * activeWindow()
void setAttribute(Qt::WidgetAttribute attribute, bool on)
QMenu * parentMenu() const
The menu in which we insert our actions Supplied in the constructor.
Definition: kbookmarkmenu.cpp:211
void ensureUpToDate()
Call ensureUpToDate() if you need KBookmarkMenu to adjust to its final size before it is executed.
Definition: kbookmarkmenu.cpp:136
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString address() const
Return the "address" of this bookmark in the whole tree.
Definition: kbookmark.cpp:479
virtual QList< FutureBookmark > currentBookmarkList() const
Returns a list of bookmark data for the open tabs.
Definition: kbookmarkowner.h:132
QString findExecutable(const QString &executableName, const QStringList &paths)
void setIcon(const QIcon &icon)
int numberOfOpenTabs() const
This function returns how many (if any) tabs the application has open.
Definition: kbookmarkmenu.cpp:150
KBookmark next(const KBookmark ¤t) const
Return the next sibling of a child bookmark of this group.
Definition: kbookmark.cpp:131
QAction * addBookmark(const QObject *recvr, const char *slot, QObject *parent)
Definition: kbookmarkactionmenu.h:20
bool isEmpty() const const
KBookmark addBookmark(const QString &title, const QUrl &url, const QString &icon, KBookmark parent=KBookmark())
Shows a "Add Bookmark" dialog Note: this updates the bookmark and calls KBookmarkManager::emitChanged...
Definition: kbookmarkdialog.cpp:199
void setStatusTip(const QString &statusTip)
KCONFIGCORE_EXPORT bool authorizeAction(const QString &action)
virtual QString currentTitle() const
This function is called whenever the user wants to add the current page to the bookmarks list.
Definition: kbookmarkowner.h:60
KBookmarkGroup toGroup() const
Convert this to a group - do this only if isGroup() returns true.
Definition: kbookmark.cpp:473
bool isEmpty() const const
void setNumberOfOpenTabs(int numberOfOpenTabs)
Sets the number of currently open tabs.
Definition: kbookmarkmenu.cpp:141
QAction * addBookmarkAction() const
Returns the action for adding a bookmark.
Definition: kbookmarkmenu.cpp:467
Definition: kbookmarkaction.h:26
KBookmarkMenu(KBookmarkManager *mgr, KBookmarkOwner *owner, QMenu *parentMenu, KActionCollection *collec)
Fills a bookmark menu (one instance of KBookmarkMenu is created for the toplevel menu,...
Definition: kbookmarkmenu.cpp:43
bool isEmpty() const const
virtual void openFolderinTabs(const KBookmarkGroup &bm)
Called if the user wants to open every bookmark in this folder in a new tab.
Definition: kbookmarkowner.cpp:76
QPoint mapToGlobal(const QPoint &pos) const const
virtual QString currentIcon() const
This function is called whenever the user wants to add the current page to the bookmarks list.
Definition: kbookmarkowner.h:93
KBookmark addBookmark(const KBookmark &bm)
Create a new bookmark, as the last child of this group Don't forget to use KBookmarkManager::self()->...
Definition: kbookmark.cpp:214
KBookmarkGroup addBookmarks(const QList< KBookmarkOwner::FutureBookmark > &list, const QString &name=QString(), KBookmarkGroup parent=KBookmarkGroup())
Creates a folder from a list of bookmarks Note: this updates the bookmark and calls KBookmarkManager:...
Definition: kbookmarkdialog.cpp:235
void removeAction(QAction *action)
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
void triggered(bool checked)
void setToolTip(const QString &tip)
void clear()
QList::iterator begin()
QAction * editBookmarks(const QObject *recvr, const char *slot, QObject *parent)
Definition: kbookmarkmanager.h:51
QAction * newBookmarkFolderAction() const
Returns the action for adding a new bookmarks folder.
Definition: kbookmarkmenu.cpp:477
bool isGroup() const
Whether the bookmark is a group or a normal bookmark.
Definition: kbookmark.cpp:287
Definition: kbookmarkdialog.h:29
QList::iterator end()
void setSeparator(bool b)
QString tr(const char *sourceText, const char *disambiguation, int n)
WA_DeleteOnClose
virtual bool enableOption(BookmarkOption option) const
Returns true if action should be shown in the menu The default is to show both a add and editBookmark...
Definition: kbookmarkowner.cpp:60
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 3 2023 03:59:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 3 2023 03:59:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.