def __init__(self, main_window=None): EntryDialog.__init__(self, main_window, title=_("Run eximstats"), label_text=_("Arguments to eximstats:")) self._statusbar = main_window.statusbar self.all_logs = gtk.CheckButton(_("Scan all logfiles")) self.all_logs.set_active(True) self.vbox.add(self.all_logs)
def __init__(self, main_window=None, text=""): EntryDialog.__init__(self, main_window, title=_("Run exigrep"), label_text=_("Search for:")) self._main_win = main_window self._statusbar = main_window.statusbar self.entry.set_text(text) self.regexp = gtk.CheckButton(_("Parse as a regular expression")) self.regexp.set_active(True) self.all_logs = gtk.CheckButton(_("Scan all logfiles")) self.all_logs.set_active(True) checkbuttons = gtk.VBox() checkbuttons.add(self.regexp) checkbuttons.add(self.all_logs) self.vbox.add(checkbuttons)
def _exim_entry(self, menuitem, callable, id, title_prefix, label_text): """Show an entry dialog, input data ant pass it to `callable`. `id` is a string (the message id). `title_prefix` is the prefix for the entry window title. `label_text` is the text of the label in the dialog.""" popup = EntryDialog(main_window=self._main_win, title=(title_prefix + " " + id), label_text=label_text) input = popup.get_input() if input: (success, status_msg) = callable(id, input) if not success: AlertDialog(self._main_win, _("An error occured."), status_msg, error=True).ask() elif self.report_success: AlertDialog(self._main_win, _("Action successful."), status_msg).ask() self._queue_widget.update()