Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjay Garg <ajay@activitycentral.com>2012-09-28 04:24:58 (GMT)
committer Ajay Garg <ajay@activitycentral.com>2012-09-28 04:24:58 (GMT)
commitbe920f91a8125f3a74ebd1747e6d4b33362db28d (patch)
treeee08c8fb3c53136e0f2eb0be7220b584636513ea
parent9a72788cc39a4424e94fb06ba8cd447163321ad5 (diff)
sdxo#2346: Now, hovering/clicking of favorite-icons in remote-shares has no effect.
-rw-r--r--rpms/sugar/0151-sdxo-2346-Now-hovering-clicking-of-favorite-icons-in.patch132
1 files changed, 132 insertions, 0 deletions
diff --git a/rpms/sugar/0151-sdxo-2346-Now-hovering-clicking-of-favorite-icons-in.patch b/rpms/sugar/0151-sdxo-2346-Now-hovering-clicking-of-favorite-icons-in.patch
new file mode 100644
index 0000000..eb0e2fa
--- /dev/null
+++ b/rpms/sugar/0151-sdxo-2346-Now-hovering-clicking-of-favorite-icons-in.patch
@@ -0,0 +1,132 @@
+From fca5be9052b0d9c20eb86e13f97a64121fd1162b Mon Sep 17 00:00:00 2001
+From: Ajay Garg <ajay@activitycentral.com>
+Date: Fri, 28 Sep 2012 09:51:50 +0530
+Subject: [PATCH] sdxo#2346: Now, hovering/clicking of favorite-icons in remote-shares has no effect.
+Organization: Sugar Labs Foundation
+Signed-off-by: Ajay Garg <ajay@activitycentral.com>
+---
+ src/jarabe/journal/expandedentry.py | 5 +++++
+ src/jarabe/journal/journalactivity.py | 1 +
+ src/jarabe/journal/keepicon.py | 7 +++++++
+ src/jarabe/journal/listview.py | 11 +++++++++++
+ src/jarabe/journal/model.py | 15 +++++++++++++++
+ 5 files changed, 39 insertions(+), 0 deletions(-)
+
+diff --git a/src/jarabe/journal/expandedentry.py b/src/jarabe/journal/expandedentry.py
+index 10e18ae..0e69b9a 100644
+--- a/src/jarabe/journal/expandedentry.py
++++ b/src/jarabe/journal/expandedentry.py
+@@ -441,6 +441,11 @@ class ExpandedEntry(hippo.CanvasBox):
+ return (str(self._metadata.get('keep', 0)) == '1')
+
+ def _keep_icon_activated_cb(self, keep_icon):
++ # If it is a locally-mounted rmote-share, return without doing
++ # any processing.
++ if model.is_current_mount_point_for_remote_share(model.DETAIL_VIEW):
++ return
++
+ if self.get_keep():
+ self._metadata['keep'] = 0
+ else:
+diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py
+index 05b2e67..ac69d42 100644
+--- a/src/jarabe/journal/journalactivity.py
++++ b/src/jarabe/journal/journalactivity.py
+@@ -231,6 +231,7 @@ class JournalActivity(JournalWindow):
+ self._secondary_view = gtk.VBox()
+
+ self._detail_toolbox = DetailToolbox()
++ self._detail_toolbox.set_mount_point('/')
+ self._detail_toolbox.entry_toolbar.connect('volume-error',
+ self.__volume_error_cb)
+
+diff --git a/src/jarabe/journal/keepicon.py b/src/jarabe/journal/keepicon.py
+index 5bc299b..8ec3f96 100644
+--- a/src/jarabe/journal/keepicon.py
++++ b/src/jarabe/journal/keepicon.py
+@@ -22,6 +22,8 @@ from sugar.graphics.icon import CanvasIcon
+ from sugar.graphics import style
+ from sugar.graphics.xocolor import XoColor
+
++from jarabe.journal import model
++
+
+ class KeepIcon(CanvasIcon):
+ def __init__(self, keep):
+@@ -53,6 +55,11 @@ class KeepIcon(CanvasIcon):
+ setter=set_keep)
+
+ def __motion_notify_event_cb(self, icon, event):
++ # If it is a locally-mounted rmote-share, return without doing
++ # any processing.
++ if model.is_current_mount_point_for_remote_share(model.DETAIL_VIEW):
++ return
++
+ if not self._keep:
+ if event.detail == hippo.MOTION_DETAIL_ENTER:
+ client = gconf.client_get_default()
+diff --git a/src/jarabe/journal/listview.py b/src/jarabe/journal/listview.py
+index 7e04d47..31bf97e 100644
+--- a/src/jarabe/journal/listview.py
++++ b/src/jarabe/journal/listview.py
+@@ -342,6 +342,11 @@ class BaseListView(gtk.Bin):
+ cell.props.xo_color = None
+
+ def __favorite_clicked_cb(self, cell, path):
++ # If this is a remote-share, return without doing any
++ # processing.
++ if model.is_current_mount_point_for_remote_share(model.LIST_VIEW):
++ return
++
+ row = self._model[path]
+ metadata = model.get(row[ListModel.COLUMN_UID])
+ if not model.is_editable(metadata):
+@@ -798,6 +803,12 @@ class CellRendererFavorite(CellRendererIcon):
+ self.props.prelit_stroke_color = prelit_color.get_stroke_color()
+ self.props.prelit_fill_color = prelit_color.get_fill_color()
+
++ def on_render(self, window, widget, background_area, cell_area, expose_area, flags):
++ # If this is a remote-share, mask the "PRELIT" flag.
++ if model.is_current_mount_point_for_remote_share(model.LIST_VIEW):
++ flags = flags & (~(gtk.CELL_RENDERER_PRELIT))
++
++ CellRendererIcon.on_render(self, window, widget, background_area, cell_area, expose_area, flags)
+
+ class CellRendererDetail(CellRendererIcon):
+ __gtype_name__ = 'JournalCellRendererDetail'
+diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
+index 0192541..97ec85c 100644
+--- a/src/jarabe/journal/model.py
++++ b/src/jarabe/journal/model.py
+@@ -63,6 +63,9 @@ LOCAL_SHARES_MOUNT_POINT = '/var/www/web1/web/'
+
+ JOURNAL_METADATA_DIR = '.Sugar-Metadata'
+
++LIST_VIEW = 1
++DETAIL_VIEW = 2
++
+ _datastore = None
+ created = dispatch.Signal()
+ updated = dispatch.Signal()
+@@ -109,6 +112,18 @@ def is_mount_point_for_peer_share(mount_point):
+ return _check_remote_sharing_mount_point(mount_point, SHARE_TYPE_PEER)
+
+
++def is_current_mount_point_for_remote_share(view_type):
++ from jarabe.journal.journalactivity import get_journal, get_mount_point
++ if view_type == LIST_VIEW:
++ current_mount_point = get_mount_point()
++ elif view_type == DETAIL_VIEW:
++ current_mount_point = get_journal().get_detail_toolbox().get_mount_point()
++
++ if is_mount_point_for_locally_mounted_remote_share(current_mount_point):
++ return True
++ return False
++
++
+ def extract_ip_address_or_dns_name_from_locally_mounted_remote_share_path(path):
+ """
+ Path is of type ::
+--
+1.7.4.4
+