diff options
author | McCabe Maxsted | 2008-10-18 17:31:02 -0700 |
---|---|---|
committer | Jacek Antonelli | 2008-12-15 18:48:59 -0600 |
commit | 5043867f05a39c1f634a1e4c0f930de4efa16c72 (patch) | |
tree | 92855ed3c45378ac19667b65747acc4f524dccce /linden | |
parent | Merged 'mccabe/VWR-3336' into next (diff) | |
download | meta-impy-5043867f05a39c1f634a1e4c0f930de4efa16c72.zip meta-impy-5043867f05a39c1f634a1e4c0f930de4efa16c72.tar.gz meta-impy-5043867f05a39c1f634a1e4c0f930de4efa16c72.tar.bz2 meta-impy-5043867f05a39c1f634a1e4c0f930de4efa16c72.tar.xz |
Added Home button functionality to the web browser.
Diffstat (limited to 'linden')
4 files changed, 39 insertions, 6 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 1f0f240..8093521 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -675,16 +675,16 @@ | |||
675 | <key>Value</key> | 675 | <key>Value</key> |
676 | <integer>0</integer> | 676 | <integer>0</integer> |
677 | </map> | 677 | </map> |
678 | <key>BrowserHomePage</key> | 678 | <key>BrowserHome</key> |
679 | <map> | 679 | <map> |
680 | <key>Comment</key> | 680 | <key>Comment</key> |
681 | <string>[NOT USED]</string> | 681 | <string>Inworld browser home page</string> |
682 | <key>Persist</key> | 682 | <key>Persist</key> |
683 | <integer>1</integer> | 683 | <integer>1</integer> |
684 | <key>Type</key> | 684 | <key>Type</key> |
685 | <string>String</string> | 685 | <string>String</string> |
686 | <key>Value</key> | 686 | <key>Value</key> |
687 | <string>http://www.secondlife.com</string> | 687 | <string>http://www.imprudenceviewer.org</string> |
688 | </map> | 688 | </map> |
689 | <key>BlockAvatarAppearanceMessages</key> | 689 | <key>BlockAvatarAppearanceMessages</key> |
690 | <map> | 690 | <map> |
diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp index d6d249e..a9d2e46 100644 --- a/linden/indra/newview/llfloaterhtmlhelp.cpp +++ b/linden/indra/newview/llfloaterhtmlhelp.cpp | |||
@@ -58,7 +58,9 @@ LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& media_data) | |||
58 | 58 | ||
59 | void LLFloaterMediaBrowser::draw() | 59 | void LLFloaterMediaBrowser::draw() |
60 | { | 60 | { |
61 | childSetEnabled("go", !mAddressCombo->getValue().asString().empty()); | 61 | BOOL url_exists = !mAddressCombo->getValue().asString().empty(); |
62 | childSetEnabled("go", url_exists); | ||
63 | childSetEnabled("set_home", url_exists); | ||
62 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); | 64 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); |
63 | if(parcel) | 65 | if(parcel) |
64 | { | 66 | { |
@@ -84,6 +86,8 @@ BOOL LLFloaterMediaBrowser::postBuild() | |||
84 | childSetAction("close", onClickClose, this); | 86 | childSetAction("close", onClickClose, this); |
85 | childSetAction("open_browser", onClickOpenWebBrowser, this); | 87 | childSetAction("open_browser", onClickOpenWebBrowser, this); |
86 | childSetAction("assign", onClickAssign, this); | 88 | childSetAction("assign", onClickAssign, this); |
89 | childSetAction("home", onClickHome, this); | ||
90 | childSetAction("set_home", onClickSetHome, this); | ||
87 | 91 | ||
88 | buildURLHistory(); | 92 | buildURLHistory(); |
89 | return TRUE; | 93 | return TRUE; |
@@ -238,6 +242,29 @@ void LLFloaterMediaBrowser::onClickAssign(void* user_data) | |||
238 | 242 | ||
239 | } | 243 | } |
240 | 244 | ||
245 | void LLFloaterMediaBrowser::onClickHome(void* user_data) | ||
246 | { | ||
247 | LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; | ||
248 | if (self) | ||
249 | { | ||
250 | if (self->mBrowser) | ||
251 | { | ||
252 | std::string home_url = gSavedSettings.getString("BrowserHome"); | ||
253 | self->mBrowser->navigateTo(home_url); | ||
254 | } | ||
255 | } | ||
256 | } | ||
257 | |||
258 | void LLFloaterMediaBrowser::onClickSetHome(void* user_data) | ||
259 | { | ||
260 | LLFloaterMediaBrowser* self = (LLFloaterMediaBrowser*)user_data; | ||
261 | std::string url = self->mCurrentURL; | ||
262 | if(!url.empty()) | ||
263 | { | ||
264 | gSavedSettings.setString("BrowserHome", url); | ||
265 | } | ||
266 | } | ||
267 | |||
241 | void LLFloaterMediaBrowser::openMedia(const std::string& media_url) | 268 | void LLFloaterMediaBrowser::openMedia(const std::string& media_url) |
242 | { | 269 | { |
243 | mBrowser->setHomePageUrl(media_url); | 270 | mBrowser->setHomePageUrl(media_url); |
diff --git a/linden/indra/newview/llfloaterhtmlhelp.h b/linden/indra/newview/llfloaterhtmlhelp.h index 7257566..f6da106 100644 --- a/linden/indra/newview/llfloaterhtmlhelp.h +++ b/linden/indra/newview/llfloaterhtmlhelp.h | |||
@@ -73,6 +73,8 @@ public: | |||
73 | static void onClickClose(void* user_data); | 73 | static void onClickClose(void* user_data); |
74 | static void onClickOpenWebBrowser(void* user_data); | 74 | static void onClickOpenWebBrowser(void* user_data); |
75 | static void onClickAssign(void* user_data); | 75 | static void onClickAssign(void* user_data); |
76 | static void onClickHome(void* user_data); | ||
77 | static void onClickSetHome(void* user_data); | ||
76 | 78 | ||
77 | private: | 79 | private: |
78 | LLWebBrowserCtrl* mBrowser; | 80 | LLWebBrowserCtrl* mBrowser; |
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_media_browser.xml b/linden/indra/newview/skins/default/xui/en-us/floater_media_browser.xml index 5b2d310..077ab23 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_media_browser.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_media_browser.xml | |||
@@ -12,9 +12,11 @@ | |||
12 | <button bottom_delta="0" enabled="false" follows="left|top" height="20" label="Reload" | 12 | <button bottom_delta="0" enabled="false" follows="left|top" height="20" label="Reload" |
13 | left_delta="65" name="reload" width="70" /> | 13 | left_delta="65" name="reload" width="70" /> |
14 | <combo_box allow_text_entry="true" bottom_delta="0" follows="left|top|right" height="20" | 14 | <combo_box allow_text_entry="true" bottom_delta="0" follows="left|top|right" height="20" |
15 | left_delta="75" max_chars="255" name="address" width="280" /> | 15 | left_delta="75" max_chars="235" name="address" width="225" /> |
16 | <button bottom_delta="0" enabled="false" follows="right|top" height="20" label="Go" | 16 | <button bottom_delta="0" enabled="false" follows="right|top" height="20" label="Go" |
17 | left_delta="285" name="go" width="55" /> | 17 | left_delta="230" name="go" width="55" /> |
18 | <button bottom_delta="0" enabled="true" follows="right|top" height="20" label="Home" | ||
19 | left_delta="60" name="home" width="55" /> | ||
18 | </layout_panel> | 20 | </layout_panel> |
19 | <layout_panel auto_resize="false" bottom="0" height="20" left="0" | 21 | <layout_panel auto_resize="false" bottom="0" height="20" left="0" |
20 | name="parcel_owner_controls" user_resize="false" width="540"> | 22 | name="parcel_owner_controls" user_resize="false" width="540"> |
@@ -30,6 +32,8 @@ | |||
30 | <check_box bottom="5" control_name="UseExternalBrowser" follows="bottom|left" height="20" | 32 | <check_box bottom="5" control_name="UseExternalBrowser" follows="bottom|left" height="20" |
31 | label="Always open in my web browser" left_delta="190" name="open_always" | 33 | label="Always open in my web browser" left_delta="190" name="open_always" |
32 | width="200" /> | 34 | width="200" /> |
35 | <button bottom="5" enabled="false" follows="bottom|right" height="20" label="Set Home To Here" | ||
36 | left="-265" name="set_home" width="155" /> | ||
33 | <button bottom="5" follows="bottom|right" height="20" label="Close" left="-70" | 37 | <button bottom="5" follows="bottom|right" height="20" label="Close" left="-70" |
34 | name="close" width="70" /> | 38 | name="close" width="70" /> |
35 | </layout_panel> | 39 | </layout_panel> |