diff options
author | Yoann Laissus <yoann.laissus@gmail.com> | 2010-08-20 15:30:03 +0200 |
---|---|---|
committer | Yoann Laissus <yoann.laissus@gmail.com> | 2010-08-20 15:30:03 +0200 |
commit | 79ad6230fd3a99e13ed5ee18cba10c90cff3ee5c (patch) | |
tree | 9740b7d4de3c1c78e0a8cf2e31b554e954090db5 /src/bookmarks/bookmarkowner.cpp | |
parent | Fixed tooltip in the bookmarks panel (diff) | |
download | rekonq-79ad6230fd3a99e13ed5ee18cba10c90cff3ee5c.tar.xz |
- The bookmark toolbar is now a real toolbar, not an action.
It fixes the problem of the submenu if there are too much items to fit on the bar
- Improve a bit the new redesign of BookmarkOwner
- Reenable the bookmark menu by default (because the icon in the bar is on the left)
Diffstat (limited to 'src/bookmarks/bookmarkowner.cpp')
-rw-r--r-- | src/bookmarks/bookmarkowner.cpp | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/src/bookmarks/bookmarkowner.cpp b/src/bookmarks/bookmarkowner.cpp index fb7c737e..f47b978d 100644 --- a/src/bookmarks/bookmarkowner.cpp +++ b/src/bookmarks/bookmarkowner.cpp @@ -49,7 +49,7 @@ BookmarkOwner::BookmarkOwner(KBookmarkManager *manager, QObject *parent) : QObject(parent) , KBookmarkOwner() , m_manager(manager) - , actions(QVector<KAction*>(NUM_ACTIONS)) + , m_actions(QVector<KAction*>(NUM_ACTIONS)) { setupActions(); } @@ -57,7 +57,7 @@ BookmarkOwner::BookmarkOwner(KBookmarkManager *manager, QObject *parent) KAction* BookmarkOwner::action(const BookmarkAction &bmAction) { - return static_cast<KAction*>(actions.at(bmAction)); + return static_cast<KAction*>(m_actions.at(bmAction)); } @@ -101,51 +101,53 @@ void BookmarkOwner::openBookmark(const KBookmark &bookmark, Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers keyboardModifiers) { - bookmarkSelected(bookmark); if (keyboardModifiers & Qt::ControlModifier || mouseButtons & Qt::MidButton) { - openBookmarkInNewTab(); + openBookmarkInNewTab(bookmark); } else { - openBookmark(); + openBookmark(bookmark); } } void BookmarkOwner::openFolderinTabs(const KBookmarkGroup &bookmark) { - bookmarkSelected(bookmark); - openBookmarkFolder(); + openBookmarkFolder(bookmark); } -void BookmarkOwner::bookmarkSelected(const KBookmark &bookmark) +void BookmarkOwner::setCurrentBookmark(const KBookmark &bookmark) { - selected = bookmark; + m_currentBookmark = bookmark; } -void BookmarkOwner::openBookmark() +void BookmarkOwner::openBookmark(const KBookmark &bookmark) { + KBookmark selected = bookmark.isNull() ? m_currentBookmark : bookmark; emit openUrl(selected.url(), Rekonq::CurrentTab); } -void BookmarkOwner::openBookmarkInNewTab() +void BookmarkOwner::openBookmarkInNewTab(const KBookmark &bookmark) { + KBookmark selected = bookmark.isNull() ? m_currentBookmark : bookmark; emit openUrl(selected.url(), Rekonq::NewTab); } -void BookmarkOwner::openBookmarkInNewWindow() +void BookmarkOwner::openBookmarkInNewWindow(const KBookmark &bookmark) { + KBookmark selected = bookmark.isNull() ? m_currentBookmark : bookmark; emit openUrl(selected.url(), Rekonq::NewWindow); } -void BookmarkOwner::openBookmarkFolder() +void BookmarkOwner::openBookmarkFolder(const KBookmark &bookmark) { + KBookmark selected = bookmark.isNull() ? m_currentBookmark : bookmark; if (!selected.isGroup()) return; @@ -168,8 +170,9 @@ void BookmarkOwner::openBookmarkFolder() } -void BookmarkOwner::bookmarkCurrentPage() +void BookmarkOwner::bookmarkCurrentPage(const KBookmark &bookmark) { + KBookmark selected = bookmark.isNull() ? m_currentBookmark : bookmark; KBookmarkGroup parent; if (!selected.isNull()) @@ -192,8 +195,9 @@ void BookmarkOwner::bookmarkCurrentPage() } -void BookmarkOwner::newBookmarkFolder() +void BookmarkOwner::newBookmarkFolder(const KBookmark &bookmark) { + KBookmark selected = bookmark.isNull() ? m_currentBookmark : bookmark; KBookmarkDialog *dialog = bookmarkDialog(m_manager, QApplication::activeWindow()); QString folderName = i18n("New folder"); @@ -223,8 +227,9 @@ void BookmarkOwner::newBookmarkFolder() } -void BookmarkOwner::newSeparator() +void BookmarkOwner::newSeparator(const KBookmark &bookmark) { + KBookmark selected = bookmark.isNull() ? m_currentBookmark : bookmark; KBookmark newBk; if (!selected.isNull()) @@ -250,8 +255,9 @@ void BookmarkOwner::newSeparator() } -void BookmarkOwner::copyLink() +void BookmarkOwner::copyLink(const KBookmark &bookmark) { + KBookmark selected = bookmark.isNull() ? m_currentBookmark : bookmark; if (selected.isNull()) return; @@ -259,8 +265,9 @@ void BookmarkOwner::copyLink() } -void BookmarkOwner::editBookmark() +void BookmarkOwner::editBookmark(KBookmark bookmark) { + KBookmark selected = bookmark.isNull() ? m_currentBookmark : bookmark; if (selected.isNull()) return; @@ -274,8 +281,9 @@ void BookmarkOwner::editBookmark() } -bool BookmarkOwner::deleteBookmark() +bool BookmarkOwner::deleteBookmark(KBookmark bookmark) { + KBookmark selected = bookmark.isNull() ? m_currentBookmark : bookmark; if (selected.isNull()) return false; @@ -346,6 +354,6 @@ void BookmarkOwner::createAction(const BookmarkAction &action, const QString &te { KAction *act = new KAction(KIcon(icon), text, this); act->setHelpText(help); - actions[action] = act; + m_actions[action] = act; connect(act, SIGNAL(triggered()), this, slot); } |