KBookmarks
kbookmarkmenu.cpp
49KBookmarkMenu::KBookmarkMenu(KBookmarkManager *manager, KBookmarkOwner *_owner, QMenu *_parentMenu)
70 connect(d->parentMenu, &QWidget::customContextMenuRequested, this, &KBookmarkMenu::slotCustomContextMenu);
98KBookmarkMenu::KBookmarkMenu(KBookmarkManager *mgr, KBookmarkOwner *_owner, QMenu *_parentMenu, const QString &parentAddress)
111 connect(d->parentMenu, &QWidget::customContextMenuRequested, this, &KBookmarkMenu::slotCustomContextMenu);
198 qCDebug(KBOOKMARKSWIDGETS_LOG) << "KBookmarkMenu::slotBookmarksChanged groupAddress: " << groupAddress;
200 // qCDebug(KBOOKMARKS_LOG) << "KBookmarkMenu::slotBookmarksChanged -> setting m_bDirty on " << groupAddress;
204 for (QList<KBookmarkMenu *>::iterator it = m_lstSubMenus.begin(), end = m_lstSubMenus.end(); it != end; ++it) {
215 for (QList<QAction *>::iterator it = m_actions.begin(), end = m_actions.end(); it != end; ++it) {
238 if (!d->owner || !d->owner->supportsTabs() || !KAuthorized::authorizeAction(QStringLiteral("bookmarks"))) {
246 paOpenFolderInTabs->setToolTip(tr("Open all bookmarks in this folder as a new tab", "@info:tooltip"));
256 if (!d->owner || !d->owner->enableOption(KBookmarkOwner::ShowAddBookmark) || !d->owner->supportsTabs()
270 d->bookmarksToFolderAction->setToolTip(tr("Add a folder of bookmarks for all open tabs", "@info:tooltip"));
272 connect(d->bookmarksToFolderAction, &QAction::triggered, this, &KBookmarkMenu::slotAddBookmarksList);
280 if (!d->owner || !d->owner->enableOption(KBookmarkOwner::ShowAddBookmark) || !KAuthorized::authorizeAction(QStringLiteral("bookmarks"))) {
285 d->addBookmarkAction = KStandardActions::addBookmark(this, &KBookmarkMenu::slotAddBookmark, this);
301 || QStandardPaths::findExecutable(QStringLiteral(KEDITBOOKMARKS_BINARY)).isEmpty() || !KAuthorized::authorizeAction(QStringLiteral("bookmarks"))) {
305 d->editBookmarksAction = KStandardActions::editBookmarks(this, &KBookmarkMenu::slotEditBookmarks, this);
309 d->editBookmarksAction->setToolTip(tr("Edit your bookmark collection in a separate window", "@info:tooltip"));
320 QMessageBox::critical(QApplication::activeWindow(), QApplication::applicationDisplayName(), result.errorMessage());
326 if (!d->owner || !d->owner->enableOption(KBookmarkOwner::ShowAddBookmark) || !KAuthorized::authorizeAction(QStringLiteral("bookmarks"))) {
333 d->newBookmarkFolderAction->setToolTip(tr("Create a new bookmark folder in this menu", "@info:tooltip"));
366 KBookmarkMenu *subMenu = new KBookmarkMenu(d->manager, d->owner, actionMenu->menu(), bm.address());
407 dlg->addBookmark(d->owner->currentTitle(), d->owner->currentUrl(), d->owner->currentIcon(), parentBookmark);
410 parentBookmark.addBookmark(d->owner->currentTitle(), d->owner->currentUrl(), d->owner->currentIcon());
static Q_INVOKABLE bool authorizeAction(const QString &action)
The interface to implement by actions and menus which represent a bookimark.
Definition kbookmarkactioninterface.h:20
A wrapper around KActionMenu to provide a nice constructor for bookmark groups.
Definition kbookmarkactionmenu.h:22
This class provides a Dialog for editing properties, adding Bookmarks and creating new folders.
Definition kbookmarkdialog.h:31
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:234
KBookmarkGroup createNewFolder(const QString &name, KBookmark parent=KBookmark())
Shows a dialog to create a new folder.
Definition kbookmarkdialog.cpp:303
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:198
KBookmark next(const KBookmark ¤t) const
Return the next sibling of a child bookmark of this group.
Definition kbookmark.cpp:129
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:212
This class implements the reading/writing of bookmarks in XML.
Definition kbookmarkmanager.h:48
void changed(const QString &groupAddress)
Signals that the group (or any of its children) with the address groupAddress (e.g.
QAction * editBookmarksAction() const
Returns the action for editing bookmarks.
Definition kbookmarkmenu.cpp:447
KBookmarkMenu(KBookmarkManager *manager, KBookmarkOwner *owner, QMenu *parentMenu)
Fills a bookmark menu (one instance of KBookmarkMenu is created for the toplevel menu,...
Definition kbookmarkmenu.cpp:49
bool browserMode() const
Whether any "Edit Bookmarks" dialog shows UI elements that are specific to browsers.
Definition kbookmarkmenu.cpp:457
QAction * bookmarkTabsAsFolderAction() const
Returns the action for adding all current tabs as bookmarks.
Definition kbookmarkmenu.cpp:437
void setBrowserMode(bool browserMode)
Set this to true to make any "Edit Bookmarks" dialog show UI elements that are specific to browsers.
Definition kbookmarkmenu.cpp:452
QAction * addBookmarkAction() const
Returns the action for adding a bookmark.
Definition kbookmarkmenu.cpp:432
void ensureUpToDate()
Call ensureUpToDate() if you need KBookmarkMenu to adjust to its final size before it is executed.
Definition kbookmarkmenu.cpp:122
QMenu * parentMenu() const
The menu in which we insert our actions Supplied in the constructor.
Definition kbookmarkmenu.cpp:183
QAction * newBookmarkFolderAction() const
Returns the action for adding a new bookmarks folder.
Definition kbookmarkmenu.cpp:442
The KBookmarkMenu and KBookmarkBar classes gives the user the ability to either edit bookmarks or add...
Definition kbookmarkowner.h:43
bool isGroup() const
Whether the bookmark is a group or a normal bookmark.
Definition kbookmark.cpp:285
QString address() const
Return the "address" of this bookmark in the whole tree.
Definition kbookmark.cpp:477
QAction * editBookmarks(const QObject *recvr, const char *slot, QObject *parent)
void setIcon(const QIcon &icon)
void setSeparator(bool b)
void setStatusTip(const QString &statusTip)
void setToolTip(const QString &tip)
void triggered(bool checked)
QWidget * activeWindow()
applicationDisplayName
QIcon fromTheme(const QString &name)
void append(QList< T > &&value)
iterator begin()
void clear()
iterator end()
StandardButton critical(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons, StandardButton defaultButton)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QString tr(const char *sourceText, const char *disambiguation, int n)
QString findExecutable(const QString &executableName, const QStringList &paths)
CustomContextMenu
WA_DeleteOnClose
void customContextMenuRequested(const QPoint &pos)
void setAttribute(Qt::WidgetAttribute attribute, bool on)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.