diff options
author | Jacek Antonelli | 2010-07-28 04:02:47 -0500 |
---|---|---|
committer | Jacek Antonelli | 2010-08-01 00:30:59 -0500 |
commit | 3b8cfc9fbbb8ede46b9bd34b0ad1c59a8d047e9e (patch) | |
tree | f09ca27d77b5f2595bb4a75d0bf96f4df30d55ae | |
parent | Refactored a bunch of messy LightShare code. (diff) | |
download | meta-impy-3b8cfc9fbbb8ede46b9bd34b0ad1c59a8d047e9e.zip meta-impy-3b8cfc9fbbb8ede46b9bd34b0ad1c59a8d047e9e.tar.gz meta-impy-3b8cfc9fbbb8ede46b9bd34b0ad1c59a8d047e9e.tar.bz2 meta-impy-3b8cfc9fbbb8ede46b9bd34b0ad1c59a8d047e9e.tar.xz |
Added confirmation dialog before applying LightShare settings.
If you are using a preset other than the default preset or
the LightShare preset, the viewer will now ask you whether
to apply settings received from the server.
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/lightshare.cpp | 37 | ||||
-rw-r--r-- | linden/indra/newview/lightshare.h | 4 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/notifications.xml | 19 |
3 files changed, 57 insertions, 3 deletions
diff --git a/linden/indra/newview/lightshare.cpp b/linden/indra/newview/lightshare.cpp index 24d4139..aa5443b 100644 --- a/linden/indra/newview/lightshare.cpp +++ b/linden/indra/newview/lightshare.cpp | |||
@@ -100,14 +100,45 @@ void WindlightMessage::processWindlight(LLMessageSystem* msg, void**) | |||
100 | { | 100 | { |
101 | if( gSavedSettings.getBOOL("UseServersideWindlightSettings") ) | 101 | if( gSavedSettings.getBOOL("UseServersideWindlightSettings") ) |
102 | { | 102 | { |
103 | WindlightMessage wl = WindlightMessage(msg); | 103 | WindlightMessage* wl = new WindlightMessage(msg); |
104 | if( wl.isValid() ) | 104 | if( wl->isValid() ) |
105 | { | 105 | { |
106 | wl.apply(); | 106 | std::string water = LLWaterParamManager::instance()->mCurParams.mName; |
107 | std::string sky = LLWLParamManager::instance()->mCurParams.mName; | ||
108 | |||
109 | // If they are using the default or region settings, just apply | ||
110 | // the new settings, don't bother asking. | ||
111 | if((sky == "Default" || sky == sSkyPresetName) && | ||
112 | (water == "Default" || water == sWaterPresetName)) | ||
113 | { | ||
114 | wl->apply(); | ||
115 | delete wl; | ||
116 | } | ||
117 | else | ||
118 | { | ||
119 | LLNotifications::instance() | ||
120 | .add("ConfirmLightShare", | ||
121 | LLSD(), LLSD(), | ||
122 | boost::bind(&applyCallback, _1, _2, wl)); | ||
123 | } | ||
107 | } | 124 | } |
108 | } | 125 | } |
109 | } | 126 | } |
110 | 127 | ||
128 | // static | ||
129 | bool WindlightMessage::applyCallback(const LLSD& notification, | ||
130 | const LLSD& response, | ||
131 | WindlightMessage* wl) | ||
132 | { | ||
133 | S32 option = LLNotification::getSelectedOption(notification, response); | ||
134 | if( option == 0 ) | ||
135 | { | ||
136 | wl->apply(); | ||
137 | } | ||
138 | delete wl; | ||
139 | return false; | ||
140 | } | ||
141 | |||
111 | 142 | ||
112 | bool WindlightMessage::apply() | 143 | bool WindlightMessage::apply() |
113 | { | 144 | { |
diff --git a/linden/indra/newview/lightshare.h b/linden/indra/newview/lightshare.h index a76cd1b..2bf95c6 100644 --- a/linden/indra/newview/lightshare.h +++ b/linden/indra/newview/lightshare.h | |||
@@ -48,6 +48,10 @@ class WindlightMessage | |||
48 | WindlightMessage( LLMessageSystem* msg ); | 48 | WindlightMessage( LLMessageSystem* msg ); |
49 | ~WindlightMessage(); | 49 | ~WindlightMessage(); |
50 | static void processWindlight(LLMessageSystem* msg, void**); | 50 | static void processWindlight(LLMessageSystem* msg, void**); |
51 | static bool applyCallback(const LLSD& notification, | ||
52 | const LLSD& response, | ||
53 | WindlightMessage* wl); | ||
54 | |||
51 | bool apply(); | 55 | bool apply(); |
52 | bool isValid(); | 56 | bool isValid(); |
53 | 57 | ||
diff --git a/linden/indra/newview/skins/default/xui/en-us/notifications.xml b/linden/indra/newview/skins/default/xui/en-us/notifications.xml index 975f10b..2a0af02 100644 --- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml | |||
@@ -6992,6 +6992,25 @@ Shadows cannot be enabled due to your graphics settings being set too low. Make | |||
6992 | Note: To comply with the Second Life Terms of Service, Imprudence did not download any texture files for the exported object(s). | 6992 | Note: To comply with the Second Life Terms of Service, Imprudence did not download any texture files for the exported object(s). |
6993 | </notification> | 6993 | </notification> |
6994 | 6994 | ||
6995 | <notification | ||
6996 | name="ConfirmLightShare" | ||
6997 | type="notify" | ||
6998 | icon="notify.tga"> | ||
6999 | This region has custom sky and water settings. | ||
7000 | |||
7001 | Apply region settings now? | ||
7002 | <form name="form"> | ||
7003 | <button | ||
7004 | index="0" | ||
7005 | name="Apply" | ||
7006 | text="Apply"/> | ||
7007 | <button | ||
7008 | index="2" | ||
7009 | name="Ignore" | ||
7010 | text="Ignore"/> | ||
7011 | </form> | ||
7012 | </notification> | ||
7013 | |||
6995 | 7014 | ||
6996 | <!--End Imprudence notifications--> | 7015 | <!--End Imprudence notifications--> |
6997 | 7016 | ||