Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#34 4.0.4 Patch to add more items to right-click menu

open
nobody
None
5
2009-08-15
2009-08-15
Nephiel
No

Here's a patch to bring back the old-style Comix v3.x.x popup menu.
IMHO this is an improvement because it allows to use common options (recent files, bookmarks...) in fullscreen mode.

Changed files:
comix-4.0.4/src/ui.py

Discussion

  • Nephiel
    Nephiel
    2009-10-17

    I found a bug with the patch. The bookmarks store would not be updated when using the popup menu.
    This is because I was creating a second bookmark.BookmarksMenu() object for the popup, but only the first one would actually touch the bookmarks store.
    I fixed it by attaching the same BookmarksMenu object to the popup menu instead of creating a new one. The downside is that now it throws this (mostly harmless) warning on startup:

    /src/ui.py:306: GtkWarning: gtk_menu_attach_to_widget(): menu already attached to GtkImageMenuItem
    self.get_widget('/Popup/menu_bookmarks_popup').set_submenu(self.bookmarksPopup)

    Other than that it seems to work.

    It's an ugly workaround... Instead of this, bookmark.py should be fixed to allow the ui to create more than one BookmarkMenu with access to the store. The recent files list (recent.py) is similar but doesn't have this problem.

     
  • Nephiel
    Nephiel
    2009-10-18

    Gah. Now the bookmarks submenu won't open in fullscreen mode or when the Menubar is hidden.
    Which is logical because it's the same menu.
    I'm now trying to fix it.

     
  • Nephiel
    Nephiel
    2009-10-19

    4.0.4 Patch to add more items to right-click menu (fix 2)

     
    Attachments
  • Nephiel
    Nephiel
    2009-10-19

    I updated the patch once more. No more warnings, and full access to the bookmarks from the popup menu in windowed and fullscreen mode.

    The downside this time is that the Bookmarks menu no longer appears on the menubar - it can only be reached from the popup menu. I did it this way because 1) I couldn't figure out how to keep two menus in sync when users add/remove bookmarks from one of them; 2) the popup menu is always available, even in fullscreen mode or when the toolbars are hidden, so I prefer it over the menubar.

    I also added the View->Toolbars menu. Now the popup menu contains every item on the menubar.