2011-09-28 21:47:40 +02:00
|
|
|
// Copyright (c) 2011, Thomas Goyne <plorkyeran@aegisub.org>
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2011-09-28 21:47:40 +02:00
|
|
|
// Permission to use, copy, modify, and distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice appear in all copies.
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2011-09-28 21:47:40 +02:00
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file dialog_progress.h
|
|
|
|
/// @see dialog_progress.cpp
|
|
|
|
/// @ingroup utility
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2009-09-11 04:36:34 +02:00
|
|
|
#ifndef AGI_PRE
|
2007-09-12 01:22:26 +02:00
|
|
|
#include <wx/dialog.h>
|
2011-09-28 21:47:40 +02:00
|
|
|
#include <wx/timer.h>
|
2009-09-11 04:36:34 +02:00
|
|
|
#endif
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2011-09-28 21:47:40 +02:00
|
|
|
#include <libaegisub/background_runner.h>
|
|
|
|
#include <libaegisub/scoped_ptr.h>
|
|
|
|
|
|
|
|
class DialogProgressSink;
|
|
|
|
class wxButton;
|
|
|
|
class wxGauge;
|
|
|
|
class wxStaticText;
|
|
|
|
class wxTextCtrl;
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @class DialogProgress
|
2011-09-28 21:47:40 +02:00
|
|
|
/// @brief Progress-bar dialog box for displaying during long operations
|
|
|
|
class DialogProgress : public wxDialog, public agi::BackgroundRunner {
|
|
|
|
DialogProgressSink *ps;
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2011-09-28 21:47:40 +02:00
|
|
|
wxStaticText *title;
|
2006-01-16 22:02:54 +01:00
|
|
|
wxStaticText *text;
|
2011-09-28 21:47:40 +02:00
|
|
|
wxGauge *gauge;
|
|
|
|
wxButton *cancel_button;
|
|
|
|
wxTextCtrl *log_output;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2011-09-28 21:47:40 +02:00
|
|
|
wxTimer pulse_timer;
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2012-02-16 22:22:04 +01:00
|
|
|
wxString pending_log;
|
|
|
|
|
2011-09-28 21:47:40 +02:00
|
|
|
void OnSetTitle(wxThreadEvent &evt);
|
|
|
|
void OnSetMessage(wxThreadEvent &evt);
|
|
|
|
void OnSetProgress(wxThreadEvent &evt);
|
|
|
|
void OnSetIndeterminate(wxThreadEvent &evt);
|
|
|
|
void OnLog(wxThreadEvent &evt);
|
|
|
|
void OnComplete(wxThreadEvent &evt);
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2011-09-28 21:47:40 +02:00
|
|
|
void OnShow(wxShowEvent&);
|
|
|
|
void OnCancel(wxCommandEvent &);
|
|
|
|
void OnPulseTimer(wxTimerEvent&);
|
2012-02-16 22:22:04 +01:00
|
|
|
void OnIdle(wxIdleEvent&);
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
public:
|
2011-09-28 21:47:40 +02:00
|
|
|
/// Constructor
|
|
|
|
/// @param parent Parent window of the dialog
|
|
|
|
/// @param title Initial title of the dialog
|
|
|
|
/// @param message Initial message of the dialog
|
|
|
|
DialogProgress(wxWindow *parent, wxString const& title="", wxString const& message="");
|
|
|
|
|
|
|
|
/// BackgroundWorker implementation
|
|
|
|
void Run(std::tr1::function<void(agi::ProgressSink *)> task, int priority=-1);
|
2006-01-16 22:02:54 +01:00
|
|
|
};
|