Ejemplo n.º 1
0
 def edit_data(self):
     mlogger.debug('Edit btn clicked.')
     self.recreate_details_frame()
     if self.gen_list_select.get() and self.det_list_select.get():
         self.populate_detail_frame()
         enable_widgets(self.detFrm.winfo_children())
         mlogger.debug('Detail frame ready for data edit.')
Ejemplo n.º 2
0
 def add_grid(self):
     if self.distr_name.get():
         self.grid_name.set('')
         self.grid_record = None
         self.recreate_location_widgets()
         enable_widgets([self.gridEnt])
         enable_widgets(self.locFrm.winfo_children())
Ejemplo n.º 3
0
 def display_library(self):
     mlogger.debug('Displaying library.')
     enable_widgets(self.libraryFrm.winfo_children())
     self.libOutLst.delete(0, END)
     self.libInLst.delete(0, END)
     libraries = get_names(Library)
     for library in libraries:
         self.libOutLst.insert(END, library)
Ejemplo n.º 4
0
 def system_observer(self, *args):
     if self.activeW.get() == 'ReportWizView':
         if self.system.get() == 1:
             self.library.set('branches')
             disable_widgets([self.libCbx])
         else:
             enable_widgets([self.libCbx])
             self.libCbx['state'] = 'readonly'
             self.library.set('any')
Ejemplo n.º 5
0
    def add_distribution(self):
        # allow edits in distribution name box
        if self.system.get():
            enable_widgets([self.distnameEnt])
            self.distr_name.set('')
            self.distr_record = None

            # remove any data from previous lookups
            self.grid_name.set('')
            self.grid_record = None
            self.recreate_location_widgets()
            self.gridLst.delete(0, END)
Ejemplo n.º 6
0
    def show_frame(self, page_name):
        """show frame for the given page name"""

        self.activeW.set(page_name)
        mlogger.debug("show_frame activewW: {}".format(self.activeW.get()))

        # disable system switching when appropriate
        if self.activeW.get() in ["CartView", "SettingsView"]:
            disable_widgets(self.app_data["systemBtns"])
        else:
            enable_widgets(self.app_data["systemBtns"])

        frame = self.frames[page_name]
        frame.tkraise()
Ejemplo n.º 7
0
    def show_fund(self, *args):
        mlogger.debug('Displaying fund details.')
        self.cur_manager.busy()
        enable_widgets(self.detFrm.winfo_children())
        self.record = get_record(Fund, code=self.fundLst.get(ACTIVE))
        self.display_branches()
        self.display_library()
        self.display_audiences()
        self.display_mattypes()
        fund_data = get_fund_data(self.record)
        mlogger.debug('Fund data: {}'.format(fund_data))

        # display code & description
        self.fund_code.set(fund_data['code'])
        self.fund_desc.set(fund_data['describ'])

        # convert values to listbox indices and add conditions
        # branchLst
        branch_idx = self.get_listbox_indices('branches', self.branchOutLst,
                                              fund_data['branches'])
        mlogger.debug('branchOutLst index matches: {}'.format(branch_idx))
        self.add_condition('branchLst', self.branchOutLst, self.branchInLst,
                           branch_idx)

        # audnLst
        audn_idx = self.get_listbox_indices('audns', self.audnOutLst,
                                            fund_data['audns'])
        mlogger.debug('audnOutLst index matches: {}'.format(audn_idx))
        self.add_condition('audnLst', self.audnOutLst, self.audnInLst,
                           audn_idx)

        # libLst
        library_idx = self.get_listbox_indices('libraries', self.libOutLst,
                                               fund_data['libraries'])
        mlogger.debug('libOutLst index matches: {}'.format(library_idx))
        self.add_condition('libLst', self.libOutLst, self.libInLst,
                           library_idx)
        if self.system.get() == 1:
            disable_widgets(self.libraryFrm.winfo_children())

        # mattypeOutLst
        mattype_idx = self.get_listbox_indices('mattypes', self.mattypeOutLst,
                                               fund_data['matTypes'])
        mlogger.debug('mattypeOutLst index matches: {}'.format(mattype_idx))
        self.add_condition('mattypeLst', self.mattypeOutLst, self.mattypeInLst,
                           mattype_idx)

        # lock the interface
        disable_widgets(self.detFrm.winfo_children())
        self.cur_manager.notbusy()
Ejemplo n.º 8
0
 def add_data(self):
     mlogger.debug('Add btn clicked.')
     self.record = None
     self.det_list_select.set('')
     if self.gen_list_select.get():
         if self.gen_list_select.get() in (
                 'Branches', 'Shelf Codes'):
             if self.system.get():
                 self.populate_detail_frame()
                 enable_widgets(self.detFrm.winfo_children())
                 mlogger.debug('Detail frame ready for new data.')
         else:
             self.populate_detail_frame()
             enable_widgets(self.detFrm.winfo_children())
             mlogger.debug('Detail frame ready for new data.')
Ejemplo n.º 9
0
 def add_data(self):
     if self.system.get():
         self.record = None
         self.fund_code.set('')
         self.fund_desc.set('')
         enable_widgets(self.detFrm.winfo_children())
         self.display_branches()
         self.display_library()
         self.display_audiences()
         self.display_mattypes()
     else:
         msg = 'Please select system first.'
         messagebox.showwarning('Input Error', msg)
     if self.system.get() == 1:
         disable_widgets(self.libraryFrm.winfo_children())
Ejemplo n.º 10
0
    def observer(self, *args):
        if self.activeW.get() == 'FundView':
            mlogger.debug('FundView: observer activated.')
            self.record = None
            self.fund_code.set('')
            self.fund_desc.set('')
            enable_widgets(self.detFrm.winfo_children())
            self.all_branches.set(0)

            # pull data from data store only
            self.display_funds()
            self.display_audiences()
            self.display_mattypes()
            if self.system.get():
                # self.display_branches()
                self.display_library()
            disable_widgets(self.detFrm.winfo_children())
Ejemplo n.º 11
0
 def edit_grid(self):
     if self.grid_name.get():
         enable_widgets([self.gridEnt])
         enable_widgets(self.locFrm.winfo_children())
Ejemplo n.º 12
0
 def edit_distribution(self):
     # enable Entry wid
     if self.distr_name.get():
         enable_widgets([self.distnameEnt])
Ejemplo n.º 13
0
 def edit_data(self):
     if self.record:
         enable_widgets(self.detFrm.winfo_children())
         if self.system.get() == 1:
             disable_widgets(self.libraryFrm.winfo_children())