diff options
author | Jon Ander Peñalba <jonan88@gmail.com> | 2010-08-16 12:34:55 +0200 |
---|---|---|
committer | Jon Ander Peñalba <jonan88@gmail.com> | 2010-08-16 12:50:44 +0200 |
commit | 025238f4fc8ab605c249678dc497eb604eed943e (patch) | |
tree | bf64a8302aeba1a8f87e102324fdbe52c81535cd /src/bookmarks | |
parent | Unify the deletion of bookmarks in one place (diff) | |
download | rekonq-025238f4fc8ab605c249678dc497eb604eed943e.tar.xz |
Message displayed when deleting a bookmark improved
Diffstat (limited to 'src/bookmarks')
-rw-r--r-- | src/bookmarks/bookmarksmanager.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp index 28f9ad8e..cade77b4 100644 --- a/src/bookmarks/bookmarksmanager.cpp +++ b/src/bookmarks/bookmarksmanager.cpp @@ -77,16 +77,29 @@ void BookmarkOwner::openBookmark(const KBookmark & bookmark, bool BookmarkOwner::deleteBookmark(KBookmark &bookmark) { - KBookmarkGroup bmg = bookmark.parentGroup(); - bool folder = bookmark.isGroup(); QString name = QString(bookmark.fullText()).replace("&&", "&"); + QString dialogCaption, dialogText; + + if (bookmark.isGroup()) + { + dialogCaption = i18n("Bookmark Folder Deletion"); + dialogText = i18n("Are you sure you wish to remove the bookmark folder\n\"%1\"?", name); + } + else if (bookmark.isSeparator()) + { + dialogCaption = i18n("Separator Deletion"); + dialogText = i18n("Are you sure you wish to remove this separator?", name); + } + else + { + dialogCaption = i18n("Bookmark Deletion"); + dialogText = i18n("Are you sure you wish to remove the bookmark\n\"%1\"?", name); + } if (KMessageBox::warningContinueCancel( QApplication::activeWindow(), - folder ? i18n("Are you sure you wish to remove the bookmark folder\n\"%1\"?", name) - : i18n("Are you sure you wish to remove the bookmark\n\"%1\"?", name), - folder ? i18n("Bookmark Folder Deletion") - : i18n("Bookmark Deletion"), + dialogText, + dialogCaption, KStandardGuiItem::del(), KStandardGuiItem::cancel(), "bookmarkDeletition_askAgain") @@ -94,6 +107,7 @@ bool BookmarkOwner::deleteBookmark(KBookmark &bookmark) ) return false; + KBookmarkGroup bmg = bookmark.parentGroup(); bmg.deleteBookmark(bookmark); Application::bookmarkProvider()->bookmarkManager()->emitChanged(bmg); return true; |