diff options
author | Mike Antipov <mantipov@productengine.com> | 2009-11-23 16:29:10 +0200 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2009-11-23 16:29:10 +0200 |
commit | 11ef9f3d41a2e628e1ded8dcb0a306fe328ae0ce (patch) | |
tree | b46431199e8498ff4f9c66e12ba7b414c9c1ab4d | |
parent | 3c4a98ff3cdc756918a2dea0c5d3dd58aa08bca3 (diff) |
Work on normal task EXT-2640 (Create a tabbed IM multifloater)
- disabled Transient & Dockable functionality of IM Floaters to do not have collisions with multifloater
- remove debug attributes in xml
--HG--
branch : product-engine
-rw-r--r-- | indra/newview/llimfloater.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llimfloater.h | 5 | ||||
-rw-r--r-- | indra/newview/llimfloatercontainer.cpp | 17 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_im_container.xml | 6 |
4 files changed, 40 insertions, 13 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 4a487bd5a7..d789139aa8 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -53,6 +53,10 @@ #include "lltransientfloatermgr.h" #include "llinventorymodel.h" +#ifdef USE_IM_CONTAINER + #include "llimfloatercontainer.h" // to replace separate IM Floaters with multifloater container +#endif + LLIMFloater::LLIMFloater(const LLUUID& session_id) @@ -257,7 +261,11 @@ BOOL LLIMFloater::postBuild() //*TODO if session is not initialized yet, add some sort of a warning message like "starting session...blablabla" //see LLFloaterIMPanel for how it is done (IB) +#ifdef USE_IM_CONTAINER + return LLFloater::postBuild(); +#else return LLDockableFloater::postBuild(); +#endif } // virtual @@ -318,6 +326,7 @@ void LLIMFloater::onSlide() //static LLIMFloater* LLIMFloater::show(const LLUUID& session_id) { +#ifndef USE_IM_CONTAINER //hide all LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); @@ -329,12 +338,23 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) floater->setVisible(false); } } +#endif LLIMFloater* floater = LLFloaterReg::showTypedInstance<LLIMFloater>("impanel", session_id); floater->updateMessages(); floater->mInputEditor->setFocus(TRUE); +#ifdef USE_IM_CONTAINER + +// LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; + // TODO: mantipov: use LLTabContainer::RIGHT_OF_CURRENT if it exists + LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END; + + // *TODO: mantipov: validate if floater was torn off. In this case it's no necessary to show container + LLIMFloaterContainer* floater_container = LLFloaterReg::showTypedInstance<LLIMFloaterContainer>("im_container"); + floater_container->addFloater(floater, TRUE, i_pt); +#else if (floater->getDockControl() == NULL) { LLChiclet* chiclet = @@ -352,6 +372,7 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) floater->setDockControl(new LLDockControl(chiclet, floater, floater->getDockTongue(), LLDockControl::TOP, boost::bind(&LLIMFloater::getAllowedRect, floater, _1))); } +#endif return floater; } @@ -368,7 +389,9 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock) (LLNotificationsUI::LLChannelManager::getInstance()-> findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID")))); +#ifndef USE_IM_CONTAINER LLTransientDockableFloater::setDocked(docked, pop_on_undock); +#endif // update notification channel state if(channel) @@ -394,6 +417,7 @@ void LLIMFloater::setVisible(BOOL visible) //static bool LLIMFloater::toggle(const LLUUID& session_id) { +#ifndef USE_IM_CONTAINER LLIMFloater* floater = LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", session_id); if (floater && floater->getVisible() && floater->isDocked()) { @@ -409,6 +433,7 @@ bool LLIMFloater::toggle(const LLUUID& session_id) return true; } else +#endif { // ensure the list of messages is updated when floater is made visible show(session_id); diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index e2d500d821..32cba71f6e 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -33,6 +33,11 @@ #ifndef LL_IMFLOATER_H #define LL_IMFLOATER_H +// This variable is used to show floaters related to chiclets in a Multi Floater Container +// So, this functionality does not require to have IM Floaters as Dockable & Transient +// See EXT-2640. +#define USE_IM_CONTAINER + #include "lltransientdockablefloater.h" #include "lllogchat.h" #include "lltooldraganddrop.h" diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 94017526c8..6e4b3ae214 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -35,9 +35,6 @@ #include "llimfloatercontainer.h"
-// TODO: mantipov: replace with floater_im_session
-#include "llimpanel.h"
-
//
// LLIMFloaterContainer
//
@@ -54,22 +51,24 @@ LLIMFloaterContainer::~LLIMFloaterContainer() BOOL LLIMFloaterContainer::postBuild()
{
- // TODO: mantipov: verify if it is needed
- mTabContainer->lockTabs();
+ // Do not call base postBuild to not connect to mCloseSignal to not close all floaters via Close button
+ // mTabContainer will be initialized in LLMultiFloater::addChild()
return TRUE;
}
void LLIMFloaterContainer::onOpen(const LLSD& key)
{
- // TODO: mantipov: verify if it is needed
+ LLMultiFloater::onOpen(key);
+/*
if (key.isDefined())
{
- LLFloaterIMPanel* impanel = gIMMgr->findFloaterBySession(key.asUUID());
- if (impanel)
+ LLIMFloater* im_floater = LLIMFloater::findInstance(key.asUUID());
+ if (im_floater)
{
- impanel->openFloater();
+ im_floater->openFloater();
}
}
+*/
}
void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml index a1a0aee97b..cf6a4e45bd 100644 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -13,8 +13,6 @@ bg_color="yellow" title="Instant Messages"
width="392">
<tab_container
-background_visible="true"
-bg_alpha_color="green"
follows="left|right|top|bottom"
height="390"
layout="topleft"
@@ -25,7 +23,7 @@ bg_alpha_color="green" top="0"
width="390" />
<icon
- color="red"
+ color="DefaultShadowLight"
enabled="false"
follows="left|right|bottom"
height="17"
@@ -33,6 +31,6 @@ bg_alpha_color="green" layout="bottomleft"
left="1"
name="im_box_tab_container_icon"
- bottom="0"
+ bottom="10"
width="390" />
</multi_floater>
|