summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermediabrowser.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2010-09-16 16:56:28 -0700
committerRichard Linden <none@none>2010-09-16 16:56:28 -0700
commitf2a297a9599fe64ec2700fe6845ec0ec6eddf410 (patch)
treea46b196d7b5df872c910bca1b72097a253d251a9 /indra/newview/llfloatermediabrowser.cpp
parentd6f1f79ced7bb7fa0bb70e41c65f7d7de9c7a306 (diff)
parent7b7d8ffc22d3af3186f96d57f1276411f558d6f1 (diff)
merge
Diffstat (limited to 'indra/newview/llfloatermediabrowser.cpp')
-rw-r--r--indra/newview/llfloatermediabrowser.cpp109
1 files changed, 7 insertions, 102 deletions
diff --git a/indra/newview/llfloatermediabrowser.cpp b/indra/newview/llfloatermediabrowser.cpp
index 751304588b..d20092e344 100644
--- a/indra/newview/llfloatermediabrowser.cpp
+++ b/indra/newview/llfloatermediabrowser.cpp
@@ -74,11 +74,11 @@ void LLFloaterMediaBrowser::create(const std::string &url, const std::string& ta
}
else
{
- // create a unique tag for this instance
- LLUUID id;
- id.generate();
- tag = id.asString();
- }
+ // create a unique tag for this instance
+ LLUUID id;
+ id.generate();
+ tag = id.asString();
+ }
}
S32 browser_window_limit = gSavedSettings.getS32("MediaBrowserWindowLimit");
@@ -149,8 +149,8 @@ void LLFloaterMediaBrowser::geometryChanged(const std::string &uuid, S32 x, S32
{
i->geometryChanged(x, y, width, height);
return;
- }
- }
+ }
+}
}
void LLFloaterMediaBrowser::geometryChanged(S32 x, S32 y, S32 width, S32 height)
@@ -213,16 +213,12 @@ void LLFloaterMediaBrowser::draw()
BOOL LLFloaterMediaBrowser::postBuild()
{
mBrowser = getChild<LLMediaCtrl>("browser");
- mBrowser->setMediaID(mKey);
mBrowser->addObserver(this);
mAddressCombo = getChild<LLComboBox>("address");
mAddressCombo->setCommitCallback(onEnterAddress, this);
mAddressCombo->sortByName();
- LLButton& notification_close = getChildRef<LLButton>("close_notification");
- notification_close.setClickedCallback(boost::bind(&LLFloaterMediaBrowser::onCloseNotification, this), NULL);
-
childSetAction("back", onClickBack, this);
childSetAction("forward", onClickForward, this);
childSetAction("reload", onClickRefresh, this);
@@ -326,73 +322,6 @@ void LLFloaterMediaBrowser::setCurrentURL(const std::string& url)
getChildView("reload")->setEnabled(TRUE);
}
-void LLFloaterMediaBrowser::showNotification(LLNotificationPtr notify)
-{
- mCurNotification = notify;
-
- // add popup here
- LLSD payload = notify->getPayload();
-
- LLNotificationFormPtr formp = notify->getForm();
- LLLayoutPanel& panel = getChildRef<LLLayoutPanel>("notification_area");
- panel.setVisible(true);
- panel.getChild<LLUICtrl>("notification_icon")->setValue(notify->getIcon());
- panel.getChild<LLUICtrl>("notification_text")->setValue(notify->getMessage());
- panel.getChild<LLUICtrl>("notification_text")->setToolTip(notify->getMessage());
- LLNotificationForm::EIgnoreType ignore_type = formp->getIgnoreType();
- LLLayoutPanel& form_elements = panel.getChildRef<LLLayoutPanel>("form_elements");
-
- const S32 FORM_PADDING_HORIZONTAL = 10;
- const S32 FORM_PADDING_VERTICAL = 5;
- S32 cur_x = FORM_PADDING_HORIZONTAL;
-
- if (ignore_type != LLNotificationForm::IGNORE_NO)
- {
- LLCheckBoxCtrl::Params checkbox_p;
- checkbox_p.name = "ignore_check";
- checkbox_p.rect = LLRect(cur_x, form_elements.getRect().getHeight() - FORM_PADDING_VERTICAL, cur_x, FORM_PADDING_VERTICAL);
- checkbox_p.label = formp->getIgnoreMessage();
- checkbox_p.label_text.text_color = LLColor4::black;
- checkbox_p.commit_callback.function = boost::bind(&LLFloaterMediaBrowser::onClickIgnore, this, _1);
-
- LLCheckBoxCtrl* check = LLUICtrlFactory::create<LLCheckBoxCtrl>(checkbox_p);
- check->setRect(check->getBoundingRect());
- form_elements.addChild(check);
- cur_x = check->getRect().mRight + FORM_PADDING_HORIZONTAL;
- }
-
- for (S32 i = 0; i < formp->getNumElements(); i++)
- {
- LLSD form_element = formp->getElement(i);
- if (form_element["type"].asString() == "button")
- {
- LLButton::Params button_p;
- button_p.name = form_element["name"];
- button_p.label = form_element["text"];
- button_p.rect = LLRect(cur_x, form_elements.getRect().getHeight() - FORM_PADDING_VERTICAL, cur_x, FORM_PADDING_VERTICAL);
- button_p.commit_callback.function = boost::bind(&LLFloaterMediaBrowser::onClickNotificationButton, this, form_element["name"].asString());
- button_p.auto_resize = true;
-
- LLButton* button = LLUICtrlFactory::create<LLButton>(button_p);
- button->autoResize();
- form_elements.addChild(button);
-
- cur_x = button->getRect().mRight + FORM_PADDING_HORIZONTAL;
- }
- }
-
-
- form_elements.reshape(cur_x, form_elements.getRect().getHeight());
-
- //LLWeb::loadURL(payload["url"], payload["target"]);
-}
-
-void LLFloaterMediaBrowser::hideNotification()
-{
- LLLayoutPanel& panel = getChildRef<LLLayoutPanel>("notification_area");
- panel.setVisible(FALSE);
-}
-
//static
void LLFloaterMediaBrowser::onEnterAddress(LLUICtrl* ctrl, void* user_data)
{
@@ -526,28 +455,4 @@ void LLFloaterMediaBrowser::openMedia(const std::string& media_url, const std::s
setCurrentURL(media_url);
}
-void LLFloaterMediaBrowser::onCloseNotification()
-{
- LLNotifications::instance().cancel(mCurNotification);
-}
-
-void LLFloaterMediaBrowser::onClickIgnore(LLUICtrl* ctrl)
-{
- bool check = ctrl->getValue().asBoolean();
- if (mCurNotification && mCurNotification->getForm()->getIgnoreType() == LLNotificationForm::IGNORE_SHOW_AGAIN)
- {
- // question was "show again" so invert value to get "ignore"
- check = !check;
- }
- mCurNotification->setIgnored(check);
-}
-
-void LLFloaterMediaBrowser::onClickNotificationButton(const std::string& name)
-{
- if (!mCurNotification) return;
- LLSD response = mCurNotification->getResponseTemplate();
- response[name] = true;
-
- mCurNotification->respond(response);
-}