Exemplo n.º 1
0
    def __init__(self, plugin_tree, plugin, title, longdesc):
        super(OptionsPanel, self).__init__()
        self.set_spacing(5)
        self.plugin_tree = plugin_tree

        # initial title
        titl = gtk.Label()
        titl.set_markup(title)
        titl.set_alignment(0.0, 0.5)
        titl.show()
        self.pack_start(titl)

        # The long description of the plugin
        long_label = WrapLabel()
        long_label.set_text(longdesc)
        long_label.set_alignment(0.0, 0.5)
        long_label.show()
        self.pack_start(long_label)

        # last row buttons
        hbox = gtk.HBox()
        save_btn = gtk.Button(_("Save"), gtk.STOCK_SAVE)
        save_btn.show()
        hbox.pack_start(save_btn, expand=False, fill=False)
        rvrt_btn = gtk.Button(_("Revert"),
                              gtk.STOCK_REVERT_TO_SAVED)
        rvrt_btn.show()
        hbox.pack_start(rvrt_btn, expand=False, fill=False)
        hbox.show()
        self.pack_end(hbox, expand=False, fill=False)

        # middle (the heart of the panel)
        self.options = confpanel.OnlyOptions(self, self.plugin_tree.w3af,
                                             plugin, save_btn, rvrt_btn)
        self.pack_start(self.options, expand=True, fill=False)

        self.show()
Exemplo n.º 2
0
 def set_quest_options(self, quest):
     self.activeQuestion = quest
     self.remove(self.widg)
     self.widg = confpanel.OnlyOptions(self, self.w3af, Quest(quest),
                                       gtk.Button(), gtk.Button())
     self.pack_start(self.widg)