def __init__(self, parent, plugins):
super(PluginConfigGUI, self).__init__()
self.main_gui = parent
#TODO: Add one for compression format
self.value_type_create = {
"text": self.create_text_hbox,
"number": self.create_number_hbox,
"checkbox": self.create_checkbox_hbox,
"radio": self.create_radio_hbox,
"option": self.create_option_hbox,
"options": self.create_options_hbox,
"time": self.create_time_hbox,
"netiface": self.create_netiface_hbox,
"netifaces": self.create_netifaces_hbox,
"filepath": self.create_filepath_hbox,
"path": self.create_path_hbox
}
self.set_title("Plugin Configurations")
self.set_modal(True)
self.set_transient_for(self.main_gui)
self.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
#self.set_size_request(500, 700)
self.set_border_width(6)
self.set_resizable(False)
self.plugins = plugins
plugin_names = [plugin.name for plugin in self.plugins]
vbox_main = gtk.VBox()
hbox_plugins = gtk.HBox()
frame_plugin_confs = gtk.Frame("Plugin Configurations:")
self.vbox_plugin_main = None
label_plugins = gtk.Label("Plugin")
combobox_plugins = gtk.combo_box_new_text()
for label in plugin_names:
combobox_plugins.append_text(label)
combobox_plugins.set_active(0)
combobox_plugins.connect('changed', self.select_plugin, combobox_plugins, frame_plugin_confs)
button_close = gtk.Button("Close")
button_close.connect("clicked", self.close_plugin_config_dialog)
hbox_plugins.pack_start(label_plugins)
hbox_plugins.pack_start(combobox_plugins)
vbox_main.pack_start(hbox_plugins)
vbox_main.pack_start(frame_plugin_confs)
vbox_main.pack_start(button_close)
self.show_plugin_configs(combobox_plugins.get_active_text(), frame_plugin_confs)
self.add(vbox_main)
self.show_all()
评论列表
文章目录