| 1082 | } |
| 1083 | |
| 1084 | void ProgressDialog::Reinit() |
| 1085 | { |
| 1086 | mLastValue = 0; |
| 1087 | |
| 1088 | mStartTime = wxGetUTCTimeMillis().GetValue(); |
| 1089 | mLastUpdate = mStartTime; |
| 1090 | mYieldTimer = mStartTime; |
| 1091 | mElapsedTime = 0; |
| 1092 | mCancel = false; |
| 1093 | mStop = false; |
| 1094 | |
| 1095 | // Because wxGTK is very sensitive about maintaining focus when |
| 1096 | // this window is not shown, we always show it. But, since we |
| 1097 | // want a 500ms delay before it's actually visible for those |
| 1098 | // quick tasks, we show it as transparent. If the initial |
| 1099 | // delay is exceeded, then we reset the dialog to full opacity. |
| 1100 | SetTransparent(0); |
| 1101 | mIsTransparent = true; |
| 1102 | |
| 1103 | auto button = FindWindowById(wxID_CANCEL, this); |
| 1104 | if (button) |
| 1105 | button->Enable(); |
| 1106 | button = FindWindowById(wxID_OK, this); |
| 1107 | if (button) |
| 1108 | button->Enable(); |
| 1109 | |
| 1110 | wxDialogWrapper::Show(true); |
| 1111 | wxDialogWrapper::Raise(); |
| 1112 | |
| 1113 | mTotalPollTime = {}; |
| 1114 | mPollsCount = {}; |
| 1115 | mTotalYieldTime = {}; |
| 1116 | mYieldsCount = {}; |
| 1117 | } |
| 1118 | |
| 1119 | void ProgressDialog::SetDialogTitle(const TranslatableString& title) |
| 1120 | { |