Ejemplo n.º 1
0
	def __init__(self):
		from natz.tree import getZoneInfoTree
		model = gtk.TreeStore(str, bool)
		gtk.ComboBoxEntry.__init__(self)
		self.set_model(model)
		self.set_entry_text_column(0)
		self.add_attribute(self.get_cells()[0], 'text', 0)
		self.add_attribute(self.get_cells()[0], 'sensitive', 1)
		self.connect('changed', self.onChanged)
		child = self.get_child()
		child.set_text(str(core.localTz))
		###
		self.get_text = child.get_text
		self.set_text = child.set_text
		#####
		recentIter = model.append(None, [
			_('Recent...'),
			False,
		])
		for tz_name in ui.localTzHist:
			model.append(recentIter, [tz_name, True])
		###
		self.appendOrderedDict(
			None,
			getZoneInfoTree(),
		)
Ejemplo n.º 2
0
	def __init__(self):
		from natz.tree import getZoneInfoTree
		gtk.HBox.__init__(self)
		model = gtk.TreeStore(str, bool)
		self.c = gtk.ComboBoxText.new_with_entry()
		pack(self, self.c, 1, 1)
		#gtk.ComboBoxText.__init__(self)
		self.c.set_model(model)
		self.c.set_entry_text_column(0)
		first_cell = self.c.get_cells()[0]
		self.c.add_attribute(first_cell, "text", 0)
		self.c.add_attribute(first_cell, "sensitive", 1)
		self.c.connect("changed", self.onChanged)
		child = self.c.get_child()
		child.set_text(str(core.localTz))
		#self.set_text(str(core.localTz)) ## FIXME
		###
		self.get_text = child.get_text
		#self.get_text = self.c.get_active_text ## FIXME
		self.set_text = child.set_text
		#####
		recentIter = model.append(None, [
			_("Recent..."),
			False,
		])
		for tz_name in ui.localTzHist:
			model.append(recentIter, [tz_name, True])
		###
		self.appendOrderedDict(
			None,
			getZoneInfoTree(),
		)
Ejemplo n.º 3
0
 def __init__(self):
     from natz.tree import getZoneInfoTree
     gtk.HBox.__init__(self)
     model = gtk.TreeStore(str, bool)
     self.c = gtk.ComboBoxText.new_with_entry()
     pack(self, self.c, 1, 1)
     #gtk.ComboBoxText.__init__(self)
     self.c.set_model(model)
     self.c.set_entry_text_column(0)
     first_cell = self.c.get_cells()[0]
     self.c.add_attribute(first_cell, 'text', 0)
     self.c.add_attribute(first_cell, 'sensitive', 1)
     self.c.connect('changed', self.onChanged)
     child = self.c.get_child()
     child.set_text(str(core.localTz))
     #self.set_text(str(core.localTz)) ## FIXME
     ###
     self.get_text = child.get_text
     #self.get_text = self.c.get_active_text ## FIXME
     self.set_text = child.set_text
     #####
     recentIter = model.append(None, [
         _('Recent...'),
         False,
     ])
     for tz_name in ui.localTzHist:
         model.append(recentIter, [tz_name, True])
     ###
     self.appendOrderedDict(
         None,
         getZoneInfoTree(),
     )
Ejemplo n.º 4
0
 def __init__(self):
     from natz.tree import getZoneInfoTree
     model = gtk.TreeStore(str, bool)
     gtk.ComboBoxEntry.__init__(self)
     self.set_model(model)
     self.set_entry_text_column(0)
     self.add_attribute(self.get_cells()[0], 'text', 0)
     self.add_attribute(self.get_cells()[0], 'sensitive', 1)
     self.connect('changed', self.onChanged)
     child = self.get_child()
     child.set_text(str(core.localTz))
     ###
     self.get_text = child.get_text
     self.set_text = child.set_text
     #####
     recentIter = model.append(None, [
         _('Recent...'),
         False,
     ])
     for tz_name in ui.localTzHist:
         model.append(recentIter, [tz_name, True])
     ###
     self.appendOrderedDict(
         None,
         getZoneInfoTree(),
     )
Ejemplo n.º 5
0
    def __init__(self):
        from natz.tree import getZoneInfoTree
        gtk.HBox.__init__(self)
        model = gtk.TreeStore(str, bool)
        self.c = gtk.ComboBoxText.new_with_entry()
        pack(self, self.c, 1, 1)
        #gtk.ComboBoxText.__init__(self)
        self.c.set_model(model)
        self.c.set_entry_text_column(0)

        first_cell = self.c.get_cells()[0]

        # self.c.add_attribute(first_cell, "text", 0)
        # above line causes this warning:
        # Cannot connect attribute 'text' for cell renderer class
        # 'GtkCellRendererText' since 'text' is already attributed to column 0

        self.c.add_attribute(first_cell, "sensitive", 1)

        self.c.connect("changed", self.onChanged)
        child = self.c.get_child()
        child.set_text(str(core.localTz))
        #self.set_text(str(core.localTz)) ## FIXME
        ###
        self.get_text = child.get_text
        #self.get_text = self.c.get_active_text ## FIXME
        self.set_text = child.set_text
        #####
        recentIter = model.append(None, [
            _("Recent..."),
            False,
        ])
        for tz_name in ui.localTzHist:
            model.append(recentIter, [tz_name, True])
        ###
        self.appendOrderedDict(
            None,
            getZoneInfoTree(),
        )