Toggle console visibility
This commit is contained in:
parent
84d3471613
commit
6e599ead06
@ -80,8 +80,12 @@ class Service(dbus.service.Object):
|
||||
self._console = Console()
|
||||
|
||||
@dbus.service.method(CONSOLE_IFACE)
|
||||
def show(self):
|
||||
self._console.window.present()
|
||||
def toggle_visibility(self):
|
||||
window = self._console.window
|
||||
if not window.props.visible:
|
||||
window.present()
|
||||
else:
|
||||
window.hide()
|
||||
|
||||
bus = dbus.SessionBus()
|
||||
name = dbus.service.BusName(CONSOLE_BUS, bus)
|
||||
|
@ -138,7 +138,7 @@ class Shell(gobject.GObject):
|
||||
elif key == '<alt>F8':
|
||||
self._hw_manager.set_display_mode(HardwareManager.B_AND_W_MODE)
|
||||
elif key == '<alt>equal' or key == '<alt>0':
|
||||
gobject.idle_add(self._show_console_cb)
|
||||
gobject.idle_add(self._toggle_console_visibility_cb)
|
||||
elif key == '<alt>f':
|
||||
self._frame.notify_key_press()
|
||||
elif key == '<alt>o':
|
||||
@ -158,12 +158,12 @@ class Shell(gobject.GObject):
|
||||
box = self._home_window.get_home_box()
|
||||
box.grab_and_rotate()
|
||||
|
||||
def _show_console_cb(self):
|
||||
def _toggle_console_visibility_cb(self):
|
||||
bus = dbus.SessionBus()
|
||||
proxy = bus.get_object('org.laptop.sugar.Console',
|
||||
'/org/laptop/sugar/Console')
|
||||
mgr = dbus.Interface(proxy, 'org.laptop.sugar.Console')
|
||||
mgr.show()
|
||||
console = dbus.Interface(proxy, 'org.laptop.sugar.Console')
|
||||
console.toggle_visibility()
|
||||
|
||||
def _shutdown(self):
|
||||
bus = dbus.SystemBus()
|
||||
|
@ -1,6 +1,6 @@
|
||||
VERSION=0.63
|
||||
DATE=`date +%Y%m%d`
|
||||
RELEASE=2.6
|
||||
RELEASE=2.7
|
||||
TARBALL=sugar-$VERSION-$RELEASE.${DATE}git.tar.bz2
|
||||
|
||||
rm sugar-$VERSION.tar.bz2
|
||||
|
Loading…
Reference in New Issue
Block a user