Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -4253,12 +4253,7 @@ bool Application::askToSetAvatarUrl(const QString& url) { · 4252 unmodified lines | ||
| 4253 | 4253 | QUrl realUrl(url); |
| 4254 | 4254 | if (realUrl.isLocalFile()) { |
| 4255 | 4255 | QString message = "You can not use local files for avatar components."; |
| 4256 | − | |
| 4257 | − QMessageBox msgBox; | |
| 4258 | − msgBox.setText(message); | |
| 4259 | − msgBox.setStandardButtons(QMessageBox::Ok); | |
| 4260 | − msgBox.setIcon(QMessageBox::Warning); | |
| 4261 | − msgBox.exec(); | |
| 4256 | + OffscreenUi::warning("", message); | |
| 4262 | 4257 | return false; |
| 4263 | 4258 | } |
| 4264 | 4259 | |
| @@ -4267,32 +4262,22 @@ bool Application::askToSetAvatarUrl(const QString& url) { · 2 unmodified lines | ||
| 4267 | 4262 | |
| 4268 | 4263 | FSTReader::ModelType modelType = FSTReader::predictModelType(fstMapping); |
| 4269 | 4264 | |
| 4270 | − QMessageBox msgBox; | |
| 4271 | − msgBox.setIcon(QMessageBox::Question); | |
| 4272 | − msgBox.setWindowTitle("Set Avatar"); | |
| 4273 | − QPushButton* bodyAndHeadButton = NULL; | |
| 4274 | − | |
| 4275 | 4265 | QString modelName = fstMapping["name"].toString(); |
| 4276 | − QString message; | |
| 4277 | − QString typeInfo; | |
| 4266 | + bool ok = false; | |
| 4278 | 4267 | switch (modelType) { |
| 4279 | 4268 | |
| 4280 | 4269 | case FSTReader::HEAD_AND_BODY_MODEL: |
| 4281 | − message = QString("Would you like to use '") + modelName + QString("' for your avatar?"); | |
| 4282 | − bodyAndHeadButton = msgBox.addButton(tr("Yes"), QMessageBox::ActionRole); | |
| 4270 | + ok = QMessageBox::Ok == OffscreenUi::question("Set Avatar", | |
| 4271 | + QString("Would you like to use '") + modelName + "' for your avatar?", | |
| 4272 | + QMessageBox::Ok | QMessageBox::Cancel); | |
| 4283 | 4273 | break; |
| 4284 | 4274 | |
| 4285 | 4275 | default: |
| 4286 | − message = QString(modelName + QString("Does not support a head and body as required.")); | |
| 4276 | + OffscreenUi::warning("", modelName + "Does not support a head and body as required."); | |
| 4287 | 4277 | break; |
| 4288 | 4278 | } |
| 4289 | 4279 | |
| 4290 | − msgBox.setText(message); | |
| 4291 | − msgBox.addButton(QMessageBox::Cancel); | |
| 4292 | − | |
| 4293 | − msgBox.exec(); | |
| 4294 | − | |
| 4295 | − if (msgBox.clickedButton() == bodyAndHeadButton) { | |
| 4280 | + if (ok) { | |
| 4296 | 4281 | getMyAvatar()->useFullAvatarURL(url, modelName); |
| 4297 | 4282 | emit fullAvatarURLChanged(url, modelName); |
| 4298 | 4283 | } else { |