Example #1
0
	def load(self):
		tmp_controls = []
		
		# Build the task controls
		tmp_controls.extend(utils.buildTaskView(self.l + self.logo_size + self.space*2, self.t + self.space, self.w - self.logo_size - self.space*2, self.h - 2*self.space, self.event))
		
		# Build Ok/Cancel controls
		tmp_controls.extend(utils.buildOkCancelButtons(self.l+(self.w-300)/2, self.t + self.h - self.space - 30, 300, 30))

		# Build Delete controls
		tmp_controls.extend(utils.buildDeleteButton(self.l+self.w-30 , self.t + self.h - self.space - 30, 30, 30))

		# Add all controls to screen 		
		utils.addControls(self, tmp_controls, self.control_to_data)
Example #2
0
	def load(self):
		try:
			tmp_controls = []
			progress = xbmcgui.DialogProgressBG()
			progress.create(utils.addonname, 'Loading ...')

			progress.update(20, 'Add Calendars controls')
			ctrls = utils.buildCalendarList(self.shift_left, self.h - 150 - self.shift_top, self.logo_size, 150, self.calCon, self)
			tmp_controls.extend(ctrls)

			progress.update(30, 'Add View Selection controls')
			ctrls = utils.buildViewSelection(self.shift_left, self.h - 350 - self.shift_top, self.logo_size, 60, self.calCon, self)
			tmp_controls.extend(ctrls)

			progress.update(40, 'Add Navigation controls')
			tmp_controls.extend(utils.buildNavigation(self.shift_left, self.shift_top+self.logo_size, self.logo_size, 73, self.date_center))

			progress.update(60, 'Add Calendar controls')
			year_ago = self.date_center + relativedelta.relativedelta(months=-1)
			next_year = self.date_center + relativedelta.relativedelta(months=1)
			tmp_controls.extend(utils.buildMonth(self.shift_left + self.logo_size, self.shift_top, self.calendar_width, self.calendar_hight, year_ago.year, year_ago.month, self.date_center, None))
			tmp_controls.extend(utils.buildMonth(self.shift_left + self.logo_size, self.shift_top+self.calendar_hight, self.calendar_width, self.calendar_hight, self.date_center.year, self.date_center.month, self.date_center, None))
			tmp_controls.extend(utils.buildMonth(self.shift_left + self.logo_size, self.shift_top+2*self.calendar_hight, self.calendar_width, self.calendar_hight, next_year.year, next_year.month, self.date_center, None))
			self.unique_month = self.date_center.year*12+self.date_center.month

			progress.update(60, 'Load View (Day/Month)')
			tmp_controls.extend(self.loadView())

			progress.update(80, 'Add all controls to window')
			utils.addControls(self, tmp_controls, self.control_to_data)

			self.focus_on_selected()

			progress.update(100, 'finish ....')
			progress.close()
			
			self.keyOrder()
		
		except:
			progress.close()
			print "Unexpected error:", sys.exc_info()[0]
			raise
    def load(self):
        tmp_controls = []

        # Build the navigation controls
        tmp_controls.extend(
            utils.buildNavigation(
                self.l + self.space, self.t + self.logo_size + self.space, self.logo_size, 60, self.selection_date
            )
        )

        # Build Ok/Cancel controls
        tmp_controls.extend(
            utils.buildOkCancelButtons(self.l + (self.w - 300) / 2, self.t + self.h - self.space - 30, 300, 30)
        )

        # Add all controls to screen
        utils.addControls(self, tmp_controls, self.control_to_data)

        # Build the controls that refreshed by update
        self.update()
	def load(self):
		tmp_controls = []
		
	
		# Build the timezone list control
		tmp_controls.extend(utils.builTimezoneView(self.l + self.logo_size + self.space*2, self.t + self.space, self.w - self.logo_size - self.space*2, self.h - 30 - 2*self.space,''))
		
		# Build Ok/Cancel controls
		tmp_controls.extend(utils.buildOkCancelButtons(self.l+(self.w-300)/2, self.t + self.h - self.space - 30, 300, 30))

		# Add all controls to screen 		
		utils.addControls(self, tmp_controls, self.control_to_data)
		
		ctrl = self.getControl(utils.getTypeControl(self, self.control_to_data, utils.CONTROL_TYPE_TIMEZONE_LIST))
		items = []
		for tz in pytz.all_timezones:
			itm = xbmcgui.ListItem(label=tz)
			items.append(itm)

		ctrl.addItems(items)
    def update(self):
        # Clean UI controls to be replaced
        utils.removeControls(self, self.month_view_controls, self.control_to_data)

        # Build the month view controls and save it for removal/update
        self.month_view_controls = utils.buildMonth(
            self.left,
            self.top,
            self.width,
            self.hight,
            self.selection_date.year,
            self.selection_date.month,
            self.getSelectedDate(),
            None,
        )

        # Build the time selection controls
        if type(self.selection_date) is date:
            _h = 0
            _m = 0
        else:
            _h = self.selection_date.hour
            _m = self.selection_date.minute

            self.month_view_controls.extend(
                utils.buildTime(
                    self.left + self.width - self.width / 2 - self.space,
                    self.top + self.hight + self.space,
                    self.width / 2,
                    30,
                    _h,
                    _m,
                )
            )

            # Add all controls to screen
        utils.addControls(self, self.month_view_controls, self.control_to_data)

        # Set the focus on the selected control
        self.focus_on_selected()
Example #6
0
	def update(self):
		utils.removeControls(self, self.view_controls, self.control_to_data)
		ctrls = self.loadView()
		utils.addControls(self, ctrls, self.control_to_data)