summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2009-11-23 17:56:14 +0200
committerMike Antipov <mantipov@productengine.com>2009-11-23 17:56:14 +0200
commit3b0bfcb4b7c1370bcf69844d52b92fee0182c8c8 (patch)
treec8ffc9162534bed15386d41a42014e936e82e54b
parent25085a67f4baf341f1ebc26d7ba21e294ec56302 (diff)
parent2f8909209648630bde2200097f52002a1dfb76e1 (diff)
merge
--HG-- branch : product-engine
-rw-r--r--indra/newview/CMakeLists.txt2
-rw-r--r--indra/newview/llimfloater.cpp31
-rw-r--r--indra/newview/llimfloater.h5
-rw-r--r--indra/newview/llimfloatercontainer.cpp96
-rw-r--r--indra/newview/llimfloatercontainer.h61
-rw-r--r--indra/newview/llviewerfloaterreg.cpp2
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_container.xml36
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_session.xml2
8 files changed, 234 insertions, 1 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 46dd045f61..611875a1e2 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -239,6 +239,7 @@ set(viewer_SOURCE_FILES
llhudtext.cpp
llhudview.cpp
llimfloater.cpp
+ llimfloatercontainer.cpp
llimhandler.cpp
llimpanel.cpp
llimview.cpp
@@ -738,6 +739,7 @@ set(viewer_HEADER_FILES
llhudtext.h
llhudview.h
llimfloater.h
+ llimfloatercontainer.h
llimpanel.h
llimview.h
llinspect.h
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 4a487bd5a7..38a9fec192 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,11 @@ void LLIMFloater::onSlide()
//static
LLIMFloater* LLIMFloater::show(const LLUUID& session_id)
{
+#ifdef USE_IM_CONTAINER
+ LLIMFloater* target_floater = findInstance(session_id);
+ bool not_existed = NULL == target_floater;
+
+#else
//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 +342,25 @@ 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
+ // do not add existed floaters to avoid adding torn off instances
+ if (not_existed)
+ {
+ // 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;
+
+ LLIMFloaterContainer* floater_container = LLFloaterReg::showTypedInstance<LLIMFloaterContainer>("im_container");
+ floater_container->addFloater(floater, TRUE, i_pt);
+ }
+#else
if (floater->getDockControl() == NULL)
{
LLChiclet* chiclet =
@@ -352,6 +378,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 +395,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 +423,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 +439,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
new file mode 100644
index 0000000000..6e4b3ae214
--- /dev/null
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -0,0 +1,96 @@
+/**
+ * @file llimfloatercontainer.cpp
+ * @brief Multifloater containing active IM sessions in separate tab container tabs
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ *
+ * Copyright (c) 2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llimfloatercontainer.h"
+
+//
+// LLIMFloaterContainer
+//
+LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed)
+: LLMultiFloater(seed),
+ mActiveVoiceFloater(NULL)
+{
+ mAutoResize = FALSE;
+}
+
+LLIMFloaterContainer::~LLIMFloaterContainer()
+{
+}
+
+BOOL LLIMFloaterContainer::postBuild()
+{
+ // 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)
+{
+ LLMultiFloater::onOpen(key);
+/*
+ if (key.isDefined())
+ {
+ LLIMFloater* im_floater = LLIMFloater::findInstance(key.asUUID());
+ if (im_floater)
+ {
+ im_floater->openFloater();
+ }
+ }
+*/
+}
+
+void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
+ BOOL select_added_floater,
+ LLTabContainer::eInsertionPoint insertion_point)
+{
+ if(!floaterp) return;
+
+ // already here
+ if (floaterp->getHost() == this)
+ {
+ openFloater(floaterp->getKey());
+ return;
+ }
+
+ LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point);
+
+ // make sure active voice icon shows up for new tab
+ if (floaterp == mActiveVoiceFloater)
+ {
+ mTabContainer->setTabImage(floaterp, "active_voice_tab.tga");
+ }
+}
+
+// EOF
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
new file mode 100644
index 0000000000..10cde56c6e
--- /dev/null
+++ b/indra/newview/llimfloatercontainer.h
@@ -0,0 +1,61 @@
+/**
+ * @file llimfloatercontainer.h
+ * @brief Multifloater containing active IM sessions in separate tab container tabs
+ *
+ * $LicenseInfo:firstyear=2009&license=viewergpl$
+ *
+ * Copyright (c) 2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLIMFLOATERCONTAINER_H
+#define LL_LLIMFLOATERCONTAINER_H
+
+#include "llfloater.h"
+#include "llmultifloater.h"
+
+class LLTabContainer;
+
+class LLIMFloaterContainer : public LLMultiFloater
+{
+public:
+ LLIMFloaterContainer(const LLSD& seed);
+ virtual ~LLIMFloaterContainer();
+
+ /*virtual*/ BOOL postBuild();
+ /*virtual*/ void onOpen(const LLSD& key);
+
+ /*virtual*/ void addFloater(LLFloater* floaterp,
+ BOOL select_added_floater,
+ LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
+
+ static LLFloater* getCurrentVoiceFloater();
+
+protected:
+
+ LLFloater* mActiveVoiceFloater;
+};
+
+#endif // LL_LLIMFLOATERCONTAINER_H
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 812107dd72..642df92379 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -109,6 +109,7 @@
#include "llfloaterwhitelistentry.h"
#include "llfloaterwindlight.h"
#include "llfloaterworldmap.h"
+#include "llimfloatercontainer.h"
#include "llinspectavatar.h"
#include "llinspectgroup.h"
#include "llinspectobject.h"
@@ -172,6 +173,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("hud", "floater_hud.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHUD>);
LLFloaterReg::add("impanel", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMFloater>);
+ LLFloaterReg::add("im_container", "floater_im_container.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMFloaterContainer>);
LLFloaterReg::add("script_floater", "floater_script.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLScriptFloater>);
LLFloaterReg::add("incoming_call", "floater_incoming_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIncomingCallDialog>);
LLFloaterReg::add("inventory", "floater_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInventory>);
diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml
new file mode 100644
index 0000000000..cf6a4e45bd
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_im_container.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<multi_floater
+background_visible="true"
+bg_color="yellow"
+ can_resize="true"
+ height="390"
+ layout="topleft"
+ name="floater_im_box"
+ help_topic="floater_im_box"
+ save_rect="true"
+ save_visibility="true"
+ single_instance="true"
+ title="Instant Messages"
+ width="392">
+ <tab_container
+ follows="left|right|top|bottom"
+ height="390"
+ layout="topleft"
+ left="1"
+ name="im_box_tab_container"
+ tab_position="bottom"
+ tab_width="80"
+ top="0"
+ width="390" />
+ <icon
+ color="DefaultShadowLight"
+ enabled="false"
+ follows="left|right|bottom"
+ height="17"
+ image_name="tabarea.tga"
+ layout="bottomleft"
+ left="1"
+ name="im_box_tab_container_icon"
+ bottom="10"
+ width="390" />
+</multi_floater>
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index 01713cc003..7f2f37409c 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -9,7 +9,7 @@
name="panel_im"
top="0"
can_close="true"
- can_dock="true"
+ can_dock="false"
can_minimize="false"
visible="true"
width="300"