Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Parkinson <sam.parkinson3@gmail.com>2014-06-14 11:33:02 (GMT)
committer Sam Parkinson <sam.parkinson3@gmail.com>2014-06-14 11:33:02 (GMT)
commitb14ced42b25130b61fc9bfdf988d3cb82562f1ec (patch)
tree49e8072d5af3802248dc223c5ca3fdbc66cc7be0
parent4b12edd7a911d89d289ca218715cedef5b21d996 (diff)
Show the bookmark title in the icon's palettetitle-in-palette
-rw-r--r--linkbutton.py2
-rw-r--r--readactivity.py7
-rw-r--r--readdb.py6
3 files changed, 9 insertions, 6 deletions
diff --git a/linkbutton.py b/linkbutton.py
index e52c8cc..808c8f6 100644
--- a/linkbutton.py
+++ b/linkbutton.py
@@ -50,7 +50,7 @@ class LinkButton(TrayButton, GObject.GObject):
color.split(',')[0])
self.page = int(page)
- info = title + '\n' + owner
+ info = title + '\n' + '<small><i>' + owner + '</i></small>'
self.setup_rollover_options(info)
def set_image(self, buf, fill='#0000ff', stroke='#4d4c4f'):
diff --git a/readactivity.py b/readactivity.py
index ce39189..dcd4724 100644
--- a/readactivity.py
+++ b/readactivity.py
@@ -971,7 +971,8 @@ class ReadActivity(activity.Activity):
thumb = self._get_screenshot()
# The database is zero based
num_page = int(page) + 1
- title = _('Page %d') % num_page
+ title = _('%s\n<small><i>Page %d</i></small>') % \
+ (bookmark.get_note_title(), num_page)
self._add_link_totray(num_page, thumb, color, title, owner)
self._bookmark_view.set_bookmarkmanager(self._bookmarkmanager)
@@ -1165,9 +1166,9 @@ class ReadActivity(activity.Activity):
def __view_toolbar_go_fullscreen_cb(self, view_toolbar):
self.fullscreen()
- def _added_bookmark_cb(self, bookmarkmanager, page):
+ def _added_bookmark_cb(self, bookmarkmanager, page, title):
logging.error('Bookmark added page %d', page)
- title = _('Page %d') % page
+ title = _('%s\n<small><i>Page %d</i></small>') % (title, page)
color = profile.get_color().to_string()
owner = profile.get_nick_name()
thumb = self._get_screenshot()
diff --git a/readdb.py b/readdb.py
index f39a42f..75fc39c 100644
--- a/readdb.py
+++ b/readdb.py
@@ -22,6 +22,7 @@ import shutil
import sqlite3
import time
import base64
+import json
from gi.repository import GObject
from sugar3 import profile
@@ -89,7 +90,7 @@ class BookmarkManager(GObject.GObject):
__gsignals__ = {
'added_bookmark': (GObject.SignalFlags.RUN_FIRST,
- None, ([int])),
+ None, ([int, str])),
'removed_bookmark': (GObject.SignalFlags.RUN_FIRST,
None, ([int])), }
@@ -127,7 +128,8 @@ class BookmarkManager(GObject.GObject):
self._conn.commit()
self._resync_bookmark_cache()
- self.emit('added_bookmark', page + 1)
+ title = json.loads(content)['title']
+ self.emit('added_bookmark', page + 1, title)
def del_bookmark(self, page):
# We delete only the locally made bookmark