def on_option(widget): try: id = self._menu.get_title() dialog = LabelOptionsDialog(self._plugin, id) if __debug__: RT.register(dialog, __name__) dialog.show() except: log.exception("Error initializing LabelOptionsDialog") pass
def on_activate(widget): try: ids = self.get_selected_torrent_labels() dialog = LabelOptionsDialog(self._plugin, ids[0]) if __debug__: RT.register(dialog, __name__) dialog.show() except: log.exception("Error initializing LabelOptionsDialog") pass
def _on_button_pressed(self, widget, event): x, y = event.get_coords() path_info = widget.get_path_at_pos(int(x), int(y)) if not path_info: return path, column, cell_x, cell_y = path_info id, data = widget.get_model()[path] if event.button == 1 and event.type == Gdk.EventType._2BUTTON_PRESS: if self._store.is_user_label(id): try: dialog = LabelOptionsDialog(self._plugin, id) if __debug__: RT.register(dialog, __name__) dialog.show() except: log.exception("Error initializing LabelOptionsDialog") pass elif event.button == 3: self._menu.set_title(id) self._menu.popup(None, None, None, None, event.button, event.time) return True
def _on_view_button_press(self, widget, event): x, y = event.get_coords() path_info = widget.get_path_at_pos(int(x), int(y)) if not path_info: self._view.treeview.get_selection().unselect_all() if event.button == 3: self._alt_menu.popup(None, None, None, None, event.button, event.time) return if event.button == 1 and event.type == Gdk.EventType._2BUTTON_PRESS: if path_info[1] == self._get_view_column(): ids = self.get_selected_torrent_labels() if self.is_filter(ids): try: dialog = LabelOptionsDialog(self._plugin, ids[0]) if __debug__: RT.register(dialog, __name__) dialog.show() except: log.exception("Error initializing LabelOptionsDialog") pass else: self._set_filter_sync_sidebar(ids)