Menu

#16 Bookmarks. Get rid of "Clear Bookmarks" and other changes

SVN
closed-accepted
nobody
Others (2)
5
2011-05-14
2011-05-13
Alan Horkan
No

I've got a messy patch for you, perhaps better to think of it half way between a feature request and a fully working solution.

The patch is mostly related to bookmarks.
There's one relatively simple change to the library dialog, which hides the status bar there too if the status bar is already set to be hidden. (MComix doesn't use the Status bar very much. The typical attitude to this is to get rid of it but I'd like to try and make it more useful. Some programs show the tooltip/description of a menu item in the status bar when you move over it and I'm sure there are other ways to make better of use the status bar.)

As I mentioned I'd much prefer if MComix used text based configuration files or even XBEL for Bookmarks but I decided to try making smaller improvements to what is already there.
I started off wanting by getting rid of the clear bookmarks menu item. It's an oddity, no one else does bookmarks like that. Ever since Comix was able to "Edit Bookmarks" the menu item is redundant and takes up space that could be used by another bookmark.

I made some cosmetic tweaks to make the dialog a little less bulky, I want to move toward a proper top level window not so much a dialog and I would get rid of the row of buttons too if I were to keep working in the same direction.

Next I looked at sorting the bookmarks. When I eventually I understood the code it only took a few lines to get GtkTreeView to sort the view.
I added some additional information to the bookmarks (but I held off on adding more fields like tags, or description, or date last viewed/modified etc.).
(The widget also has a crude built in search, more like type ahead find, where you type the first few letters of an item to jump to it which I also enabled.)

The way Gtk Tree View separates out the model and view is good Engineering theory but a pain in practise. (The various bits of documentation I read recommended using Glade or using a module for PyGTK called Kiwi to avoid reinventing the wheel.)
The data sort looks like a mess to me. Sorting the data seems to be there to help organise the Bookmarks menu. It seems strange to have to roll your own sort especially since you get the view sorted so easily. There must be an easier way to do this, or maybe just not do it at all and only sort the view?
It has taken me ages to do this much but what I'm really hoping is that when you see the patch and see the existing code you'll know an even better cleaner simpler way to do this and more (and after reading through the Bookmarks code this long there are other parts of the code I want to look at for a while instead, and ideas I've been wondering about and questions about the code that is too much detail to go into here so I'll mail you to discuss them later).

Discussion

  • Alan Horkan

    Alan Horkan - 2011-05-13

    Bookmarks, clear bookmarks, sorting, and library status

     
  • Oddegamra

    Oddegamra - 2011-05-14

    Applied in SVN revision #311 (library status bar) and #312 (remaining changes). Thanks!

     
  • Oddegamra

    Oddegamra - 2011-05-14
    • status: open --> closed-accepted
     

Log in to post a comment.

MongoDB Logo MongoDB