def __action_connect_other_bus_cb(self, action, parameter): """connect to other bus""" dialog = AddConnectionDialog(self.data_dir, self, self.bus_history) result = dialog.run() if result == Gtk.ResponseType.OK: address = dialog.address if address == 'Session Bus': self.activate_action('connect-session-bus', None) return elif address == 'System Bus': self.activate_action('connect-system-bus', None) return else: try: bw = BusWatch(self.data_dir, address) self.stack.add_titled(bw.box_bus, address, address) # Fill history if address in self.bus_history: self.bus_history.remove(address) self.bus_history.insert(0, address) # Truncating history if (len(self.bus_history) > self.HISTORY_MAX_SIZE): self.bus_history = self.bus_history[0:self. HISTORY_MAX_SIZE] except Exception as e: print("can not connect to '%s': %s" % (address, str(e))) dialog.destroy()
def __otherbus_connect_cb(self, action): """connect to other bus""" dialog = AddConnectionDialog(self.data_dir, self, self.bus_history) result = dialog.run() if result == Gtk.ResponseType.OK: address = dialog.address if address == 'Session Bus': self.__sessionbus_connect_cb(None) return elif address == 'System Bus': self.__systembus_connect_cb(None) return else: try: bw = BusWatch(self.data_dir, address) self.__notebook_append_page(bw.paned_buswatch, address) # Fill history if address in self.bus_history: self.bus_history.remove(address) self.bus_history.insert(0, address) # Truncating history if (len(self.bus_history) > self.HISTORY_MAX_SIZE): self.bus_history = self.bus_history[0:self.HISTORY_MAX_SIZE] except Exception as e: print("can not connect to '%s': %s" % (address, str(e))) dialog.destroy()
def __action_connect_other_bus_cb(self, action, parameter): """connect to other bus""" dialog = AddConnectionDialog(self.data_dir, self, self.bus_history) result = dialog.run() if result == Gtk.ResponseType.OK: address = dialog.address if address == 'Session Bus': self.activate_action('connect-session-bus', None) return elif address == 'System Bus': self.activate_action('connect-system-bus', None) return else: try: bw = BusWatch(self.data_dir, address) self.stack.add_titled(bw.box_bus, address, address) # Fill history if address in self.bus_history: self.bus_history.remove(address) self.bus_history.insert(0, address) # Truncating history if (len(self.bus_history) > self.HISTORY_MAX_SIZE): self.bus_history = self.bus_history[0:self.HISTORY_MAX_SIZE] except Exception as e: print("can not connect to '%s': %s" % (address, str(e))) dialog.destroy()
def __action_connect_other_bus_cb(self, action, parameter): """connect to other bus""" dialog = AddConnectionDialog(self.data_dir, self, self.bus_history) result = dialog.run() if result == Gtk.ResponseType.OK: address = dialog.address if address == 'Session Bus': self.activate_action('connect-session-bus', None) return elif address == 'System Bus': self.activate_action('connect-system-bus', None) return else: self.connect_to(address) dialog.destroy()