diff options
author | Sayamindu Dasgupta <sayamindu@gmail.com> | 2009-08-05 18:00:28 (GMT) |
---|---|---|
committer | Sayamindu Dasgupta <sayamindu@gmail.com> | 2009-08-05 18:00:28 (GMT) |
commit | 9dc4ad107a90811ae3b000f9d84536604d865893 (patch) | |
tree | 06743a4b1f5ea021f3b6f0e006148464d0491bba /readsidebar.py | |
parent | 98e358b9f712aa02a86e076387e6e567fb48167a (diff) |
Add method to Bookmark class to retrieve note title and body
Diffstat (limited to 'readsidebar.py')
-rw-r--r-- | readsidebar.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/readsidebar.py b/readsidebar.py index 0b745c2..d8bb895 100644 --- a/readsidebar.py +++ b/readsidebar.py @@ -16,7 +16,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import logging -import time, cjson +import time import gtk @@ -76,10 +76,8 @@ class Sidebar(gtk.EventBox): self._is_showing_local_bookmark = True def __bookmark_icon_query_tooltip_cb(self, widget, x, y, keyboard_mode, tip, bookmark): - content = cjson.decode(bookmark.title) - - tooltip_header = content['title'] - tooltip_body = content['content'] + tooltip_header = bookmark.get_note_title() + tooltip_body = bookmark.get_note_body() #TRANS: This goes like Bookmark added by User 5 days ago (the elapsed string gets translated #TRANS: automatically) tooltip_footer = (_('Bookmark added by %(user)s %(time)s') \ @@ -118,9 +116,9 @@ class Sidebar(gtk.EventBox): def __event_cb(self, widget, event, bookmark): if event.type == gtk.gdk.BUTTON_PRESS and \ self._bookmark_icon is not None: - content = cjson.decode(bookmark.title) - bookmark_title = content['title'] - bookmark_content = content['content'] + + bookmark_title = bookmark.get_note_title() + bookmark_content = bookmark.get_note_body() dialog = BookmarkEditDialog(parent_xid = self.get_toplevel().window.xid, \ dialog_title = _("Add notes for bookmark: "), \ |