I'm currently using wah!cade in a cocktail cab and needed a way to shutdown without a keyboard and without a power button (acpi). I also didn't want it to ask for a password and didn't want to run wah!cade as root. This patch is against 0.21.
Adding the following bits to win_options.py does the trick on (x)ubuntu (not tested on any other distro):
- Code: Select all
--- win_options.py.orig 2007-12-05 23:10:47.000000000 +1100
+++ win_options.py 2007-12-05 23:09:24.000000000 +1100
@@ -25,6 +25,7 @@
import os
import sys
import string
+import dbus
#gtk
import pygtk
@@ -100,8 +101,9 @@
[_('Games List Options'), 'list_options'],
#['Launch External Application', 'external'],
[_('About...'), 'about'],
- [_('Exit Wah!Cade'), 'exit']],
- 'list_options':
+ [_('Exit Wah!Cade'), 'exit'],
+ [_('Close Arcade'), 'shutdown']],
+ 'list_options':
[[_('Add Game to List'), 'add_to_list'],
[_('Remove Game from List'), 'remove_from_list'],
[_('Generate Filtered List...'), 'generate_ftr'],
@@ -292,6 +294,12 @@
elif menu_item == 'exit':
#exit
self.WinMain.on_winMain_destroy()
+ elif menu_item == 'shutdown':
+ bus = dbus.SystemBus()
+ hal_obj = bus.get_object ('org.freedesktop.Hal', '/org/freedesktop/Hal/devices/computer')
+ hal = dbus.Interface (hal_obj, 'org.freedesktop.Hal.Device.SystemPowerManagement')
+ rv = hal.Shutdown()
+ self.WinMain.on_winMain_destroy()
else:
#show appropriate menu
self.set_menu(menu_item, menu_desc)
thanks
