diff --git a/indra/newview/app_settings/settings_alchemy.xml b/indra/newview/app_settings/settings_alchemy.xml index bd0ad7244be3f68208184885edcbb0641c9131e4..64159e580bcb64a51fa2efccf4be7b84d07ee731 100644 --- a/indra/newview/app_settings/settings_alchemy.xml +++ b/indra/newview/app_settings/settings_alchemy.xml @@ -354,6 +354,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>AlchemyKeepSettingsOnGPUChange</key> + <map> + <key>Comment</key> + <string>Keep graphical preferences when GPU changes</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>-1</integer> + </map> <key>AlchemyLookAtShow</key> <map> <key>Comment</key> diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 352b47bbe82bc15415bbc5f412d2d44ad300da6c..a7695495c8b69b1c87711c0f2adf868ca8e7d85c 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -296,6 +296,7 @@ void transition_back_to_login_panel(const std::string& emsg); // [SL:KB] - Patch: Chat-Alerts | Checked: 2012-09-22 (Catznip-3.3) void handleLoadChatAlertSounds(); // [/SL:KB] +bool callbackConfirmDisplayPreferencesReset(const LLSD& notification, const LLSD& response); void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is_group) { @@ -425,12 +426,12 @@ bool idle_startup() { LLNotificationsUtil::add("DisplaySetToRecommendedFeatureChange"); } - else if ( ! lastGPU.empty() && (lastGPU != thisGPU)) + else if ( ! lastGPU.empty() && (gSavedSettings.getS32("AlchemyKeepSettingsOnGPUChange") == -1) && (lastGPU != thisGPU)) { LLSD subs; subs["LAST_GPU"] = lastGPU; subs["THIS_GPU"] = thisGPU; - LLNotificationsUtil::add("DisplaySetToRecommendedGPUChange", subs); + LLNotificationsUtil::add("AskForDisplayPreferencesReset", subs, callbackConfirmDisplayPreferencesReset); } else if (!gViewerWindow->getInitAlert().empty()) { @@ -3859,3 +3860,23 @@ void handleLoadChatAlertSounds() } } // [/SL:KB] + +bool callbackConfirmDisplayPreferencesReset(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + switch (option) + { + case 0: // Yes + LLFeatureManager::getInstance()->applyRecommendedSettings(); + break; + case 1: // No + break; + case -1: // Cancel/window closed + break; + default: + // Don't ask again + gSavedSettings.setS32("AlchemyKeepSettingsOnGPUChange", 1); + break; + } + return false; +} \ No newline at end of file diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index dbfe0522ec6008321406aa137d49fd484b7d9f1f..e1512f7cb69464b0a4f452a5bb303988ae2909fe 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2034,7 +2034,10 @@ LLViewerWindow::LLViewerWindow(const Params& p) || (gSavedSettings.getString("LastGPUString") != LLFeatureManager::getInstance()->getGPUString()) || (gSavedSettings.getBOOL("ProbeHardwareOnStartup"))) { - LLFeatureManager::getInstance()->applyRecommendedSettings(); + if (gSavedSettings.getS32("AlchemyKeepSettingsOnGPUChange") < 1) + { + LLFeatureManager::getInstance()->applyRecommendedSettings(); + } gSavedSettings.setBOOL("ProbeHardwareOnStartup", FALSE); } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index e02f2df7f7b3affe5a9442c8b994fb1f7ddf5db0..c74532d8c7c906fc4028e2eba14ea7da56f92515 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -12576,4 +12576,21 @@ Always Run disabled. Irrevocably destroying object. Hope you didn't need that. </notification> + <notification + icon="notify" + name="AskForDisplayPreferencesReset" + type="alertmodal"> +Your Graphic card seems to have changed + +from '[LAST_GPU]' +to '[THIS_GPU]' + +Would you like to reset the graphic preferences? + <usetemplate + name="yesnocancelbuttons" + yestext="Reset now" + notext="Leave as-is" + canceltext="Never reset"/> + </notification> + </notifications>