Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2012-08-15 17:23:33 (GMT)
committer Simon Schampijer <simon@schampijer.de>2012-08-21 03:56:40 (GMT)
commit682c6c2fdebb8dcc2ee16ece2330c4d840806273 (patch)
treee1e49d3f44c97597007a9e45b30374314de55350
parent071e534d44a2294ca8e27fe854a16644fc8e35d7 (diff)
Neighborhood View: reveal Palette on left click/touch instead of a primary action
Having a primary action for the icons in the Neighborhood View like the AP icon, the Ad-hoc, the Mesh network icon and the icon for a shared activity has never been a fully working UI design because the result you get by clicking on the icon was not fully clear to the user (e.g. I clicked on the AP icon to connect to it, when I click again will it deconnect?). With the mouse you have a way of discovering secondary information by hovering over the icon, this is not as elegant with touch. You would need to use touch&hold for that but the 'failure' rate of undesired actions is much higher. In long discussions with Gary we agreed on always revealing the Palette on left-click/touch and giving the learner the information to make his choice. We think this is the best behavior for both worlds. For the SugarAdhoc Palette we make sure it has the connect option in the Palette. Until now, the Palette did only have the connect option shown when the device state had changed once. Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-by: Manuel QuiƱones <manuq@laptop.org>
-rw-r--r--src/jarabe/desktop/meshbox.py14
-rw-r--r--src/jarabe/desktop/networkviews.py10
2 files changed, 15 insertions, 9 deletions
diff --git a/src/jarabe/desktop/meshbox.py b/src/jarabe/desktop/meshbox.py
index 8ac5047..412a093 100644
--- a/src/jarabe/desktop/meshbox.py
+++ b/src/jarabe/desktop/meshbox.py
@@ -64,7 +64,8 @@ class _ActivityIcon(EventIcon):
EventIcon.__init__(self, file_name=file_name,
xo_color=xo_color, pixel_size=size)
self._model = model
- self.connect('button-release-event', self._button_release_cb)
+ self.connect('button-release-event',
+ self.__button_release_event_cb)
def create_palette(self):
primary_text = glib.markup_escape_text(self._model.bundle.get_name())
@@ -82,21 +83,22 @@ class _ActivityIcon(EventIcon):
if joined:
item = MenuItem(_('Resume'), 'activity-start')
- item.connect('activate', self._clicked_cb)
+ item.connect('activate', self.__palette_item_clicked_cb)
item.show()
p.menu.append(item)
elif not private:
item = MenuItem(_('Join'), 'activity-start')
- item.connect('activate', self._clicked_cb)
+ item.connect('activate', self.__palette_item_clicked_cb)
item.show()
p.menu.append(item)
return p
- def _button_release_cb(self, widget, event):
- return self._clicked_cb(item=None)
+ def __button_release_event_cb(self, widget, event):
+ self.props.palette.popup(immediate=True,
+ state=palette.Palette.SECONDARY)
- def _clicked_cb(self, item):
+ def __palette_item_clicked_cb(self, item):
bundle = self._model.get_bundle()
misc.launch(bundle, activity_id=self._model.activity_id,
color=self._model.get_color())
diff --git a/src/jarabe/desktop/networkviews.py b/src/jarabe/desktop/networkviews.py
index d2531bf..83269e0 100644
--- a/src/jarabe/desktop/networkviews.py
+++ b/src/jarabe/desktop/networkviews.py
@@ -330,7 +330,8 @@ class WirelessNetworkView(EventPulsingIcon):
self._connect()
def __button_release_event_cb(self, icon, event):
- self._connect()
+ self._palette.popup(immediate=True,
+ state=palette.Palette.SECONDARY)
def _connect(self):
# Activate existing connection, if there is one
@@ -489,6 +490,7 @@ class SugarAdhocView(EventPulsingIcon):
self._connect_item = MenuItem(_('Connect'), 'dialog-ok')
self._connect_item.connect('activate', self.__connect_activate_cb)
palette_.menu.append(self._connect_item)
+ self._connect_item.show()
self._disconnect_item = MenuItem(_('Disconnect'), 'media-eject')
self._disconnect_item.connect('activate',
@@ -498,7 +500,8 @@ class SugarAdhocView(EventPulsingIcon):
return palette_
def __button_release_event_cb(self, icon, event):
- get_adhoc_manager_instance().activate_channel(self._channel)
+ self._palette.popup(immediate=True,
+ state=palette.Palette.SECONDARY)
def __connect_activate_cb(self, icon):
get_adhoc_manager_instance().activate_channel(self._channel)
@@ -688,7 +691,8 @@ class OlpcMeshView(EventPulsingIcon):
self._connect()
def __button_release_event_cb(self, icon, event):
- self._connect()
+ self._palette.popup(immediate=True,
+ state=palette.Palette.SECONDARY)
def _connect(self):
self._mesh_mgr.user_activate_channel(self._channel)