2006-09-19 14:43:42 +02:00
|
|
|
import gobject
|
|
|
|
|
|
|
|
class MenuShell(gobject.GObject):
|
|
|
|
__gsignals__ = {
|
|
|
|
'activated': (gobject.SIGNAL_RUN_FIRST,
|
|
|
|
gobject.TYPE_NONE, ([])),
|
|
|
|
'deactivated': (gobject.SIGNAL_RUN_FIRST,
|
|
|
|
gobject.TYPE_NONE, ([])),
|
|
|
|
}
|
|
|
|
|
2006-09-19 14:04:11 +02:00
|
|
|
def __init__(self, grid):
|
2006-09-19 14:43:42 +02:00
|
|
|
gobject.GObject.__init__(self)
|
2006-09-19 14:04:11 +02:00
|
|
|
self._menu_controller = None
|
|
|
|
self._grid = grid
|
|
|
|
|
2006-09-19 14:43:42 +02:00
|
|
|
def is_active(self):
|
|
|
|
return (self._menu_controller != None)
|
|
|
|
|
2006-09-19 14:04:11 +02:00
|
|
|
def set_active(self, controller):
|
2006-09-19 14:43:42 +02:00
|
|
|
if controller == None:
|
|
|
|
self.emit('deactivated')
|
|
|
|
else:
|
|
|
|
self.emit('activated')
|
|
|
|
|
2006-09-19 14:04:11 +02:00
|
|
|
if self._menu_controller:
|
|
|
|
self._menu_controller.popdown()
|
|
|
|
self._menu_controller = controller
|
|
|
|
|
|
|
|
def get_grid(self):
|
|
|
|
return self._grid
|