Sascha,
Ishan tried to add the tag - Coauthored by in his patch, and that line
gets scrubbed off. We might have mistaken in understanding your review. Can
you elaborate on the format of the patch been worked on by multiple authors?
Unfortunately, git does not provide this feature at this
juncture. Appreciate your pointers as always.
On a separate note, could you please review the patch submitted by Shan
below. It was peer reviewed within the team by Ayush and Anurag.
Regards,
Manu
On Thu, Oct 7, 2010 at 8:52 PM, sugar-devel-requ...@lists.sugarlabs.orgwrote:
2. [PATCH] Downgrading activities not allowed. (#2164)
(shan...@seeta.in)
From: shan...@seeta.in
To: sugar-devel@lists.sugarlabs.org
Subject: [Sugar-devel] [PATCH] Downgrading activities not allowed.
(#2164)
Message-ID: 4cadd298.c83ddf0a.508f.3...@mx.google.com
From: Shanjit Singh Jajmann shan...@seeta.in, Anubhav Aggarwal
anub...@seeta.in
Downgrading an activity is now made possible. When a .xo file of a version
older than the currently installed version is clicked, a downgrading option
is made available, by popping up of a confirmation alert. Depending upton
the choice selected you can downgrade the activity.
---
src/jarabe/journal/journalactivity.py | 36 +++--
src/jarabe/journal/listview.py|7 +++-
src/jarabe/journal/misc.py| 56
-
src/jarabe/model/bundleregistry.py| 18 +++---
4 files changed, 91 insertions(+), 26 deletions(-)
mode change 100644 = 100755 src/jarabe/journal/misc.py
mode change 100644 = 100755 src/jarabe/model/bundleregistry.py
diff --git a/src/jarabe/journal/journalactivity.py
b/src/jarabe/journal/journalactivity.py
index 44cc018..2af55d3 100644
--- a/src/jarabe/journal/journalactivity.py
+++ b/src/jarabe/journal/journalactivity.py
@@ -28,6 +28,7 @@ import os
from sugar.graphics.window import Window
from sugar.graphics.alert import ErrorAlert
+from sugar.graphics.alert import ConfirmationAlert
from sugar.bundle.bundle import ZipExtractException, RegistrationException
from sugar import env
@@ -128,7 +129,7 @@ class JournalActivity(Window):
self.connect('window-state-event', self.__window_state_event_cb)
self.connect('key-press-event', self._key_press_event_cb)
self.connect('focus-in-event', self._focus_in_event_cb)
-
+
model.created.connect(self.__model_created_cb)
model.updated.connect(self.__model_updated_cb)
model.deleted.connect(self.__model_deleted_cb)
@@ -136,7 +137,6 @@ class JournalActivity(Window):
self._dbus_service = JournalActivityDBusService(self)
self.iconify()
-
self._critical_space_alert = None
self._check_available_space()
@@ -145,7 +145,29 @@ class JournalActivity(Window):
alert.connect('response', self.__alert_response_cb)
self.add_alert(alert)
alert.show()
-
+
+def __activity_alert1_cb(self):
+ if misc.check_previous_install() == 1 and
misc.return_checked()==0:
+ alert1 = ConfirmationAlert()
+ logging.debug('value of misc is %d',
misc.check_previous_install())
+ alert1.props.title=_('Previous Version Found')
+ alert1.props.msg = _('A previous version of an installed
activity was found. Are you sure you want to continue with installation ?
If Yes
click Ok and the activity icon of the older .xo file in the Journal')
+ alert1.connect('response', self.__alert1_response_cb)
+ self.add_alert(alert1)
+ alert1.show()
+
+def __alert1_response_cb(self, alert1, response_id):
+if response_id is gtk.RESPONSE_OK:
+logging.debug('value of checked initial %d',
misc.return_checked())
+logging.debug('Installing previous version')
+self.remove_alert(alert1)
+misc.checked = 1
+logging.debug('value of checked final %d',
misc.return_checked())
+
+elif response_id is gtk.RESPONSE_CANCEL:
+logging.debug('Cancelled by user')
+self.remove_alert(alert1)
+
def __alert_response_cb(self, alert, response_id):
self.remove_alert(alert)
@@ -166,6 +188,8 @@ class JournalActivity(Window):
self._list_view = ListView()
self._list_view.connect('detail-clicked', self.__detail_clicked_cb)
self._list_view.connect('clear-clicked', self.__clear_clicked_cb)
+self._list_view.connect('icon-clicked', self.__icon_clicked_cb)
+logging.debug('icon clicked in main')
self._main_view.pack_start(self._list_view)
self._list_view.show()
@@ -195,7 +219,11 @@ class JournalActivity(Window):
keyname = gtk.gdk.keyval_name(event.keyval)
if keyname == 'Escape':
self.show_main_view()
-
+
+