mirror of
https://github.com/gryf/wicd.git
synced 2025-12-19 20:38:00 +01:00
Make configscript use GtkBuilder as well (LP: #555386)
This commit is contained in:
@@ -30,7 +30,6 @@ import sys
|
||||
import os
|
||||
import gtk
|
||||
import ConfigParser
|
||||
import gtk.glade
|
||||
|
||||
from wicd import wpath
|
||||
from wicd import translations
|
||||
@@ -155,21 +154,22 @@ def main (argv):
|
||||
|
||||
script_info = get_script_info(network, network_type)
|
||||
|
||||
gladefile = wpath.gtk + "wicd.glade"
|
||||
wTree = gtk.glade.XML(gladefile)
|
||||
dialog = wTree.get_widget("configure_script_dialog")
|
||||
wTree.get_widget("pre_label").set_label(language['before_script'] + ":")
|
||||
wTree.get_widget("post_label").set_label(language['after_script'] + ":")
|
||||
wTree.get_widget("pre_disconnect_label").set_label(language['pre_disconnect_script']
|
||||
gladefile = os.path.join(wpath.gtk, "wicd.ui")
|
||||
self.wTree = gtk.Builder()
|
||||
self.wTree.add_from_file(gladefile)
|
||||
self.dialog = self.wTree.get_object("configure_script_dialog")
|
||||
self.wTree.get_object("pre_label").set_label(language['before_script'] + ":")
|
||||
self.wTree.get_object("post_label").set_label(language['after_script'] + ":")
|
||||
self.wTree.get_object("pre_disconnect_label").set_label(language['pre_disconnect_script']
|
||||
+ ":")
|
||||
wTree.get_widget("post_disconnect_label").set_label(language['post_disconnect_script']
|
||||
self.wTree.get_object("post_disconnect_label").set_label(language['post_disconnect_script']
|
||||
+ ":")
|
||||
wTree.get_widget("window1").hide()
|
||||
self.wTree.get_object("window1").hide()
|
||||
|
||||
pre_entry = wTree.get_widget("pre_entry")
|
||||
post_entry = wTree.get_widget("post_entry")
|
||||
pre_disconnect_entry = wTree.get_widget("pre_disconnect_entry")
|
||||
post_disconnect_entry = wTree.get_widget("post_disconnect_entry")
|
||||
pre_entry = self.wTree.get_object("pre_entry")
|
||||
post_entry = self.wTree.get_object("post_entry")
|
||||
pre_disconnect_entry = self.wTree.get_object("pre_disconnect_entry")
|
||||
post_disconnect_entry = self.wTree.get_object("post_disconnect_entry")
|
||||
|
||||
pre_entry.set_text(none_to_blank(script_info.get("pre_entry")))
|
||||
post_entry.set_text(none_to_blank(script_info.get("post_entry")))
|
||||
|
||||
@@ -55,7 +55,7 @@ def get_gettext():
|
||||
_ = lang.gettext
|
||||
return _
|
||||
|
||||
# Generated automatically on Wed, 30 Dec 2009 15:23:05 CST
|
||||
# Generated automatically on Mon, 11 Jul 2011 03:53:23 CDT
|
||||
_ = get_gettext()
|
||||
language = {}
|
||||
language['resetting_ip_address'] = _('''Resetting IP address...''')
|
||||
@@ -75,7 +75,7 @@ language['backend_alert'] = _('''Changes to your backend won't occur until the d
|
||||
language['about_help'] = _('''Stop a network connection in progress''')
|
||||
language['connecting'] = _('''Connecting''')
|
||||
language['pre_disconnect_script'] = _('''Run pre-disconnect script''')
|
||||
language['cannot_edit_scripts_1'] = _('''To avoid various complications, wicd-curses does not support directly editing the scripts directly. However, you can edit them manually. First, (as root)", open the "$A" config file, and look for the section labeled by the $B in question. In this case, this is:''')
|
||||
language['cannot_edit_scripts_1'] = _('''To avoid various complications, wicd-curses does not support directly editing the scripts. However, you can edit them manually. First, (as root)", open the "$A" config file, and look for the section labeled by the $B in question. In this case, this is:''')
|
||||
language['cannot_edit_scripts_3'] = _('''You can also configure the wireless networks by looking for the "[<ESSID>]" field in the config file.''')
|
||||
language['cannot_edit_scripts_2'] = _('''Once there, you can adjust (or add) the "beforescript", "afterscript", and "disconnectscript" variables as needed, to change the preconnect, postconnect, and disconnect scripts respectively. Note that you will be specifying the full path to the scripts - not the actual script contents. You will need to add/edit the script contents separately. Refer to the wicd manual page for more information.''')
|
||||
language['scripts_need_pass'] = _('''You must enter your password to configure scripts''')
|
||||
|
||||
Reference in New Issue
Block a user