Fallback to gtk.combo_box_new_text when gtk.ComboBoxText is not available
issue6008 review29711002
This commit is contained in:
1 parent
b425523424
commit
bfaa26425f
2 files changed
+8
-2
No files matched your search
@@ -157,7 +157,10 @@ class WinCSV(NoModal):
|
||||
label_csv_enc = gtk.Label(_("Encoding:"))
|
||||
label_csv_enc.set_alignment(1, 0.5)
|
||||
table.attach(label_csv_enc, 0, 1, 1, 2)
|
||||
self.csv_enc = gtk.ComboBoxText()
|
||||
if hasattr(gtk, 'ComboBoxText'):
|
||||
self.csv_enc = gtk.ComboBoxText()
|
||||
else:
|
||||
self.csv_enc = gtk.combo_box_new_text()
|
||||
for i, encoding in enumerate(encodings):
|
||||
self.csv_enc.append_text(encoding)
|
||||
if ((os.name == 'nt' and encoding == 'cp1252')
|
||||
|
||||
@@ -77,7 +77,10 @@ class WinExport(WinCSV):
|
||||
def add_chooser(self, box):
|
||||
hbox_csv_export = gtk.HBox()
|
||||
box.pack_start(hbox_csv_export, False, True, 0)
|
||||
self.saveas = gtk.ComboBoxText()
|
||||
if hasattr(gtk, 'ComboBoxText'):
|
||||
self.saveas = gtk.ComboBoxText()
|
||||
else:
|
||||
self.saveas = gtk.combo_box_new_text()
|
||||
hbox_csv_export.pack_start(self.saveas, True, True, 0)
|
||||
self.saveas.append_text(_("Open"))
|
||||
self.saveas.append_text(_("Save"))
|
||||
|
||||
Reference in new issue
Block a user