def __init__(self, title=_('Bug Report'), summary=None, description=None,
                 category=None, crashreport=False, description_dialog=None,
                 reuse_mainloop=True):
        HIGDialog.__init__(self, title=title,
            buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
                gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))

        # If reuse_mainloop is true, then dialogs created inside this dialog
        # will not start another mainloop.
        self._reuse_mainloop = reuse_mainloop

        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)

        self.crashreport = crashreport
        self.description_dialog = description_dialog
        self._create_widgets()
        self._set_category_list()
        self._pack_widgets()
        self._connect_widgets()
        self.summary = summary or ''
        self.description_report = description
        if self.crashreport:
            self.description = _("CrashReport automatically created")
        else:
            if self.description_dialog is None:
                self.description = description or ''
            else:
                self.description = description_dialog or ''
        self.category = category or ''
Esempio n. 2
0
 def __init__(self, type_ = None, path = None):
     if type_ and path:
         title = _("Edit Source")
     else:
         type_ = "FILE"
         path = ""
         title = _("Add Source")
     HIGDialog.__init__(self, title, None,
                        gtk.DIALOG_MODAL,
                        (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
                         gtk.STOCK_OK, gtk.RESPONSE_OK))
     hbox = HIGHBox()
     self.combo = gtk.combo_box_new_text()
     types = sorted(self.types.keys())
     for t in types:
         self.combo.append_text(t)
     self.combo.set_active(types.index(type_))
     self.combo.connect("changed", self._changed_cb)
     hbox.pack_start(self.combo, False, False)
     self.entry = HIGTextEntry()
     self.entry.set_text(path)
     hbox.pack_start(self.entry)
     self.btn = HIGButton(_("Browse..."), stock=gtk.STOCK_OPEN)
     self.btn.connect("clicked", self._clicked_cb)
     hbox.pack_start(self.btn, False, False)
     self.vbox.add(hbox)
     self.show_all()
     self.update()
 def __init__(self, option, restructfiles, profile, wizard):
     HIGDialog.__init__(self, _('Dependence of Option ') + option )
     self.set_size_request(-1,300)
     self.restructfiles = restructfiles
     self._profile = profile
     self._wizard = wizard
     self._draw_widgets()
     self.show_all()
Esempio n. 4
0
 def __init__(self, option, restructfiles, profile, wizard):
     HIGDialog.__init__(self, _('Dependence of Option ') + option)
     self.set_size_request(-1, 300)
     self.restructfiles = restructfiles
     self._profile = profile
     self._wizard = wizard
     self._draw_widgets()
     self.show_all()
Esempio n. 5
0
    def __init__(self, colors):
        # Shows colors and chars legend
        HIGDialog.__init__(self, title=_('Color Descriptions'),
                          buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))

        self.colors = colors
        self._create_widgets()
        self._pack_widgets()
        self._connect_widgets()
Esempio n. 6
0
    def __init__(self, colors):
        # Shows colors and chars legend
        HIGDialog.__init__(self,
                           title=_('Color Descriptions'),
                           buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))

        self.colors = colors
        self._create_widgets()
        self._pack_widgets()
        self._connect_widgets()
    def __init__(self, nmap_output_view):
        HIGDialog.__init__(self, _("Nmap Output Properties"),
                           buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
        
        self.nmap_highlight = NmapOutputHighlight()

        self.__create_widgets()
        self.__pack_widgets()
        self.highlight_tab()

        self.vbox.show_all()
    def __init__(self, text):
        HIGDialog.__init__(self, _('Profile\'s Name'))

        dialog_label = HIGDialogLabel(text)
        dialog_label.show()
        self.vbox.pack_start(dialog_label)
        self.entry_text = HIGTextEntry()
        self.entry_text.show()
        self.vbox.pack_start(self.entry_text)
        self.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)
        self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
Esempio n. 9
0
    def __init__(self, text):
        HIGDialog.__init__(self, _('Profile\'s Name'))

        dialog_label = HIGDialogLabel(text)
        dialog_label.show()
        self.vbox.pack_start(dialog_label)
        self.entry_text = HIGTextEntry()
        self.entry_text.show()
        self.vbox.pack_start(self.entry_text)
        self.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)
        self.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
    def __init__(self, title=_('Registration')):
        """Constructor"""
        HIGDialog.__init__(self, title=title,
                           buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
                                    gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))

        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
        
        self._create_widgets()
        self._pack_widgets()

        # Register callbacks
        self.connect("response", self.check_response)
Esempio n. 11
0
 def __init__(self, parent = None):
     HIGDialog.__init__(self, _("Find"), parent,
                        gtk.DIALOG_MODAL | gtk.DIALOG_NO_SEPARATOR,
                        (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
                         gtk.STOCK_FIND, gtk.RESPONSE_OK))
     self.set_default_response(gtk.RESPONSE_OK)
     hbox = HIGHBox()
     hbox.pack_start(gtk.Label(_("Search:")))
     self.entry = HIGTextEntry()
     self.entry.set_activates_default(True)
     hbox.pack_start(self.entry)
     self.vbox.add(hbox)
     self.show_all()
 def __init__(self, selected = ''):
     HIGDialog.__init__(self, _("Select Necessory Scripts"), None,
                        gtk.DIALOG_MODAL,
                        (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
                         gtk.STOCK_OK, gtk.RESPONSE_OK,
                         gtk.STOCK_HELP, gtk.RESPONSE_HELP))
     self.config = ScriptConfig()
     self.config.load()
     self.base = ScriptBase(self.config)
     self.base.load()
     self.selection = ScriptSelection(self.base)
     self.selection.set_selected(selected)
     self.set_size_request(400, 400)
     self.create_widgets()
Esempio n. 13
0
    def __init__(self, title=_('Open Monitor 2012')):
        """Constructor"""
        HIGDialog.__init__(self, title=title, flags=gtk.DIALOG_MODAL,
                           buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))

        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
        self.set_default_response(gtk.RESPONSE_ACCEPT)
        self.set_keep_above(True)
        self.set_size_request(480, 240)
        self.set_border_width(2)

        self._create_widgets()
        self._pack_widgets()
        self._connect_widgets()
    def __init__(self, title=_('Registration')):
        """Constructor"""
        HIGDialog.__init__(self,
                           title=title,
                           buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
                                    gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))

        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)

        self._create_widgets()
        self._pack_widgets()

        # Register callbacks
        self.connect("response", self.check_response)
Esempio n. 15
0
    def __init__(self, parent):
        HIGDialog.__init__(self, _("Script Manager Preferences"), parent,
                           gtk.DIALOG_MODAL,
                           (gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE,
                            gtk.STOCK_HELP, gtk.RESPONSE_HELP))
        self.config = parent.config
        self.preferences = parent.preferences
        self.set_size_request(450, 400)
	self.tab_catalog = self.create_tab_catalog()
	self.tab_editor = self.create_tab_editor()
	self.tab_columns = self.create_tab_columns()
	self.tab_network = self.create_tab_network()
        self.create_widgets()
        self.connect("destroy", self.update_preferences)
Esempio n. 16
0
    def __init__(self, start_value):
        HIGDialog.__init__(self, title=_("Refresh Time"),
            buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
                gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))

        lbl = gtk.Label(_("Minutes"))
        self.spinbtn = gtk.SpinButton(gtk.Adjustment(value=start_value,
            lower=1, upper=10000, step_incr=1), 1)

        hbox = gtk.HBox()
        hbox.add(lbl)
        hbox.add(self.spinbtn)

        self.vbox.pack_start(hbox)
        self.show_all()
    def __init__(self, reporter, summary, description, comments, category):
        HIGDialog.__init__(self,
                           title='Details of Crash Report',
                           buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
        # Save information about Bug Report
        self._reporter = reporter
        self._summary = summary
        self._description = description
        self._comments = comments
        self._category = category

        # Widgets matter
        self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
        self._create_widgets()
        self._pack_widgets()
Esempio n. 18
0
 def __init__(self, reporter, summary, description, 
              comments, category):
     HIGDialog.__init__(self,
                        title='Details of Crash Report',
                        buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)
                        )
     # Save information about Bug Report
     self._reporter = reporter
     self._summary = summary
     self._description = description
     self._comments = comments
     self._category = category
     
     # Widgets matter
     self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
     self._create_widgets()
     self._pack_widgets()
    def dialog_args(self):
        '''
        Create a dialog
        '''

        d = HIGDialog(_('Arguments'))
        description_label = HIGEntryLabel(
            _('Insert the description to argument:'))
        description_label.show()
        description_entry = HIGTextEntry()
        text = self.arguments_entry.get_text()
        description_entry.set_text(text)
        description_entry.show()

        combo_box = gtk.combo_box_new_text()
        combo_box.set_wrap_width(1)
        index = -1
        j = 0
        for i in ARG_TYPES:
            combo_box.append_text(ARG_TYPES[i])
            if i == self.arg_type:
                index = j
            j = j + 1
        if index > -1:
            combo_box.set_active(index)
        combo_box.show()
        d.vbox.pack_start(description_label, False, False)
        d.vbox.pack_start(description_entry, False, False)
        d.vbox.pack_start(combo_box, False, False)
        d.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)
        d.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
        resp = d.run()
        result = None, None
        if resp == gtk.RESPONSE_OK:
            model = combo_box.get_model()
            active = combo_box.get_active()
            if active < 0:
                return None, None
            combo_selected = model[active][0]

            for i in ARG_TYPES:
                if combo_selected == ARG_TYPES[i]:
                    combo_selected = i

            result = description_entry.get_text(), combo_selected
            #self.insert_arg_button.set_label('Edit args')
            #self.insert_arg_button.
        d.destroy()
        return result
Esempio n. 20
0
    def __init__(self, start_value):
        HIGDialog.__init__(self,
                           title=_("Refresh Time"),
                           buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
                                    gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))

        lbl = gtk.Label(_("Minutes"))
        self.spinbtn = gtk.SpinButton(
            gtk.Adjustment(value=start_value,
                           lower=1,
                           upper=10000,
                           step_incr=1), 1)

        hbox = gtk.HBox()
        hbox.add(lbl)
        hbox.add(self.spinbtn)

        self.vbox.pack_start(hbox)
        self.show_all()
Esempio n. 21
0
 def run(self):
     """
     Returns text of entry
     and None if someone clicked Cancel.
     """
     text = None
     response = HIGDialog.run(self)
     text = self.entry_text.get_text()
     if response==gtk.RESPONSE_CANCEL:
         text = None
     self.destroy()
     return text
 def run(self):
     """
     Returns text of entry
     and None if someone clicked Cancel.
     """
     text = None
     response = HIGDialog.run(self)
     text = self.entry_text.get_text()
     if response == gtk.RESPONSE_CANCEL:
         text = None
     self.destroy()
     return text
    def quit(self, widget=None, extra=None):
        if self.deleted:
            dialog = HIGDialog(buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
                                        gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
            alert = HIGEntryLabel('<b>' + _("Deleting Profile") + '</b>')
            text = HIGEntryLabel(
                _('Your profile is going to be deleted! Click\
                                   Ok to continue, or Cancel to go back to Profile Editor.'
                  ))
            hbox = HIGHBox()
            hbox.set_border_width(5)
            hbox.set_spacing(12)

            vbox = HIGVBox()
            vbox.set_border_width(5)
            vbox.set_spacing(12)

            image = gtk.Image()
            image.set_from_stock(gtk.STOCK_DIALOG_WARNING,
                                 gtk.ICON_SIZE_DIALOG)

            vbox.pack_start(alert)
            vbox.pack_start(text)
            hbox.pack_start(image)
            hbox.pack_start(vbox)

            dialog.vbox.pack_start(hbox)
            dialog.vbox.show_all()

            response = dialog.run()
            dialog.destroy()

            if response == gtk.RESPONSE_CANCEL:
                return None
        self.destroy()
        if self.scan_notebook != None:

            for i in xrange(self.scan_notebook.get_n_pages()):
                page = self.scan_notebook.get_nth_page(i)
                page.toolbar.profile_entry.update()
Esempio n. 24
0
    def dialog_args(self):
        '''
        Create a dialog
        '''

        d = HIGDialog(_('Arguments'))
        description_label = HIGEntryLabel(
            _('Insert the description to argument:'))
        description_label.show()
        description_entry = HIGTextEntry()
        text = self.arguments_entry.get_text()
        description_entry.set_text(text)
        description_entry.show()

        combo_box = gtk.combo_box_new_text()
        combo_box.set_wrap_width(1)
        index = -1 
        j = 0 
        for i in ARG_TYPES:
            combo_box.append_text(ARG_TYPES[i])
            if i == self.arg_type:
                index = j 
            j = j + 1
        if index > -1 : 
            combo_box.set_active(index)
        combo_box.show()
        d.vbox.pack_start(description_label, False, False)
        d.vbox.pack_start(description_entry, False, False)
        d.vbox.pack_start(combo_box, False, False)
        d.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)
        d.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
        resp = d.run()
        result  = None, None 
        if resp == gtk.RESPONSE_OK:
            model = combo_box.get_model()
            active = combo_box.get_active()
            if active < 0:
                return None, None 
            combo_selected =  model[active][0]

            for i in ARG_TYPES:
                if combo_selected == ARG_TYPES[i]:
                    combo_selected = i

            result = description_entry.get_text(), combo_selected
            #self.insert_arg_button.set_label('Edit args')
            #self.insert_arg_button.
        d.destroy()
        return result 
    def on_delete(self, widget=None):
        if not self.profile_name:
            return self.on_cancel()

        dialog = HIGDialog(buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
                                    gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
        alert = HIGEntryLabel('<b>' + _("Deleting Profile") + '</b>')
        text = HIGEntryLabel(
            _('Your profile is going to be deleted! Click \
Ok to continue, or Cancel to go back to Profile Editor.'))
        hbox = HIGHBox()
        hbox.set_border_width(5)
        hbox.set_spacing(12)

        vbox = HIGVBox()
        vbox.set_border_width(5)
        vbox.set_spacing(12)

        image = gtk.Image()
        image.set_from_stock(gtk.STOCK_DIALOG_WARNING, gtk.ICON_SIZE_DIALOG)

        vbox.pack_start(alert)
        vbox.pack_start(text)
        hbox.pack_start(image)
        hbox.pack_start(vbox)

        dialog.vbox.pack_start(hbox)
        dialog.vbox.show_all()

        response = dialog.run()
        dialog.destroy()

        if response == gtk.RESPONSE_CANCEL:
            return None

        self.deleted = True
        self.profile.remove_profile(self.profile_name)
        self.on_cancel()
Esempio n. 26
0
    def quit(self, widget=None, extra=None):
        if self.deleted:
            dialog = HIGDialog(buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
                                        gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
            alert = HIGEntryLabel('<b>'+_("Deleting Profile")+'</b>')
            text = HIGEntryLabel(_('Your profile is going to be deleted! Click\
                                   Ok to continue, or Cancel to go back to Profile Editor.'))
            hbox = HIGHBox()
            hbox.set_border_width(5)
            hbox.set_spacing(12)

            vbox = HIGVBox()
            vbox.set_border_width(5)
            vbox.set_spacing(12)

            image = gtk.Image()
            image.set_from_stock(gtk.STOCK_DIALOG_WARNING, gtk.ICON_SIZE_DIALOG)

            vbox.pack_start(alert)
            vbox.pack_start(text)
            hbox.pack_start(image)
            hbox.pack_start(vbox)

            dialog.vbox.pack_start(hbox)
            dialog.vbox.show_all()

            response = dialog.run()
            dialog.destroy()

            if response == gtk.RESPONSE_CANCEL:
                return None
        self.destroy()       
        if self.scan_notebook != None:

            for i in xrange(self.scan_notebook.get_n_pages()):
                page = self.scan_notebook.get_nth_page(i)
                page.toolbar.profile_entry.update()
Esempio n. 27
0
    def on_delete(self, widget=None):
        if not self.profile_name:
            return self.on_cancel()

        dialog = HIGDialog(buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
                                    gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
        alert = HIGEntryLabel('<b>'+_("Deleting Profile")+'</b>')
        text = HIGEntryLabel(_('Your profile is going to be deleted! Click \
Ok to continue, or Cancel to go back to Profile Editor.'))
        hbox = HIGHBox()
        hbox.set_border_width(5)
        hbox.set_spacing(12)

        vbox = HIGVBox()
        vbox.set_border_width(5)
        vbox.set_spacing(12)

        image = gtk.Image()
        image.set_from_stock(gtk.STOCK_DIALOG_WARNING, gtk.ICON_SIZE_DIALOG)

        vbox.pack_start(alert)
        vbox.pack_start(text)
        hbox.pack_start(image)
        hbox.pack_start(vbox)

        dialog.vbox.pack_start(hbox)
        dialog.vbox.show_all()

        response = dialog.run()
        dialog.destroy()

        if response == gtk.RESPONSE_CANCEL:
            return None

        self.deleted = True
        self.profile.remove_profile(self.profile_name)
        self.on_cancel()