aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelpermissions.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-09-07 18:09:25 -0700
committerMcCabe Maxsted2009-09-07 18:09:25 -0700
commitd6973dce3fd453599eccf5519c30672124d622d7 (patch)
tree4ff616f21a404d2c8eb113ce5c9e45e0b8c211f2 /linden/indra/newview/llpanelpermissions.cpp
parentFixed tool brush size (diff)
downloadmeta-impy-d6973dce3fd453599eccf5519c30672124d622d7.zip
meta-impy-d6973dce3fd453599eccf5519c30672124d622d7.tar.gz
meta-impy-d6973dce3fd453599eccf5519c30672124d622d7.tar.bz2
meta-impy-d6973dce3fd453599eccf5519c30672124d622d7.tar.xz
Applied and tweaked last owner in tools window from Emerald viewer
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llpanelpermissions.cpp65
1 files changed, 33 insertions, 32 deletions
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()
84 84
85 85
86 this->childSetAction("button owner profile",LLPanelPermissions::onClickOwner,this); 86 this->childSetAction("button owner profile",LLPanelPermissions::onClickOwner,this);
87 this->childSetAction("button last owner profile",LLPanelPermissions::onClickLastOwner,this);
87 this->childSetAction("button creator profile",LLPanelPermissions::onClickCreator,this); 88 this->childSetAction("button creator profile",LLPanelPermissions::onClickCreator,this);
88 89
89 this->childSetAction("button set group",LLPanelPermissions::onClickGroup,this); 90 this->childSetAction("button set group",LLPanelPermissions::onClickGroup,this);
@@ -177,6 +178,11 @@ void LLPanelPermissions::refresh()
177 childSetEnabled("Owner Name",false); 178 childSetEnabled("Owner Name",false);
178 childSetEnabled("button owner profile",false); 179 childSetEnabled("button owner profile",false);
179 180
181 childSetEnabled("Last Owner:",false);
182 childSetText("Last Owner Name",LLStringUtil::null);
183 childSetEnabled("Last Owner Name",false);
184 childSetEnabled("button last owner profile",false);
185
180 childSetEnabled("Group:",false); 186 childSetEnabled("Group:",false);
181 childSetText("Group Name",LLStringUtil::null); 187 childSetText("Group Name",LLStringUtil::null);
182 childSetEnabled("Group Name",false); 188 childSetEnabled("Group Name",false);
@@ -190,9 +196,6 @@ void LLPanelPermissions::refresh()
190 childSetEnabled("Description:",false); 196 childSetEnabled("Description:",false);
191 childSetText("Object Description",LLStringUtil::null); 197 childSetText("Object Description",LLStringUtil::null);
192 childSetEnabled("Object Description",false); 198 childSetEnabled("Object Description",false);
193
194 childSetText("prim info",LLStringUtil::null);
195 childSetEnabled("prim info",false);
196 199
197 childSetEnabled("Permissions:",false); 200 childSetEnabled("Permissions:",false);
198 201
@@ -299,6 +302,8 @@ void LLPanelPermissions::refresh()
299 owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); 302 owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name);
300 303
301// llinfos << "owners_identical " << (owners_identical ? "TRUE": "FALSE") << llendl; 304// llinfos << "owners_identical " << (owners_identical ? "TRUE": "FALSE") << llendl;
305 std::string last_owner_name;
306 LLSelectMgr::getInstance()->selectGetLastOwner(mLastOwnerID, last_owner_name);
302 307
303 if (mOwnerID.isNull()) 308 if (mOwnerID.isNull())
304 { 309 {
@@ -309,8 +314,8 @@ void LLPanelPermissions::refresh()
309 else 314 else
310 { 315 {
311 // Display last owner if public 316 // Display last owner if public
312 std::string last_owner_name; 317 //std::string last_owner_name;
313 LLSelectMgr::getInstance()->selectGetLastOwner(mLastOwnerID, last_owner_name); 318 //LLSelectMgr::getInstance()->selectGetLastOwner(mLastOwnerID, last_owner_name);
314 319
315 // It should never happen that the last owner is null and the owner 320 // It should never happen that the last owner is null and the owner
316 // is null, but it seems to be a bug in the simulator right now. JC 321 // is null, but it seems to be a bug in the simulator right now. JC
@@ -326,6 +331,19 @@ void LLPanelPermissions::refresh()
326 childSetEnabled("Owner Name",TRUE); 331 childSetEnabled("Owner Name",TRUE);
327 childSetEnabled("button owner profile",owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned())); 332 childSetEnabled("button owner profile",owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned()));
328 333
334 if (owner_name != last_owner_name)
335 {
336 childSetText("Last Owner Name", last_owner_name);
337 childSetEnabled("Last Owner Name", TRUE);
338 childSetEnabled("button last owner profile", TRUE);
339 }
340 else
341 {
342 childSetText("Last Owner Name", LLStringUtil::null);
343 childSetEnabled("Last Owner Name", FALSE);
344 childSetEnabled("button last owner profile", FALSE);
345 }
346
329 // update group text field 347 // update group text field
330 childSetEnabled("Group:",true); 348 childSetEnabled("Group:",true);
331 childSetText("Group Name",LLStringUtil::null); 349 childSetText("Group Name",LLStringUtil::null);
@@ -388,33 +406,6 @@ void LLPanelPermissions::refresh()
388 childSetEnabled("Object Description",false); 406 childSetEnabled("Object Description",false);
389 } 407 }
390 408
391
392 // Pre-compute object info string
393 S32 prim_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
394 S32 obj_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount();
395
396 std::string object_info_string;
397 if (1 == obj_count)
398 {
399 object_info_string.assign("1 Object, ");
400 }
401 else
402 {
403 object_info_string = llformat( "%d Objects, ", obj_count);
404 }
405 if (1 == prim_count)
406 {
407 object_info_string.append("1 Primitive");
408 }
409 else
410 {
411 std::string buffer;
412 buffer = llformat( "%d Primitives", prim_count);
413 object_info_string.append(buffer);
414 }
415 childSetText("prim info",object_info_string);
416 childSetEnabled("prim info",true);
417
418 S32 total_sale_price = 0; 409 S32 total_sale_price = 0;
419 S32 individual_sale_price = 0; 410 S32 individual_sale_price = 0;
420 BOOL is_for_sale_mixed = FALSE; 411 BOOL is_for_sale_mixed = FALSE;
@@ -865,6 +856,16 @@ void LLPanelPermissions::onClickOwner(void *data)
865 } 856 }
866} 857}
867 858
859void LLPanelPermissions::onClickLastOwner(void *data)
860{
861 LLPanelPermissions *self = (LLPanelPermissions *)data;
862
863 if ( self->mLastOwnerID.notNull() )
864 {
865 LLFloaterAvatarInfo::showFromObject(self->mLastOwnerID);
866 }
867}
868
868void LLPanelPermissions::onClickGroup(void* data) 869void LLPanelPermissions::onClickGroup(void* data)
869{ 870{
870 LLPanelPermissions* panelp = (LLPanelPermissions*)data; 871 LLPanelPermissions* panelp = (LLPanelPermissions*)data;