def contextMenuEvent(self, event): rows = self.get_selected_rows() is_selection = True if rows else False options = [(_('Open destination folder'), self.on_open_folder, is_selection), (_('Copy link'), self.on_copy_link, is_selection), #(_('Add password'), self.on_password, is_selection), None, (_('Delete'), self.on_delete, is_selection), None, (_('Start all'), self.on_start_all, True), (_('Stop all'), self.on_stop_all, True), (_('Clear Completed'), self.on_clear_completed, True)] menu = Menu(options) menu.exec_(event.globalPos())
def context_menu(self, position): rows = self.get_selected_rows() is_single_row = True if len(rows) == 1 else False options = [(_('Save as...'), self.on_save_as, is_single_row), None, (_('Download Selected'), self.on_download_selected, True), None, (_('Select all'), self.on_select_all, True), (_('Select none'), self.on_select_none, True), (_('Select inverse'), self.on_select_inverse, True), None, (_('Re-check'), self.on_recheck, True), (_('Clear list'), self.on_clear_list, True)] menu = Menu(options) menu.exec_(self.tree_view.viewport().mapToGlobal(position))
def contextMenuEvent(self, event): rows = self.get_selected_rows() is_selection = True if rows else False options = [ (_('Open destination folder'), self.on_open_folder, is_selection), (_('Copy link'), self.on_copy_link, is_selection), #(_('Add password'), self.on_password, is_selection), None, (_('Delete'), self.on_delete, is_selection), None, (_('Start all'), self.on_start_all, True), (_('Stop all'), self.on_stop_all, True), (_('Clear Completed'), self.on_clear_completed, True) ] menu = Menu(options) menu.exec_(event.globalPos())
def context_menu(self): options = [(_('Show/Hide'), self.show_or_hide, True), None, (_('Quit'), self.parent.event_close, True)] self.menu = Menu(options) self.setContextMenu(self.menu)