diff options
author | McCabe Maxsted | 2009-11-09 15:38:46 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-11-09 15:38:46 -0700 |
commit | a7395832cd58596098e04882d29b8defa8ef905c (patch) | |
tree | 92c680d1239b67aa311ed94dce9f4c4f643dd88b /linden/indra/newview | |
parent | Moved 1.2 alerts to the new notification system (diff) | |
download | meta-impy-a7395832cd58596098e04882d29b8defa8ef905c.zip meta-impy-a7395832cd58596098e04882d29b8defa8ef905c.tar.gz meta-impy-a7395832cd58596098e04882d29b8defa8ef905c.tar.bz2 meta-impy-a7395832cd58596098e04882d29b8defa8ef905c.tar.xz |
Media browser now compiles (TODO: rewrite this file again)
Diffstat (limited to 'linden/indra/newview')
-rw-r--r-- | linden/indra/newview/llfloaterhtmlhelp.cpp | 47 | ||||
-rw-r--r-- | linden/indra/newview/llfloaterhtmlhelp.h | 4 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/notifications.xml | 2 |
3 files changed, 51 insertions, 2 deletions
diff --git a/linden/indra/newview/llfloaterhtmlhelp.cpp b/linden/indra/newview/llfloaterhtmlhelp.cpp index 9f07e0f..8de489a 100644 --- a/linden/indra/newview/llfloaterhtmlhelp.cpp +++ b/linden/indra/newview/llfloaterhtmlhelp.cpp | |||
@@ -62,7 +62,9 @@ LLFloaterMediaBrowser::LLFloaterMediaBrowser(const LLSD& media_data) | |||
62 | 62 | ||
63 | void LLFloaterMediaBrowser::draw() | 63 | void LLFloaterMediaBrowser::draw() |
64 | { | 64 | { |
65 | childSetEnabled("go", !mAddressCombo->getValue().asString().empty()); | 65 | BOOL url_exists = !mAddressCombo->getValue().asString().empty(); |
66 | childSetEnabled("go", url_exists); | ||
67 | childSetEnabled("set_home", url_exists); | ||
66 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); | 68 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); |
67 | if(parcel) | 69 | if(parcel) |
68 | { | 70 | { |
@@ -88,6 +90,8 @@ BOOL LLFloaterMediaBrowser::postBuild() | |||
88 | childSetAction("close", onClickClose, this); | 90 | childSetAction("close", onClickClose, this); |
89 | childSetAction("open_browser", onClickOpenWebBrowser, this); | 91 | childSetAction("open_browser", onClickOpenWebBrowser, this); |
90 | childSetAction("assign", onClickAssign, this); | 92 | childSetAction("assign", onClickAssign, this); |
93 | childSetAction("home", onClickHome, this); | ||
94 | childSetAction("set_home", onClickSetHome, this); | ||
91 | 95 | ||
92 | buildURLHistory(); | 96 | buildURLHistory(); |
93 | return TRUE; | 97 | return TRUE; |
@@ -150,6 +154,7 @@ void LLFloaterMediaBrowser::onLocationChange( const EventType& eventIn ) | |||
150 | childSetEnabled("back", mBrowser->canNavigateBack()); | 154 | childSetEnabled("back", mBrowser->canNavigateBack()); |
151 | childSetEnabled("forward", mBrowser->canNavigateForward()); | 155 | childSetEnabled("forward", mBrowser->canNavigateForward()); |
152 | childSetEnabled("reload", TRUE); | 156 | childSetEnabled("reload", TRUE); |
157 | gSavedSettings.setString("BrowserLastVisited", truncated_url); | ||
153 | } | 158 | } |
154 | 159 | ||
155 | LLFloaterMediaBrowser* LLFloaterMediaBrowser::showInstance(const LLSD& media_url) | 160 | LLFloaterMediaBrowser* LLFloaterMediaBrowser::showInstance(const LLSD& media_url) |
@@ -160,6 +165,46 @@ LLFloaterMediaBrowser* LLFloaterMediaBrowser::showInstance(const LLSD& media_url | |||
160 | return floaterp; | 165 | return floaterp; |
161 | } | 166 | } |
162 | 167 | ||
168 | //static | ||
169 | void LLFloaterMediaBrowser::toggle() | ||
170 | { | ||
171 | LLFloaterMediaBrowser* self = LLFloaterMediaBrowser::getInstance(); | ||
172 | |||
173 | if(self->getVisible()) | ||
174 | { | ||
175 | self->close(); | ||
176 | } | ||
177 | else | ||
178 | { | ||
179 | //Show home url if new session, last visited if not | ||
180 | std::string last_url = gSavedSettings.getString("BrowserLastVisited"); | ||
181 | if(last_url.empty()) | ||
182 | last_url = gSavedSettings.getString("BrowserHome"); | ||
183 | showInstance(last_url); | ||
184 | } | ||
185 | } | ||
186 | |||
187 | //static | ||
188 | void LLFloaterMediaBrowser::helpF1() | ||
189 | { | ||
190 | std::string url = gSavedSettings.getString("HelpSupportURL"); | ||
191 | LLSD payload; | ||
192 | payload["url"] = url; | ||
193 | |||
194 | LLNotifications::instance().add("ClickOpenF1Help", LLSD(), payload, onClickF1HelpLoadURL); | ||
195 | } | ||
196 | |||
197 | // static | ||
198 | bool LLFloaterMediaBrowser::onClickF1HelpLoadURL(const LLSD& notification, const LLSD& response) | ||
199 | { | ||
200 | S32 option = LLNotification::getSelectedOption(notification, response); | ||
201 | if (option == 0) | ||
202 | { | ||
203 | LLWeb::loadURL(notification["payload"]["url"].asString()); | ||
204 | } | ||
205 | return false; | ||
206 | } | ||
207 | |||
163 | //static | 208 | //static |
164 | void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data) | 209 | void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data) |
165 | { | 210 | { |
diff --git a/linden/indra/newview/llfloaterhtmlhelp.h b/linden/indra/newview/llfloaterhtmlhelp.h index deb5c4c..5b09634 100644 --- a/linden/indra/newview/llfloaterhtmlhelp.h +++ b/linden/indra/newview/llfloaterhtmlhelp.h | |||
@@ -66,6 +66,9 @@ public: | |||
66 | void buildURLHistory(); | 66 | void buildURLHistory(); |
67 | 67 | ||
68 | static LLFloaterMediaBrowser* showInstance(const LLSD& id); | 68 | static LLFloaterMediaBrowser* showInstance(const LLSD& id); |
69 | |||
70 | static void toggle(); | ||
71 | static void helpF1(); | ||
69 | static void onEnterAddress(LLUICtrl* ctrl, void* user_data); | 72 | static void onEnterAddress(LLUICtrl* ctrl, void* user_data); |
70 | static void onClickRefresh(void* user_data); | 73 | static void onClickRefresh(void* user_data); |
71 | static void onClickBack(void* user_data); | 74 | static void onClickBack(void* user_data); |
@@ -76,6 +79,7 @@ public: | |||
76 | static void onClickAssign(void* user_data); | 79 | static void onClickAssign(void* user_data); |
77 | static void onClickHome(void* user_data); | 80 | static void onClickHome(void* user_data); |
78 | static void onClickSetHome(void* user_data); | 81 | static void onClickSetHome(void* user_data); |
82 | static bool onClickF1HelpLoadURL(const LLSD& notification, const LLSD& response); | ||
79 | 83 | ||
80 | private: | 84 | private: |
81 | LLWebBrowserCtrl* mBrowser; | 85 | LLWebBrowserCtrl* mBrowser; |
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 8fe2db0..665b972 100644 --- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml | |||
@@ -4107,7 +4107,7 @@ Add this Ability to '[ROLE_NAME]'? | |||
4107 | type="alertmodal"> | 4107 | type="alertmodal"> |
4108 | Visit the [SECOND_LIFE] Support Website? (note: this is not an Imprudence Help site) | 4108 | Visit the [SECOND_LIFE] Support Website? (note: this is not an Imprudence Help site) |
4109 | <usetemplate | 4109 | <usetemplate |
4110 | ignoretext="When visiting the Second Life Support Website." | 4110 | ignoretext="When visiting the Support Website." |
4111 | name="okcancelignore" | 4111 | name="okcancelignore" |
4112 | notext="Cancel" | 4112 | notext="Cancel" |
4113 | yestext="Go"/> | 4113 | yestext="Go"/> |