Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pippy_app.py
diff options
context:
space:
mode:
Diffstat (limited to 'pippy_app.py')
-rw-r--r--pippy_app.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/pippy_app.py b/pippy_app.py
index 74f37d6..04e7baa 100644
--- a/pippy_app.py
+++ b/pippy_app.py
@@ -30,6 +30,7 @@ import signal
from activity import ViewSourceActivity
from sugar.activity.activity import ActivityToolbox, \
get_bundle_path, get_bundle_name
+from sugar.graphics.alert import NotifyAlert
SERVICE = "org.laptop.Screencast"
IFACE = SERVICE
@@ -53,6 +54,11 @@ class ScreencastActivity(ViewSourceActivity):
# Toolbar.
toolbox = ActivityToolbox(self)
+ activity_toolbar = toolbox.get_activity_toolbar()
+ activity_toolbar.remove(activity_toolbar.share)
+ activity_toolbar.share = None
+ activity_toolbar.remove(activity_toolbar.keep)
+ activity_toolbar.keep = None
self.set_toolbox(toolbox)
toolbox.show()
@@ -98,6 +104,24 @@ class ScreencastActivity(ViewSourceActivity):
#except OSError, e:
# print "unable to remove outfile: %s" % e
+ def can_close(self):
+ if self.status.get_text().startswith("Status: Stopped"):
+ return True
+ else:
+ self.alert("You need to finish operation before quitting.", self.status.get_text())
+
+ def alert(self, title, text=None):
+ alert = NotifyAlert(timeout=10)
+ alert.props.title = title
+ alert.props.msg = text
+ self.add_alert(alert)
+ alert.connect('response', self.alert_cancel_cb)
+ alert.show()
+
+ def alert_cancel_cb(self, alert, response_id):
+ self.remove_alert(alert)
+
+
def record_cb(self, record):
self.stop.set_sensitive(True)
self.record.set_sensitive(False)