diff options
author | Jacek Antonelli | 2011-02-24 04:26:39 -0600 |
---|---|---|
committer | McCabe Maxsted | 2011-02-27 16:24:52 -0700 |
commit | 373179115193077d258881d54cc1c07edf99c3a5 (patch) | |
tree | 9d9f0512b972b76a645fd79e6e7eafb413619366 /linden/indra/newview | |
parent | Improved warning message about SL statistics packet. (diff) | |
download | meta-impy-373179115193077d258881d54cc1c07edf99c3a5.zip meta-impy-373179115193077d258881d54cc1c07edf99c3a5.tar.gz meta-impy-373179115193077d258881d54cc1c07edf99c3a5.tar.bz2 meta-impy-373179115193077d258881d54cc1c07edf99c3a5.tar.xz |
Added a "news bar" at the bottom of the login screen.
The web page to load is defined by the setting "NewsBarURL".
Default is "http://app.kokuaviewer.org/news/", which will display
links to the latest Imprudence/Kokua blog posts, etc.
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | linden/indra/newview/llpanellogin.cpp | 96 | ||||
-rw-r--r-- | linden/indra/newview/llpanellogin.h | 3 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/panel_login.xml | 23 |
4 files changed, 112 insertions, 21 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 986f3a8..17d4c3c 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -832,6 +832,17 @@ | |||
832 | <key>Value</key> | 832 | <key>Value</key> |
833 | <integer>1</integer> | 833 | <integer>1</integer> |
834 | </map> | 834 | </map> |
835 | <key>NewsBarURL</key> | ||
836 | <map> | ||
837 | <key>Comment</key> | ||
838 | <string>URL to load in the news bar on the login screen</string> | ||
839 | <key>Persist</key> | ||
840 | <integer>1</integer> | ||
841 | <key>Type</key> | ||
842 | <string>String</string> | ||
843 | <key>Value</key> | ||
844 | <string>http://app.kokuaviewer.org/news/</string> | ||
845 | </map> | ||
835 | <key>ObjectIMColor</key> | 846 | <key>ObjectIMColor</key> |
836 | <map> | 847 | <map> |
837 | <key>Comment</key> | 848 | <key>Comment</key> |
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index 6464f0b..4fe0624 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp | |||
@@ -302,17 +302,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, | |||
302 | // make links open in external browser | 302 | // make links open in external browser |
303 | web_browser->setOpenInExternalBrowser( true ); | 303 | web_browser->setOpenInExternalBrowser( true ); |
304 | 304 | ||
305 | // force the size to be correct (XML doesn't seem to be sufficient to do this) (with some padding so the other login screen doesn't show through) | ||
306 | LLRect htmlRect = getRect(); | ||
307 | #if USE_VIEWER_AUTH | ||
308 | htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY(), getRect().getWidth() + 6, getRect().getHeight()); | ||
309 | #else | ||
310 | htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY() + 40, getRect().getWidth() + 6, getRect().getHeight() - 78 ); | ||
311 | #endif | ||
312 | web_browser->setRect( htmlRect ); | ||
313 | web_browser->reshape( htmlRect.getWidth(), htmlRect.getHeight(), TRUE ); | ||
314 | reshape( getRect().getWidth(), getRect().getHeight(), 1 ); | ||
315 | |||
316 | // kick off a request to grab the url manually | 305 | // kick off a request to grab the url manually |
317 | gResponsePtr = LLIamHereLogin::build( this ); | 306 | gResponsePtr = LLIamHereLogin::build( this ); |
318 | std::string login_page = gSavedSettings.getString("LoginPage"); | 307 | std::string login_page = gSavedSettings.getString("LoginPage"); |
@@ -327,6 +316,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, | |||
327 | refreshLocation( false ); | 316 | refreshLocation( false ); |
328 | #endif | 317 | #endif |
329 | 318 | ||
319 | loadNewsBar(); | ||
320 | |||
330 | LLFirstUse::useLoginScreen(); | 321 | LLFirstUse::useLoginScreen(); |
331 | } | 322 | } |
332 | 323 | ||
@@ -419,13 +410,20 @@ void LLPanelLogin::draw() | |||
419 | S32 width = getRect().getWidth(); | 410 | S32 width = getRect().getWidth(); |
420 | S32 height = getRect().getHeight(); | 411 | S32 height = getRect().getHeight(); |
421 | 412 | ||
413 | S32 news_bar_height = 0; | ||
414 | LLMediaCtrl* news_bar = getChild<LLMediaCtrl>("news_bar"); | ||
415 | if (news_bar) | ||
416 | { | ||
417 | news_bar_height = news_bar->getRect().getHeight(); | ||
418 | } | ||
419 | |||
422 | if ( mHtmlAvailable ) | 420 | if ( mHtmlAvailable ) |
423 | { | 421 | { |
424 | #if !USE_VIEWER_AUTH | 422 | #if !USE_VIEWER_AUTH |
425 | // draw a background box in black | 423 | // draw a background box in black |
426 | gl_rect_2d( 0, height - 264, width, 264, LLColor4( 0.0f, 0.0f, 0.0f, 1.f ) ); | 424 | gl_rect_2d( 0, height - 264 + news_bar_height, width, 264, LLColor4( 0.0f, 0.0f, 0.0f, 1.f ) ); |
427 | // draw the bottom part of the background image - just the blue background to the native client UI | 425 | // draw the bottom part of the background image - just the blue background to the native client UI |
428 | mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight()); | 426 | mLogoImage->draw(0, -264 + news_bar_height, width + 8, mLogoImage->getHeight()); |
429 | #endif | 427 | #endif |
430 | } | 428 | } |
431 | else | 429 | else |
@@ -1151,3 +1149,75 @@ void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) | |||
1151 | } | 1149 | } |
1152 | } | 1150 | } |
1153 | */ | 1151 | */ |
1152 | |||
1153 | |||
1154 | bool LLPanelLogin::loadNewsBar() | ||
1155 | { | ||
1156 | std::string news_url = gSavedSettings.getString("NewsBarURL"); | ||
1157 | |||
1158 | if (news_url.empty()) | ||
1159 | { | ||
1160 | return false; | ||
1161 | } | ||
1162 | |||
1163 | LLMediaCtrl* news_bar = getChild<LLMediaCtrl>("news_bar"); | ||
1164 | |||
1165 | if (!news_bar) | ||
1166 | { | ||
1167 | return false; | ||
1168 | } | ||
1169 | |||
1170 | // *HACK: Not sure how else to make LLMediaCtrl respect user's | ||
1171 | // preference when opening links with target="_blank". -Jacek | ||
1172 | if (gSavedSettings.getBOOL("UseExternalBrowser")) | ||
1173 | { | ||
1174 | news_bar->setOpenInExternalBrowser( true ); | ||
1175 | news_bar->setOpenInInternalBrowser( false ); | ||
1176 | } | ||
1177 | else | ||
1178 | { | ||
1179 | news_bar->setOpenInExternalBrowser( false ); | ||
1180 | news_bar->setOpenInInternalBrowser( true ); | ||
1181 | } | ||
1182 | |||
1183 | |||
1184 | std::ostringstream full_url; | ||
1185 | |||
1186 | full_url << news_url; | ||
1187 | |||
1188 | // Append a "?" if the URL doesn't already have query params. | ||
1189 | if (LLURI(news_url).queryMap().size() == 0) | ||
1190 | { | ||
1191 | full_url << "?"; | ||
1192 | } | ||
1193 | |||
1194 | std::string channel = gSavedSettings.getString("VersionChannelName"); | ||
1195 | std::string skin = gSavedSettings.getString("SkinCurrent"); | ||
1196 | |||
1197 | std::string version = | ||
1198 | llformat("%d.%d.%d", | ||
1199 | ViewerVersion::getImpMajorVersion(), | ||
1200 | ViewerVersion::getImpMinorVersion(), | ||
1201 | ViewerVersion::getImpPatchVersion()); | ||
1202 | if (!ViewerVersion::getImpTestVersion().empty()) | ||
1203 | { | ||
1204 | version += " " + ViewerVersion::getImpTestVersion(); | ||
1205 | } | ||
1206 | |||
1207 | char* curl_channel = curl_escape(channel.c_str(), 0); | ||
1208 | char* curl_version = curl_escape(version.c_str(), 0); | ||
1209 | char* curl_skin = curl_escape(skin.c_str(), 0); | ||
1210 | |||
1211 | full_url << "&channel=" << curl_channel; | ||
1212 | full_url << "&version=" << curl_version; | ||
1213 | full_url << "&skin=" << curl_skin; | ||
1214 | |||
1215 | curl_free(curl_channel); | ||
1216 | curl_free(curl_version); | ||
1217 | curl_free(curl_skin); | ||
1218 | |||
1219 | news_bar->navigateTo( full_url.str() ); | ||
1220 | |||
1221 | |||
1222 | return true; | ||
1223 | } | ||
diff --git a/linden/indra/newview/llpanellogin.h b/linden/indra/newview/llpanellogin.h index c99fa30..5830b52 100644 --- a/linden/indra/newview/llpanellogin.h +++ b/linden/indra/newview/llpanellogin.h | |||
@@ -87,6 +87,9 @@ public: | |||
87 | // inherited from LLViewerMediaObserver | 87 | // inherited from LLViewerMediaObserver |
88 | /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); | 88 | /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); |
89 | 89 | ||
90 | /// Load the news bar web page, return true if successful. | ||
91 | bool loadNewsBar(); | ||
92 | |||
90 | private: | 93 | private: |
91 | static void onClickConnect(void*); | 94 | static void onClickConnect(void*); |
92 | static void onClickGrid(void*); | 95 | static void onClickGrid(void*); |
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_login.xml b/linden/indra/newview/skins/default/xui/en-us/panel_login.xml index 048005d..16dd4ad 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_login.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_login.xml | |||
@@ -5,7 +5,7 @@ | |||
5 | follows="left|top|right|bottom" mouse_opaque="true" > | 5 | follows="left|top|right|bottom" mouse_opaque="true" > |
6 | 6 | ||
7 | <web_browser name="login_html" | 7 | <web_browser name="login_html" |
8 | bottom="0" top="-1" left="0" right="-1" | 8 | bottom="102" top="-1" left="0" right="-1" |
9 | border_visible="false" follows="top|left|bottom|right" | 9 | border_visible="false" follows="top|left|bottom|right" |
10 | start_url="data:text/html, | 10 | start_url="data:text/html, |
11 | %3Chtml%3E | 11 | %3Chtml%3E |
@@ -33,7 +33,7 @@ | |||
33 | <!-- START LOCATION --> | 33 | <!-- START LOCATION --> |
34 | 34 | ||
35 | <text name="start_location_text" | 35 | <text name="start_location_text" |
36 | bottom="8" left="10" height="16" right="115" | 36 | bottom="32" left="10" height="16" right="115" |
37 | follows="left|bottom" h_pad="0" halign="right" v_pad="0" | 37 | follows="left|bottom" h_pad="0" halign="right" v_pad="0" |
38 | bg_visible="false" drop_shadow_visible="true" | 38 | bg_visible="false" drop_shadow_visible="true" |
39 | border_visible="false" border_drop_shadow_visible="false" | 39 | border_visible="false" border_drop_shadow_visible="false" |
@@ -59,7 +59,7 @@ | |||
59 | <!-- FIRST NAME --> | 59 | <!-- FIRST NAME --> |
60 | 60 | ||
61 | <text name="first_name_text" | 61 | <text name="first_name_text" |
62 | bottom="56" left="24" height="16" width="120" | 62 | bottom="80" left="24" height="16" width="120" |
63 | follows="left|bottom" h_pad="0" halign="left" v_pad="0" | 63 | follows="left|bottom" h_pad="0" halign="left" v_pad="0" |
64 | bg_visible="false" drop_shadow_visible="true" | 64 | bg_visible="false" drop_shadow_visible="true" |
65 | border_visible="false" border_drop_shadow_visible="false" | 65 | border_visible="false" border_drop_shadow_visible="false" |
@@ -123,7 +123,7 @@ | |||
123 | <!-- GRIDS --> | 123 | <!-- GRIDS --> |
124 | 124 | ||
125 | <text name="grid_text" | 125 | <text name="grid_text" |
126 | bottom="56" left_delta="150" height="16" width="120" | 126 | bottom="80" left_delta="150" height="16" width="120" |
127 | follows="left|bottom" h_pad="0" halign="left" v_pad="0" | 127 | follows="left|bottom" h_pad="0" halign="left" v_pad="0" |
128 | bg_visible="false" drop_shadow_visible="true" | 128 | bg_visible="false" drop_shadow_visible="true" |
129 | border_visible="false" border_drop_shadow_visible="false" | 129 | border_visible="false" border_drop_shadow_visible="false" |
@@ -143,7 +143,7 @@ | |||
143 | <!-- LOG IN --> | 143 | <!-- LOG IN --> |
144 | 144 | ||
145 | <button name="connect_btn" label="Log In" | 145 | <button name="connect_btn" label="Log In" |
146 | bottom="34" left_delta="140" height="24" width="120" | 146 | bottom="58" left_delta="140" height="24" width="120" |
147 | follows="left|bottom" font="SansSerif" halign="center" | 147 | follows="left|bottom" font="SansSerif" halign="center" |
148 | mouse_opaque="true" scale_image="TRUE" /> | 148 | mouse_opaque="true" scale_image="TRUE" /> |
149 | 149 | ||
@@ -151,7 +151,7 @@ | |||
151 | <!-- ACCOUNT / FORGOT PASSWORD --> | 151 | <!-- ACCOUNT / FORGOT PASSWORD --> |
152 | 152 | ||
153 | <text name="create_new_account_text" | 153 | <text name="create_new_account_text" |
154 | bottom="45" left="-210" height="16" width="200" | 154 | bottom="69" left="-210" height="16" width="200" |
155 | follows="right|bottom" h_pad="0" halign="right" v_pad="0" | 155 | follows="right|bottom" h_pad="0" halign="right" v_pad="0" |
156 | bg_visible="false" drop_shadow_visible="true" | 156 | bg_visible="false" drop_shadow_visible="true" |
157 | border_visible="false" border_drop_shadow_visible="false" | 157 | border_visible="false" border_drop_shadow_visible="false" |
@@ -161,7 +161,7 @@ | |||
161 | </text> | 161 | </text> |
162 | 162 | ||
163 | <text name="forgot_password_text" | 163 | <text name="forgot_password_text" |
164 | bottom="25" left="-210" height="16" width="200" | 164 | bottom="49" left="-210" height="16" width="200" |
165 | follows="right|bottom" h_pad="0" halign="right" v_pad="0" | 165 | follows="right|bottom" h_pad="0" halign="right" v_pad="0" |
166 | bg_visible="false" drop_shadow_visible="true" | 166 | bg_visible="false" drop_shadow_visible="true" |
167 | border_visible="false" border_drop_shadow_visible="false" | 167 | border_visible="false" border_drop_shadow_visible="false" |
@@ -174,7 +174,7 @@ | |||
174 | <!-- CHANNEL & VERSION --> | 174 | <!-- CHANNEL & VERSION --> |
175 | 175 | ||
176 | <text name="channel_text" | 176 | <text name="channel_text" |
177 | bottom="5" left="-310" height="16" width="300" | 177 | bottom="29" left="-310" height="16" width="300" |
178 | follows="right|bottom" h_pad="0" halign="right" v_pad="0" | 178 | follows="right|bottom" h_pad="0" halign="right" v_pad="0" |
179 | bg_visible="false" drop_shadow_visible="true" | 179 | bg_visible="false" drop_shadow_visible="true" |
180 | border_visible="false" border_drop_shadow_visible="false" | 180 | border_visible="false" border_drop_shadow_visible="false" |
@@ -182,4 +182,11 @@ | |||
182 | hover="true" hover_color="50 115 185"> | 182 | hover="true" hover_color="50 115 185"> |
183 | [CHANNEL] [VERSION] | 183 | [CHANNEL] [VERSION] |
184 | </text> | 184 | </text> |
185 | |||
186 | |||
187 | <web_browser name="news_bar" | ||
188 | bottom="0" top="20" left="0" right="-1" | ||
189 | border_visible="true" follows="left|bottom|right" | ||
190 | start_url="data:text/html,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody bgcolor=%22#000%22%3E%3C/body%3E%3C/html%3E" /> | ||
191 | |||
185 | </panel> | 192 | </panel> |