Example #1
0
 def show_important_error(self, event):
     """Creates an importan error dialog with a callback to send
     the developers the error traceback.
     """
     dialog_text = event.text
     dialog = ImportantErrorDialog(self.window, dialog_text)
     response = dialog.run()
     if response == 42:
         error = event.error_name
         event.callback(error, *event.exception_objects)
     dialog.destroy()
Example #2
0
 def do_important_error(self):
     """Creates an importan error dialog with a callback to send
     the developers the error traceback.
     """
     dialog_text = self.event.text
     dialog = ImportantErrorDialog(self, dialog_text)
     response = dialog.run()
     if response == 42:
         error = self.event.error_name
         self.event.callback(error, *self.event.exception_objects)
     dialog.destroy()
Example #3
0
    def postEvent(self, receiver, event):
        if receiver is None:
            receiver = self.getMainWindow()

        if event.type() == 3131:  # new log event
            receiver.emit("new_log", event.text)

        if event.type() == 3141:  # new conflict event
            receiver.emit("set_conflict_label", event.nconflicts)

        if event.type() == 5100:  # new notification event
            self.notificationsModel.prepend([event.change.getMessage()])
            receiver.emit("new_notif")
            host_count, service_count, vuln_count = self.update_counts()
            receiver.emit("update_ws_info", host_count,
                          service_count, vuln_count)

        if event.type() == 4100 or event.type() == 3140:  # newinfo or changews
            host_count, service_count, vuln_count = self.update_counts()
            receiver.emit("update_ws_info", host_count,
                          service_count, vuln_count)

        if event.type() == 3132:  # error
            dialog_text = event.text
            dialog = Gtk.MessageDialog(self.window, 0,
                                       Gtk.MessageType.INFO,
                                       Gtk.ButtonsType.OK,
                                       dialog_text)
            dialog.run()
            dialog.destroy()

        if event.type() == 3134:  # important error, uncaught exception
            dialog_text = event.text
            dialog = ImportantErrorDialog(self.window, dialog_text)
            response = dialog.run()
            if response == 42:
                error = event.error_name
                event.callback(error, *event.exception_objects)
            dialog.destroy()