diff options
author | Jacek Antonelli | 2011-02-24 04:26:39 -0600 |
---|---|---|
committer | Jacek Antonelli | 2011-02-24 04:42:59 -0600 |
commit | eed92468eb469420928d286d112f637cdf9e9c82 (patch) | |
tree | 6d423751293da148a79b8f83f178967c6dbc29a7 /linden/indra | |
parent | gio-2.0 is not used on Mac. (diff) | |
download | meta-impy-eed92468eb469420928d286d112f637cdf9e9c82.zip meta-impy-eed92468eb469420928d286d112f637cdf9e9c82.tar.gz meta-impy-eed92468eb469420928d286d112f637cdf9e9c82.tar.bz2 meta-impy-eed92468eb469420928d286d112f637cdf9e9c82.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 'linden/indra')
-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 f57cc12..707abc7 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -486,6 +486,17 @@ | |||
486 | <key>Value</key> | 486 | <key>Value</key> |
487 | <integer>1</integer> | 487 | <integer>1</integer> |
488 | </map> | 488 | </map> |
489 | <key>NewsBarURL</key> | ||
490 | <map> | ||
491 | <key>Comment</key> | ||
492 | <string>URL to load in the news bar on the login screen</string> | ||
493 | <key>Persist</key> | ||
494 | <integer>1</integer> | ||
495 | <key>Type</key> | ||
496 | <string>String</string> | ||
497 | <key>Value</key> | ||
498 | <string>http://app.kokuaviewer.org/news/</string> | ||
499 | </map> | ||
489 | <key>ObjectIMColor</key> | 500 | <key>ObjectIMColor</key> |
490 | <map> | 501 | <map> |
491 | <key>Comment</key> | 502 | <key>Comment</key> |
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index 23b7785..d09875b 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp | |||
@@ -305,17 +305,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, | |||
305 | // make links open in external browser | 305 | // make links open in external browser |
306 | web_browser->setOpenInExternalBrowser( true ); | 306 | web_browser->setOpenInExternalBrowser( true ); |
307 | 307 | ||
308 | // 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) | ||
309 | LLRect htmlRect = getRect(); | ||
310 | #if USE_VIEWER_AUTH | ||
311 | htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY(), getRect().getWidth() + 6, getRect().getHeight()); | ||
312 | #else | ||
313 | htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY() + 40, getRect().getWidth() + 6, getRect().getHeight() - 78 ); | ||
314 | #endif | ||
315 | web_browser->setRect( htmlRect ); | ||
316 | web_browser->reshape( htmlRect.getWidth(), htmlRect.getHeight(), TRUE ); | ||
317 | reshape( getRect().getWidth(), getRect().getHeight(), 1 ); | ||
318 | |||
319 | // kick off a request to grab the url manually | 308 | // kick off a request to grab the url manually |
320 | gResponsePtr = LLIamHereLogin::build( this ); | 309 | gResponsePtr = LLIamHereLogin::build( this ); |
321 | std::string login_page = gSavedSettings.getString("LoginPage"); | 310 | std::string login_page = gSavedSettings.getString("LoginPage"); |
@@ -330,6 +319,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, | |||
330 | refreshLocation( false ); | 319 | refreshLocation( false ); |
331 | #endif | 320 | #endif |
332 | 321 | ||
322 | loadNewsBar(); | ||
323 | |||
333 | LLFirstUse::useLoginScreen(); | 324 | LLFirstUse::useLoginScreen(); |
334 | } | 325 | } |
335 | 326 | ||
@@ -417,13 +408,20 @@ void LLPanelLogin::draw() | |||
417 | S32 width = getRect().getWidth(); | 408 | S32 width = getRect().getWidth(); |
418 | S32 height = getRect().getHeight(); | 409 | S32 height = getRect().getHeight(); |
419 | 410 | ||
411 | S32 news_bar_height = 0; | ||
412 | LLWebBrowserCtrl* news_bar = getChild<LLWebBrowserCtrl>("news_bar"); | ||
413 | if (news_bar) | ||
414 | { | ||
415 | news_bar_height = news_bar->getRect().getHeight(); | ||
416 | } | ||
417 | |||
420 | if ( mHtmlAvailable ) | 418 | if ( mHtmlAvailable ) |
421 | { | 419 | { |
422 | #if !USE_VIEWER_AUTH | 420 | #if !USE_VIEWER_AUTH |
423 | // draw a background box in black | 421 | // draw a background box in black |
424 | gl_rect_2d( 0, height - 264, width, 264, LLColor4( 0.0f, 0.0f, 0.0f, 1.f ) ); | 422 | gl_rect_2d( 0, height - 264 + news_bar_height, width, 264, LLColor4( 0.0f, 0.0f, 0.0f, 1.f ) ); |
425 | // draw the bottom part of the background image - just the blue background to the native client UI | 423 | // draw the bottom part of the background image - just the blue background to the native client UI |
426 | mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight()); | 424 | mLogoImage->draw(0, -264 + news_bar_height, width + 8, mLogoImage->getHeight()); |
427 | #endif | 425 | #endif |
428 | } | 426 | } |
429 | else | 427 | else |
@@ -1146,3 +1144,75 @@ void LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) | |||
1146 | } | 1144 | } |
1147 | } | 1145 | } |
1148 | */ | 1146 | */ |
1147 | |||
1148 | |||
1149 | bool LLPanelLogin::loadNewsBar() | ||
1150 | { | ||
1151 | std::string news_url = gSavedSettings.getString("NewsBarURL"); | ||
1152 | |||
1153 | if (news_url.empty()) | ||
1154 | { | ||
1155 | return false; | ||
1156 | } | ||
1157 | |||
1158 | LLWebBrowserCtrl* news_bar = getChild<LLWebBrowserCtrl>("news_bar"); | ||
1159 | |||
1160 | if (!news_bar) | ||
1161 | { | ||
1162 | return false; | ||
1163 | } | ||
1164 | |||
1165 | // *HACK: Not sure how else to make LLWebBrowserCtrl respect user's | ||
1166 | // preference when opening links with target="_blank". -Jacek | ||
1167 | if (gSavedSettings.getBOOL("UseExternalBrowser")) | ||
1168 | { | ||
1169 | news_bar->setOpenInExternalBrowser( true ); | ||
1170 | news_bar->setOpenInInternalBrowser( false ); | ||
1171 | } | ||
1172 | else | ||
1173 | { | ||
1174 | news_bar->setOpenInExternalBrowser( false ); | ||
1175 | news_bar->setOpenInInternalBrowser( true ); | ||
1176 | } | ||
1177 | |||
1178 | |||
1179 | std::ostringstream full_url; | ||
1180 | |||
1181 | full_url << news_url; | ||
1182 | |||
1183 | // Append a "?" if the URL doesn't already have query params. | ||
1184 | if (LLURI(news_url).queryMap().size() == 0) | ||
1185 | { | ||
1186 | full_url << "?"; | ||
1187 | } | ||
1188 | |||
1189 | std::string channel = gSavedSettings.getString("VersionChannelName"); | ||
1190 | std::string skin = gSavedSettings.getString("SkinCurrent"); | ||
1191 | |||
1192 | std::string version = | ||
1193 | llformat("%d.%d.%d", | ||
1194 | ViewerVersion::getImpMajorVersion(), | ||
1195 | ViewerVersion::getImpMinorVersion(), | ||
1196 | ViewerVersion::getImpPatchVersion()); | ||
1197 | if (!ViewerVersion::getImpTestVersion().empty()) | ||
1198 | { | ||
1199 | version += " " + ViewerVersion::getImpTestVersion(); | ||
1200 | } | ||
1201 | |||
1202 | char* curl_channel = curl_escape(channel.c_str(), 0); | ||
1203 | char* curl_version = curl_escape(version.c_str(), 0); | ||
1204 | char* curl_skin = curl_escape(skin.c_str(), 0); | ||
1205 | |||
1206 | full_url << "&channel=" << curl_channel; | ||
1207 | full_url << "&version=" << curl_version; | ||
1208 | full_url << "&skin=" << curl_skin; | ||
1209 | |||
1210 | curl_free(curl_channel); | ||
1211 | curl_free(curl_version); | ||
1212 | curl_free(curl_skin); | ||
1213 | |||
1214 | news_bar->navigateTo( full_url.str() ); | ||
1215 | |||
1216 | |||
1217 | return true; | ||
1218 | } | ||
diff --git a/linden/indra/newview/llpanellogin.h b/linden/indra/newview/llpanellogin.h index 15c2d28..386d201 100644 --- a/linden/indra/newview/llpanellogin.h +++ b/linden/indra/newview/llpanellogin.h | |||
@@ -84,6 +84,9 @@ public: | |||
84 | static void setAlwaysRefresh(bool refresh); | 84 | static void setAlwaysRefresh(bool refresh); |
85 | static void mungePassword(LLUICtrl* caller, void* user_data); | 85 | static void mungePassword(LLUICtrl* caller, void* user_data); |
86 | 86 | ||
87 | /// Load the news bar web page, return true if successful. | ||
88 | bool loadNewsBar(); | ||
89 | |||
87 | private: | 90 | private: |
88 | static void onClickConnect(void*); | 91 | static void onClickConnect(void*); |
89 | static void onClickGrid(void*); | 92 | 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 dda5e4d..a60beac 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="600" left="0" right="800" |
9 | border_visible="false" follows="top|left|bottom|right" | 9 | border_visible="false" follows="top|left|bottom|right" |
10 | start_url="data:text/html,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody bgcolor=%22#000000%22 text=%22ffffff%22%3E%3Ch1%3E%3Ctt%3Eloading...%3C/tt%3E%3C/h1%3E %3C/body%3E %3C/html%3E" /> | 10 | start_url="data:text/html,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody bgcolor=%22#000000%22 text=%22ffffff%22%3E%3Ch1%3E%3Ctt%3Eloading...%3C/tt%3E%3C/h1%3E %3C/body%3E %3C/html%3E" /> |
11 | <string name="real_url"> | 11 | <string name="real_url"> |
@@ -19,7 +19,7 @@ | |||
19 | <!-- START LOCATION --> | 19 | <!-- START LOCATION --> |
20 | 20 | ||
21 | <text name="start_location_text" | 21 | <text name="start_location_text" |
22 | bottom="8" left="10" height="16" right="115" | 22 | bottom="32" left="10" height="16" right="115" |
23 | follows="left|bottom" h_pad="0" halign="right" v_pad="0" | 23 | follows="left|bottom" h_pad="0" halign="right" v_pad="0" |
24 | bg_visible="false" drop_shadow_visible="true" | 24 | bg_visible="false" drop_shadow_visible="true" |
25 | border_visible="false" border_drop_shadow_visible="false" | 25 | border_visible="false" border_drop_shadow_visible="false" |
@@ -45,7 +45,7 @@ | |||
45 | <!-- FIRST NAME --> | 45 | <!-- FIRST NAME --> |
46 | 46 | ||
47 | <text name="first_name_text" | 47 | <text name="first_name_text" |
48 | bottom="56" left="24" height="16" width="120" | 48 | bottom="80" left="24" height="16" width="120" |
49 | follows="left|bottom" h_pad="0" halign="left" v_pad="0" | 49 | follows="left|bottom" h_pad="0" halign="left" v_pad="0" |
50 | bg_visible="false" drop_shadow_visible="true" | 50 | bg_visible="false" drop_shadow_visible="true" |
51 | border_visible="false" border_drop_shadow_visible="false" | 51 | border_visible="false" border_drop_shadow_visible="false" |
@@ -106,7 +106,7 @@ | |||
106 | <!-- GRIDS --> | 106 | <!-- GRIDS --> |
107 | 107 | ||
108 | <text name="grid_text" | 108 | <text name="grid_text" |
109 | bottom="56" left_delta="150" height="16" width="120" | 109 | bottom="80" left_delta="150" height="16" width="120" |
110 | follows="left|bottom" h_pad="0" halign="left" v_pad="0" | 110 | follows="left|bottom" h_pad="0" halign="left" v_pad="0" |
111 | bg_visible="false" drop_shadow_visible="true" | 111 | bg_visible="false" drop_shadow_visible="true" |
112 | border_visible="false" border_drop_shadow_visible="false" | 112 | border_visible="false" border_drop_shadow_visible="false" |
@@ -126,7 +126,7 @@ | |||
126 | <!-- LOG IN --> | 126 | <!-- LOG IN --> |
127 | 127 | ||
128 | <button name="connect_btn" label="Log In" | 128 | <button name="connect_btn" label="Log In" |
129 | bottom="34" left_delta="140" height="24" width="120" | 129 | bottom="58" left_delta="140" height="24" width="120" |
130 | follows="left|bottom" font="SansSerif" halign="center" | 130 | follows="left|bottom" font="SansSerif" halign="center" |
131 | mouse_opaque="true" scale_image="TRUE" /> | 131 | mouse_opaque="true" scale_image="TRUE" /> |
132 | 132 | ||
@@ -134,7 +134,7 @@ | |||
134 | <!-- ACCOUNT / FORGOT PASSWORD --> | 134 | <!-- ACCOUNT / FORGOT PASSWORD --> |
135 | 135 | ||
136 | <text name="create_new_account_text" | 136 | <text name="create_new_account_text" |
137 | bottom="45" left="-210" height="16" width="200" | 137 | bottom="69" left="-210" height="16" width="200" |
138 | follows="right|bottom" h_pad="0" halign="right" v_pad="0" | 138 | follows="right|bottom" h_pad="0" halign="right" v_pad="0" |
139 | bg_visible="false" drop_shadow_visible="true" | 139 | bg_visible="false" drop_shadow_visible="true" |
140 | border_visible="false" border_drop_shadow_visible="false" | 140 | border_visible="false" border_drop_shadow_visible="false" |
@@ -144,7 +144,7 @@ | |||
144 | </text> | 144 | </text> |
145 | 145 | ||
146 | <text name="forgot_password_text" | 146 | <text name="forgot_password_text" |
147 | bottom="25" left="-210" height="16" width="200" | 147 | bottom="49" left="-210" height="16" width="200" |
148 | follows="right|bottom" h_pad="0" halign="right" v_pad="0" | 148 | follows="right|bottom" h_pad="0" halign="right" v_pad="0" |
149 | bg_visible="false" drop_shadow_visible="true" | 149 | bg_visible="false" drop_shadow_visible="true" |
150 | border_visible="false" border_drop_shadow_visible="false" | 150 | border_visible="false" border_drop_shadow_visible="false" |
@@ -157,7 +157,7 @@ | |||
157 | <!-- CHANNEL & VERSION --> | 157 | <!-- CHANNEL & VERSION --> |
158 | 158 | ||
159 | <text name="channel_text" | 159 | <text name="channel_text" |
160 | bottom="5" left="-310" height="16" width="300" | 160 | bottom="29" left="-310" height="16" width="300" |
161 | follows="right|bottom" h_pad="0" halign="right" v_pad="0" | 161 | follows="right|bottom" h_pad="0" halign="right" v_pad="0" |
162 | bg_visible="false" drop_shadow_visible="true" | 162 | bg_visible="false" drop_shadow_visible="true" |
163 | border_visible="false" border_drop_shadow_visible="false" | 163 | border_visible="false" border_drop_shadow_visible="false" |
@@ -165,4 +165,11 @@ | |||
165 | hover="true" hover_color="50 115 185"> | 165 | hover="true" hover_color="50 115 185"> |
166 | [CHANNEL] [VERSION] | 166 | [CHANNEL] [VERSION] |
167 | </text> | 167 | </text> |
168 | |||
169 | |||
170 | <web_browser name="news_bar" | ||
171 | bottom="0" top="20" left="0" right="800" | ||
172 | border_visible="true" follows="left|bottom|right" | ||
173 | start_url="data:text/html,%3Chtml%3E%3Chead%3E%3C/head%3E%3Cbody bgcolor=%22#000%22%3E%3C/body%3E%3C/html%3E" /> | ||
174 | |||
168 | </panel> | 175 | </panel> |