#include <process_progress_dialog.h>
Inheritance diagram for process_progress_dialog:

Public Methods |
|
| process_progress_dialog (wxWindow *parent, const wxArrayString &commandline_array, long stream_kind=optionPROCESS_PROGRESS_DIALOG_STDOUT_STREAM_KIND|optionPROCESS_PROGRESS_DIALOG_STDERR_STREAM_KIND, wxSignal kill_signal=wxSIGKILL, bool automatically_close_when_done=TRUE, const wxString &show_hide_listbox_configuration_key=wxEmptyString, const wxString &log_filename=wxEmptyString, const wxString &log_path=wxEmptyString, long scroll_history=optionDETAILS_PROGRESS_LISTBOX_RECOMMENDED_SCROLL_HISTORY) | |
| Constructor. |
|
| process_progress_dialog () | |
| virtual | ~process_progress_dialog () |
| Destructor. |
|
| virtual bool | on_before_execute_commandline_array () |
| Virtual: optional action to do before starting execution of the commandline array. |
|
| virtual bool | on_before_execute_commandline_array_item (size_t commandline_array_index) |
| Virtual: optional action to do before start execution of a commandline in array. |
|
| virtual bool | on_after_commandline_array_item_execution_finished (size_t commandline_array_index) |
| Virtual: optional action to do after a commandline in the array has terminated. |
|
| virtual bool | on_after_commandline_array_executions_finished () |
| Virtual: optional action to de after all commands's processes have terminated. |
|
| virtual void | on_process_generated_an_output_line (long stream_kind, const wxString &line_text, size_t commandline_array_index) |
| The vital function to override: actions to do when process made a line of output. |
|
| virtual void | action_to_do_when_dialog_is_ready () |
| Start up the actions watched by the progress dialog. Called from on_paint(). |
|
| virtual void | action_to_do_before_dialog_finishes_closing () |
| Clean up any actions before the dialog vanishes. Called from on_close(). |
|
| virtual void | action_to_do_after_dialog_finishes_closing () |
| Clean up any actions after the dialog EndModal()s. Called from on_close(). |
|
| void | set_stream_kind (long stream_kind) |
| Accessor to m_stream_kind,allowing switching of what types of streams to catch. |
|
| long | get_stream_kind () |
| Accessor to query what types of streams should be caught (used by piped_process). |
|
| size_t | get_current_commandline_array_index () |
| Acessor to m_current_commandline_array_index. |
|
| virtual void | custom_kill (long pid, wxSignal sig, wxKillError *krc) |
| An optional custom kill for the process instead of a stock wxKill(). |
|
This dialog manages the execution of an array of processes. The processes are run one after another: when one terminates, the next one starts. If the class is used directly, it will just run the processes and put the output into the progress_listbox. However, it is more useful as a derived class, using the pluggable virtual functions for things that are to be done before and after each commandline, and before and after the entire suite of commandlines, and most importantly: something to do when a line of output is generated from the process.
The stream kinds that are caught by the process dialog can be either stdout, stderr, both or neither. The stream kinds are specified in the constructor, but also can be changed by a derived class while the array of processes is running. IMPORTANTLY, however, don't use a stream of which there will be no/little output generated, unless you don't care about the program freezing while it gets a character from the stream (to see if Eof and other things).
When the dialog is closed, via stop button or window's corner 'X' button it will detach and kill all processes that it started, that are still running (which should only be 1 at a time, since they are executed in sequence).
\note: This implementation is the only current approach that works as of wx2.3.3. All other avenues have already been examined.
|
||||||||||||||||||||||||||||||||||||||||
|
Constructor.
|
|
|
Clean up any actions after the dialog EndModal()s. Called from on_close(). Needed for MSW to drop in something to terminate program if this is the only window, as otherwise app doesn't seem to quit Reimplemented from details_progress_dialog. Reimplemented in build_progress_dialog. |
|
||||||||||||||||
|
An optional custom kill for the process instead of a stock wxKill(). See wxKill() for parameter list Reimplemented in build_progress_dialog. |
|
|
Virtual: optional action to de after all commands's processes have terminated.
Reimplemented in build_progress_dialog. |
|
|
Virtual: optional action to do after a commandline in the array has terminated.
Reimplemented in build_progress_dialog. |
|
|
Virtual: optional action to do before starting execution of the commandline array.
Reimplemented in build_progress_dialog. |
|
|
Virtual: optional action to do before start execution of a commandline in array.
Reimplemented in build_progress_dialog. |
|
||||||||||||||||
|
The vital function to override: actions to do when process made a line of output. Most likely you are going to want to parse the added line and based on what the line said, append_line_to_listbox() (or not), set_gauge(), or set_statictext() or maybe throw up a message box or something else. The Default is to just call_append_line_to_listbox() and then keep going, but you'll probably want to override with what you want it to do.
Reimplemented in build_progress_dialog. |