summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2009-11-24 21:55:23 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2009-11-24 21:55:23 +0200
commitb619f822e676c803a1b1921a420d284ed08ecdad (patch)
tree72f036a1304fc94f2f9c66690c7284fe5fc1014f /indra/newview
parent240c21cc2dd82dd41a664ec225fafb24bab44ca6 (diff)
parent87d7c6d6f962281f11b35e02a399e3d0e1dd9e12 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/CMakeLists.txt4
-rw-r--r--indra/newview/llavataractions.cpp2
-rw-r--r--indra/newview/llpanelavatar.cpp22
-rw-r--r--indra/newview/llpanelavatar.h8
-rw-r--r--indra/newview/llpanelme.cpp272
-rw-r--r--indra/newview/llpanelme.h111
-rw-r--r--indra/newview/llpanelpeople.cpp27
-rw-r--r--indra/newview/llpanelpeople.h4
-rw-r--r--indra/newview/llpanelpicks.h2
-rw-r--r--indra/newview/llpanelprofile.cpp18
-rw-r--r--indra/newview/llpanelprofile.h4
-rw-r--r--indra/newview/llpanelprofileview.cpp4
-rw-r--r--indra/newview/llpanelprofileview.h2
-rw-r--r--indra/newview/llsidetray.cpp39
-rw-r--r--indra/newview/skins/default/xui/de/panel_me.xml7
-rw-r--r--indra/newview/skins/default/xui/en/panel_me.xml52
-rw-r--r--indra/newview/skins/default/xui/en/panel_my_profile.xml427
-rw-r--r--indra/newview/skins/default/xui/en/panel_picks.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_side_tray.xml6
-rw-r--r--indra/newview/skins/default/xui/fr/panel_me.xml7
-rw-r--r--indra/newview/skins/default/xui/ja/panel_me.xml7
21 files changed, 953 insertions, 74 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 611875a1e2..e632cbaaf2 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -325,7 +325,7 @@ set(viewer_SOURCE_FILES
llpanelmediasettingsgeneral.cpp
llpanelmediasettingspermissions.cpp
llpanelmediasettingssecurity.cpp
- llpanelmeprofile.cpp
+ llpanelme.cpp
llpanelobject.cpp
llpanelobjectinventory.cpp
llpaneloutfitsinventory.cpp
@@ -821,7 +821,7 @@ set(viewer_HEADER_FILES
llpanelmediasettingsgeneral.h
llpanelmediasettingspermissions.h
llpanelmediasettingssecurity.h
- llpanelmeprofile.h
+ llpanelme.h
llpanelobject.h
llpanelobjectinventory.h
llpaneloutfitsinventory.h
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index a133bd6fe6..839a84f2d2 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -297,7 +297,7 @@ void LLAvatarActions::showProfile(const LLUUID& id)
//Show own profile
if(gAgent.getID() == id)
{
- LLSideTray::getInstance()->showPanel("panel_me_profile", params);
+ LLSideTray::getInstance()->showPanel("panel_me", params);
}
//Show other user profile
else
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index ed1d93db78..2c27808f03 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -120,7 +120,7 @@ BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
static LLDefaultChildRegistry::Register<LLDropTarget> r("drop_target");
static LLRegisterPanelClassWrapper<LLPanelAvatarProfile> t_panel_profile("panel_profile");
-static LLRegisterPanelClassWrapper<LLPanelAvatarMeProfile> t_panel_me_profile("panel_me_profile");
+static LLRegisterPanelClassWrapper<LLPanelMyProfile> t_panel_my_profile("panel_my_profile");
static LLRegisterPanelClassWrapper<LLPanelAvatarNotes> t_panel_notes("panel_notes");
//-----------------------------------------------------------------------------
@@ -595,19 +595,19 @@ void LLPanelAvatarProfile::onOverflowButtonClicked()
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
-LLPanelAvatarMeProfile::LLPanelAvatarMeProfile()
+LLPanelMyProfile::LLPanelMyProfile()
: LLPanelAvatarProfile()
{
}
-BOOL LLPanelAvatarMeProfile::postBuild()
+BOOL LLPanelMyProfile::postBuild()
{
LLPanelAvatarProfile::postBuild();
mStatusCombobox = getChild<LLComboBox>("status_combo");
- childSetCommitCallback("status_combo", boost::bind(&LLPanelAvatarMeProfile::onStatusChanged, this), NULL);
- childSetCommitCallback("status_me_message_text", boost::bind(&LLPanelAvatarMeProfile::onStatusMessageChanged, this), NULL);
+ childSetCommitCallback("status_combo", boost::bind(&LLPanelMyProfile::onStatusChanged, this), NULL);
+ childSetCommitCallback("status_me_message_text", boost::bind(&LLPanelMyProfile::onStatusMessageChanged, this), NULL);
resetControls();
resetData();
@@ -615,12 +615,12 @@ BOOL LLPanelAvatarMeProfile::postBuild()
return TRUE;
}
-void LLPanelAvatarMeProfile::onOpen(const LLSD& key)
+void LLPanelMyProfile::onOpen(const LLSD& key)
{
LLPanelProfileTab::onOpen(key);
}
-void LLPanelAvatarMeProfile::processProfileProperties(const LLAvatarData* avatar_data)
+void LLPanelMyProfile::processProfileProperties(const LLAvatarData* avatar_data)
{
fillCommonData(avatar_data);
@@ -631,7 +631,7 @@ void LLPanelAvatarMeProfile::processProfileProperties(const LLAvatarData* avatar
fillAccountStatus(avatar_data);
}
-void LLPanelAvatarMeProfile::fillStatusData(const LLAvatarData* avatar_data)
+void LLPanelMyProfile::fillStatusData(const LLAvatarData* avatar_data)
{
std::string status;
if (gAgent.getAFK())
@@ -650,7 +650,7 @@ void LLPanelAvatarMeProfile::fillStatusData(const LLAvatarData* avatar_data)
mStatusCombobox->setValue(status);
}
-void LLPanelAvatarMeProfile::resetControls()
+void LLPanelMyProfile::resetControls()
{
childSetVisible("status_panel", false);
childSetVisible("profile_buttons_panel", false);
@@ -660,7 +660,7 @@ void LLPanelAvatarMeProfile::resetControls()
childSetVisible("profile_me_buttons_panel", true);
}
-void LLPanelAvatarMeProfile::onStatusChanged()
+void LLPanelMyProfile::onStatusChanged()
{
LLSD::String status = mStatusCombobox->getValue().asString();
@@ -682,7 +682,7 @@ void LLPanelAvatarMeProfile::onStatusChanged()
}
}
-void LLPanelAvatarMeProfile::onStatusMessageChanged()
+void LLPanelMyProfile::onStatusMessageChanged()
{
updateData();
}
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index 8e0965e0b7..716bb29d45 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -47,7 +47,7 @@ enum EOnlineStatus
};
/**
-* Base class for any Profile View or Me Profile Panel.
+* Base class for any Profile View or My Profile Panel.
*/
class LLPanelProfileTab
: public LLPanel
@@ -148,7 +148,7 @@ protected:
virtual void processGroupProperties(const LLAvatarGroups* avatar_groups);
/**
- * Fills common for Avatar profile and Me Profile fields.
+ * Fills common for Avatar profile and My Profile fields.
*/
virtual void fillCommonData(const LLAvatarData* avatar_data);
@@ -192,11 +192,11 @@ private:
/**
* Panel for displaying own first and second life related info.
*/
-class LLPanelAvatarMeProfile
+class LLPanelMyProfile
: public LLPanelAvatarProfile
{
public:
- LLPanelAvatarMeProfile();
+ LLPanelMyProfile();
/*virtual*/ BOOL postBuild();
diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp
new file mode 100644
index 0000000000..046118cf75
--- /dev/null
+++ b/indra/newview/llpanelme.cpp
@@ -0,0 +1,272 @@
+/**
+ * @file llpanelme.cpp
+ * @brief Side tray "Me" (My Profile) panel
+ *
+ * $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 "llpanelprofile.h"
+#include "llavatarconstants.h"
+#include "llpanelme.h"
+#include "llagent.h"
+#include "llagentwearables.h"
+#include "lliconctrl.h"
+#include "llsidetray.h"
+#include "lltabcontainer.h"
+#include "lltexturectrl.h"
+
+#define PICKER_SECOND_LIFE "2nd_life_pic"
+#define PICKER_FIRST_LIFE "real_world_pic"
+#define PANEL_PROFILE "panel_profile"
+
+static LLRegisterPanelClassWrapper<LLPanelMyProfileEdit> t_panel_me_profile_edit("edit_profile_panel");
+static LLRegisterPanelClassWrapper<LLPanelMe> t_panel_me_profile("panel_me");
+
+LLPanelMe::LLPanelMe(void)
+ : LLPanelProfile()
+ , mEditPanel(NULL)
+{
+ setAvatarId(gAgent.getID());
+}
+
+BOOL LLPanelMe::postBuild()
+{
+ LLPanelProfile::postBuild();
+
+ getTabContainer()[PANEL_PROFILE]->childSetAction("edit_profile_btn", boost::bind(&LLPanelMe::onEditProfileClicked, this), this);
+ getTabContainer()[PANEL_PROFILE]->childSetAction("edit_appearance_btn", boost::bind(&LLPanelMe::onEditAppearanceClicked, this), this);
+
+ return TRUE;
+}
+
+void LLPanelMe::onOpen(const LLSD& key)
+{
+ LLPanelProfile::onOpen(key);
+}
+
+void LLPanelMe::notifyChildren(const LLSD& info)
+{
+ if (info.has("task-panel-action") && info["task-panel-action"].asString() == "handle-tri-state")
+ {
+ // Implement task panel tri-state behavior.
+ //
+ // When the button of an active open task panel is clicked, side tray
+ // calls notifyChildren() on the panel, passing task-panel-action=>handle-tri-state as an argument.
+ // The task panel is supposed to handle this by reverting to the default view,
+ // i.e. closing any dependent panels like "pick info" or "profile edit".
+
+ bool on_default_view = true;
+
+ const LLRect& task_panel_rect = getRect();
+ for (LLView* child = getFirstChild(); child; child = findNextSibling(child))
+ {
+ LLPanel* panel = dynamic_cast<LLPanel*>(child);
+ if (!panel)
+ continue;
+
+ // *HACK: implement panel stack instead (e.g. me->pick_info->pick_edit).
+ if (panel->getRect().getWidth() == task_panel_rect.getWidth() &&
+ panel->getRect().getHeight() == task_panel_rect.getHeight() &&
+ panel->getVisible())
+ {
+ panel->setVisible(FALSE);
+ on_default_view = false;
+ }
+ }
+
+ if (on_default_view)
+ LLSideTray::getInstance()->collapseSideBar();
+
+ return; // this notification is only supposed to be handled by task panels
+ }
+
+ LLPanel::notifyChildren(info);
+}
+
+void LLPanelMe::buildEditPanel()
+{
+ if (NULL == mEditPanel)
+ {
+ mEditPanel = new LLPanelMyProfileEdit();
+ mEditPanel->childSetAction("save_btn", boost::bind(&LLPanelMe::onSaveChangesClicked, this), this);
+ mEditPanel->childSetAction("cancel_btn", boost::bind(&LLPanelMe::onCancelClicked, this), this);
+ }
+}
+
+
+void LLPanelMe::onEditProfileClicked()
+{
+ buildEditPanel();
+ togglePanel(mEditPanel, getAvatarId()); // open
+}
+
+void LLPanelMe::onEditAppearanceClicked()
+{
+ if (gAgentWearables.areWearablesLoaded())
+ {
+ gAgent.changeCameraToCustomizeAvatar();
+ }
+}
+
+void LLPanelMe::onSaveChangesClicked()
+{
+ LLAvatarData data = LLAvatarData();
+ data.avatar_id = gAgent.getID();
+ data.image_id = mEditPanel->getChild<LLTextureCtrl>(PICKER_SECOND_LIFE)->getImageAssetID();
+ data.fl_image_id = mEditPanel->getChild<LLTextureCtrl>(PICKER_FIRST_LIFE)->getImageAssetID();
+ data.about_text = mEditPanel->childGetValue("sl_description_edit").asString();
+ data.fl_about_text = mEditPanel->childGetValue("fl_description_edit").asString();
+ data.profile_url = mEditPanel->childGetValue("homepage_edit").asString();
+ data.allow_publish = mEditPanel->childGetValue("show_in_search_checkbox");
+
+ LLAvatarPropertiesProcessor::getInstance()->sendAvatarPropertiesUpdate(&data);
+ togglePanel(mEditPanel); // close
+ onOpen(getAvatarId());
+}
+
+void LLPanelMe::onCancelClicked()
+{
+ togglePanel(mEditPanel); // close
+}
+
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
+LLPanelMyProfileEdit::LLPanelMyProfileEdit()
+ : LLPanelMyProfile()
+{
+ LLUICtrlFactory::getInstance()->buildPanel(this, "panel_edit_profile.xml");
+
+ setAvatarId(gAgent.getID());
+}
+
+void LLPanelMyProfileEdit::onOpen(const LLSD& key)
+{
+ resetData();
+
+ // Disable editing until data is loaded, or edited fields will be overwritten when data
+ // is loaded.
+ enableEditing(false);
+ LLPanelMyProfile::onOpen(getAvatarId());
+}
+
+void LLPanelMyProfileEdit::processProperties(void* data, EAvatarProcessorType type)
+{
+ if(APT_PROPERTIES == type)
+ {
+ const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data);
+ if(avatar_data && getAvatarId() == avatar_data->avatar_id)
+ {
+ // *TODO dzaporozhan
+ // Workaround for ticket EXT-1099, waiting for fix for ticket EXT-1128
+ enableEditing(true);
+ processProfileProperties(avatar_data);
+ LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this);
+ }
+ }
+}
+
+void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_data)
+{
+ fillCommonData(avatar_data);
+
+ fillOnlineStatus(avatar_data);
+
+ fillPartnerData(avatar_data);
+
+ fillAccountStatus(avatar_data);
+
+ childSetValue("show_in_search_checkbox", (BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH));
+
+ std::string first, last;
+ BOOL found = gCacheName->getName(avatar_data->avatar_id, first, last);
+ if (found)
+ {
+ childSetTextArg("name_text", "[FIRST]", first);
+ childSetTextArg("name_text", "[LAST]", last);
+ }
+}
+
+BOOL LLPanelMyProfileEdit::postBuild()
+{
+ initTexturePickerMouseEvents();
+
+ childSetTextArg("partner_edit_link", "[URL]", getString("partner_edit_link_url"));
+
+ return LLPanelAvatarProfile::postBuild();
+}
+/**
+ * Inits map with texture picker and appropriate edit icon.
+ * Sets callbacks of Mouse Enter and Mouse Leave signals of Texture Pickers
+ */
+void LLPanelMyProfileEdit::initTexturePickerMouseEvents()
+{
+ LLTextureCtrl* text_pic = getChild<LLTextureCtrl>(PICKER_SECOND_LIFE);
+ LLIconCtrl* text_icon = getChild<LLIconCtrl>("2nd_life_edit_icon");
+ mTextureEditIconMap[text_pic->getName()] = text_icon;
+ text_pic->setMouseEnterCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseEnter, this, _1));
+ text_pic->setMouseLeaveCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseLeave, this, _1));
+ text_icon->setVisible(FALSE);
+
+ text_pic = getChild<LLTextureCtrl>(PICKER_FIRST_LIFE);
+ text_icon = getChild<LLIconCtrl>("real_world_edit_icon");
+ mTextureEditIconMap[text_pic->getName()] = text_icon;
+ text_pic->setMouseEnterCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseEnter, this, _1));
+ text_pic->setMouseLeaveCallback(boost::bind(&LLPanelMyProfileEdit::onTexturePickerMouseLeave, this, _1));
+ text_icon->setVisible(FALSE);
+}
+
+void LLPanelMyProfileEdit::resetData()
+{
+ LLPanelMyProfile::resetData();
+
+ childSetTextArg("name_text", "[FIRST]", LLStringUtil::null);
+ childSetTextArg("name_text", "[LAST]", LLStringUtil::null);
+}
+
+void LLPanelMyProfileEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl)
+{
+ mTextureEditIconMap[ctrl->getName()]->setVisible(TRUE);
+}
+void LLPanelMyProfileEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl)
+{
+ mTextureEditIconMap[ctrl->getName()]->setVisible(FALSE);
+}
+
+void LLPanelMyProfileEdit::enableEditing(bool enable)
+{
+ childSetEnabled("2nd_life_pic", enable);
+ childSetEnabled("real_world_pic", enable);
+ childSetEnabled("sl_description_edit", enable);
+ childSetEnabled("fl_description_edit", enable);
+ childSetEnabled("homepage_edit", enable);
+ childSetEnabled("show_in_search_checkbox", enable);
+}
diff --git a/indra/newview/llpanelme.h b/indra/newview/llpanelme.h
new file mode 100644
index 0000000000..17d367132e
--- /dev/null
+++ b/indra/newview/llpanelme.h
@@ -0,0 +1,111 @@
+/**
+ * @file llpanelme.h
+ * @brief Side tray "Me" (My Profile) panel
+ *
+ * $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_LLPANELMEPROFILE_H
+#define LL_LLPANELMEPROFILE_H
+
+#include "llpanel.h"
+#include "llpanelavatar.h"
+
+class LLPanelMyProfileEdit;
+class LLPanelProfile;
+class LLIconCtrl;
+
+/**
+* Panel for displaying Agent's profile, it consists of two sub panels - Profile
+* and Picks.
+* LLPanelMe allows user to edit his profile and picks.
+*/
+class LLPanelMe : public LLPanelProfile
+{
+ LOG_CLASS(LLPanelMe);
+
+public:
+
+ LLPanelMe();
+
+ /*virtual*/ void onOpen(const LLSD& key);
+ /*virtual*/ void notifyChildren(const LLSD& info);
+
+ /*virtual*/ BOOL postBuild();
+
+private:
+
+ void buildEditPanel();
+
+ void onEditProfileClicked();
+ void onEditAppearanceClicked();
+ void onSaveChangesClicked();
+ void onCancelClicked();
+
+ LLPanelMyProfileEdit * mEditPanel;
+
+};
+
+class LLPanelMyProfileEdit : public LLPanelMyProfile
+{
+ LOG_CLASS(LLPanelMyProfileEdit);
+
+public:
+
+ LLPanelMyProfileEdit();
+
+ /*virtual*/void processProperties(void* data, EAvatarProcessorType type);
+
+ /*virtual*/BOOL postBuild();
+
+ /*virtual*/ void onOpen(const LLSD& key);
+
+protected:
+
+ /*virtual*/void resetData();
+
+ void processProfileProperties(const LLAvatarData* avatar_data);
+
+private:
+ void initTexturePickerMouseEvents();
+ void onTexturePickerMouseEnter(LLUICtrl* ctrl);
+ void onTexturePickerMouseLeave(LLUICtrl* ctrl);
+
+ /**
+ * Enabled/disables controls to prevent overwriting edited data upon receiving
+ * current data from server.
+ */
+ void enableEditing(bool enable);
+
+private:
+ // map TexturePicker name => Edit Icon pointer should be visible while hovering Texture Picker
+ typedef std::map<std::string, LLIconCtrl*> texture_edit_icon_map_t;
+ texture_edit_icon_map_t mTextureEditIconMap;
+};
+
+#endif // LL_LLPANELMEPROFILE_H
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 29f7cc1851..9dee83a7a1 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -56,6 +56,8 @@
#include "llgrouplist.h"
#include "llinventoryobserver.h"
#include "llpanelpeoplemenus.h"
+#include "llsidetray.h"
+#include "llsidetraypanelcontainer.h"
#include "llrecentpeople.h"
#include "llviewercontrol.h" // for gSavedSettings
#include "llviewermenu.h" // for gMenuHolder
@@ -1270,6 +1272,31 @@ void LLPanelPeople::onOpen(const LLSD& key)
reSelectedCurrentTab();
}
+void LLPanelPeople::notifyChildren(const LLSD& info)
+{
+ if (info.has("task-panel-action") && info["task-panel-action"].asString() == "handle-tri-state")
+ {
+ LLSideTrayPanelContainer* container = dynamic_cast<LLSideTrayPanelContainer*>(getParent());
+ if (!container)
+ {
+ llwarns << "Cannot find People panel container" << llendl;
+ return;
+ }
+
+ if (container->getCurrentPanelIndex() > 0)
+ {
+ // if not on the default panel, switch to it
+ container->onOpen(LLSD().insert(LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME, getName()));
+ }
+ else
+ LLSideTray::getInstance()->collapseSideBar();
+
+ return; // this notification is only supposed to be handled by task panels
+ }
+
+ LLPanel::notifyChildren(info);
+}
+
void LLPanelPeople::showAccordion(const std::string name, bool show)
{
if(name.empty())
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index a369bcd3e2..d9dd76f3ac 100644
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -50,8 +50,8 @@ public:
virtual ~LLPanelPeople();
/*virtual*/ BOOL postBuild();
-
- virtual void onOpen(const LLSD& key);
+ /*virtual*/ void onOpen(const LLSD& key);
+ /*virtual*/ void notifyChildren(const LLSD& info);
// internals
class Updater;
diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h
index 4b90ea5048..b17b6d6fe9 100644
--- a/indra/newview/llpanelpicks.h
+++ b/indra/newview/llpanelpicks.h
@@ -83,7 +83,7 @@ public:
LLClassifiedItem* getSelectedClassifiedItem();
//*NOTE top down approch when panel toggling is done only by
- // parent panels failed to work (picks related code was in me profile panel)
+ // parent panels failed to work (picks related code was in my profile panel)
void setProfilePanel(LLPanelProfile* profile_panel);
private:
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 02f45c1b48..4d152a13f3 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -158,28 +158,14 @@ void LLPanelProfile::onOpen(const LLSD& key)
}
//*TODO redo panel toggling
-void LLPanelProfile::togglePanel(LLPanel* panel)
+void LLPanelProfile::togglePanel(LLPanel* panel, const LLSD& key)
{
// TRUE - we need to open/expand "panel"
bool expand = getChildList()->front() != panel; // mTabCtrl->getVisible();
if (expand)
{
- if (panel->getParent() != this)
- {
- addChild(panel);
- }
- else
- {
- sendChildToFront(panel);
- }
-
- panel->setVisible(TRUE);
-
- LLRect new_rect = getRect();
- panel->reshape(new_rect.getWidth(), new_rect.getHeight());
- new_rect.setLeftTopAndSize(0, new_rect.getHeight(), new_rect.getWidth(), new_rect.getHeight());
- panel->setRect(new_rect);
+ openPanel(panel, key);
}
else
{
diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h
index e0b827c986..067beb248b 100644
--- a/indra/newview/llpanelprofile.h
+++ b/indra/newview/llpanelprofile.h
@@ -40,7 +40,7 @@
class LLTabContainer;
/**
-* Base class for Profile View and Me Profile.
+* Base class for Profile View and My Profile.
*/
class LLPanelProfile : public LLPanel
{
@@ -51,7 +51,7 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
- virtual void togglePanel(LLPanel*);
+ virtual void togglePanel(LLPanel*, const LLSD& key = LLSD());
virtual void openPanel(LLPanel* panel, const LLSD& params);
diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp
index d4ab5013f9..08aea8cfd8 100644
--- a/indra/newview/llpanelprofileview.cpp
+++ b/indra/newview/llpanelprofileview.cpp
@@ -193,8 +193,10 @@ void LLPanelProfileView::onAvatarNameCached(const LLUUID& id, const std::string&
getChild<LLTextBox>("user_name", FALSE)->setValue(first_name + " " + last_name);
}
-void LLPanelProfileView::togglePanel(LLPanel* panel)
+void LLPanelProfileView::togglePanel(LLPanel* panel, const LLSD& key)
{
+ // *TODO: unused method?
+
LLPanelProfile::togglePanel(panel);
if(FALSE == panel->getVisible())
{
diff --git a/indra/newview/llpanelprofileview.h b/indra/newview/llpanelprofileview.h
index 45c2fc116e..5dc617d4a0 100644
--- a/indra/newview/llpanelprofileview.h
+++ b/indra/newview/llpanelprofileview.h
@@ -64,7 +64,7 @@ public:
/*virtual*/ BOOL postBuild();
- /*virtual*/ void togglePanel(LLPanel* panel);
+ /*virtual*/ void togglePanel(LLPanel* panel, const LLSD& key = LLSD());
BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
BOOL drop, EDragAndDropType cargo_type,
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp
index 7711f3c733..0b832a8239 100644
--- a/indra/newview/llsidetray.cpp
+++ b/indra/newview/llsidetray.cpp
@@ -435,35 +435,16 @@ void LLSideTray::processTriState ()
expandSideBar();
else
{
- //!!!!!!!!!!!!!!!!!
- //** HARDCODED!!!!!
- //!!!!!!!!!!!!!!!!!
-
- //there is no common way to determine "default" panel for tab
- //so default panels for now will be hardcoded
-
- //hardcoded for people tab and profile tab
-
- /*if(mActiveTab == getTab("sidebar_people"))
- {
- LLSideTrayPanelContainer* container = findChild<LLSideTrayPanelContainer>("panel_container");
- if(container && container->getCurrentPanelIndex()>0)
- {
- container->onOpen(LLSD().insert("sub_panel_name","panel_people"));
- }
- else
- collapseSideBar();
- }
- else if(mActiveTab == getTab("sidebar_me"))
- {
- LLTabContainer* tab_container = findChild<LLTabContainer>("tabs");
- if(tab_container && tab_container->getCurrentPanelIndex()>0)
- tab_container->selectFirstTab();
- else
- collapseSideBar();
- }
- else*/
- collapseSideBar();
+#if 0 // *TODO: EXT-2092
+
+ // Tell the active task panel to switch to its default view
+ // or collapse side tray if already on the default view.
+ LLSD info;
+ info["task-panel-action"] = "handle-tri-state";
+ mActiveTab->notifyChildren(info);
+#else
+ collapseSideBar();
+#endif
}
}
diff --git a/indra/newview/skins/default/xui/de/panel_me.xml b/indra/newview/skins/default/xui/de/panel_me.xml
new file mode 100644
index 0000000000..a685a430f0
--- /dev/null
+++ b/indra/newview/skins/default/xui/de/panel_me.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Ich" name="panel_me">
+ <tab_container name="tabs">
+ <panel label="Mein Profil" name="panel_profile"/>
+ <panel label="Auswahl" name="panel_picks"/>
+ </tab_container>
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_me.xml b/indra/newview/skins/default/xui/en/panel_me.xml
new file mode 100644
index 0000000000..a99777848b
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_me.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ background_visible="true"
+ border="false"
+ follows="all"
+ height="570"
+ label="My Profile"
+ layout="topleft"
+ left="0"
+ name="panel_me"
+ top="0"
+ width="333">
+ <!--<text
+ type="string"
+ follows="top|left|right"
+ font="SansSerifHugeBold"
+ height="20"
+ layout="topleft"
+ left="15"
+ name="user_name"
+ text_color="white"
+ top="0"
+ mouse_opaque="true"
+ width="280">
+ (Loading...)
+ </text> -->
+ <tab_container
+ follows="all"
+ height="575"
+ halign="center"
+ layout="topleft"
+ left="10"
+ name="tabs"
+ tab_min_width="95"
+ tab_height="30"
+ tab_position="top"
+ top_pad="10"
+ width="313">
+ <panel
+ class="panel_my_profile"
+ filename="panel_my_profile.xml"
+ label="PROFILE"
+ help_topic="panel_my_profile_tab"
+ name="panel_profile" />
+ <panel
+ class="panel_picks"
+ filename="panel_picks.xml"
+ label="PICKS"
+ help_topic="panel_my_picks_tab"
+ name="panel_picks" />
+ </tab_container>
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml
new file mode 100644
index 0000000000..d259623c0b
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_my_profile.xml
@@ -0,0 +1,427 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ follows="all"
+ height="535"
+ label="Profile"
+ layout="topleft"
+ left="0"
+ name="panel_profile"
+ top="0"
+ width="313">
+ <string
+ name="CaptionTextAcctInfo">
+ [ACCTTYPE]
+[PAYMENTINFO] [AGEVERIFICATION]
+ </string>
+ <string
+ name="payment_update_link_url">
+ http://www.secondlife.com/account/billing.php?lang=en
+ </string>
+ <string
+ name="partner_edit_link_url">
+ http://www.secondlife.com/account/partners.php?lang=en
+ </string>
+ <string
+ name="my_account_link_url"
+ value="http://secondlife.com/account" />
+ <string
+ name="no_partner_text"
+ value="None" />
+ <string name="RegisterDateFormat">[REG_DATE] ([AGE])</string>
+ <scroll_container
+ color="DkGray2"
+ follows="all"
+ height="485"
+ layout="topleft"
+ name="profile_scroll"
+ reserve_scroll_corner="true"
+ opaque="true"
+ top="0"
+ width="313">
+ <panel
+ name="scroll_content_panel"
+ follows="left|top|right"
+ height="485"
+ layout="topleft"
+ top="0"
+ left="0"
+ width="313">
+ <panel
+ follows="left|top"
+ height="117"
+ layout="topleft"
+ left="10"
+ name="second_life_image_panel"
+ top="0"
+ width="280">
+ <texture_picker
+ allow_no_texture="true"
+ default_image_name="None"
+ enabled="false"
+ follows="top|left"
+ height="117"
+ layout="topleft"
+ left="0"
+ name="2nd_life_pic"
+ top="10"
+ width="102" />
+ <icon
+ height="102"
+ image_name="Blank"
+ layout="topleft"
+ name="2nd_life_edit_icon"
+ label=""
+ left="0"
+ tool_tip="Click the Edit Profile button below to change image"
+ top="10"
+ width="102" />
+ <text
+ follows="left|top|right"
+ font.style="BOLD"
+ height="15"
+ layout="topleft"
+ left_pad="10"
+ name="title_sl_descr_text"
+ text_color="white"
+ top_delta="0"
+ value="[SECOND_LIFE]:"
+ width="165" />
+ <expandable_text
+ follows="left|top|right"
+ height="95"
+ layout="topleft"
+ left="107"
+ textbox.max_length="512"
+ name="sl_description_edit"
+ top_pad="-3"
+ width="173"
+ expanded_bg_visible="true"
+ expanded_bg_color="DkGray">
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum.
+ </expandable_text>
+ </panel>
+ <panel
+ follows="left|top"
+ height="117"
+ layout="topleft"
+ top_pad="10"
+ left="10"
+ name="first_life_image_panel"
+ width="280">
+ <texture_picker
+ allow_no_texture="true"
+ default_image_name="None"
+ enabled="false"
+ follows="top|left"
+ height="117"
+ layout="topleft"
+ left="0"
+ name="real_world_pic"
+ width="102" />
+ <icon
+ height="102"
+ image_name="Blank"
+ layout="topleft"
+ name="real_world_edit_icon"
+ label=""
+ left="0"
+ tool_tip="Click the Edit Profile button below to change image"
+ top="4"
+ width="102" />
+ <text
+ follows="left|top|right"
+ font.style="BOLD"
+ height="15"
+ layout="topleft"
+ left_pad="10"
+ name="title_rw_descr_text"
+ text_color="white"
+ top_delta="0"
+ value="Real World:"
+ width="165" />
+ <expandable_text
+ follows="left|top|right"
+ height="95"
+ layout="topleft"
+ left="107"
+ textbox.max_length="512"
+ name="fl_description_edit"
+ top_pad="-3"
+ width="173"
+ expanded_bg_visible="true"
+ expanded_bg_color="DkGray">
+ Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum.
+ </expandable_text>
+ </panel>
+
+
+ <!-- <panel
+ name="lifes_images_panel"
+ follows="left|top|right"
+ height="244"
+ layout="topleft"
+ top="0"
+ left="0"
+ width="285">
+ <panel
+ follows="left|top"
+ height="117"
+ layout="topleft"
+ left="10"
+ name="second_life_image_panel"
+ top="0"
+ width="285">
+ <text
+ follows="left|top|right"
+ font.style="BOLD"
+ height="15"
+ layout="topleft"
+ left="0"
+ name="second_life_photo_title_text"
+ text_color="white"
+ value="[SECOND_LIFE]:"
+ width="170" />
+ <texture_picker
+ allow_no_texture="true"
+ default_image_name="None"
+ enabled="false"
+ follows="top|left"
+ height="117"
+ layout="topleft"
+ left="0"
+ name="2nd_life_pic"
+ top_pad="0"
+ width="102" />
+ </panel>
+ <icon
+ height="18"
+ image_name="AddItem_Off"
+ layout="topleft"
+ name="2nd_life_edit_icon"
+ label=""
+ left="87"
+ tool_tip="Click to select an image"
+ top="25"
+ width="18" />
+ </panel> -->
+
+
+
+
+ <text
+ type="string"
+ follows="left|top"
+ font="SansSerifSmall"
+ font.style="BOLD"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="me_homepage_text"
+ text_color="white"
+ top_pad="0"
+ width="280">
+ Homepage:
+ </text>
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="homepage_edit"
+ top_pad="0"
+ value="http://librarianavengers.org"
+ width="280"
+ word_wrap="false"
+ use_ellipses="true"
+ />
+ <text
+ follows="left|top"
+ font.style="BOLD"
+ height="10"
+ layout="topleft"
+ left="10"
+ name="title_member_text"
+ text_color="white"
+ top_pad="10"
+ value="Member Since:"
+ width="280" />
+ <text
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="register_date"
+ value="05/31/1976"
+ width="280"
+ word_wrap="true" />
+ <text
+ follows="left|top"
+ font.style="BOLD"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="title_acc_status_text"
+ text_color="white"
+ top_pad="10"
+ value="Account Status:"
+ width="280" />
+ <!-- <text
+ type="string"
+ follows="left|top"
+ font="SansSerifSmall"
+ height="15"
+ layout="topleft"
+ left_pad="10"
+ name="my_account_link"
+ top_delta="0"
+ value="Go to Dashboard"
+ width="100"/> -->
+ <text
+ follows="left|top"
+ height="20"
+ layout="topleft"
+ left="10"
+ name="acc_status_text"
+ top_pad="0"
+ value="Resident. No payment info on file."
+ width="280"
+ word_wrap="true" />
+ <text
+ follows="left|top"
+ font.style="BOLD"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="title_partner_text"
+ text_color="white"
+ top_pad="5"
+ value="Partner:"
+ width="280" />
+ <panel
+ follows="left|top"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="partner_data_panel"
+ top_pad="0"
+ width="280">
+ <text
+ follows="left|top"
+ height="10"
+ layout="topleft"
+ left="0"
+ name="partner_text"
+ top="0"
+ value="[FIRST] [LAST]"
+ width="280"
+ word_wrap="true" />
+ </panel>
+ <text
+ follows="left|top"
+ font.style="BOLD"
+ height="15"
+ layout="topleft"
+ left="10"
+ name="title_groups_text"
+ text_color="white"
+ top_pad="8"
+ value="Groups:"
+ width="280" />
+ <expandable_text
+ follows="left|top|bottom"
+ height="60"
+ layout="topleft"
+ left="10"
+ name="sl_groups"
+ top_pad="0"
+ width="280"
+ expanded_bg_visible="true"
+ expanded_bg_color="DkGray">
+ Lorem ipsum dolor sit amet, consectetur adlkjpiscing elit moose moose. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet. adipiscing elit. Aenean rigviverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet sorbet ipsum. adipiscing elit. Aenean viverra orci et justo sagittis aliquet. Nullam malesuada mauris sit amet ipsum.
+ </expandable_text>
+ </panel>
+ </scroll_container>
+ <panel
+ follows="bottom|left"
+ layout="topleft"
+ left="0"
+ name="profile_buttons_panel"
+ top_pad="2"
+ bottom="10"
+ height="19"
+ width="303">
+ <button
+ follows="bottom|left"
+ height="19"
+ label="Add Friend"
+ layout="topleft"
+ left="0"
+ mouse_opaque="false"
+ name="add_friend"
+ top="5"
+ width="75" />
+ <button
+ follows="bottom|left"
+ height="19"
+ label="IM"
+ layout="topleft"
+ name="im"
+ top="5"
+ left_pad="5"
+ width="45" />
+ <button
+ follows="bottom|left"
+ height="19"
+ label="Call"
+ layout="topleft"
+ name="call"
+ left_pad="5"
+ top="5"
+ width="45" />
+ <button
+ enabled="false"
+ follows="bottom|left"
+ height="19"
+ label="Map"
+ layout="topleft"
+ name="show_on_map_btn"
+ top="5"
+ left_pad="5"
+ width="45" />
+ <button
+ follows="bottom|left"
+ height="19"
+ label="Teleport"
+ layout="topleft"
+ name="teleport"
+ left_pad="5"
+ top="5"
+ width="80" />
+ </panel>
+ <panel
+ follows="bottom|left"
+ layout="topleft"
+ left="0"
+ top_pad="-17"
+ name="profile_me_buttons_panel"
+ visible="false"
+ height="19"
+ width="303">
+ <button
+ follows="bottom|right"
+ font="SansSerifSmall"
+ height="19"
+ left="10"
+ label="Edit Profile"
+ name="edit_profile_btn"
+ width="130" />
+ <button
+ follows="bottom|right"
+ height="19"
+ label="Edit Appearance"
+ left_pad="10"
+ name="edit_appearance_btn"
+ right="-10"
+ width="130" />
+ </panel>
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml
index 5cefe3e4ab..ece58180f7 100644
--- a/indra/newview/skins/default/xui/en/panel_picks.xml
+++ b/indra/newview/skins/default/xui/en/panel_picks.xml
@@ -24,7 +24,7 @@
top="10"
visible="false"
width="313">
- There are no any picks/classifieds here
+ There are no picks/classifieds here
</text>
<accordion
follows="all"
diff --git a/indra/newview/skins/default/xui/en/panel_side_tray.xml b/indra/newview/skins/default/xui/en/panel_side_tray.xml
index d02354a647..95242a9639 100644
--- a/indra/newview/skins/default/xui/en/panel_side_tray.xml
+++ b/indra/newview/skins/default/xui/en/panel_side_tray.xml
@@ -102,9 +102,9 @@
background_visible="true"
>
<panel
- class="panel_me_profile_view"
- name="panel_me_profile"
- filename="panel_me_profile.xml"
+ class="panel_me"
+ name="panel_me"
+ filename="panel_me.xml"
label="Me"
/>
</sidetray_tab>
diff --git a/indra/newview/skins/default/xui/fr/panel_me.xml b/indra/newview/skins/default/xui/fr/panel_me.xml
new file mode 100644
index 0000000000..5bedee4616
--- /dev/null
+++ b/indra/newview/skins/default/xui/fr/panel_me.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="Moi" name="panel_me">
+ <tab_container name="tabs">
+ <panel label="Mon Profil" name="panel_profile"/>
+ <panel label="Préférences" name="panel_picks"/>
+ </tab_container>
+</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_me.xml b/indra/newview/skins/default/xui/ja/panel_me.xml
new file mode 100644
index 0000000000..84151f43cf
--- /dev/null
+++ b/indra/newview/skins/default/xui/ja/panel_me.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<panel label="ミー" name="panel_me">
+ <tab_container name="tabs">
+ <panel label="プロフィール" name="panel_profile"/>
+ <panel label="ピック" name="panel_picks"/>
+ </tab_container>
+</panel>