Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/readdialog.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-04-10 13:09:46 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-04-10 13:21:16 (GMT)
commit743f1428db484972a2a9e9ba3e85d97c66cb76f4 (patch)
tree53714af68f3dfa7bafe6eec0bbed1ed1fad0c589 /readdialog.py
parent454367e028b564b59378e243b8a21503aae7bbb9 (diff)
Improve bookmarks add/remove - SL #3405
The bug have two sources. First, the button used to add/remove the bookmark is a toggle, and the gtk3 theme is not setting the right grey color, then is not obvious to the user if the button is pressed or not. (this problem will be addressed in sugar-artwork) The second problem is, if the user cancel the dialog creating the bookmark, the bookmark is not created but the button continue pressed until the page is changed. This was solved sending a signal to uptade the button state. Two other problems were found and solved: * The page number in the bookmark description was wrong by one. * If the page had more than one bookmark, the clear method only removed the last then the sidebar accumulated bookmark icons. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'readdialog.py')
-rw-r--r--readdialog.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/readdialog.py b/readdialog.py
index be13621..b6366bf 100644
--- a/readdialog.py
+++ b/readdialog.py
@@ -50,7 +50,7 @@ class BaseReadDialog(Gtk.Window):
separator.show()
stop = ToolButton(icon_name='dialog-cancel')
stop.set_tooltip(_('Cancel'))
- stop.connect('clicked', lambda *w: self.destroy())
+ stop.connect('clicked', self.cancel_clicked_cb)
self.toolbar.insert(stop, -1)
stop.show()
@@ -93,6 +93,8 @@ class BaseReadDialog(Gtk.Window):
def accept_clicked_cb(self, widget):
raise NotImplementedError
+ def cancel_clicked_cb(self, widget):
+ self.destroy()
class BookmarkDialog(BaseReadDialog):
def __init__(self, parent_xid, dialog_title, bookmark_title,
@@ -160,6 +162,10 @@ class BookmarkDialog(BaseReadDialog):
self.set_canvas(vbox)
+ def cancel_clicked_cb(self, widget):
+ self._sidebarinstance.notify_bookmark_change()
+ BaseReadDialog.cancel_clicked_cb(self,widget)
+
class BookmarkAddDialog(BookmarkDialog):
@@ -177,6 +183,10 @@ class BookmarkAddDialog(BookmarkDialog):
cjson.encode(content))
self.destroy()
+ def cancel_clicked_cb(self, widget):
+ self._sidebarinstance.notify_bookmark_change()
+ BaseReadDialog.cancel_clicked_cb(self,widget)
+
class BookmarkEditDialog(BookmarkDialog):