SL-19109 Turn LLSidepanelTaskInfo into a normal panel
parent
13a65319e0
commit
7a99ce16d1
|
|
@ -42,6 +42,7 @@
|
|||
#include "llresmgr.h"
|
||||
#include "lltextbox.h"
|
||||
#include "llbutton.h"
|
||||
#include "llcallbacklist.h"
|
||||
#include "llcheckboxctrl.h"
|
||||
#include "llviewerobject.h"
|
||||
#include "llselectmgr.h"
|
||||
|
|
@ -78,6 +79,7 @@ LLSidepanelTaskInfo::LLSidepanelTaskInfo()
|
|||
{
|
||||
setMouseOpaque(FALSE);
|
||||
LLSelectMgr::instance().mUpdateSignal.connect(boost::bind(&LLSidepanelTaskInfo::refreshAll, this));
|
||||
gIdleCallbacks.addFunction(&LLSidepanelTaskInfo::onIdle, (void*)this);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -85,13 +87,12 @@ LLSidepanelTaskInfo::~LLSidepanelTaskInfo()
|
|||
{
|
||||
if (sActivePanel == this)
|
||||
sActivePanel = NULL;
|
||||
gIdleCallbacks.deleteFunction(&LLSidepanelTaskInfo::onIdle, (void*)this);
|
||||
}
|
||||
|
||||
// virtual
|
||||
BOOL LLSidepanelTaskInfo::postBuild()
|
||||
{
|
||||
LLSidepanelInventorySubpanel::postBuild();
|
||||
|
||||
mOpenBtn = getChild<LLButton>("open_btn");
|
||||
mOpenBtn->setClickedCallback(boost::bind(&LLSidepanelTaskInfo::onOpenButtonClicked, this));
|
||||
mPayBtn = getChild<LLButton>("pay_btn");
|
||||
|
|
@ -253,6 +254,8 @@ void LLSidepanelTaskInfo::disablePermissions()
|
|||
|
||||
void LLSidepanelTaskInfo::refresh()
|
||||
{
|
||||
mIsDirty = false;
|
||||
|
||||
LLButton* btn_deed_to_group = mDeedBtn;
|
||||
if (btn_deed_to_group)
|
||||
{
|
||||
|
|
@ -864,33 +867,6 @@ void LLSidepanelTaskInfo::refresh()
|
|||
getChildView("label click action")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume);
|
||||
getChildView("clickaction")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume);
|
||||
|
||||
if (!getIsEditing())
|
||||
{
|
||||
const std::string no_item_names[] =
|
||||
{
|
||||
"Object Name",
|
||||
"Object Description",
|
||||
"button set group",
|
||||
"checkbox share with group",
|
||||
"button deed",
|
||||
"checkbox allow everyone move",
|
||||
"checkbox allow everyone copy",
|
||||
"checkbox for sale",
|
||||
"sale type",
|
||||
"Edit Cost",
|
||||
"checkbox next owner can modify",
|
||||
"checkbox next owner can copy",
|
||||
"checkbox next owner can transfer",
|
||||
"clickaction",
|
||||
"search_check",
|
||||
"perm_modify",
|
||||
"Group Name",
|
||||
};
|
||||
for (size_t t=0; t<LL_ARRAY_SIZE(no_item_names); ++t)
|
||||
{
|
||||
getChildView(no_item_names[t])->setEnabled( FALSE);
|
||||
}
|
||||
}
|
||||
updateVerbs();
|
||||
}
|
||||
|
||||
|
|
@ -1202,16 +1178,6 @@ void LLSidepanelTaskInfo::onCommitIncludeInSearch(LLUICtrl* ctrl, void* data)
|
|||
// virtual
|
||||
void LLSidepanelTaskInfo::updateVerbs()
|
||||
{
|
||||
LLSidepanelInventorySubpanel::updateVerbs();
|
||||
|
||||
/*
|
||||
mOpenBtn->setVisible(!getIsEditing());
|
||||
mPayBtn->setVisible(!getIsEditing());
|
||||
mBuyBtn->setVisible(!getIsEditing());
|
||||
//const LLViewerObject *obj = getFirstSelectedObject();
|
||||
//mEditBtn->setEnabled(obj && obj->permModify());
|
||||
*/
|
||||
|
||||
LLSafeHandle<LLObjectSelection> object_selection = LLSelectMgr::getInstance()->getSelection();
|
||||
const BOOL any_selected = (object_selection->getNumNodes() > 0);
|
||||
|
||||
|
|
@ -1296,6 +1262,23 @@ LLSidepanelTaskInfo* LLSidepanelTaskInfo::getActivePanel()
|
|||
return sActivePanel;
|
||||
}
|
||||
|
||||
void LLSidepanelTaskInfo::dirty()
|
||||
{
|
||||
mIsDirty = true;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLSidepanelTaskInfo::onIdle( void* user_data )
|
||||
{
|
||||
LLSidepanelTaskInfo* self = reinterpret_cast<LLSidepanelTaskInfo*>(user_data);
|
||||
|
||||
if( self->mIsDirty )
|
||||
{
|
||||
self->refresh();
|
||||
self->mIsDirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
LLViewerObject* LLSidepanelTaskInfo::getObject()
|
||||
{
|
||||
if (!mObject->isDead())
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@
|
|||
#ifndef LL_LLSIDEPANELTASKINFO_H
|
||||
#define LL_LLSIDEPANELTASKINFO_H
|
||||
|
||||
#include "llsidepanelinventorysubpanel.h"
|
||||
#include "lluuid.h"
|
||||
#include "llpanel.h"
|
||||
#include "llselectmgr.h"
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
@ -43,14 +43,14 @@ class LLNameBox;
|
|||
class LLViewerObject;
|
||||
class LLTextBase;
|
||||
|
||||
class LLSidepanelTaskInfo : public LLSidepanelInventorySubpanel
|
||||
class LLSidepanelTaskInfo : public LLPanel
|
||||
{
|
||||
public:
|
||||
LLSidepanelTaskInfo();
|
||||
virtual ~LLSidepanelTaskInfo();
|
||||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ void onVisibilityChange ( BOOL new_visibility );
|
||||
BOOL postBuild() override;
|
||||
void onVisibilityChange ( BOOL new_visibility ) override;
|
||||
|
||||
void setObjectSelection(LLObjectSelectionHandle selection);
|
||||
|
||||
|
|
@ -58,10 +58,12 @@ public:
|
|||
LLViewerObject* getFirstSelectedObject();
|
||||
|
||||
static LLSidepanelTaskInfo *getActivePanel();
|
||||
void dirty();
|
||||
static void onIdle( void* user_data );
|
||||
protected:
|
||||
/*virtual*/ void refresh(); // refresh all labels as needed
|
||||
/*virtual*/ void save();
|
||||
/*virtual*/ void updateVerbs();
|
||||
void refresh() override; // refresh all labels as needed
|
||||
void save();
|
||||
void updateVerbs();
|
||||
|
||||
void refreshAll(); // ignore current keyboard focus and update all fields
|
||||
|
||||
|
|
@ -103,6 +105,8 @@ private:
|
|||
LLUUID mCreatorID;
|
||||
LLUUID mOwnerID;
|
||||
LLUUID mLastOwnerID;
|
||||
|
||||
bool mIsDirty;
|
||||
|
||||
protected:
|
||||
void onOpenButtonClicked();
|
||||
|
|
|
|||
|
|
@ -62,25 +62,12 @@
|
|||
name="Sale Mixed">
|
||||
Mixed Sale
|
||||
</panel.string>
|
||||
<button
|
||||
follows="top|left"
|
||||
height="24"
|
||||
image_hover_unselected="BackButton_Over"
|
||||
image_pressed="BackButton_Press"
|
||||
image_unselected="BackButton_Off"
|
||||
layout="topleft"
|
||||
left="8"
|
||||
name="back_btn"
|
||||
tab_stop="false"
|
||||
top="0"
|
||||
width="30"
|
||||
use_draw_context_alpha="false" />
|
||||
<text
|
||||
<text
|
||||
follows="top|left|right"
|
||||
font="SansSerifHuge"
|
||||
height="26"
|
||||
layout="topleft"
|
||||
left_pad="10"
|
||||
left="48"
|
||||
name="title"
|
||||
text_color="LtGray"
|
||||
top="0"
|
||||
|
|
|
|||
Loading…
Reference in New Issue