11 #include "utils/Job.h" 28 const char *
GetType()
const override {
return "ProgressJob"; }
29 bool operator==(
const CJob* job)
const override {
return false; }
30 bool ShouldCancel(
unsigned int progress,
unsigned int total)
const override;
51 bool HasProgressIndicator()
const;
122 void SetTitle(
const std::string &title);
129 void SetText(
const std::string &text);
144 void SetProgress(
int currentStep,
int totalSteps)
const;
157 bool m_modal =
false;
158 bool m_autoClose =
true;
159 bool m_updateProgress =
true;
160 bool m_updateInformation =
true;
bool GetUpdateInformation()
Whether to update the progress information or not.
Definition: ProgressJob.h:105
CGUIDialogProgressBarHandle * GetProgressBar() const
Returns the progress bar indicating the progress of the job.
Definition: ProgressJob.h:65
Base class for jobs that are executed asynchronously.
Definition: Job.h:109
bool IsModal() const
Whether the job is being run modally or in the background.
Definition: ProgressJob.h:60
bool GetUpdateProgress()
Whether to update the progress bar or not.
Definition: ProgressJob.h:95
void SetUpdateProgress(bool updateProgress)
Set whether to update the progress bar or not.
Definition: ProgressJob.h:100
bool DoModal()
Executes the job showing a modal progress dialog.
Definition: ProgressJob.cpp:48
bool IsCancelled() const
Checks if the progress dialog has been cancelled.
Definition: ProgressJob.cpp:178
void SetAutoClose(bool autoClose)
Set whether to automatically close the progress indicator in MarkFinished().
Definition: ProgressJob.h:90
bool GetAutoClose()
Whether to automatically close the progress indicator in MarkFinished().
Definition: ProgressJob.h:85
CGUIDialogProgress * GetProgressDialog() const
Returns the progress dialog indicating the progress of the job.
Definition: ProgressJob.h:75
void SetUpdateInformation(bool updateInformation)
Set whether to update the progress information or not.
Definition: ProgressJob.h:110
void SetProgressIndicators(CGUIDialogProgressBarHandle *progressBar, CGUIDialogProgress *progressDialog, bool updateProgress=true, bool updateInformation=true)
Sets the given progress indicators to be used during execution of the job.
Definition: ProgressJob.cpp:73
bool ShouldCancel(unsigned int progress, unsigned int total) const override
Function for longer jobs to report progress and check whether they have been cancelled.
Definition: ProgressJob.cpp:38
void SetTitle(const std::string &title)
Sets the given title as the title of the progress bar.
Definition: ProgressJob.cpp:95
void SetText(const std::string &text)
Sets the given text as the description of the progress bar.
Definition: ProgressJob.cpp:112
Definition: GUIDialogExtendedProgressBar.h:16
void SetProgressBar(CGUIDialogProgressBarHandle *progress)
Sets the progress bar indicating the progress of the job.
Definition: ProgressJob.h:70
Definition: GUIDialogProgress.h:16
void SetProgress(float percentage) const
Sets the progress of the progress bar to the given value in percentage.
Definition: ProgressJob.cpp:129
void SetProgressDialog(CGUIDialogProgress *progressDialog)
Sets the progress bar indicating the progress of the job.
Definition: ProgressJob.h:80
void MarkFinished()
Marks the progress as finished by setting it to 100%.
Definition: ProgressJob.cpp:162
const char * GetType() const override
Function that returns the type of job.
Definition: ProgressJob.h:28
void ShowProgressDialog() const
Makes sure that the modal dialog is being shown.
Definition: ProgressJob.cpp:84
Basic implementation of a CJob with a progress bar to indicate the progress of the job being processe...
Definition: ProgressJob.h:22