def __init__(self, params, prev_page="location", next_page="keymap"): super().__init__(self, params, "timezone", prev_page, next_page) self.map_window = self.ui.get_object('timezone_map_window') self.combobox_zone = self.ui.get_object('comboboxtext_zone') self.combobox_region = self.ui.get_object('comboboxtext_region') # Show regions in three columns self.combobox_region.set_wrap_width(3) self.tzdb = tz.Database() self.timezone = None # This is for populate_cities self.old_zone = None # Autotimezone process will store detected coords in this queue self.auto_timezone_coords = multiprocessing.Queue() # Process to try to determine timezone. self.autodetected_coords = None self.start_auto_timezone_process() # Setup window self.tzmap = timezonemap.TimezoneMap() self.tzmap.connect('location-changed', self.on_location_changed) # Strip .UTF-8 from locale, icu doesn't parse it self.locale = os.environ['LANG'].rsplit('.', 1)[0] self.map_window.add(self.tzmap) self.tzmap.show()
def __init__(self): Gtk.Widget.__init__(self) self.set_size_request(40, 40) self._background = None self._color_map = None self._olsen_map = None self._selected_offset = 0.0 self._show_offset = False self._tz_location = None self._bubble_text = "" self.olsen_map_timezones = [] self.load_olsen_map_timezones() try: self._orig_background = GdkPixbuf.Pixbuf.new_from_file( os.path.join(TIMEZONEMAP_IMAGES_PATH, "bg.png")) self._orig_background_dim = GdkPixbuf.Pixbuf.new_from_file( os.path.join(TIMEZONEMAP_IMAGES_PATH, "bg_dim.png")) self._orig_color_map = GdkPixbuf.Pixbuf.new_from_file( os.path.join(TIMEZONEMAP_IMAGES_PATH, "cc.png")) self._olsen_map = GdkPixbuf.Pixbuf.new_from_file( os.path.join(TIMEZONEMAP_IMAGES_PATH, "olsen_map.png")) self._pin = GdkPixbuf.Pixbuf.new_from_file( os.path.join(TIMEZONEMAP_IMAGES_PATH, "pin.png")) except Exception as ex: template = "Error loading timezone widget. An exception of type {0} occured. Arguments:\n{1!r}" message = template.format(type(ex).__name__, ex.args) print(message) sys.exit(1) self.tzdb = tz.Database()
def __init__(self): Gtk.Widget.__init__(self) self.set_size_request(40, 40) self._background = None self._color_map = None self._olsen_map = None self._selected_offset = 0.0 self._show_offset = False self._tz_location = None self._bubble_text = "" self.olsen_map_timezones = [] self.load_olsen_map_timezones() try: self._orig_background = GdkPixbuf.Pixbuf.new_from_file( os.path.join(TIMEZONEMAP_IMAGES_PATH, "bg.png")) self._orig_background_dim = GdkPixbuf.Pixbuf.new_from_file( os.path.join(TIMEZONEMAP_IMAGES_PATH, "bg_dim.png")) self._orig_color_map = GdkPixbuf.Pixbuf.new_from_file( os.path.join(TIMEZONEMAP_IMAGES_PATH, "cc.png")) self._olsen_map = GdkPixbuf.Pixbuf.new_from_file( os.path.join(TIMEZONEMAP_IMAGES_PATH, "olsen_map.png")) self._pin = GdkPixbuf.Pixbuf.new_from_file( os.path.join(TIMEZONEMAP_IMAGES_PATH, "pin.png")) except Exception as err: print(err) sys.exit(1) self.tzdb = tz.Database()
def __init__(self, params, prev_page="location", next_page="keymap"): super().__init__(self, params, "timezone", prev_page, next_page) self.map_window = self.ui.get_object('timezone_map_window') self.combobox_zone = self.ui.get_object('comboboxtext_zone') self.combobox_region = self.ui.get_object('comboboxtext_region') # Show regions in three columns self.combobox_region.set_wrap_width(3) self.tzdb = tz.Database() self.timezone = None # This is for populate_cities self.old_zone = None # Autotimezone thread will store detected coords in this queue self.auto_timezone_coords = multiprocessing.Queue() # Thread to try to determine timezone. self.autodetected_coords = None self.auto_timezone_thread = None self.start_auto_timezone_thread() # Thread to generate a pacman mirrorlist based on country code # Why do this? There're foreign mirrors faster than the Spanish ones... - Karasu # self.mirrorlist_thread = None # self.start_mirrorlist_thread() # Setup window self.tzmap = timezonemap.TimezoneMap() self.tzmap.connect('location-changed', self.on_location_changed) # Strip .UTF-8 from locale, icu doesn't parse it self.locale = os.environ['LANG'].rsplit('.', 1)[0] self.map_window.add(self.tzmap) self.tzmap.show()