Re: [Sugar-devel] [PATCH] Downgrading activities not allowed. (#2164)

2010-10-15 Thread Sascha Silbe
Excerpts from shanjit's message of Fri Oct 15 23:37:42 +0200 2010:

 Downgrading an activity is now made possible. [...]

You've told git send-email to mark your patch as a reply to some message
that I've not only never received, but that's also the same as the one
referenced by a totally different patch against Paint. Because of this
both patches now appear in the same thread, turning review into quite a
mess.

Please don't set In-Reply-To for patches unless you know exactly what
you're doing. And even then please think twice whether it's really a good
idea.

Sascha

--
http://sascha.silbe.org/
http://www.infra-silbe.de/


signature.asc
Description: PGP signature
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [PATCH] Downgrading activities not allowed. (#2164)

2010-10-13 Thread shanjit
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.

v1 - v2. Named according to the nomenclature suggested,inline function 
used,signal emission condition revised,global variables removed.

Signed-off-by: Shanjit Singh Jajmann shan...@seeta.in, Anubhav Aggarwal 
anub...@seeta.in
---
 src/jarabe/journal/journalactivity.py |   15 +++
 src/jarabe/journal/listview.py|   22 ++
 src/jarabe/journal/misc.py|8 +---
 src/jarabe/model/bundleregistry.py|   11 ++-
 4 files changed, 44 insertions(+), 12 deletions(-)

diff --git a/src/jarabe/journal/journalactivity.py 
b/src/jarabe/journal/journalactivity.py
index 44cc018..d0af20a 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
@@ -166,6 +167,7 @@ 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('older-version-clicked', 
self.__older_version_clicked_cb)
 self._main_view.pack_start(self._list_view)
 self._list_view.show()
 
@@ -204,6 +206,19 @@ class JournalActivity(Window):
 
 def __go_back_clicked_cb(self, detail_view):
 self.show_main_view()
+def __older_version_clicked_cb(self,a):
+alert1=ConfirmationAlert()
+alert1.props.title = _('Newer Version Found')
+alert1.props.msg = _('Newer version of the chosen activity is 
available do you still want to continue with the installation?  
If Yes click Ok and 
the activity icon of the older .xo file in the Journal')
+alert1.connect('response',self.__downgrade_alert_response_cb)
+self.add_alert(alert1)
+alert1.show()
+def __downgrade_alert_response_cb(self, alert1, response_id):
+if response_id is gtk.RESPONSE_OK:
+self.remove_alert(alert1)
+self._list_view.downgrade_confirmation()
+elif response_id is gtk.RESPONSE_CANCEL:
+self.remove_alert(alert1)
 
 def _query_changed_cb(self, toolbar, query):
 self._list_view.update_with_query(query)
diff --git a/src/jarabe/journal/listview.py b/src/jarabe/journal/listview.py
index 3d6281a..653f400 100644
--- a/src/jarabe/journal/listview.py
+++ b/src/jarabe/journal/listview.py
@@ -27,6 +27,7 @@ import pango
 from sugar.graphics import style
 from sugar.graphics.icon import CanvasIcon, Icon, CellRendererIcon
 from sugar.graphics.xocolor import XoColor
+from sugar.bundle.bundle import AlreadyInstalledException
 from sugar import util
 
 from jarabe.journal.listmodel import ListModel
@@ -466,12 +467,17 @@ class ListView(BaseListView):
 __gsignals__ = {
 'detail-clicked': (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
-   ([object]))
+   ([object])),
+'older-version-clicked': (gobject.SIGNAL_RUN_FIRST,
+  gobject.TYPE_NONE,
+  ([]))
 }
+
 
 def __init__(self):
 BaseListView.__init__(self)
 self._is_dragging = False
+self.downgrade = False
 
 self.tree_view.connect('drag-begin', self.__drag_begin_cb)
 self.tree_view.connect('button-release-event',
@@ -522,12 +528,20 @@ class ListView(BaseListView):
 
 def __detail_clicked_cb(self, cell, uid):
 self.emit('detail-clicked', uid)
-
+def downgrade_confirmation(self):
+self.downgrade = True
 def __icon_clicked_cb(self, cell, path):
 row = self.tree_view.get_model()[path]
 metadata = model.get(row[ListModel.COLUMN_UID])
-misc.resume(metadata)
-
+if not self.downgrade:
+try:
+misc.resume(metadata)
+except AlreadyInstalledException :
+self.emit('older-version-clicked')
+if self.downgrade:
+self.downgrade = False
+misc.resume(metadata,forcing_downgrade=True)
+ 
 def __cell_title_edited_cb(self, cell, path, new_text):
 row = self._model[path]
 metadata = model.get(row[ListModel.COLUMN_UID])
diff --git a/src/jarabe/journal/misc.py b/src/jarabe/journal/misc.py
index 32a2847..0ae4a1d 100644
--- a/src/jarabe/journal/misc.py
+++ b/src/jarabe/journal/misc.py
@@ 

Re: [Sugar-devel] [PATCH] Downgrading activities not allowed. (#2164)

2010-10-13 Thread Aleksey Lim
On Wed, Oct 13, 2010 at 07:28:51PM +0530, shan...@seeta.in wrote:
 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.
 
 v1 - v2. Named according to the nomenclature suggested,inline function 
 used,signal emission condition revised,global variables removed.

As I was talking while IRC discussion, I don't think that processing
downgrade hook in every misc.resume invocation place (you missed
misc.resume call in expandedentry.py, journaltoolbox.py and
palettes.py) is useful, more apriproate is keeping it in one place
(whatevery it will be).

 Signed-off-by: Shanjit Singh Jajmann shan...@seeta.in, Anubhav Aggarwal 
 anub...@seeta.in
 ---
  src/jarabe/journal/journalactivity.py |   15 +++
  src/jarabe/journal/listview.py|   22 ++
  src/jarabe/journal/misc.py|8 +---
  src/jarabe/model/bundleregistry.py|   11 ++-
  4 files changed, 44 insertions(+), 12 deletions(-)
 
 diff --git a/src/jarabe/journal/journalactivity.py 
 b/src/jarabe/journal/journalactivity.py
 index 44cc018..d0af20a 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
 @@ -166,6 +167,7 @@ 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('older-version-clicked', 
 self.__older_version_clicked_cb)
  self._main_view.pack_start(self._list_view)
  self._list_view.show()
  
 @@ -204,6 +206,19 @@ class JournalActivity(Window):
  
  def __go_back_clicked_cb(self, detail_view):
  self.show_main_view()
 +def __older_version_clicked_cb(self,a):
 +alert1=ConfirmationAlert()
 +alert1.props.title = _('Newer Version Found')
 +alert1.props.msg = _('Newer version of the chosen activity is 
 available do you still want to continue with the installation?
   If Yes click Ok 
 and the activity icon of the older .xo file in the Journal')
 +alert1.connect('response',self.__downgrade_alert_response_cb)
 +self.add_alert(alert1)
 +alert1.show()
 +def __downgrade_alert_response_cb(self, alert1, response_id):
 +if response_id is gtk.RESPONSE_OK:
 +self.remove_alert(alert1)
 +self._list_view.downgrade_confirmation()
 +elif response_id is gtk.RESPONSE_CANCEL:
 +self.remove_alert(alert1)
  
  def _query_changed_cb(self, toolbar, query):
  self._list_view.update_with_query(query)
 diff --git a/src/jarabe/journal/listview.py b/src/jarabe/journal/listview.py
 index 3d6281a..653f400 100644
 --- a/src/jarabe/journal/listview.py
 +++ b/src/jarabe/journal/listview.py
 @@ -27,6 +27,7 @@ import pango
  from sugar.graphics import style
  from sugar.graphics.icon import CanvasIcon, Icon, CellRendererIcon
  from sugar.graphics.xocolor import XoColor
 +from sugar.bundle.bundle import AlreadyInstalledException
  from sugar import util
  
  from jarabe.journal.listmodel import ListModel
 @@ -466,12 +467,17 @@ class ListView(BaseListView):
  __gsignals__ = {
  'detail-clicked': (gobject.SIGNAL_RUN_FIRST,
 gobject.TYPE_NONE,
 -   ([object]))
 +   ([object])),
 +'older-version-clicked': (gobject.SIGNAL_RUN_FIRST,
 +  gobject.TYPE_NONE,
 +  ([]))
  }
 +
  
  def __init__(self):
  BaseListView.__init__(self)
  self._is_dragging = False
 +self.downgrade = False
  
  self.tree_view.connect('drag-begin', self.__drag_begin_cb)
  self.tree_view.connect('button-release-event',
 @@ -522,12 +528,20 @@ class ListView(BaseListView):
  
  def __detail_clicked_cb(self, cell, uid):
  self.emit('detail-clicked', uid)
 -
 +def downgrade_confirmation(self):
 +self.downgrade = True
  def __icon_clicked_cb(self, cell, path):
  row = self.tree_view.get_model()[path]
  metadata = model.get(row[ListModel.COLUMN_UID])
 -misc.resume(metadata)
 -
 +if not self.downgrade:
 +try:
 +misc.resume(metadata)
 +except AlreadyInstalledException :
 +

[Sugar-devel] [PATCH] Downgrading activities not allowed. (#2164)

2010-10-11 Thread shanjit
From: Shanjit Singh Jajmann shan...@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 |   31 +++--
 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/journalactivity.py
 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
old mode 100644
new mode 100755
index 44cc018..5f9d708
--- 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,30 @@ 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 +189,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 +220,11 @@ class JournalActivity(Window):
 keyname = gtk.gdk.keyval_name(event.keyval)
 if keyname == 'Escape':
 self.show_main_view()
-
+
+def __icon_clicked_cb(self):
+   logging.debug('value of misc is %d', 
misc.check_previous_install())
+   self.__activity_alert1_cb()
+   
 def __detail_clicked_cb(self, list_view, object_id):
 self._show_secondary_view(object_id)
 
diff --git a/src/jarabe/journal/listview.py b/src/jarabe/journal/listview.py
index 3d6281a..4e59ed3 100644
--- a/src/jarabe/journal/listview.py
+++ b/src/jarabe/journal/listview.py
@@ -466,8 +466,12 @@ class ListView(BaseListView):
 __gsignals__ = {
 'detail-clicked': (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
-   ([object]))
+   ([object])),
+'icon-clicked': (gobject.SIGNAL_RUN_FIRST,
+  

Re: [Sugar-devel] [PATCH] Downgrading activities not allowed. (#2164)

2010-10-11 Thread James Cameron
Nak.  See detailed comments below.

On Tue, Oct 12, 2010 at 01:15:34AM +0530, shan...@seeta.in wrote:
 From: Shanjit Singh Jajmann shan...@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.

Please text wrap these subsequent lines of your commit message.

  mode change 100644 = 100755 src/jarabe/journal/journalactivity.py
  mode change 100644 = 100755 src/jarabe/journal/misc.py
  mode change 100644 = 100755 src/jarabe/model/bundleregistry.py

You are incorrectly changing file modes.  Please restore the file modes
before you commit.

 @@ -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)
 -
 +

Please remove this gratuitous whitespace change from your patch.

 @@ -145,7 +145,30 @@ class JournalActivity(Window):
  alert.connect('response', self.__alert_response_cb)
  self.add_alert(alert)
  alert.show()
 -
 +
 +def __activity_alert1_cb(self):

Please use a method name that describes the action to be taken.  As
Bernie pointed out, the name you used did not explain the reason for the
alert.

 + 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')

The message you have written is ambiguous and could be read in either of
two ways; that the user has clicked on a newer version, or that the user
has clicked on an older version.

 +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)

The logging is useful to you at this stage of development, but you
should assess whether it is useful to other developers.  Perhaps some of
these and later logging calls should be removed.

 @@ -148,31 +152,53 @@ def get_activities(metadata):
 [...]
  def resume(metadata, bundle_id=None):
  registry = bundleregistry.get_registry()
 -
 +global checker
 +global checked

I agree with Bernie ... there seems to be no justification for using
globals in this situation.

-- 
James Cameron
http://quozl.linux.org.au/
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


Re: [Sugar-devel] [PATCH] Downgrading activities not allowed. (#2164)

2010-10-10 Thread Aleksey Lim
On Thu, Oct 07, 2010 at 07:30:36PM +0530, shan...@seeta.in wrote:
 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()
 -
 +
 +def __icon_clicked_cb(self,a):
 + logging.debug('value of misc is %d', 
 misc.check_previous_install())
 + self.__activity_alert1_cb()
 + 
  def __detail_clicked_cb(self, list_view, object_id):
  self._show_secondary_view(object_id)
  
 diff --git a/src/jarabe/journal/listview.py b/src/jarabe/journal/listview.py
 index 3d6281a..3dbcc2d 100644
 --- a/src/jarabe/journal/listview.py
 +++ b/src/jarabe/journal/listview.py
 @@ -466,8 +466,12 @@ class ListView(BaseListView):
  __gsignals__ = {
  'detail-clicked': (gobject.SIGNAL_RUN_FIRST,
 gobject.TYPE_NONE,
 -   ([object]))
 

[Sugar-devel] [PATCH] Downgrading activities not allowed. (#2164)

2010-10-07 Thread shanjit
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()
-
+
+def __icon_clicked_cb(self,a):
+   logging.debug('value of misc is %d', 
misc.check_previous_install())
+   self.__activity_alert1_cb()
+   
 def __detail_clicked_cb(self, list_view, object_id):
 self._show_secondary_view(object_id)
 
diff --git a/src/jarabe/journal/listview.py b/src/jarabe/journal/listview.py
index 3d6281a..3dbcc2d 100644
--- a/src/jarabe/journal/listview.py
+++ b/src/jarabe/journal/listview.py
@@ -466,8 +466,12 @@ class ListView(BaseListView):
 __gsignals__ = {
 'detail-clicked': (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
-   ([object]))
+   ([object])),
+'icon-clicked': (gobject.SIGNAL_RUN_FIRST,
+  gobject.TYPE_NONE,
+  ([]))