def __bind_keys(self): XfConKeyBinder.register(self, [ (self.settings.get_property('key-notebook-tab-rename'), self.__on_accel_tab_rename), (self.settings.get_property('key-notebook-tab-close'), self.__on_accel_tab_delete), (self.settings.get_property('key-notebook-tab-next'), self.__on_accel_tab_previous), (self.settings.get_property('key-notebook-tab-previous'), self.__on_accel_tab_next), ])
def __bind_keys(self): XfConKeyBinder.register( self, [ (self.settings.get_property("key-quit"), self.__on_accel_quit), (self.settings.get_property("key-new-tab"), self.__on_accel_tab_create), ], ) XfConKeyBinder.register_global( "XfCon Global", [(self.settings.get_property("key-show-hide"), self.__on_accel_show_hide)] )
def __on_focus_in(self, source, event): self.emit("focus-in-event", event) XfConKeyBinder.register( self, [ (self.settings.get_property("key-clipboard-copy"), self.__on_menu_copy), (self.settings.get_property("key-clipboard-paste"), self.__on_menu_paste), (self.settings.get_property("key-view-split-horizontal"), self.__on_split_horizontal), (self.settings.get_property("key-view-split-vertical"), self.__on_split_vertical), (self.settings.get_property("key-view-activate-next"), self.__on_activate_next), (self.settings.get_property("key-view-activate-previous"), self.__on_activate_previous), ], )
def __init__(self): super(XfConWindow, self).__init__() XfConDialog.init(self) self.settings = XfConSettings.Instance() self.activate() self.set_decorated(False) self.set_gravity(gtk.gdk.GRAVITY_STATIC) self.set_skip_pager_hint(True) self.set_skip_taskbar_hint(True) self.set_title(APPNAME) self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_UTILITY) self.set_keep_above(True) self.set_urgency_hint(True) self.set_resizable(False) self.set_position(gtk.WIN_POS_NONE) self.add_accel_group(XfConKeyBinder.create()) self.notebook = XfConNotebook() self.notebook.connect(XfConObject.XFCON_SIGNAL_MENU_BUILD, self.__on_menu_build) self.notebook.connect(XfConObject.XFCON_SIGNAL_MENU_SHOW, self.__on_menu_show) self.notebook.connect(XfConObject.XFCON_SIGNAL_MENU_HIDE, self.__on_menu_hide) self.add(self.notebook) # trayicon! # TODO(error): make a nice definition out of this. # Can't see the tray icon on awesome. why's that? img = pixmapfile("terminal.png") self.tray_icon = gtk.status_icon_new_from_file(img) self.tray_icon.set_tooltip(APPNAME) self.tray_icon.set_visible(True) self.tray_icon.connect("popup-menu", self.__on_accel_show_hide) self.tray_icon.connect("activate", self.__on_accel_show_hide) self.connect("delete-event", self.__on_destroy) self.connect("set-focus", self.__on_focus_move) self.last_focus = None self.expose_animation = None self.expose_step = 0.0 self.__import_plugins() self.__bind_config() self.__bind_keys() self.__apply_config() self.__show_start_notification()
def __on_focus_out(self, source, event): XfConKeyBinder.unregister(self) self.emit("focus-out-event", event)
def destroy(self): start_new_thread(self.__delete_shell, (self.pid,)) XfConKeyBinder.unregister(self) XfConTerminal.class_last_path = "~" super(self.__class__, self).destroy()