Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgnacio Rodríguez <ignaciorodriguez@sugarlabs.org>2012-12-17 22:29:48 (GMT)
committer Ignacio Rodríguez <ignaciorodriguez@sugarlabs.org>2012-12-17 22:29:48 (GMT)
commit047df7bb903ab50c17733c3cfa3235e245513b31 (patch)
tree4810699fe0e95b72d57b1e25170de2dcea6ecc5d
parent54ae7773ec4c9daae6b89cf41a96f93f65c8d5b6 (diff)
Ninja-Ide Cleanup
-rw-r--r--AbacusActivity.py51
1 files changed, 25 insertions, 26 deletions
diff --git a/AbacusActivity.py b/AbacusActivity.py
index ec1bece..adb5560 100644
--- a/AbacusActivity.py
+++ b/AbacusActivity.py
@@ -13,8 +13,6 @@
from gi.repository import Gtk
from gi.repository import Gdk
-from gi.repository import GObject
-from gi.repository import Pango
from sugar3.activity import activity
from sugar3 import profile
@@ -328,35 +326,36 @@ class AbacusActivity(activity.Activity):
return
if self.abacus.mode.name == abacus:
return
- self.alert = Alert()
- self.okicon = Icon(icon_name='dialog-ok')
- self.cancelicon = Icon(icon_name='dialog-cancel')
- self.alert.add_button(Gtk.ResponseType.OK, _('Ok'), self.okicon)
- self.alert.add_button(Gtk.ResponseType.CANCEL, _('Cancel'), self.cancelicon)
- self.alert.props.msg = _('The current progress has delete')
- self.alert.props.title = _('¿Sure?')
- self.alert.connect('response', self._switch_modes, abacus)
- self.add_alert(self.alert)
+ self.alert = Alert()
+ self.okicon = Icon(icon_name='dialog-ok')
+ self.cancelicon = Icon(icon_name='dialog-cancel')
+ self.alert.add_button(Gtk.ResponseType.OK, _('Ok'), self.okicon)
+ self.alert.add_button(Gtk.ResponseType.CANCEL, _('Cancel'), self.cancelicon)
+ self.alert.props.msg = _('The current progress has delete')
+ self.alert.props.title = _('¿Sure?')
+ self.alert.connect('response', self._switch_modes, abacus)
+ self.add_alert(self.alert)
def _switch_modes(self, widget, response, abacus):
''' Display the selected abacus '''
# Save current value
value = int(float(self.abacus.mode.value()))
- # Remove alert
- self.remove_alert(widget)
- if response == Gtk.ResponseType.OK:
- if abacus == 'custom':
- self._custom_cb()
- self.abacus.mode = self.abacus.custom
- else:
- self.abacus.select_abacus(abacus)
-
- self._notify_new_abacus(NAMES[abacus])
- self.abacus.mode.set_value_from_number(value)
- self.abacus.mode.label(self.abacus.generate_label())
- self._label.set_text(NAMES[abacus])
- else:
- pass
+ # Remove alert
+ self.remove_alert(widget)
+ if response == Gtk.ResponseType.OK:
+ if abacus == 'custom':
+ self._custom_cb()
+ self.abacus.mode = self.abacus.custom
+ else:
+ self.abacus.select_abacus(abacus)
+
+ self._notify_new_abacus(NAMES[abacus])
+ self.abacus.mode.set_value_from_number(value)
+ self.abacus.mode.label(self.abacus.generate_label())
+ self._label.set_text(NAMES[abacus])
+ else:
+ pass
+
def _rods_spin_cb(self, button=None):
return