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
42534253 QUrl realUrl(url);
42544254 if (realUrl.isLocalFile()) {
42554255 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);
42624257 return false;
42634258 }
42644259
@@ -4267,32 +4262,22 @@ bool Application::askToSetAvatarUrl(const QString& url) { · 2 unmodified lines
42674262
42684263 FSTReader::ModelType modelType = FSTReader::predictModelType(fstMapping);
42694264
4270− QMessageBox msgBox;
4271− msgBox.setIcon(QMessageBox::Question);
4272− msgBox.setWindowTitle("Set Avatar");
4273− QPushButton* bodyAndHeadButton = NULL;
4274−
42754265 QString modelName = fstMapping["name"].toString();
4276− QString message;
4277− QString typeInfo;
4266+ bool ok = false;
42784267 switch (modelType) {
42794268
42804269 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);
42834273 break;
42844274
42854275 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.");
42874277 break;
42884278 }
42894279
4290− msgBox.setText(message);
4291− msgBox.addButton(QMessageBox::Cancel);
4292−
4293− msgBox.exec();
4294−
4295− if (msgBox.clickedButton() == bodyAndHeadButton) {
4280+ if (ok) {
42964281 getMyAvatar()->useFullAvatarURL(url, modelName);
42974282 emit fullAvatarURLChanged(url, modelName);
42984283 } 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