Esempio n. 1
0
    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()