From d6973dce3fd453599eccf5519c30672124d622d7 Mon Sep 17 00:00:00 2001
From: McCabe Maxsted
Date: Mon, 7 Sep 2009 18:09:25 -0700
Subject: Applied and tweaked last owner in tools window from Emerald viewer
---
linden/indra/newview/llpanelpermissions.cpp | 65 +++++++++++-----------
linden/indra/newview/llpanelpermissions.h | 1 +
.../skins/default/xui/en-us/floater_tools.xml | 24 ++++++--
3 files changed, 54 insertions(+), 36 deletions(-)
(limited to 'linden')
diff --git a/linden/indra/newview/llpanelpermissions.cpp b/linden/indra/newview/llpanelpermissions.cpp
index c430922..439d8b4 100644
--- a/linden/indra/newview/llpanelpermissions.cpp
+++ b/linden/indra/newview/llpanelpermissions.cpp
@@ -84,6 +84,7 @@ BOOL LLPanelPermissions::postBuild()
this->childSetAction("button owner profile",LLPanelPermissions::onClickOwner,this);
+ this->childSetAction("button last owner profile",LLPanelPermissions::onClickLastOwner,this);
this->childSetAction("button creator profile",LLPanelPermissions::onClickCreator,this);
this->childSetAction("button set group",LLPanelPermissions::onClickGroup,this);
@@ -177,6 +178,11 @@ void LLPanelPermissions::refresh()
childSetEnabled("Owner Name",false);
childSetEnabled("button owner profile",false);
+ childSetEnabled("Last Owner:",false);
+ childSetText("Last Owner Name",LLStringUtil::null);
+ childSetEnabled("Last Owner Name",false);
+ childSetEnabled("button last owner profile",false);
+
childSetEnabled("Group:",false);
childSetText("Group Name",LLStringUtil::null);
childSetEnabled("Group Name",false);
@@ -190,9 +196,6 @@ void LLPanelPermissions::refresh()
childSetEnabled("Description:",false);
childSetText("Object Description",LLStringUtil::null);
childSetEnabled("Object Description",false);
-
- childSetText("prim info",LLStringUtil::null);
- childSetEnabled("prim info",false);
childSetEnabled("Permissions:",false);
@@ -299,6 +302,8 @@ void LLPanelPermissions::refresh()
owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name);
// llinfos << "owners_identical " << (owners_identical ? "TRUE": "FALSE") << llendl;
+ std::string last_owner_name;
+ LLSelectMgr::getInstance()->selectGetLastOwner(mLastOwnerID, last_owner_name);
if (mOwnerID.isNull())
{
@@ -309,8 +314,8 @@ void LLPanelPermissions::refresh()
else
{
// Display last owner if public
- std::string last_owner_name;
- LLSelectMgr::getInstance()->selectGetLastOwner(mLastOwnerID, last_owner_name);
+ //std::string last_owner_name;
+ //LLSelectMgr::getInstance()->selectGetLastOwner(mLastOwnerID, last_owner_name);
// It should never happen that the last owner is null and the owner
// is null, but it seems to be a bug in the simulator right now. JC
@@ -326,6 +331,19 @@ void LLPanelPermissions::refresh()
childSetEnabled("Owner Name",TRUE);
childSetEnabled("button owner profile",owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned()));
+ if (owner_name != last_owner_name)
+ {
+ childSetText("Last Owner Name", last_owner_name);
+ childSetEnabled("Last Owner Name", TRUE);
+ childSetEnabled("button last owner profile", TRUE);
+ }
+ else
+ {
+ childSetText("Last Owner Name", LLStringUtil::null);
+ childSetEnabled("Last Owner Name", FALSE);
+ childSetEnabled("button last owner profile", FALSE);
+ }
+
// update group text field
childSetEnabled("Group:",true);
childSetText("Group Name",LLStringUtil::null);
@@ -388,33 +406,6 @@ void LLPanelPermissions::refresh()
childSetEnabled("Object Description",false);
}
-
- // Pre-compute object info string
- S32 prim_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
- S32 obj_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount();
-
- std::string object_info_string;
- if (1 == obj_count)
- {
- object_info_string.assign("1 Object, ");
- }
- else
- {
- object_info_string = llformat( "%d Objects, ", obj_count);
- }
- if (1 == prim_count)
- {
- object_info_string.append("1 Primitive");
- }
- else
- {
- std::string buffer;
- buffer = llformat( "%d Primitives", prim_count);
- object_info_string.append(buffer);
- }
- childSetText("prim info",object_info_string);
- childSetEnabled("prim info",true);
-
S32 total_sale_price = 0;
S32 individual_sale_price = 0;
BOOL is_for_sale_mixed = FALSE;
@@ -865,6 +856,16 @@ void LLPanelPermissions::onClickOwner(void *data)
}
}
+void LLPanelPermissions::onClickLastOwner(void *data)
+{
+ LLPanelPermissions *self = (LLPanelPermissions *)data;
+
+ if ( self->mLastOwnerID.notNull() )
+ {
+ LLFloaterAvatarInfo::showFromObject(self->mLastOwnerID);
+ }
+}
+
void LLPanelPermissions::onClickGroup(void* data)
{
LLPanelPermissions* panelp = (LLPanelPermissions*)data;
diff --git a/linden/indra/newview/llpanelpermissions.h b/linden/indra/newview/llpanelpermissions.h
index 3b73254..57339ed 100644
--- a/linden/indra/newview/llpanelpermissions.h
+++ b/linden/indra/newview/llpanelpermissions.h
@@ -68,6 +68,7 @@ protected:
static void onClickRelease(void*);
static void onClickCreator(void*);
static void onClickOwner(void*);
+ static void onClickLastOwner(void*);
static void onClickGroup(void*);
static void cbGroupID(LLUUID group_id, void* userdata);
static void onClickDeedToGroup(void*);
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml
index d9b51b1..411eec3 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml
@@ -386,20 +386,36 @@
height="20" label="Profile..." label_selected="Profile..." left_delta="94"
mouse_opaque="true" name="button owner profile" scale_image="TRUE"
width="78" />
+
+ Last Owner:
+
+
+ Thrax Linden
+
+
Group:
The Lindens
-
Deed
-