Beispiel #1
0
    def show(self):
        dummy, x, y = self.get_window().get_origin()

        alloc = self.get_allocation()

        self.popup.move(x + alloc.x, y + alloc.y + alloc.height)

        self.get_widget("day_preview").set_text(
            stuff.format_range(self.today, self.today))
        self.get_widget("week_preview").set_text(
            stuff.format_range(*stuff.week(self.today)))
        self.get_widget("month_preview").set_text(
            stuff.format_range(*stuff.month(self.today)))

        start_cal = self.get_widget("start_calendar")
        start_cal.select_month(self.start_date.month - 1, self.start_date.year)
        start_cal.select_day(self.start_date.day)

        end_cal = self.get_widget("end_calendar")
        end_cal.select_month(self.end_date.month - 1, self.end_date.year)
        end_cal.select_day(self.end_date.day)

        self.popup.show_all()
        self.get_widget("day").grab_focus()
        self.set_active(True)
Beispiel #2
0
    def on_show(self, user_data):
        self.get_widget("day_preview").set_text(
            stuff.format_range(self.today, self.today))
        self.get_widget("week_preview").set_text(
            stuff.format_range(*stuff.week(self.today)))
        self.get_widget("month_preview").set_text(
            stuff.format_range(*stuff.month(self.today)))

        start_cal = self.get_widget("start_calendar")
        start_cal.select_month(self.start_date.month - 1, self.start_date.year)
        start_cal.select_day(self.start_date.day)

        end_cal = self.get_widget("end_calendar")
        end_cal.select_month(self.end_date.month - 1, self.end_date.year)
        end_cal.select_day(self.end_date.day)

        self.get_widget("day").grab_focus()
Beispiel #3
0
    def show(self):
        dummy, x, y = self.get_window().get_origin()

        alloc = self.get_allocation()

        self.popup.move(x + alloc.x,y + alloc.y + alloc.height)

        self.get_widget("day_preview").set_text(stuff.format_range(self.today, self.today))
        self.get_widget("week_preview").set_text(stuff.format_range(*stuff.week(self.today)))
        self.get_widget("month_preview").set_text(stuff.format_range(*stuff.month(self.today)))

        start_cal = self.get_widget("start_calendar")
        start_cal.select_month(self.start_date.month - 1, self.start_date.year)
        start_cal.select_day(self.start_date.day)

        end_cal = self.get_widget("end_calendar")
        end_cal.select_month(self.end_date.month - 1, self.end_date.year)
        end_cal.select_day(self.end_date.day)

        self.popup.show_all()
        self.get_widget("day").grab_focus()
        self.set_active(True)
Beispiel #4
0
 def on_month_clicked(self, button):
     self.current_range = "month"
     self.start_date, self.end_date = stuff.month(self.today)
     self.emit_range("month", self.start_date, self.end_date)
Beispiel #5
0
 def on_month_clicked(self, button):
     self.current_range = "month"
     self.start_date, self.end_date = stuff.month(self.today)
     self.emit_range("month", self.start_date, self.end_date)