def on_okbutton1_clicked(self, widget, *args):
for obj in self.tblGeneral:
if hasattr(obj, "field"):
if isinstance(obj, gtk.CheckButton):
value = obj.get_active()
elif isinstance(obj, gtk.SpinButton):
value = obj.get_value_as_int()
elif isinstance(obj, gtk.ComboBox):
value = obj.get_active()
else:
value = '"%s"' % (obj.get_text())
exec("%s=%s" % (obj.field, value))
if self.get_widget("chkDefaultColors").get_active():
conf.FONT_COLOR=""
conf.BACK_COLOR=""
else:
conf.FONT_COLOR = self.btnFColor.selected_color
conf.BACK_COLOR = self.btnBColor.selected_color
if self.btnFont.selected_font.to_string() != 'monospace' and not self.chkDefaultFont.get_active():
conf.FONT = self.btnFont.selected_font.to_string()
else:
conf.FONT = ''
#Guardar shortcuts
scuts={}
for x in self.treeModel:
if x[0]!='' and x[1]!='':
scuts[x[1]] = [x[0]]
for x in self.treeModel2:
if x[0]!='' and x[1]!='':
scuts[x[1]] = x[0]
global shortcuts
shortcuts = scuts
#Boton donate
global wMain
if conf.HIDE_DONATE:
wMain.get_widget("btnDonate").hide_all()
else:
wMain.get_widget("btnDonate").show_all()
#Recrear menu de comandos personalizados
wMain.populateCommandsMenu()
wMain.writeConfig()
self.get_widget("wConfig").destroy()
#-- Wconfig.on_okbutton1_clicked }
#-- Wconfig.on_btnBColor_clicked {
gnome_connection_manager.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录