diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-03-28 00:03:49 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-03-28 00:03:49 +0100 |
commit | afdbc3ceed9d1def8e4e3615d0ae591074055d75 (patch) | |
tree | 7eb7ad163b6cd89d5f06d85956514fb0be479a1e | |
parent | Merge commit 'refs/merge-requests/107' of git://gitorious.org/rekonq/mainline... (diff) | |
parent | - Remove the Add Bookmark action from the different context menus (diff) | |
download | rekonq-afdbc3ceed9d1def8e4e3615d0ae591074055d75.tar.xz |
Merge commit 'refs/merge-requests/107' of git://gitorious.org/rekonq/mainline into HistoryBookmarksImprovements
-rw-r--r-- | src/bookmarks/bookmarkspanel.cpp | 59 | ||||
-rw-r--r-- | src/bookmarks/bookmarkspanel.h | 1 | ||||
-rw-r--r-- | src/history/historypanel.cpp | 12 |
3 files changed, 10 insertions, 62 deletions
diff --git a/src/bookmarks/bookmarkspanel.cpp b/src/bookmarks/bookmarkspanel.cpp index c5c2f548..2f530c6c 100644 --- a/src/bookmarks/bookmarkspanel.cpp +++ b/src/bookmarks/bookmarkspanel.cpp @@ -186,14 +186,10 @@ void BookmarksPanel::setupActions() connect(action, SIGNAL(triggered()), m_treeView, SLOT(openInNewWindow())); m_ac->addAction("open_window", action); - action = new KAction(KIcon("rating"), i18n("Bookmark Current Page"), this); - connect(action, SIGNAL(triggered()), this, SLOT(bookmarkPage())); + action = new KAction(KIcon("bookmark-new"), i18n("Add Bookmark Here"), this); + connect(action, SIGNAL(triggered()), this, SLOT(bookmarkCurrentPage())); m_ac->addAction("bookmark_page", action); - action = new KAction(KIcon("bookmark-new"), i18n("New Bookmark"), this); - connect(action, SIGNAL(triggered()), this, SLOT(newBookmark())); - m_ac->addAction("bookmark_new", action); - action = new KAction(KIcon("folder-new"), i18n("New Bookmark Folder"), this); connect(action, SIGNAL(triggered()), this, SLOT(newBookmarkGroup())); m_ac->addAction("folder_new", action); @@ -202,7 +198,7 @@ void BookmarksPanel::setupActions() connect(action, SIGNAL(triggered()), this, SLOT(newSeparator())); m_ac->addAction("separator_new", action); - action = new KAction(KIcon("edit-copy"), i18n("Copy Link Adress"), this); + action = new KAction(KIcon("edit-copy"), i18n("Copy Link Address"), this); connect(action, SIGNAL(triggered()), m_treeView, SLOT(copyToClipboard())); m_ac->addAction("copy", action); @@ -263,7 +259,6 @@ void BookmarksPanel::contextMenuBk(const QPoint &pos) menu->addSeparator(); menu->addAction(m_ac->action("bookmark_page")); - menu->addAction(m_ac->action("bookmark_new")); menu->addAction(m_ac->action("folder_new")); menu->addAction(m_ac->action("separator_new")); @@ -295,7 +290,6 @@ void BookmarksPanel::contextMenuBkGroup(const QPoint &pos, bool emptyGroup) } menu->addAction(m_ac->action("bookmark_page")); - menu->addAction(m_ac->action("bookmark_new")); menu->addAction(m_ac->action("folder_new")); menu->addAction(m_ac->action("separator_new")); @@ -314,7 +308,6 @@ void BookmarksPanel::contextMenuSeparator(const QPoint &pos) KMenu *menu = new KMenu(this); menu->addAction(m_ac->action("bookmark_page")); - menu->addAction(m_ac->action("bookmark_new")); menu->addAction(m_ac->action("folder_new")); menu->addAction(m_ac->action("separator_new")); @@ -332,7 +325,6 @@ void BookmarksPanel::contextMenuBlank(const QPoint &pos) KMenu *menu = new KMenu(this); menu->addAction(m_ac->action("bookmark_page")); - menu->addAction(m_ac->action("bookmark_new")); menu->addAction(m_ac->action("folder_new")); menu->addAction(m_ac->action("separator_new")); @@ -399,49 +391,6 @@ void BookmarksPanel::openFolderInTabs() } -void BookmarksPanel::newBookmark() -{ - QModelIndex index = m_treeView->currentIndex(); - - KBookmark selected; - KBookmark newBk; - - KBookmarkDialog *dialog = Application::bookmarkProvider()->bookmarkOwner()->bookmarkDialog(Application::bookmarkProvider()->bookmarkManager(), QApplication::activeWindow()); - - if(index.isValid()) - { - selected = bookmarkForIndex(index); - - if(selected.isGroup()) - newBk = dialog->addBookmark("New bookmark", KUrl(), selected); - else - newBk = dialog->addBookmark("New bookmark", KUrl(), selected.parentGroup()); - } - - else - { - newBk = dialog->addBookmark("New bookmark", KUrl()); - } - - delete dialog; - - // a click on cancel - if(newBk.isNull()) - return; - - // addBookmark already added the bookmark, but without the default favicon - KBookmarkGroup parent = newBk.parentGroup(); - parent.deleteBookmark(newBk); - newBk.setIcon(("text-html")); - parent.addBookmark(newBk); - - if(index.isValid()) - parent.moveBookmark(newBk, selected); - - Application::bookmarkProvider()->bookmarkManager()->emitChanged(); -} - - void BookmarksPanel::newBookmarkGroup() { QModelIndex index = m_treeView->currentIndex(); @@ -522,7 +471,7 @@ void BookmarksPanel::bookmarkCurrentPage() parent = selected.toGroup(); KBookmark newBk = parent.addBookmark(Application::bookmarkProvider()->bookmarkOwner()->currentTitle(), KUrl(Application::bookmarkProvider()->bookmarkOwner()->currentUrl()), "text-html"); - parent.moveBookmark(newBk, selected); + parent.moveBookmark(newBk, selected.parentGroup().previous(selected)); } else diff --git a/src/bookmarks/bookmarkspanel.h b/src/bookmarks/bookmarkspanel.h index be52804f..f8528b71 100644 --- a/src/bookmarks/bookmarkspanel.h +++ b/src/bookmarks/bookmarkspanel.h @@ -66,7 +66,6 @@ private slots: void deleteBookmark(); void openFolderInTabs(); void editBookmark(); - void newBookmark(); void newBookmarkGroup(); void newSeparator(); void onCollapse(const QModelIndex &index); diff --git a/src/history/historypanel.cpp b/src/history/historypanel.cpp index c67594ff..03f2b880 100644 --- a/src/history/historypanel.cpp +++ b/src/history/historypanel.cpp @@ -52,7 +52,8 @@ HistoryPanel::HistoryPanel(const QString &title, QWidget *parent, Qt::WindowFlags flags) - : QDockWidget(title, parent, flags) + : QDockWidget(title, parent, flags), + m_treeView(new UrlTreeView(this)) { setup(); setShown(ReKonfig::showHistoryPanel()); @@ -73,7 +74,6 @@ void HistoryPanel::setup() QWidget *ui = new QWidget(this); - m_treeView = new UrlTreeView(this); m_treeView->setUniformRowHeights(true); m_treeView->setSelectionBehavior(QAbstractItemView::SelectRows); m_treeView->setTextElideMode(Qt::ElideMiddle); @@ -129,15 +129,15 @@ void HistoryPanel::contextMenuItem(const QPoint &pos) connect(action, SIGNAL(triggered()), m_treeView, SLOT(openInCurrentTab())); menu->addAction(action); - action = new KAction(KIcon("tab-new"), i18n("Open in new tab"), this); + action = new KAction(KIcon("tab-new"), i18n("Open in New Tab"), this); connect(action, SIGNAL(triggered()), m_treeView, SLOT(openInNewTab())); menu->addAction(action); - action = new KAction(KIcon("window-new"), i18n("Open in new window"), this); + action = new KAction(KIcon("window-new"), i18n("Open in New Window"), this); connect(action, SIGNAL(triggered()), m_treeView, SLOT(openInNewWindow())); menu->addAction(action); - action = new KAction(KIcon("edit-copy"), i18n("Copy link"), this); + action = new KAction(KIcon("edit-copy"), i18n("Copy Link Address"), this); connect(action, SIGNAL(triggered()), m_treeView, SLOT(copyToClipboard())); menu->addAction(action); @@ -152,7 +152,7 @@ void HistoryPanel::contextMenuGroup(const QPoint &pos) KMenu *menu = new KMenu(this); KAction* action; - action = new KAction(KIcon("tab-new"), i18n("Open all Bookmarks"), this); + action = new KAction(KIcon("tab-new"), i18n("Open Folder in Tabs"), this); connect(action, SIGNAL(triggered()), this, SLOT(openAll())); menu->addAction(action); |