Beispiel #1
0
    def _singleton_init(self, controlState, xml):
        self.timezones = TimezoneList()
        chosenTZ = userchoices.getTimezone()
        if chosenTZ:
            self.selectedTZ = self.timezones.findByCityName(chosenTZ['city'])
        else:
            self.selectedTZ = self.timezones.defaultTimezone

        connectSignalHandlerByDict(
            self, TimezoneWindow, xml, {
                ('advanced_ok', 'clicked'): 'onCityListSelect',
                ('advanced_cancel', 'clicked'): 'onCityListCancel',
                ('tz_button', 'clicked'): 'onAdvancedClicked',
                ('TimezoneDrawingArea', 'motion_notify_event'):
                'onTZDrawMotion',
                ('TimezoneDrawingArea', 'button_press_event'): 'onTZDrawPress',
                ('TimezoneDrawingArea', 'button_release_event'):
                'onTZDrawRelease',
                ('TimezoneDrawingArea', 'expose_event'): 'onTZDrawExpose',
            })

        self.tzEntry = xml.get_widget("tz_entry")
        self.advancedDialog = AdvancedDialog(xml)
        self.allTZsView = xml.get_widget("tz_treeview")

        self.setupMap(xml)
        self.setupTimezone(xml)
Beispiel #2
0
def hostActionTimezone(_context):
    choice = userchoices.getTimezone()
    timezones = TimezoneList()
    if choice:
        tz = timezones.findByZoneName(choice['tzName'])
        isUTC = choice['isUTC']
    else:
        tz = timezones.defaultTimezone
        isUTC = True
    assert tz
    tz.hostAction(isUTC)
Beispiel #3
0
def hostActionTimezone(_context):
    choice = userchoices.getTimezone()
    timezones = TimezoneList()
    if choice:
        tz = timezones.findByZoneName(choice["tzName"])
        isUTC = choice["isUTC"]
    else:
        tz = timezones.defaultTimezone
        isUTC = True
    assert tz
    tz.hostAction(isUTC)
Beispiel #4
0
    def __init__(self):
        super(TimezoneWindow, self).__init__()
        self.substep = self.start
        self.timezones = TimezoneList()
        self.userinput = None
        self.uiTitle = 'Timezone'

        if not userchoices.getTimezone():  # not set in userchoices
            # copy default timezone values into userchoices
            dtz = self.timezones.defaultTimezone
            userchoices.setTimezone(dtz.zoneName, dtz.offset, dtz.city)
            dtz.runtimeAction()

        self.scrollable = None
Beispiel #5
0
 def askConfirm(self):
     currentTz = userchoices.getTimezone()
     if currentTz['city']:
         formattedTz = tzDictStrWithCity % currentTz
     else:
         formattedTz = tzDictStrWithoutCity % currentTz
     ui = {
         'title': self.uiTitle,
         'body': askConfirmText % formattedTz,
         'menu': {
             '1': self.stepForward,
             '2': self.showTzList,
             '<': self.stepBack,
             '?': self.help,
         }
     }
     self.setSubstepEnv(ui)
Beispiel #6
0
 def _singleton_init(self, controlState, xml):
     self.timezones = TimezoneList()
     chosenTZ = userchoices.getTimezone()
     if chosenTZ:
         self.selectedTZ = self.timezones.findByCityName( chosenTZ['city'] )
     else:
         self.selectedTZ = self.timezones.defaultTimezone
     
     connectSignalHandlerByDict(self, TimezoneWindow, xml,
       { ('advanced_ok', 'clicked'): 'onCityListSelect',
         ('advanced_cancel', 'clicked'): 'onCityListCancel',
         ('tz_button', 'clicked'): 'onAdvancedClicked',
         ('TimezoneDrawingArea', 'motion_notify_event'): 'onTZDrawMotion',
         ('TimezoneDrawingArea', 'button_press_event'): 'onTZDrawPress',
         ('TimezoneDrawingArea', 'button_release_event'): 'onTZDrawRelease',
         ('TimezoneDrawingArea', 'expose_event'): 'onTZDrawExpose',
       })
     
     self.tzEntry = xml.get_widget("tz_entry")
     self.advancedDialog = AdvancedDialog(xml)
     self.allTZsView = xml.get_widget("tz_treeview")
     
     self.setupMap(xml)
     self.setupTimezone(xml)
Beispiel #7
0
def reviewTimezone(values):
    choice = userchoices.getTimezone()

    values['timezone'] = htmlEscape(choice.get('tzName', 'default'))
Beispiel #8
0
def systemClockIsUTC():
    choice = userchoices.getTimezone()
    if not choice:
        return True  #System clock assumed UTC by default
    else:
        return choice['isUTC']
Beispiel #9
0
def getTimezoneName():
    choice = userchoices.getTimezone()
    if not choice:
        return os.environ.get('TZ', '')
    else:
        return choice['tzName']
Beispiel #10
0
def _genTimezone():
    choice = userchoices.getTimezone()

    flags = ""
    
    return "timezone%s '%s'\n" % (flags, shquote(choice['tzName']))
Beispiel #11
0
def _genTimezone():
    choice = userchoices.getTimezone()

    flags = ""

    return "timezone%s '%s'\n" % (flags, shquote(choice['tzName']))