Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
 def _update_selection(self):
     self.dialog.select_category(
         self.dialog.categories[self.selected_index])
     GUISelectableList._update_selection(self)
Ejemplo n.º 6
0
 def _update_selection(self):
     GUISelectableList._update_selection(self)
     if self.setfunc is not None:
         self.setfunc(self.selected_index)
Ejemplo n.º 7
0
 def _update_selection(self):
     GUISelectableList._update_selection(self)
     selected_type = AccountType.InOrder[self.selected_index]
     self.panel.type = selected_type
Ejemplo n.º 8
0
 def _update_selection(self):
     GUISelectableList._update_selection(self)
     repeat_type = REPEAT_OPTIONS_ORDER[self.selected_index]
     self.panel.repeat_type = repeat_type
Ejemplo n.º 9
0
 def _update_selection(self):
     GUISelectableList._update_selection(self)
     if self.setfunc is not None:
         self.setfunc(self.selected_index)
Ejemplo n.º 10
0
 def _update_selection(self):
     GUISelectableList._update_selection(self)
     selected_type = AccountType.InOrder[self.selected_index]
     self.panel.type = selected_type
Ejemplo n.º 11
0
 def _update_selection(self):
     GUISelectableList._update_selection(self)
     repeat_type = REPEAT_OPTIONS_ORDER[self.selected_index]
     self.panel.repeat_type = repeat_type
Ejemplo n.º 12
0
 def __init__(self, mainwindow):
     MainWindowPanel.__init__(self, mainwindow)
     self.account_list = GUISelectableList()
Ejemplo n.º 13
0
 def _update_selection(self):
     GUISelectableList._update_selection(self)
     target = self.panel._targets[self.selected_index]
     self.panel.budget.target = target
Ejemplo n.º 14
0
 def _update_selection(self):
     GUISelectableList._update_selection(self)
     account = self.panel._accounts[self.selected_index]
     self.panel.budget.account = account
Ejemplo n.º 15
0
 def __init__(self, mainwindow):
     MainWindowPanel.__init__(self, mainwindow)
     self.account_list = GUISelectableList()
Ejemplo n.º 16
0
 def __init__(self, dialog):
     self.dialog = dialog
     GUISelectableList.__init__(self)
Ejemplo n.º 17
0
 def __init__(self, panel):
     self.panel = panel
     GUISelectableList.__init__(self)
Ejemplo n.º 18
0
 def __init__(self, dialog):
     self.dialog = dialog
     GUISelectableList.__init__(self, [c.NAME for c in dialog.categories])
Ejemplo n.º 19
0
 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)
Ejemplo n.º 20
0
 def _update_selection(self):
     self.dialog.select_category(self.dialog.categories[self.selected_index])
     GUISelectableList._update_selection(self)
Ejemplo n.º 21
0
 def __init__(self, items=None, setfunc=None):
     # setfunc(newindex)
     GUISelectableList.__init__(self, items=items)
     self.setfunc = setfunc
Ejemplo n.º 22
0
 def __init__(self, dialog):
     self.dialog = dialog
     GUISelectableList.__init__(self)
Ejemplo n.º 23
0
 def __init__(self, panel):
     self.panel = panel
     GUISelectableList.__init__(self)
Ejemplo n.º 24
0
 def _update_selection(self):
     GUISelectableList._update_selection(self)
     account = self.panel._accounts[self.selected_index]
     self.panel.budget.account = account
Ejemplo n.º 25
0
 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)
Ejemplo n.º 26
0
 def _update_selection(self):
     GUISelectableList._update_selection(self)
     target = self.panel._targets[self.selected_index]
     self.panel.budget.target = target
Ejemplo n.º 27
0
 def __init__(self, dialog):
     self.dialog = dialog
     GUISelectableList.__init__(self, [c.NAME for c in dialog.categories])
Ejemplo n.º 28
0
 def __init__(self, items=None, setfunc=None):
     # setfunc(newindex)
     GUISelectableList.__init__(self, items=items)
     self.setfunc = setfunc