Beispiel #1
0
    def bt_dur_week_action(self, sender):
        ''' fill "tableview1" with list of duration of tasks in the week, the selected day is in
        '''
        start = self.view["datepicker"].date
        start = start.replace(hour=0, minute=0, second=0, microsecond=0)
        monday = start - timedelta(days=start.weekday())
        satday = monday + timedelta(days=5)

        lc = self.myCalender.findBetween(monday, satday)
        l = lc.UICalcDurations()

        self.LogMessage(
            f"dur_week_action len {len(l)} {monday.strftime('%a %d.%m.%y')}")

        #self.LogMessage(f"dur_day_action liste {len(l)}")
        lst = MDS.MyDurDataSource("weekly", l)
        lst.highlight_color = (1.0, 0.9, 0.3, 1.0)
        tv1 = self.view['tableview1']
        tv1.data_source = tv1.delegate = lst
        tv1.data_source.delete_enabled = tv1.editing = False
        self.selected_row = -1
        tv1.reload_data()
        self.view['bt_save_hours'].enabled = True
        if self.state == 1:
            self.view['bt_save_hours'].title = "Save Hours"
            self.view['switch_share_hours'].hidden = False
            self.view['l_share'].hidden = False
            self.view['bt_add'].enabled = False
            self.view['label_up'].hidden = True
            self.view['label_left'].hidden = True
            self.view['bt_edit_tasks'].hidden = True
        self.state = 4
Beispiel #2
0
    def bt_dur_day_action(self, sender):
        ''' fill "tableview1" with list of duration of tasks in selcted day
        Anzeigen welche Zeiten für welche Tasks gebraucht wurden
        '''
        start = self.view["datepicker"].date

        start = start.replace(hour=0, minute=0, second=0, microsecond=0)
        end = start + timedelta(days=1)

        lc = self.myCalender.findBetween(start, end)
        l = lc.UICalcDurations()

        self.LogMessage(f"dur_day_action len {len(l)}")

        #self.LogMessage(f"dur_day_action liste {len(l)}")
        lst = MDS.MyDurDataSource("daily", l)
        lst.highlight_color = (1.0, 0.9, 0.3, 1.0)
        tv1 = self.view['tableview1']
        tv1.data_source = tv1.delegate = lst
        tv1.data_source.delete_enabled = tv1.editing = False
        self.selected_row = -1
        tv1.reload_data()
        self.view['bt_save_hours'].enabled = True
        if self.state == 1:
            self.view['bt_save_hours'].title = "Save Hours"
            self.view['switch_share_hours'].hidden = False
            self.view['l_share'].hidden = False
            self.view['bt_add'].enabled = False
            self.view['label_up'].hidden = True
            self.view['label_left'].hidden = True
            self.view['bt_edit_tasks'].hidden = True
        self.state = 3
Beispiel #3
0
    def bt_dur_year_action(self, sender):
        ''' fill "tableview1" with list of duration of tasks in the month, the selected day is in
        '''
        start = self.view["datepicker"].date
        #        self.view["datepicker"].font=("<system>",12). # WHAT is THIS ??

        mstart = start.replace(month=1,
                               day=1,
                               hour=0,
                               minute=0,
                               second=0,
                               microsecond=0)
        mend = mstart.replace(year=mstart.year + 1,
                              day=1,
                              hour=0,
                              minute=0,
                              second=0,
                              microsecond=0)

        # print(f"mstart = {mstart} mend = {mend}")

        lc = self.myCalender.findBetween(mstart, mend)
        l = lc.UICalcDurations()

        self.LogMessage(f"dur_year_action len {len(l)}")
        lst = MDS.MyDurDataSource("yearly", l)

        #lst.font=("<system>",12)
        lst.highlight_color = (1.0, 0.9, 0.3, 1.0)
        tv1 = self.view['tableview1']
        tv1.data_source = tv1.delegate = lst
        tv1.data_source.delete_enabled = tv1.editing = False
        self.selected_row = -1
        tv1.reload_data()
        self.view['bt_save_hours'].enabled = True
        if self.state == 1:
            self.view['bt_save_hours'].title = "Save Hours"
            self.view['switch_share_hours'].hidden = False
            self.view['l_share'].hidden = False
            self.view['bt_add'].enabled = False
            self.view['label_up'].hidden = True
            self.view['label_left'].hidden = True
            self.view['bt_edit_tasks'].hidden = True
        self.state = 6