Author: dmeyer
Date: Sun Dec 3 12:32:45 2006
New Revision: 8690
Modified:
trunk/ui/src/plugins/shutdown.py
Log:
make it possible to restart freevo
Modified: trunk/ui/src/plugins/shutdown.py
==============================================================================
--- trunk/ui/src/plugins/shutdown.py (original)
+++ trunk/ui/src/plugins/shutdown.py Sun Dec 3 12:32:45 2006
@@ -63,10 +63,12 @@
if config.CONFIRM_SHUTDOWN:
items = [ Action(_('Shutdown Freevo'), self.confirm_freevo),
Action(_('Shutdown system'), self.confirm_system),
+ Action(_('Restart Freevo'), self.confirm_freevo_restart),
Action(_('Restart system'), self.confirm_sys_restart) ]
else:
items = [ Action(_('Shutdown Freevo'), self.shutdown_freevo),
Action(_('Shutdown system'), self.shutdown_system),
+ Action(_('Restart Freevo'),
self.shutdown_freevo_restart),
Action(_('Restart system'), self.shutdown_sys_restart) ]
if config.ENABLE_SHUTDOWN_SYS:
@@ -95,6 +97,16 @@
box.show()
+ def confirm_freevo_restart(self):
+ """
+ Pops up a ConfirmBox.
+ """
+ what = _('Do you really want to restart Freevo?')
+ box = ConfirmBox(what, default_choice=1)
+ box.connect(0, self.shutdown_freevo_restart)
+ box.show()
+
+
def confirm_sys_restart(self):
"""
Pops up a ConfirmBox.
@@ -133,6 +145,15 @@
kaa.notifier.OneShotTimer(os.system, config.SHUTDOWN_SYS_CMD).start(1)
+ def shutdown_freevo_restart(self):
+ """
+ restart freevo
+ """
+ self.show_gui_message(_('restart...'))
+ kaa.notifier.signals['shutdown'].connect(os.execvp, sys.argv[0],
sys.argv)
+ kaa.notifier.OneShotTimer(sys.exit, 0).start(1)
+
+
def shutdown_sys_restart(self):
"""
restart the complete system
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog