| 45 | } |
| 46 | |
| 47 | void ModalProgressDialog::setTextAndFraction(const std::string& text, double fraction) |
| 48 | { |
| 49 | if (WasCancelled()) |
| 50 | { |
| 51 | throw OperationAbortedException(_("Operation cancelled by user")); |
| 52 | } |
| 53 | |
| 54 | if (fraction < 0) |
| 55 | { |
| 56 | fraction = 0.0; |
| 57 | } |
| 58 | else if (fraction > 1.0) |
| 59 | { |
| 60 | fraction = 1.0; |
| 61 | } |
| 62 | |
| 63 | int newValue = static_cast<int>(fraction * 100); |
| 64 | |
| 65 | Update(newValue, text); |
| 66 | Fit(); |
| 67 | } |
| 68 | |
| 69 | } // namespace |
no test coverage detected