def __init__(self, mainwindow): BaseView.__init__(self, mainwindow) plugin_names = [ p.NAME for p in self.mainwindow.app.get_enabled_plugins() if p.IS_VIEW ] self.plugin_list = GUISelectableList(plugin_names)
def __init__(self, app): GUIObject.__init__(self) self.app = app self.categories = [cat(app.results) for cat in app._prioritization_categories()] self.category_list = CriterionCategoryList(self) self.criteria = [] self.criteria_list = GUISelectableList() self.prioritizations = [] self.prioritization_list = PrioritizationList(self)
class AccountReassignPanel(MainWindowPanel): def __init__(self, mainwindow): MainWindowPanel.__init__(self, mainwindow) self.account_list = GUISelectableList() def _load(self, accounts): self.deleted_accounts = set(accounts) all_accounts = self.document.accounts[:] target_accounts = [a for a in all_accounts if a not in self.deleted_accounts] sort_accounts(target_accounts) target_account_names = [a.name for a in target_accounts] target_account_names.insert(0, tr('No Account')) self._target_accounts = target_accounts self._target_accounts.insert(0, None) self.account_list[:] = target_account_names self.account_list.select(0) def _save(self): reassign_to = self._target_accounts[self.account_list.selected_index] self.document.delete_accounts(self.deleted_accounts, reassign_to=reassign_to)
class AccountReassignPanel(MainWindowPanel): def __init__(self, mainwindow): MainWindowPanel.__init__(self, mainwindow) self.account_list = GUISelectableList() def _load(self, accounts): self.deleted_accounts = set(accounts) all_accounts = self.document.accounts[:] target_accounts = [ a for a in all_accounts if a not in self.deleted_accounts ] sort_accounts(target_accounts) target_account_names = [a.name for a in target_accounts] target_account_names.insert(0, tr('No Account')) self._target_accounts = target_accounts self._target_accounts.insert(0, None) self.account_list[:] = target_account_names self.account_list.select(0) def _save(self): reassign_to = self._target_accounts[self.account_list.selected_index] self.document.delete_accounts(self.deleted_accounts, reassign_to=reassign_to)
def _update_selection(self): self.dialog.select_category( self.dialog.categories[self.selected_index]) GUISelectableList._update_selection(self)
def _update_selection(self): GUISelectableList._update_selection(self) if self.setfunc is not None: self.setfunc(self.selected_index)
def _update_selection(self): GUISelectableList._update_selection(self) selected_type = AccountType.InOrder[self.selected_index] self.panel.type = selected_type
def _update_selection(self): GUISelectableList._update_selection(self) repeat_type = REPEAT_OPTIONS_ORDER[self.selected_index] self.panel.repeat_type = repeat_type
def __init__(self, mainwindow): MainWindowPanel.__init__(self, mainwindow) self.account_list = GUISelectableList()
def _update_selection(self): GUISelectableList._update_selection(self) target = self.panel._targets[self.selected_index] self.panel.budget.target = target
def _update_selection(self): GUISelectableList._update_selection(self) account = self.panel._accounts[self.selected_index] self.panel.budget.account = account
def __init__(self, dialog): self.dialog = dialog GUISelectableList.__init__(self)
def __init__(self, panel): self.panel = panel GUISelectableList.__init__(self)
def __init__(self, dialog): self.dialog = dialog GUISelectableList.__init__(self, [c.NAME for c in dialog.categories])
def __init__(self, panel): self.panel = panel account_types_desc = [ ACCOUNT_TYPE_DESC[at] for at in AccountType.InOrder ] GUISelectableList.__init__(self, account_types_desc)
def _update_selection(self): self.dialog.select_category(self.dialog.categories[self.selected_index]) GUISelectableList._update_selection(self)
def __init__(self, items=None, setfunc=None): # setfunc(newindex) GUISelectableList.__init__(self, items=items) self.setfunc = setfunc
def __init__(self, panel): self.panel = panel account_types_desc = [ACCOUNT_TYPE_DESC[at] for at in AccountType.InOrder] GUISelectableList.__init__(self, account_types_desc)