diff options
Diffstat (limited to 'linden')
-rw-r--r-- | linden/indra/newview/CMakeLists.txt | 3 | ||||
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 24 | ||||
-rw-r--r-- | linden/indra/newview/floatervoicelicense.cpp | 237 | ||||
-rw-r--r-- | linden/indra/newview/floatervoicelicense.h | 72 | ||||
-rw-r--r-- | linden/indra/newview/llfirstuse.cpp | 20 | ||||
-rw-r--r-- | linden/indra/newview/llfirstuse.h | 1 | ||||
-rw-r--r-- | linden/indra/newview/llprefsvoice.cpp | 15 | ||||
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 23 | ||||
-rw-r--r-- | linden/indra/newview/llstartup.h | 1 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_voice_license.xml | 36 |
10 files changed, 426 insertions, 6 deletions
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index a7b78f1..6decbf6 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt | |||
@@ -71,6 +71,7 @@ set(viewer_SOURCE_FILES | |||
71 | floaterbusy.cpp | 71 | floaterbusy.cpp |
72 | floatergriddefault.cpp | 72 | floatergriddefault.cpp |
73 | floatergridmanager.cpp | 73 | floatergridmanager.cpp |
74 | floatervoicelicense.cpp | ||
74 | hbfloatergrouptitles.cpp | 75 | hbfloatergrouptitles.cpp |
75 | hippoGridManager.cpp | 76 | hippoGridManager.cpp |
76 | hippoLimits.cpp | 77 | hippoLimits.cpp |
@@ -503,6 +504,7 @@ set(viewer_HEADER_FILES | |||
503 | floaterbusy.h | 504 | floaterbusy.h |
504 | floatergriddefault.h | 505 | floatergriddefault.h |
505 | floatergridmanager.h | 506 | floatergridmanager.h |
507 | floatervoicelicense.h | ||
506 | hbfloatergrouptitles.h | 508 | hbfloatergrouptitles.h |
507 | hippoGridManager.h | 509 | hippoGridManager.h |
508 | hippoLimits.h | 510 | hippoLimits.h |
@@ -1215,6 +1217,7 @@ set(viewer_XUI_FILES | |||
1215 | skins/default/xui/en-us/floater_top_objects.xml | 1217 | skins/default/xui/en-us/floater_top_objects.xml |
1216 | skins/default/xui/en-us/floater_tos.xml | 1218 | skins/default/xui/en-us/floater_tos.xml |
1217 | skins/default/xui/en-us/floater_url_entry.xml | 1219 | skins/default/xui/en-us/floater_url_entry.xml |
1220 | skins/default/xui/en-us/floater_voice_license.xml | ||
1218 | skins/default/xui/en-us/floater_voice_wizard.xml | 1221 | skins/default/xui/en-us/floater_voice_wizard.xml |
1219 | skins/default/xui/en-us/floater_water.xml | 1222 | skins/default/xui/en-us/floater_water.xml |
1220 | skins/default/xui/en-us/floater_wearable_save_as.xml | 1223 | skins/default/xui/en-us/floater_wearable_save_as.xml |
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 9f67615..1951e07 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -844,6 +844,17 @@ | |||
844 | <key>Value</key> | 844 | <key>Value</key> |
845 | <integer>0</integer> | 845 | <integer>0</integer> |
846 | </map> | 846 | </map> |
847 | <key>VivoxLicenseAccepted</key> | ||
848 | <map> | ||
849 | <key>Comment</key> | ||
850 | <string>By setting to true, you agree to accept the Vivox personal license agreement at http://www.vivox.com/vivox_aup.html</string> | ||
851 | <key>Persist</key> | ||
852 | <integer>1</integer> | ||
853 | <key>Type</key> | ||
854 | <string>Boolean</string> | ||
855 | <key>Value</key> | ||
856 | <integer>0</integer> | ||
857 | </map> | ||
847 | <key>WarnFirstAO</key> | 858 | <key>WarnFirstAO</key> |
848 | <map> | 859 | <map> |
849 | <key>Comment</key> | 860 | <key>Comment</key> |
@@ -877,6 +888,17 @@ | |||
877 | <key>Value</key> | 888 | <key>Value</key> |
878 | <integer>1</integer> | 889 | <integer>1</integer> |
879 | </map> | 890 | </map> |
891 | <key>WarnFirstVoiceLicense</key> | ||
892 | <map> | ||
893 | <key>Comment</key> | ||
894 | <string>Enables FirstVoiceLicense window on login</string> | ||
895 | <key>Persist</key> | ||
896 | <integer>1</integer> | ||
897 | <key>Type</key> | ||
898 | <string>Boolean</string> | ||
899 | <key>Value</key> | ||
900 | <integer>1</integer> | ||
901 | </map> | ||
880 | <key>DefaultGrid</key> | 902 | <key>DefaultGrid</key> |
881 | <map> | 903 | <map> |
882 | <key>Comment</key> | 904 | <key>Comment</key> |
@@ -4531,7 +4553,7 @@ | |||
4531 | <key>Type</key> | 4553 | <key>Type</key> |
4532 | <string>Boolean</string> | 4554 | <string>Boolean</string> |
4533 | <key>Value</key> | 4555 | <key>Value</key> |
4534 | <integer>1</integer> | 4556 | <integer>0</integer> |
4535 | </map> | 4557 | </map> |
4536 | <key>EnergyFromTop</key> | 4558 | <key>EnergyFromTop</key> |
4537 | <map> | 4559 | <map> |
diff --git a/linden/indra/newview/floatervoicelicense.cpp b/linden/indra/newview/floatervoicelicense.cpp new file mode 100644 index 0000000..4004290 --- /dev/null +++ b/linden/indra/newview/floatervoicelicense.cpp | |||
@@ -0,0 +1,237 @@ | |||
1 | /** | ||
2 | * @file floatervoicelicense.cpp | ||
3 | * @brief prompts user to agree to the Vivox license in order to enable voice | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2009&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2010, McCabe Maxsted | ||
8 | * | ||
9 | * Imprudence Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided to you | ||
11 | * under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in | ||
13 | * this distribution, or online at | ||
14 | * http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
15 | * | ||
16 | * There are special exceptions to the terms and conditions of the GPL as | ||
17 | * it is applied to this Source Code. View the full text of the exception | ||
18 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
19 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
20 | * | ||
21 | * By copying, modifying or distributing this software, you acknowledge | ||
22 | * that you have read and understood your obligations described above, | ||
23 | * and agree to abide by those obligations. | ||
24 | * | ||
25 | * ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO | ||
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
27 | * COMPLETENESS OR PERFORMANCE. | ||
28 | * $/LicenseInfo$ | ||
29 | */ | ||
30 | |||
31 | #include "llviewerprecompiledheaders.h" | ||
32 | |||
33 | #include "floatervoicelicense.h" | ||
34 | |||
35 | // viewer includes | ||
36 | #include "llagent.h" | ||
37 | #include "llappviewer.h" | ||
38 | #include "llstartup.h" | ||
39 | #include "llviewercontrol.h" | ||
40 | #include "llviewerstats.h" | ||
41 | #include "llviewertexteditor.h" | ||
42 | #include "llviewerwindow.h" | ||
43 | |||
44 | // linden library includes | ||
45 | #include "llbutton.h" | ||
46 | #include "llhttpclient.h" | ||
47 | #include "llhttpstatuscodes.h" // for HTTP_FOUND | ||
48 | #include "llradiogroup.h" | ||
49 | #include "lltextbox.h" | ||
50 | #include "llui.h" | ||
51 | #include "lluictrlfactory.h" | ||
52 | #include "llvfile.h" | ||
53 | #include "message.h" | ||
54 | |||
55 | |||
56 | FloaterVoiceLicense::FloaterVoiceLicense(const LLSD& key) | ||
57 | : LLModalDialog( std::string(" "), 100, 100 ), | ||
58 | mWebBrowserWindowId( 0 ), | ||
59 | mLoadCompleteCount( 0 ) | ||
60 | { | ||
61 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_voice_license.xml"); | ||
62 | } | ||
63 | |||
64 | // helper class that trys to download a URL from a web site and calls a method | ||
65 | // on parent class indicating if the web server is working or not | ||
66 | class LLIamHere : public LLHTTPClient::Responder | ||
67 | { | ||
68 | private: | ||
69 | LLIamHere( FloaterVoiceLicense* parent ) : | ||
70 | mParent( parent ) | ||
71 | {} | ||
72 | |||
73 | FloaterVoiceLicense* mParent; | ||
74 | |||
75 | public: | ||
76 | |||
77 | static boost::intrusive_ptr< LLIamHere > build( FloaterVoiceLicense* parent ) | ||
78 | { | ||
79 | return boost::intrusive_ptr< LLIamHere >( new LLIamHere( parent ) ); | ||
80 | }; | ||
81 | |||
82 | virtual void setParent( FloaterVoiceLicense* parentIn ) | ||
83 | { | ||
84 | mParent = parentIn; | ||
85 | }; | ||
86 | |||
87 | virtual void result( const LLSD& content ) | ||
88 | { | ||
89 | if ( mParent ) | ||
90 | mParent->setSiteIsAlive( true ); | ||
91 | }; | ||
92 | |||
93 | virtual void error( U32 status, const std::string& reason ) | ||
94 | { | ||
95 | if ( mParent ) | ||
96 | { | ||
97 | // *HACK: For purposes of this alive check, 302 Found | ||
98 | // (aka Moved Temporarily) is considered alive. The web site | ||
99 | // redirects this link to a "cache busting" temporary URL. JC | ||
100 | bool alive = (status == HTTP_FOUND); | ||
101 | mParent->setSiteIsAlive( alive ); | ||
102 | } | ||
103 | }; | ||
104 | }; | ||
105 | |||
106 | // this is global and not a class member to keep crud out of the header file | ||
107 | namespace { | ||
108 | boost::intrusive_ptr< LLIamHere > gResponsePtr = 0; | ||
109 | }; | ||
110 | |||
111 | BOOL FloaterVoiceLicense::postBuild() | ||
112 | { | ||
113 | childSetAction("Continue", onContinue, this); | ||
114 | childSetAction("Cancel", onCancel, this); | ||
115 | childSetCommitCallback("agree_chk", updateAgree, this); | ||
116 | |||
117 | // disable Agree to License radio button until the page has fully loaded | ||
118 | LLCheckBoxCtrl* license_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); | ||
119 | license_agreement->setEnabled( false ); | ||
120 | |||
121 | // hide the SL text widget if we're displaying license with using a browser widget. | ||
122 | LLTextEditor *editor = getChild<LLTextEditor>("license_text"); | ||
123 | editor->setVisible( FALSE ); | ||
124 | |||
125 | LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("license_html"); | ||
126 | if ( web_browser ) | ||
127 | { | ||
128 | // start to observe it so we see navigate complete events | ||
129 | web_browser->addObserver( this ); | ||
130 | |||
131 | gResponsePtr = LLIamHere::build( this ); | ||
132 | LLHTTPClient::get( getString( "real_url" ), gResponsePtr ); | ||
133 | } | ||
134 | |||
135 | return TRUE; | ||
136 | } | ||
137 | |||
138 | void FloaterVoiceLicense::setSiteIsAlive( bool alive ) | ||
139 | { | ||
140 | LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("license_html"); | ||
141 | // if the contents of the site was retrieved | ||
142 | if ( alive ) | ||
143 | { | ||
144 | if ( web_browser ) | ||
145 | { | ||
146 | // navigate to the "real" page | ||
147 | web_browser->navigateTo( getString( "real_url" ) ); | ||
148 | } | ||
149 | } | ||
150 | else | ||
151 | { | ||
152 | // normally this is set when navigation to license page completes (so you can't accept before it loads) | ||
153 | // but if the page is unavailable, we need to do this now | ||
154 | LLCheckBoxCtrl* license_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); | ||
155 | license_agreement->setEnabled( true ); | ||
156 | } | ||
157 | } | ||
158 | |||
159 | FloaterVoiceLicense::~FloaterVoiceLicense() | ||
160 | { | ||
161 | // stop observing events | ||
162 | LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("license_html"); | ||
163 | if ( web_browser ) | ||
164 | { | ||
165 | web_browser->remObserver( this ); | ||
166 | } | ||
167 | |||
168 | // tell the responder we're not here anymore | ||
169 | if ( gResponsePtr ) | ||
170 | { | ||
171 | gResponsePtr->setParent( 0 ); | ||
172 | } | ||
173 | } | ||
174 | |||
175 | // virtual | ||
176 | void FloaterVoiceLicense::draw() | ||
177 | { | ||
178 | // draw children | ||
179 | LLModalDialog::draw(); | ||
180 | } | ||
181 | |||
182 | // static | ||
183 | void FloaterVoiceLicense::updateAgree(LLUICtrl*, void* userdata ) | ||
184 | { | ||
185 | FloaterVoiceLicense* self = (FloaterVoiceLicense*) userdata; | ||
186 | bool agree = self->childGetValue("agree_chk").asBoolean(); | ||
187 | self->childSetEnabled("Continue", agree); | ||
188 | } | ||
189 | |||
190 | // static | ||
191 | void FloaterVoiceLicense::onContinue( void* userdata ) | ||
192 | { | ||
193 | FloaterVoiceLicense* self = (FloaterVoiceLicense*) userdata; | ||
194 | llinfos << "User agreed to the Vivox personal license" << llendl; | ||
195 | |||
196 | // enabling voice by default here seems like the best behavior | ||
197 | gSavedSettings.setBOOL("EnableVoiceChat", TRUE); | ||
198 | gSavedSettings.setBOOL("VivoxLicenseAccepted", TRUE); | ||
199 | |||
200 | // save these settings in case something bad happens later | ||
201 | gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); | ||
202 | |||
203 | if (LLStartUp::getStartupState() == STATE_LOGIN_VOICE_LICENSE) | ||
204 | { | ||
205 | LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); // Go back and finish authentication | ||
206 | } | ||
207 | self->close(); // destroys this object | ||
208 | } | ||
209 | |||
210 | // static | ||
211 | void FloaterVoiceLicense::onCancel( void* userdata ) | ||
212 | { | ||
213 | FloaterVoiceLicense* self = (FloaterVoiceLicense*) userdata; | ||
214 | llinfos << "User disagreed with the vivox personal license" << llendl; | ||
215 | gSavedSettings.setBOOL("EnableVoiceChat", FALSE); | ||
216 | gSavedSettings.setBOOL("VivoxLicenseAccepted", FALSE); | ||
217 | |||
218 | if (LLStartUp::getStartupState() == STATE_LOGIN_VOICE_LICENSE) | ||
219 | { | ||
220 | LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); // Go back and finish authentication | ||
221 | } | ||
222 | self->mLoadCompleteCount = 0; // reset counter for next time we come here | ||
223 | self->close(); // destroys this object | ||
224 | } | ||
225 | |||
226 | //virtual | ||
227 | void FloaterVoiceLicense::onNavigateComplete( const EventType& eventIn ) | ||
228 | { | ||
229 | // skip past the loading screen navigate complete | ||
230 | if ( ++mLoadCompleteCount == 2 ) | ||
231 | { | ||
232 | llinfos << "NAVIGATE COMPLETE" << llendl; | ||
233 | // enable Agree to License radio button now that page has loaded | ||
234 | LLCheckBoxCtrl * license_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); | ||
235 | license_agreement->setEnabled( true ); | ||
236 | } | ||
237 | } | ||
diff --git a/linden/indra/newview/floatervoicelicense.h b/linden/indra/newview/floatervoicelicense.h new file mode 100644 index 0000000..4130d22 --- /dev/null +++ b/linden/indra/newview/floatervoicelicense.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /** | ||
2 | * @file floatervoicelicense.h | ||
3 | * @brief prompts user to agree to the Vivox license in order to enable voice | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2009&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2010, McCabe Maxsted | ||
8 | * | ||
9 | * Imprudence Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided to you | ||
11 | * under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in | ||
13 | * this distribution, or online at | ||
14 | * http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
15 | * | ||
16 | * There are special exceptions to the terms and conditions of the GPL as | ||
17 | * it is applied to this Source Code. View the full text of the exception | ||
18 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
19 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
20 | * | ||
21 | * By copying, modifying or distributing this software, you acknowledge | ||
22 | * that you have read and understood your obligations described above, | ||
23 | * and agree to abide by those obligations. | ||
24 | * | ||
25 | * ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO | ||
26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
27 | * COMPLETENESS OR PERFORMANCE. | ||
28 | * $/LicenseInfo$ | ||
29 | */ | ||
30 | |||
31 | #ifndef FLOATERVOICELICENSE_H | ||
32 | #define FLOATERVOICELICENSE_H | ||
33 | |||
34 | #include "llfloater.h" | ||
35 | |||
36 | #include "llmodaldialog.h" | ||
37 | #include "llassetstorage.h" | ||
38 | #include "llwebbrowserctrl.h" | ||
39 | |||
40 | class LLButton; | ||
41 | class LLRadioGroup; | ||
42 | class LLVFS; | ||
43 | class LLTextEditor; | ||
44 | class LLUUID; | ||
45 | |||
46 | class FloaterVoiceLicense : | ||
47 | public LLModalDialog, | ||
48 | public LLWebBrowserCtrlObserver, | ||
49 | public LLFloaterSingleton<FloaterVoiceLicense> | ||
50 | { | ||
51 | public: | ||
52 | FloaterVoiceLicense(const LLSD& key); | ||
53 | virtual ~FloaterVoiceLicense(); | ||
54 | |||
55 | BOOL postBuild(); | ||
56 | |||
57 | virtual void draw(); | ||
58 | |||
59 | static void updateAgree( LLUICtrl *, void* userdata ); | ||
60 | static void onContinue( void* userdata ); | ||
61 | static void onCancel( void* userdata ); | ||
62 | |||
63 | void setSiteIsAlive( bool alive ); | ||
64 | |||
65 | virtual void onNavigateComplete( const EventType& eventIn ); | ||
66 | |||
67 | private: | ||
68 | int mWebBrowserWindowId; | ||
69 | int mLoadCompleteCount; | ||
70 | }; | ||
71 | |||
72 | #endif // FLOATERVOICELICENSE_H | ||
diff --git a/linden/indra/newview/llfirstuse.cpp b/linden/indra/newview/llfirstuse.cpp index 886bb94..e82aa96 100644 --- a/linden/indra/newview/llfirstuse.cpp +++ b/linden/indra/newview/llfirstuse.cpp | |||
@@ -45,9 +45,11 @@ | |||
45 | #include "llappviewer.h" | 45 | #include "llappviewer.h" |
46 | #include "lltracker.h" | 46 | #include "lltracker.h" |
47 | 47 | ||
48 | #include "llvoavatar.h" | ||
49 | #include "floatergriddefault.h" | 48 | #include "floatergriddefault.h" |
49 | #include "floatervoicelicense.h" | ||
50 | #include "hippoGridManager.h" | 50 | #include "hippoGridManager.h" |
51 | #include "llstartup.h" | ||
52 | #include "llvoavatar.h" | ||
51 | 53 | ||
52 | // static | 54 | // static |
53 | std::set<std::string> LLFirstUse::sConfigVariables; | 55 | std::set<std::string> LLFirstUse::sConfigVariables; |
@@ -387,3 +389,19 @@ void LLFirstUse::useLoginScreen() | |||
387 | FloaterGridDefault::getInstance()->center(); | 389 | FloaterGridDefault::getInstance()->center(); |
388 | } | 390 | } |
389 | } | 391 | } |
392 | |||
393 | // static | ||
394 | void LLFirstUse::voiceLicenseAgreement() | ||
395 | { | ||
396 | if (gSavedSettings.getWarning("FirstVoiceLicense")) | ||
397 | { | ||
398 | gSavedSettings.setWarning("FirstVoiceLicense", FALSE); | ||
399 | |||
400 | FloaterVoiceLicense::getInstance()->open(); | ||
401 | FloaterVoiceLicense::getInstance()->center(); | ||
402 | } | ||
403 | else // currently in STATE_LOGIN_VOICE_LICENSE when arriving here | ||
404 | { | ||
405 | LLStartUp::setStartupState(STATE_LOGIN_AUTH_INIT); | ||
406 | } | ||
407 | } | ||
diff --git a/linden/indra/newview/llfirstuse.h b/linden/indra/newview/llfirstuse.h index c77f0b2..b0bf05f 100644 --- a/linden/indra/newview/llfirstuse.h +++ b/linden/indra/newview/llfirstuse.h | |||
@@ -115,6 +115,7 @@ public: | |||
115 | static void useLoginScreen(); | 115 | static void useLoginScreen(); |
116 | static void callbackClientTags(const LLSD& notification, const LLSD& response); | 116 | static void callbackClientTags(const LLSD& notification, const LLSD& response); |
117 | static void ClientTags(); | 117 | static void ClientTags(); |
118 | static void voiceLicenseAgreement(); | ||
118 | 119 | ||
119 | protected: | 120 | protected: |
120 | static std::set<std::string> sConfigVariables; | 121 | static std::set<std::string> sConfigVariables; |
diff --git a/linden/indra/newview/llprefsvoice.cpp b/linden/indra/newview/llprefsvoice.cpp index 167e079..2d6eeb0 100644 --- a/linden/indra/newview/llprefsvoice.cpp +++ b/linden/indra/newview/llprefsvoice.cpp | |||
@@ -35,6 +35,7 @@ | |||
35 | 35 | ||
36 | #include "llprefsvoice.h" | 36 | #include "llprefsvoice.h" |
37 | 37 | ||
38 | #include "floatervoicelicense.h" | ||
38 | #include "llcheckboxctrl.h" | 39 | #include "llcheckboxctrl.h" |
39 | #include "llfloatervoicedevicesettings.h" | 40 | #include "llfloatervoicedevicesettings.h" |
40 | #include "llfocusmgr.h" | 41 | #include "llfocusmgr.h" |
@@ -136,8 +137,6 @@ BOOL LLPrefsVoice::postBuild() | |||
136 | 137 | ||
137 | void LLPrefsVoice::apply() | 138 | void LLPrefsVoice::apply() |
138 | { | 139 | { |
139 | gSavedSettings.setBOOL("EnableVoiceChat", childGetValue("enable_voice_check")); | ||
140 | |||
141 | gSavedSettings.setString("PushToTalkButton", childGetValue("modifier_combo")); | 140 | gSavedSettings.setString("PushToTalkButton", childGetValue("modifier_combo")); |
142 | gSavedSettings.setBOOL("VoiceCallsFriendsOnly", childGetValue("voice_call_friends_only_check")); | 141 | gSavedSettings.setBOOL("VoiceCallsFriendsOnly", childGetValue("voice_call_friends_only_check")); |
143 | gSavedSettings.setBOOL("AutoDisengageMic", childGetValue("auto_disengage_mic_check")); | 142 | gSavedSettings.setBOOL("AutoDisengageMic", childGetValue("auto_disengage_mic_check")); |
@@ -149,6 +148,18 @@ void LLPrefsVoice::apply() | |||
149 | { | 148 | { |
150 | voice_device_settings->apply(); | 149 | voice_device_settings->apply(); |
151 | } | 150 | } |
151 | |||
152 | bool enable_voice = childGetValue("enable_voice_check"); | ||
153 | if (enable_voice && !gSavedSettings.getBOOL("VivoxLicenseAccepted")) | ||
154 | { | ||
155 | // This window enables voice chat if license is accepted | ||
156 | FloaterVoiceLicense::getInstance()->open(); | ||
157 | FloaterVoiceLicense::getInstance()->center(); | ||
158 | } | ||
159 | else | ||
160 | { | ||
161 | gSavedSettings.setBOOL("EnableVoiceChat", enable_voice); | ||
162 | } | ||
152 | } | 163 | } |
153 | 164 | ||
154 | void LLPrefsVoice::cancel() | 165 | void LLPrefsVoice::cancel() |
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index e438f0c..3f55fd8 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -1045,12 +1045,30 @@ bool idle_startup() | |||
1045 | // color init must be after saved settings loaded | 1045 | // color init must be after saved settings loaded |
1046 | init_colors(); | 1046 | init_colors(); |
1047 | 1047 | ||
1048 | // skipping over STATE_UPDATE_CHECK because that just waits for input | 1048 | if (gSavedSettings.getBOOL("VivoxLicenseAccepted")) |
1049 | LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); | 1049 | { |
1050 | // skipping over STATE_LOGIN_VOICE_LICENSE since we don't need it | ||
1051 | // skipping over STATE_UPDATE_CHECK because that just waits for input | ||
1052 | LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); | ||
1053 | } | ||
1054 | else | ||
1055 | { | ||
1056 | LLStartUp::setStartupState(STATE_LOGIN_VOICE_LICENSE); | ||
1057 | LLFirstUse::voiceLicenseAgreement(); | ||
1058 | } | ||
1050 | 1059 | ||
1051 | return FALSE; | 1060 | return FALSE; |
1052 | } | 1061 | } |
1053 | 1062 | ||
1063 | if (STATE_LOGIN_VOICE_LICENSE == LLStartUp::getStartupState()) | ||
1064 | { | ||
1065 | LL_DEBUGS("AppInitStartupState") << "STATE_LOGIN_VOICE_LICENSE" << LL_ENDL; | ||
1066 | // prompt the user to agree to the voice license before enabling voice. | ||
1067 | // only send users here on first login, otherwise continue | ||
1068 | // on to STATE_LOGIN_AUTH_INIT | ||
1069 | return FALSE; | ||
1070 | } | ||
1071 | |||
1054 | if (STATE_UPDATE_CHECK == LLStartUp::getStartupState()) | 1072 | if (STATE_UPDATE_CHECK == LLStartUp::getStartupState()) |
1055 | { | 1073 | { |
1056 | LL_DEBUGS("AppInitStartupState") << "STATE_UPDATE_CHECK" << LL_ENDL; | 1074 | LL_DEBUGS("AppInitStartupState") << "STATE_UPDATE_CHECK" << LL_ENDL; |
@@ -3642,6 +3660,7 @@ std::string LLStartUp::startupStateToString(EStartupState state) | |||
3642 | RTNENUM( STATE_LOGIN_SHOW ); | 3660 | RTNENUM( STATE_LOGIN_SHOW ); |
3643 | RTNENUM( STATE_LOGIN_WAIT ); | 3661 | RTNENUM( STATE_LOGIN_WAIT ); |
3644 | RTNENUM( STATE_LOGIN_CLEANUP ); | 3662 | RTNENUM( STATE_LOGIN_CLEANUP ); |
3663 | RTNENUM( STATE_LOGIN_VOICE_LICENSE ); | ||
3645 | RTNENUM( STATE_UPDATE_CHECK ); | 3664 | RTNENUM( STATE_UPDATE_CHECK ); |
3646 | RTNENUM( STATE_LOGIN_AUTH_INIT ); | 3665 | RTNENUM( STATE_LOGIN_AUTH_INIT ); |
3647 | RTNENUM( STATE_LOGIN_AUTHENTICATE ); | 3666 | RTNENUM( STATE_LOGIN_AUTHENTICATE ); |
diff --git a/linden/indra/newview/llstartup.h b/linden/indra/newview/llstartup.h index 65bfc68..9a3c91c 100644 --- a/linden/indra/newview/llstartup.h +++ b/linden/indra/newview/llstartup.h | |||
@@ -50,6 +50,7 @@ typedef enum { | |||
50 | STATE_LOGIN_SHOW, // Show login screen | 50 | STATE_LOGIN_SHOW, // Show login screen |
51 | STATE_LOGIN_WAIT, // Wait for user input at login screen | 51 | STATE_LOGIN_WAIT, // Wait for user input at login screen |
52 | STATE_LOGIN_CLEANUP, // Get rid of login screen and start login | 52 | STATE_LOGIN_CLEANUP, // Get rid of login screen and start login |
53 | STATE_LOGIN_VOICE_LICENSE, // Show license agreement for using voice | ||
53 | STATE_UPDATE_CHECK, // Wait for user at a dialog box (updates, term-of-service, etc) | 54 | STATE_UPDATE_CHECK, // Wait for user at a dialog box (updates, term-of-service, etc) |
54 | STATE_LOGIN_AUTH_INIT, // Start login to SL servers | 55 | STATE_LOGIN_AUTH_INIT, // Start login to SL servers |
55 | STATE_LOGIN_AUTHENTICATE, // Do authentication voodoo | 56 | STATE_LOGIN_AUTHENTICATE, // Do authentication voodoo |
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_voice_license.xml b/linden/indra/newview/skins/default/xui/en-us/floater_voice_license.xml new file mode 100644 index 0000000..3a2b0be --- /dev/null +++ b/linden/indra/newview/skins/default/xui/en-us/floater_voice_license.xml | |||
@@ -0,0 +1,36 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> | ||
2 | <floater can_close="false" can_drag_on_left="false" can_minimize="false" | ||
3 | can_resize="false" height="500" min_height="100" min_width="100" | ||
4 | name="modal container" title="" width="600"> | ||
5 | <button bottom="-484" enabled="false" font="SansSerif" halign="center" height="20" | ||
6 | label="Continue" label_selected="Continue" left="484" mouse_opaque="true" | ||
7 | name="Continue" width="100" /> | ||
8 | <button bottom="-484" font="SansSerif" halign="center" height="20" label="Cancel" | ||
9 | label_selected="Cancel" left="16" mouse_opaque="true" name="Cancel" | ||
10 | width="100" /> | ||
11 | <check_box bottom="-435" follows="top|right" | ||
12 | font="SansSerifSmall" height="16" initial_value="false" label="I Agree to the Terms of the Vivox Personal License" | ||
13 | left="16" mouse_opaque="true" name="agree_chk" width="55" /> | ||
14 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | ||
15 | bottom="-50" drop_shadow_visible="true" follows="left|top" font="SansSerif" | ||
16 | h_pad="0" halign="left" height="30" left="16" mouse_opaque="true" | ||
17 | name="license_heading" v_pad="0" width="552"> | ||
18 | Please read the following license carefully. | ||
19 | To use voice, you must accept the license agreement. | ||
20 | </text> | ||
21 | <text_editor bottom="-376" embedded_items="false" follows="left|top" font="SansSerif" | ||
22 | height="283" left="16" max_length="65536" mouse_opaque="true" | ||
23 | name="license_text" width="568" | ||
24 | word_wrap="true"> | ||
25 | LICENSE_TEXT | ||
26 | </text_editor> | ||
27 | <!-- Loading text says: "Loading Vivox Personal License Agreement..." URL encoded --> | ||
28 | <web_browser bottom="-406" embedded_items="false" follows="left|top" font="SansSerif" | ||
29 | height="340" left="16" max_length="65536" mouse_opaque="true" | ||
30 | name="license_html" | ||
31 | start_url="data:text/html,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody text=%22000000%22%3E%3Ch2%3E Loading %3Ca%20target%3D%22_external%22%20href%3D%22http%3A//vivox.com/vivox_aup.html%22%3EVivox%20Personal%20License%20Agreement%3C/a%3E...%3C/h2%3E %3C/body%3E %3C/html%3E" | ||
32 | width="568" word_wrap="true" /> | ||
33 | <string name="real_url"> | ||
34 | http://www.vivox.com/vivox_aup.html | ||
35 | </string> | ||
36 | </floater> \ No newline at end of file | ||