Version: 3.2.0 (using KDE 3.2.0 RC1, Gentoo) Compiler: gcc version 3.2.1 OS: Linux (i686) release 2.4.23-ck1 when i enable advanced bookmark entry in KEditBookmarks, Konqueror will open a window where I can edit title and URL, and determine where the bookmark should be added. But, when I open my bookmark menu, go to some submenu and select that submenu's 'Add Bookmark' entry; the relevant bookmark tree in the opened dialog is not highlighted, and when I don't highlight the correct location myself, the bookmarkt is added to the toplevel. It would be better if the treedisplay in the advanced bookmark add dialog would also highlight the menu from where the dialog was opened.
actually, it shouldn't even open the dialog then, but instead file the bookmark directly to this folder. the advanced bookmark dialog should _only_ pop up, if you select "add bookmark" from the mainmenu. therefore i'm changing this here to bug instead of wish.
I second the original reporter. "Advanced Add Bookmark" is very nice, but it should by default add it in the subfolder it was called from. I slightly disagree with Christian Muehlhaeuser. The big benefit of "Advanced Add Bookmark" is that it allows you to edit title and URL for the bookmark. I want this functionality even if I already told it in which subfolder to add the bookmark. But I suppose I could choose that subfolder in the dialog instead of in the actual bookmarks menu. Somebody make a decision which behavior is better.
I also disagree Christian Muehlhaesuser's view; I think he is misunderstanding the poster's report. That is something completely different. The intended report has a relatively simple solution. It's hard for me to explain, so I apologize beforehand if I'm overcomplicating it. This is how I see it: Assuming the following Bookmarks folder setup: <Bookmarks> Sub_1 Sub_2 Sub_2_1 Sub_3 With the advanced bookmark option SET, and the user attempts to add a bookmark from either the Menu or from the Bookmark Toolbar, this is the behavior: Go to either scenario: (1) <Bookmark> -> "Add Bookmark" (2) <Bookmark> -> Sub_1 -> "Add Bookmark" (3) <Bookmark> -> Sub_2 -> "Add Bookmark" (4) <Bookmark> -> Sub_2 -> Sub_2_1 -> "Add Bookmark" (5) <Bookmark> -> Sub_3 -> "Add Bookmark" and the Dialog pops up with <Bookmark> folder selected (this is the bug). Here's a crude ascii picture of what that dialog looks like: ----------------- =<Bookmark>====== Sub_1 Sub_2 Sub_3 ----------------- Therefore, if the user simply clicks "Ok" without changing anything, the bookmark will be added under <Bookmark>. After do so, setup will look like: <Bookmarks> Sub_1 Sub_2 Sub_2_1 Sub_3 Newly_Added_Bookmark Scenarios (1), (2), (3), (4), and (5) incorrectly do the same thing. The actual expected behavior is to have the Dialog pop up and have the correct corresponding folder selected by default. For example, if you went to scenario (4), the dialog looks like: ----------------- <Bookmark> Sub_1 Sub_2 =====Sub_2_1===== Sub_3 ----------------- And if you click "Ok" without chaning anything, Newly_Added_Bookmark is added under Sub_2_1. Simple. I don't really know what Christian is saying.
christian, yeah its a bug. but sorry i disagree with your opinion on not showing it in the first place. users (me including) want to edit the info, thats the whole point in the dialog. jose, yup, thats it exactly. hans, nod :) cheers, Alex
Created attachment 5519 [details] opens parent groups in add bookmark dialog Here's a full patch (my first!). It extends KBookmarkEditDialog::KBookmarkEditDialog, fillGroup, KBookmarkFolderTree::createTree, and KBookmarkFolderTree::fillTree, sends the optional parentBookmarkAddress to the dialog, and unfolds its parent groups. Also, it looks like fillGroup should probably be KBookmarkFolderTree::fillGroup, but I'll let you decide. :] cya
On 3 Apr 2004 20:51:10 -0000, Jose Hernandez <code@joseman.net> wrote: > Created an attachment (id=5519) > --> (http://bugs.kde.org/attachment.cgi?id=5519&action=view) > opens parent groups in add bookmark dialog > > Here's a full patch (my first!). congratulations loooks good also :D > It extends KBookmarkEditDialog::KBookmarkEditDialog, fillGroup, > KBookmarkFolderTree::createTree, and KBookmarkFolderTree::fillTree, > sends the optional parentBookmarkAddress to the dialog, and unfolds its > parent groups. > > Also, it looks like fillGroup should probably be > KBookmarkFolderTree::fillGroup, but I'll let you decide. :] hehe :) i'm out of development a bit unfortunately so i'll try and pass on the patch to someone who can get it in, i currently don't even have a running cvs unfortunately :S the changes all look good only one thing struck me, thats the removal of the "setopen" from the fillgroup. this makes a lot of sense in the case the to-be-selected item is below the first level, but if the to-be-selected item is either the root item or its qstring::null. i'd prefer for the old setopen behaviour to stay, this means that the tree shown will be the same as the one shown in keditbookmarks, therefore u can easily find the relevant folder as most people will have all the important folders open most of the time. well at least. i think so. :) could u fix this final thing? after that i'll it pass on to someone who was working on a few other fixes in the bookmarks stuff, who also has a cvs account and can actually commit and test, hopefully i'll able to get a second patch in quickly :) thanks very much for the work this it was one of my first priorities for when i return but i'm really not sure how long that will take unfortunately, thanks again, Alex
Comment on attachment 5519 [details] opens parent groups in add bookmark dialog Common subdirectories: bookmarks/CVS and bookmarks.mine/CVS Only in bookmarks.mine: Makefile.in diff -au bookmarks/kbookmarkmanager.cc bookmarks.mine/kbookmarkmanager.cc --- bookmarks/kbookmarkmanager.cc 2004-03-24 06:16:19.000000000 -0700 +++ bookmarks.mine/kbookmarkmanager.cc 2004-04-03 13:25:23.000000000 -0700 @@ -510,7 +510,7 @@ if ( KBookmarkSettings::self()->m_advancedaddbookmark) { - KBookmarkEditDialog dlg( title, url, this, KBookmarkEditDialog::InsertionMode ); + KBookmarkEditDialog dlg( title, url, this, KBookmarkEditDialog::InsertionMode, parentBookmarkAddress ); if ( dlg.exec() != KDialogBase::Accepted ) return KBookmarkGroup(); title = dlg.finalTitle(); diff -au bookmarks/kbookmarkmenu.cc bookmarks.mine/kbookmarkmenu.cc --- bookmarks/kbookmarkmenu.cc 2004-03-27 00:54:39.000000000 -0700 +++ bookmarks.mine/kbookmarkmenu.cc 2004-04-03 23:42:33.000000000 -0700 @@ -319,7 +319,7 @@ QString folder = bookmark.isGroup() ? QString::null : bookmark.url().url(); KBookmarkEditDialog dlg( bookmark.fullText(), folder, - m_pManager, KBookmarkEditDialog::ModifyMode, + m_pManager, KBookmarkEditDialog::ModifyMode, 0, 0, 0, i18n("Bookmark Properties") ); if ( dlg.exec() != KDialogBase::Accepted ) return; @@ -806,12 +806,12 @@ /********************************************************************/ // TODO - make the dialog use Properties as a title when in Modify mode... (dirk noticed the bug...) -KBookmarkEditDialog::KBookmarkEditDialog(const QString& title, const QString& url, KBookmarkManager * mgr, BookmarkEditType editType, - QWidget * parent, const char * name, const QString& caption) +KBookmarkEditDialog::KBookmarkEditDialog(const QString& title, const QString& url, KBookmarkManager * mgr, BookmarkEditType editType, const QString& address, + QWidget * parent, const char * name, const QString& caption ) : KDialogBase(parent, name, true, caption, (editType == InsertionMode) ? (User1|Ok|Cancel) : (Ok|Cancel), Ok, false, KGuiItem()), - m_folderTree(0), m_mgr(mgr), m_editType(editType) + m_folderTree(0), m_mgr(mgr), m_editType(editType), m_address(address) { setButtonOK( KGuiItem((editType == InsertionMode) ? i18n( "Add" ) : i18n( "Update" )) ); if (editType == InsertionMode) @@ -833,7 +833,7 @@ if ( editType == InsertionMode ) { - m_folderTree = KBookmarkFolderTree::createTree( m_mgr, m_main, name ); + m_folderTree = KBookmarkFolderTree::createTree( m_mgr, m_main, name, m_address ); connect( m_folderTree, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( slotDoubleClicked(QListViewItem*) ) ); vbox->addWidget( m_folderTree ); @@ -898,29 +898,34 @@ /********************************************************************/ /********************************************************************/ -static void fillGroup( KBookmarkFolderTreeItem * parentItem, KBookmarkGroup group ) +static void fillGroup( QListView* listview, KBookmarkFolderTreeItem * parentItem, KBookmarkGroup group, bool expandOpenGroups = true, const QString& address = QString::null ) { bool noSubGroups = true; KBookmarkFolderTreeItem * lastItem = 0L; + KBookmarkFolderTreeItem * item = 0L; for ( KBookmark bk = group.first() ; !bk.isNull() ; bk = group.next(bk) ) { if ( bk.isGroup() ) { KBookmarkGroup grp = bk.toGroup(); - KBookmarkFolderTreeItem * item = new KBookmarkFolderTreeItem( parentItem, lastItem, grp ); - fillGroup( item, grp ); - if ( grp.isOpen() ) + item = new KBookmarkFolderTreeItem( parentItem, lastItem, grp ); + fillGroup( listview, item, grp, expandOpenGroups, address ); + if ( expandOpenGroups && grp.isOpen() ) item->setOpen( true ); lastItem = item; noSubGroups = false; } + if (bk.address() == address) { + listview->setCurrentItem( lastItem ); + listview->ensureItemVisible( item ); + } } if ( noSubGroups ) { parentItem->setOpen( true ); } } -QListView* KBookmarkFolderTree::createTree( KBookmarkManager* mgr, QWidget* parent, const char* name ) +QListView* KBookmarkFolderTree::createTree( KBookmarkManager* mgr, QWidget* parent, const char* name, const QString& address ) { QListView *listview = new QListView( parent, name ); @@ -933,23 +938,21 @@ listview->setResizeMode( QListView::AllColumns ); listview->setMinimumSize( 60, 100 ); - fillTree( listview, mgr ); + fillTree( listview, mgr, address ); return listview; } -void KBookmarkFolderTree::fillTree( QListView *listview, KBookmarkManager* mgr ) +void KBookmarkFolderTree::fillTree( QListView *listview, KBookmarkManager* mgr, const QString& address ) { listview->clear(); - + KBookmarkGroup root = mgr->root(); KBookmarkFolderTreeItem * rootItem = new KBookmarkFolderTreeItem( listview, root ); - fillGroup( rootItem, root ); - rootItem->setOpen( true ); - - listview->setFocus(); listview->setCurrentItem( rootItem ); rootItem->setSelected( true ); + fillGroup( listview, rootItem, root, (address == root.groupAddress() || address == QString::null) ? true : false, address ); + rootItem->setOpen( true ); } static KBookmarkFolderTreeItem* ft_cast( QListViewItem *i ) Only in bookmarks.mine: kbookmarkmenu.cc~ diff -au bookmarks/kbookmarkmenu_p.h bookmarks.mine/kbookmarkmenu_p.h --- bookmarks/kbookmarkmenu_p.h 2004-01-12 11:24:28.000000000 -0700 +++ bookmarks.mine/kbookmarkmenu_p.h 2004-04-03 13:25:23.000000000 -0700 @@ -137,7 +137,7 @@ public: typedef enum { ModifyMode, InsertionMode } BookmarkEditType; - KBookmarkEditDialog( const QString& title, const QString& url, KBookmarkManager *, BookmarkEditType editType, + KBookmarkEditDialog( const QString& title, const QString& url, KBookmarkManager *, BookmarkEditType editType, const QString& address = QString::null, QWidget * = 0, const char * = 0, const QString& caption = i18n( "Add Bookmark" ) ); QString finalUrl() const; @@ -157,6 +157,7 @@ QPushButton * m_button; KBookmarkManager * m_mgr; BookmarkEditType m_editType; + QString m_address; }; class KBookmarkFolderTreeItem : public QListViewItem @@ -173,8 +174,8 @@ class KBookmarkFolderTree { public: - static QListView* createTree( KBookmarkManager *, QWidget * = 0, const char * = 0 ); - static void fillTree( QListView*, KBookmarkManager * ); + static QListView* createTree( KBookmarkManager *, QWidget * = 0, const char * = 0, const QString& = QString::null ); + static void fillTree( QListView*, KBookmarkManager *, const QString& = QString::null ); static QString selectedAddress( QListView* ); static void setAddress( QListView *, const QString & ); };
Created attachment 5524 [details] opens parent groups in add bookmark dialog w/ open groups Ahhh, that is a good behavior to have that I wasn't thinking of since I like to drag out folders from the menu. This shoud work. :]
*** Bug 79094 has been marked as a duplicate of this bug. ***
CVS commit by waba: When advanced bookmark entry is enabled and a bookmark is added to a submenu, the relevant bookmark tree in the opened dialog should be pre-selected. (BR73711) Patch by Jose Hernandez CCMAIL: 73711-done@bugs.kde.org M +1 -1 kbookmarkmanager.cc 1.94 M +20 -17 kbookmarkmenu.cc 1.238 M +4 -3 kbookmarkmenu_p.h 1.26