~canonical-platform-qa/ubiquity/no-gtk-modules

« back to all changes in this revision

Viewing changes to ubiquity/plugins/ubi-timezone.py

  • Committer: Mathieu Trudel-Lapierre
  • Date: 2016-10-06 04:09:54 UTC
  • Revision ID: mathieu.trudel-lapierre@canonical.com-20161006040954-o1s40yw0pivn51ey
Finish porting to PyQt5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
292
292
        self.page.timezone_city_combo.clear()
293
293
 
294
294
        code = str(
295
 
            self.page.timezone_zone_combo.itemData(regionIndex).toPyObject())
 
295
            self.page.timezone_zone_combo.itemData(regionIndex))
296
296
        countries = self.controller.dbfilter.get_countries_for_region(code)
297
297
        if not countries:  # must have been a country code itself
298
298
            countries = [code]
333
333
    # called when the city combo changes
334
334
    def cityChanged(self, cityindex):
335
335
        zone = str(
336
 
            self.page.timezone_city_combo.itemData(cityindex).toPyObject())
 
336
            self.page.timezone_city_combo.itemData(cityindex))
337
337
        self.tzmap.zoneChanged.disconnect(self.mapZoneChanged)
338
338
        self.tzmap.set_timezone(zone)
339
339
        self.tzmap.zoneChanged.connect(self.mapZoneChanged)
344
344
        self.page.timezone_city_combo.blockSignals(True)
345
345
 
346
346
        for i in range(self.page.timezone_zone_combo.count()):
347
 
            code = str(self.page.timezone_zone_combo.itemData(i).toPyObject())
 
347
            code = str(self.page.timezone_zone_combo.itemData(i))
348
348
            countries = self.controller.dbfilter.get_countries_for_region(code)
349
349
            if not countries:  # must have been a country code itself
350
350
                countries = [code]
354
354
                break
355
355
 
356
356
        for i in range(self.page.timezone_city_combo.count()):
357
 
            code = str(self.page.timezone_city_combo.itemData(i).toPyObject())
 
357
            code = str(self.page.timezone_city_combo.itemData(i))
358
358
            if zone == code:
359
359
                self.page.timezone_city_combo.setCurrentIndex(i)
360
360
                self.cityChanged(i)