History

Fix askToSetAvatarUrl dialogs to use new style.

howard-stearns committed 10 years ago

Commit eb19f291 parent 5171ec91 file · +7 −22Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t