Refactor and extensions to png export dialog.

This commit is contained in:
tamasmeszaros
2018-06-27 17:43:54 +02:00
parent 30e177d986
commit ac9d81cfa0
11 changed files with 492 additions and 341 deletions

View File

@@ -15,7 +15,7 @@ public:
private:
float state_ = .0f, max_ = 1.f, step_;
std::function<void(void)> cancelfunc_ = [](){};
CancelFn cancelfunc_ = [](){};
unsigned proc_count_ = 1;
public:
@@ -54,8 +54,11 @@ public:
/// Set up a cancel callback for the operation if feasible.
inline void on_cancel(CancelFn func) { cancelfunc_ = func; }
/// Call a previously specified cancel callback.
inline void on_cancel() { cancelfunc_(); }
/**
* Explicitly shut down the progress indicator and call the associated
* callback.
*/
virtual void cancel() { cancelfunc_(); }
/**
* \brief Set up how many subprocedures does the whole operation contain.