diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llavataractions.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llfloaterproperties.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llfloaterwebcontent.cpp | 90 | ||||
-rw-r--r-- | indra/newview/llfloaterwebcontent.h | 10 | ||||
-rw-r--r-- | indra/newview/llpreview.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llviewerfloaterreg.cpp | 16 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_search.xml | 17 |
7 files changed, 89 insertions, 84 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index cd6754facd..5ccd5ff073 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -320,6 +320,7 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa url(url). id(agent_id). show_chrome(show_chrome). + window_class("profile"). preferred_media_size(profile_rect)); } diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index dd12fa64d3..3f00ba39c7 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -887,18 +887,14 @@ void LLFloaterProperties::dirtyAll() LLMultiProperties::LLMultiProperties() : LLMultiFloater(LLSD()) { - // *TODO: There should be a .xml file for this - const LLRect& nextrect = LLFloaterReg::getFloaterRect("properties"); // place where the next properties should show up - if (nextrect.getWidth() > 0) - { - setRect(nextrect); - } - else - { - // start with a small rect in the top-left corner ; will get resized - LLRect rect; - rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeightScaled(), 20, 20); - setRect(rect); + // start with a small rect in the top-left corner ; will get resized + LLRect rect; + rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeightScaled(), 20, 20); + setRect(rect); + LLFloater* last_floater = LLFloaterReg::getLastFloaterInGroup("properties"); + if (last_floater) + { + stackWith(*last_floater); } setTitle(LLTrans::getString("MultiPropertiesTitle")); buildTabContainer(); diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 785441a67e..8aeb5675a5 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -44,14 +44,17 @@ LLFloaterWebContent::_Params::_Params() : url("url"), target("target"), id("id"), + window_class("window_class", "web_content"), show_chrome("show_chrome", true), allow_address_entry("allow_address_entry", true), preferred_media_size("preferred_media_size"), trusted_content("trusted_content", false) {} -LLFloaterWebContent::LLFloaterWebContent( const Params& key ) -: LLFloater( key ) +LLFloaterWebContent::LLFloaterWebContent( const Params& params ) +: LLFloater( params ), + LLInstanceTracker(params.id()), + mUUID(params.id().asString()) { mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this )); mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this )); @@ -64,9 +67,9 @@ LLFloaterWebContent::LLFloaterWebContent( const Params& key ) BOOL LLFloaterWebContent::postBuild() { // these are used in a bunch of places so cache them - mWebBrowser = getChild< LLMediaCtrl >( "webbrowser" ); - mAddressCombo = getChild< LLComboBox >( "address" ); - mStatusBarText = getChild< LLTextBox >( "statusbartext" ); + mWebBrowser = getChild< LLMediaCtrl >( "webbrowser" ); + mAddressCombo = getChild< LLComboBox >( "address" ); + mStatusBarText = getChild< LLTextBox >( "statusbartext" ); mStatusBarProgress = getChild<LLProgressBar>("statusbarprogress" ); // observe browser events @@ -110,10 +113,8 @@ void LLFloaterWebContent::initializeURLHistory() // Get all of the entries in the "browser" collection LLSD browser_history = LLURLHistory::getURLHistory("browser"); - LLSD::array_iterator iter_history = - browser_history.beginArray(); - LLSD::array_iterator end_history = - browser_history.endArray(); + LLSD::array_iterator iter_history = browser_history.beginArray(); + LLSD::array_iterator end_history = browser_history.endArray(); for(; iter_history != end_history; ++iter_history) { std::string url = (*iter_history).asString(); @@ -123,7 +124,7 @@ void LLFloaterWebContent::initializeURLHistory() } //static -void LLFloaterWebContent::create( Params p) +LLFloater* LLFloaterWebContent::create( Params p) { lldebugs << "url = " << p.url() << ", target = " << p.target() << ", uuid = " << p.id().asString() << llendl; @@ -139,7 +140,9 @@ void LLFloaterWebContent::create( Params p) S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit"); - if(LLFloaterReg::findInstance("web_content", p.target()) != NULL) + LLSD sd; + sd["target"] = p.target; + if(LLFloaterReg::findInstance(p.window_class, sd) != NULL) { // There's already a web browser for this tag, so we won't be opening a new window. } @@ -148,7 +151,7 @@ void LLFloaterWebContent::create( Params p) // showInstance will open a new window. Figure out how many web browsers are already open, // and close the least recently opened one if this will put us over the limit. - LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList("web_content"); + LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class); lldebugs << "total instance count is " << instances.size() << llendl; for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++) @@ -163,40 +166,26 @@ void LLFloaterWebContent::create( Params p) } } - LLFloaterReg::showInstance("web_content", p); + return LLFloaterReg::showInstance(p.window_class, p); } //static void LLFloaterWebContent::closeRequest(const std::string &uuid) { - LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("web_content"); - lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl; - for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) + LLFloaterWebContent* floaterp = getInstance(LLUUID(uuid)); + if (floaterp) { - LLFloaterWebContent* i = dynamic_cast<LLFloaterWebContent*>(*iter); - lldebugs << " " << i->mUUID << llendl; - if (i && i->mUUID == uuid) - { - i->closeFloater(false); - return; - } - } + floaterp->closeFloater(false); + } } //static void LLFloaterWebContent::geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height) { - LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("web_content"); - lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl; - for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) + LLFloaterWebContent* floaterp = getInstance(LLUUID(uuid)); + if (floaterp) { - LLFloaterWebContent* i = dynamic_cast<LLFloaterWebContent*>(*iter); - lldebugs << " " << i->mUUID << llendl; - if (i && i->mUUID == uuid) - { - i->geometryChanged(x, y, width, height); - return; - } + floaterp->geometryChanged(x, y, width, height); } } @@ -210,15 +199,21 @@ void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height) getWindow()->getSize(&window_size); // Adjust width and height for the size of the chrome on the web Browser window. - width += getRect().getWidth() - mWebBrowser->getRect().getWidth(); - height += getRect().getHeight() - mWebBrowser->getRect().getHeight(); + LLRect browser_rect; + mWebBrowser->localRectToOtherView(mWebBrowser->getLocalRect(), &browser_rect, this); + S32 requested_browser_bottom = window_size.mY - (y + height); LLRect geom; - geom.setOriginAndSize(x, window_size.mY - (y + height), width, height); + geom.setOriginAndSize(x - browser_rect.mLeft, + requested_browser_bottom - browser_rect.mBottom, + width + getRect().getWidth() - browser_rect.getWidth(), + height + getRect().getHeight() - browser_rect.getHeight()); lldebugs << "geometry change: " << geom << llendl; - - setShape(geom); + + LLRect new_rect; + getParent()->screenRectToLocal(geom, &new_rect); + setShape(new_rect); } void LLFloaterWebContent::open_media(const Params& p) @@ -242,8 +237,12 @@ void LLFloaterWebContent::open_media(const Params& p) if (!p.preferred_media_size().isEmpty()) { - //ignore x, y for now - geometryChanged(getRect().mLeft, getRect().mBottom, p.preferred_media_size().getWidth(), p.preferred_media_size().getHeight()); + LLLayoutStack::updateClass(); + LLRect browser_rect = mWebBrowser->calcScreenRect(); + LLCoordWindow window_size; + getWindow()->getSize(&window_size); + + geometryChanged(browser_rect.mLeft, window_size.mY - browser_rect.mTop, p.preferred_media_size().getWidth(), p.preferred_media_size().getHeight()); } } @@ -258,11 +257,6 @@ void LLFloaterWebContent::onOpen(const LLSD& key) return; } - if (params.target() == params.id().asString()) - { - setRectControl(""); - } - mUUID = params.id().asString(); mWebBrowser->setTrustedContent(params.trusted_content); // tell the browser instance to load the specified URL @@ -279,7 +273,7 @@ void LLFloaterWebContent::onClose(bool app_quitting) // virtual void LLFloaterWebContent::draw() { - // this is asychronous so we need to keep checking + // this is asynchronous so we need to keep checking getChildView( "back" )->setEnabled( mWebBrowser->canNavigateBack() ); getChildView( "forward" )->setEnabled( mWebBrowser->canNavigateForward() ); @@ -421,7 +415,7 @@ void LLFloaterWebContent::onClickStop() // still should happen when we catch the navigate complete event // but sometimes (don't know why) that event isn't sent from Qt - // and we getto a point where the stop button stays active. + // and we ghetto a point where the stop button stays active. getChildView("reload")->setVisible( true ); getChildView("stop")->setVisible( false ); } diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 3a99d49b5a..2e3c6ffd84 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -39,7 +39,8 @@ class LLIconCtrl; class LLFloaterWebContent : public LLFloater, - public LLViewerMediaObserver + public LLViewerMediaObserver, + public LLInstanceTracker<LLFloaterWebContent, LLUUID> { public: LOG_CLASS(LLFloaterWebContent); @@ -47,7 +48,8 @@ public: struct _Params : public LLInitParam::Block<_Params> { Optional<std::string> url, - target; + target, + window_class; Optional<LLUUID> id; Optional<bool> show_chrome, allow_address_entry, @@ -59,11 +61,11 @@ public: typedef LLSDParamAdapter<_Params> Params; - LLFloaterWebContent(const Params& key); + LLFloaterWebContent(const Params& params); void initializeURLHistory(); - static void create(Params); + static LLFloater* create(Params); static void closeRequest(const std::string &uuid); static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height); diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index a90f23d637..119fc95cf0 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -444,18 +444,15 @@ void LLPreview::handleReshape(const LLRect& new_rect, bool by_user) LLMultiPreview::LLMultiPreview() : LLMultiFloater(LLSD()) { - // *TODO: There should be a .xml file for this - const LLRect& nextrect = LLFloaterReg::getFloaterRect("preview"); // place where the next preview should show up - if (nextrect.getWidth() > 0) - { - setRect(nextrect); - } - else + // start with a rect in the top-left corner ; will get resized + LLRect rect; + rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeightScaled(), 200, 400); + setRect(rect); + + LLFloater* last_floater = LLFloaterReg::getLastFloaterInGroup("preview"); + if (last_floater) { - // start with a rect in the top-left corner ; will get resized - LLRect rect; - rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeightScaled(), 200, 400); - setRect(rect); + stackWith(*last_floater); } setTitle(LLTrans::getString("MultiPreviewTitle")); buildTabContainer(); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 0e58f54f8b..77afd0ea22 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -246,15 +246,11 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("publish_classified", "floater_publish_classified.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLPublishClassifiedFloater>); LLFloaterReg::add("telehubs", "floater_telehub.xml",&LLFloaterReg::build<LLFloaterTelehub>); - LLFloaterReg::add("test_inspectors", "floater_test_inspectors.xml", - &LLFloaterReg::build<LLFloaterTestInspectors>); + LLFloaterReg::add("test_inspectors", "floater_test_inspectors.xml", &LLFloaterReg::build<LLFloaterTestInspectors>); //LLFloaterReg::add("test_list_view", "floater_test_list_view.xml",&LLFloaterReg::build<LLFloaterTestListView>); - LLFloaterReg::add("test_textbox", "floater_test_textbox.xml", - &LLFloaterReg::build<LLFloater>); - LLFloaterReg::add("test_text_editor", "floater_test_text_editor.xml", - &LLFloaterReg::build<LLFloater>); - LLFloaterReg::add("test_widgets", "floater_test_widgets.xml", - &LLFloaterReg::build<LLFloater>); + LLFloaterReg::add("test_textbox", "floater_test_textbox.xml", &LLFloaterReg::build<LLFloater>); + LLFloaterReg::add("test_text_editor", "floater_test_text_editor.xml", &LLFloaterReg::build<LLFloater>); + LLFloaterReg::add("test_widgets", "floater_test_widgets.xml", &LLFloaterReg::build<LLFloater>); LLFloaterReg::add("top_objects", "floater_top_objects.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTopObjects>); LLFloaterReg::add("reporter", "floater_report_abuse.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterReporter>); @@ -274,7 +270,9 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("start_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterRunQueue>); LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotRunQueue>); LLFloaterReg::add("snapshot", "floater_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSnapshot>); - LLFloaterReg::add("search", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSearch>); + LLFloaterReg::add("search", "floater_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSearch>); + LLFloaterReg::add("profile", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWebContent>); + LLFloaterUIPreviewUtil::registerFloater(); LLFloaterReg::add("upload_anim", "floater_animation_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterAnimPreview>, "upload"); diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml new file mode 100644 index 0000000000..05b578665d --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + can_resize="true" + height="775" + layout="topleft" + min_height="400" + min_width="500" + name="floater_web_content" + help_topic="floater_web_content" + save_rect="true" + auto_tile="true" + save_visibility="true" + title="" + initial_mime_type="text/html" + width="780" + filename="floater_web_content.xml"/>
\ No newline at end of file |