FIRE-22292: Configurable columns for inspect floater
parent
6dc56ad039
commit
2e2658061c
|
|
@ -24692,6 +24692,17 @@ Change of this parameter will affect the layout of buttons in notification toast
|
|||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FSInspectColumnConfig</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Stores the column visibility of the inspect window</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>1023</integer>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
||||
|
|
|
|||
|
|
@ -55,17 +55,42 @@
|
|||
// PoundLife END
|
||||
#include "llvovolume.h"
|
||||
|
||||
// <FS:Ansariel> FIRE-22292: Configurable columns
|
||||
#include "llmenugl.h"
|
||||
#include "llmenubutton.h"
|
||||
#include "lltoggleablemenu.h"
|
||||
#include "llviewermenu.h" // for gMenuHolder
|
||||
// </FS:Ansariel>
|
||||
|
||||
//LLFloaterInspect* LLFloaterInspect::sInstance = NULL;
|
||||
|
||||
LLFloaterInspect::LLFloaterInspect(const LLSD& key)
|
||||
: LLFloater(key),
|
||||
mDirty(FALSE),
|
||||
mOwnerNameCacheConnection(),
|
||||
mCreatorNameCacheConnection()
|
||||
mCreatorNameCacheConnection(),
|
||||
// <FS:Ansariel> FIRE-22292: Configurable columns
|
||||
mOptionsButton(NULL),
|
||||
mFSInspectColumnConfigConnection(),
|
||||
mLastResizeDelta(0)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
mCommitCallbackRegistrar.add("Inspect.OwnerProfile", boost::bind(&LLFloaterInspect::onClickOwnerProfile, this));
|
||||
mCommitCallbackRegistrar.add("Inspect.CreatorProfile", boost::bind(&LLFloaterInspect::onClickCreatorProfile, this));
|
||||
mCommitCallbackRegistrar.add("Inspect.SelectObject", boost::bind(&LLFloaterInspect::onSelectObject, this));
|
||||
|
||||
// <FS:Ansariel> FIRE-22292: Configurable columns
|
||||
mColumnBits["object_name"] = 1;
|
||||
mColumnBits["description"] = 2;
|
||||
mColumnBits["owner_name"] = 4;
|
||||
mColumnBits["creator_name"] = 8;
|
||||
mColumnBits["facecount"] = 16;
|
||||
mColumnBits["vertexcount"] = 32;
|
||||
mColumnBits["trianglecount"] = 64;
|
||||
mColumnBits["tramcount"] = 128;
|
||||
mColumnBits["vramcount"] = 256;
|
||||
mColumnBits["creation_date"] = 512;
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
BOOL LLFloaterInspect::postBuild()
|
||||
|
|
@ -74,6 +99,26 @@ BOOL LLFloaterInspect::postBuild()
|
|||
// childSetAction("button owner",onClickOwnerProfile, this);
|
||||
// childSetAction("button creator",onClickCreatorProfile, this);
|
||||
// childSetCommitCallback("object_list", onSelectObject, NULL);
|
||||
|
||||
// <FS:Ansariel> FIRE-22292: Configurable columns
|
||||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
|
||||
|
||||
registrar.add("Inspect.ToggleColumn", boost::bind(&LLFloaterInspect::onColumnVisibilityChecked, this, _2));
|
||||
enable_registrar.add("Inspect.EnableColumn", boost::bind(&LLFloaterInspect::onEnableColumnVisibilityChecked, this, _2));
|
||||
|
||||
mOptionsButton = getChild<LLMenuButton>("options_btn");
|
||||
|
||||
LLToggleableMenu* options_menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_fs_inspect_options.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if (options_menu)
|
||||
{
|
||||
mOptionsMenuHandle = options_menu->getHandle();
|
||||
mOptionsButton->setMenu(options_menu, LLMenuButton::MP_BOTTOM_LEFT);
|
||||
}
|
||||
|
||||
mFSInspectColumnConfigConnection = gSavedSettings.getControl("FSInspectColumnConfig")->getSignal()->connect(boost::bind(&LLFloaterInspect::onColumnDisplayModeChanged, this));
|
||||
onColumnDisplayModeChanged();
|
||||
// </FS:Ansariel>
|
||||
|
||||
refresh();
|
||||
|
||||
|
|
@ -103,6 +148,15 @@ LLFloaterInspect::~LLFloaterInspect(void)
|
|||
{
|
||||
LLFloaterReg::showInstance("build", LLSD(), TRUE);
|
||||
}
|
||||
|
||||
// <FS:Ansariel> FIRE-22292: Configurable columns
|
||||
if (mFSInspectColumnConfigConnection.connected())
|
||||
{
|
||||
mFSInspectColumnConfigConnection.disconnect();
|
||||
}
|
||||
|
||||
if (mOptionsMenuHandle.get()) mOptionsMenuHandle.get()->die();
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
void LLFloaterInspect::onOpen(const LLSD& key)
|
||||
|
|
@ -671,3 +725,103 @@ void LLFloaterInspect::draw()
|
|||
|
||||
LLFloater::draw();
|
||||
}
|
||||
|
||||
// <FS:Ansariel> FIRE-22292: Configurable columns
|
||||
void LLFloaterInspect::onColumnDisplayModeChanged()
|
||||
{
|
||||
U32 column_config = gSavedSettings.getU32("FSInspectColumnConfig");
|
||||
std::vector<LLScrollListColumn::Params> column_params = mObjectList->getColumnInitParams();
|
||||
S32 column_padding = mObjectList->getColumnPadding();
|
||||
|
||||
S32 default_width = 0;
|
||||
S32 new_width = 0;
|
||||
S32 min_width, min_height;
|
||||
getResizeLimits(&min_width, &min_height);
|
||||
|
||||
std::string current_sort_col = mObjectList->getSortColumnName();
|
||||
BOOL current_sort_asc = mObjectList->getSortAscending();
|
||||
|
||||
mObjectList->clearRows();
|
||||
mObjectList->clearColumns();
|
||||
mObjectList->updateLayout();
|
||||
|
||||
std::vector<LLScrollListColumn::Params>::iterator param_it;
|
||||
for (param_it = column_params.begin(); param_it != column_params.end(); ++param_it)
|
||||
{
|
||||
LLScrollListColumn::Params p = *param_it;
|
||||
default_width += (p.width.pixel_width.getValue() + column_padding);
|
||||
|
||||
LLScrollListColumn::Params params;
|
||||
params.header = p.header;
|
||||
params.name = p.name;
|
||||
params.halign = p.halign;
|
||||
params.sort_direction = p.sort_direction;
|
||||
params.sort_column = p.sort_column;
|
||||
params.tool_tip = p.tool_tip;
|
||||
|
||||
if (column_config & mColumnBits[p.name.getValue()])
|
||||
{
|
||||
params.width = p.width;
|
||||
new_width += (params.width.pixel_width.getValue() + column_padding);
|
||||
}
|
||||
else
|
||||
{
|
||||
params.width.pixel_width.set(-1, true);
|
||||
}
|
||||
|
||||
mObjectList->addColumn(params);
|
||||
}
|
||||
|
||||
min_width -= (default_width - new_width - mLastResizeDelta);
|
||||
mLastResizeDelta = default_width - new_width;
|
||||
setResizeLimits(min_width, min_height);
|
||||
|
||||
if (getRect().getWidth() < min_width)
|
||||
{
|
||||
reshape(min_width, getRect().getHeight());
|
||||
}
|
||||
|
||||
if (!current_sort_col.empty())
|
||||
{
|
||||
if ((current_sort_col == "creation_date_sort" && mObjectList->getColumn("creation_date")->getWidth() == -1) ||
|
||||
mObjectList->getColumn(current_sort_col)->getWidth() == -1)
|
||||
{
|
||||
mObjectList->clearSortOrder();
|
||||
}
|
||||
else
|
||||
{
|
||||
mObjectList->sortByColumn(current_sort_col, current_sort_asc);
|
||||
}
|
||||
}
|
||||
mObjectList->setFilterColumn(0);
|
||||
mObjectList->dirtyColumns();
|
||||
setDirty();
|
||||
}
|
||||
|
||||
void LLFloaterInspect::onColumnVisibilityChecked(const LLSD& userdata)
|
||||
{
|
||||
std::string column = userdata.asString();
|
||||
U32 column_config = gSavedSettings.getU32("FSInspectColumnConfig");
|
||||
|
||||
U32 new_value;
|
||||
U32 enabled = (mColumnBits[column] & column_config);
|
||||
if (enabled)
|
||||
{
|
||||
new_value = (column_config & ~mColumnBits[column]);
|
||||
}
|
||||
else
|
||||
{
|
||||
new_value = (column_config | mColumnBits[column]);
|
||||
}
|
||||
|
||||
gSavedSettings.setU32("FSInspectColumnConfig", new_value);
|
||||
}
|
||||
|
||||
bool LLFloaterInspect::onEnableColumnVisibilityChecked(const LLSD& userdata)
|
||||
{
|
||||
std::string column = userdata.asString();
|
||||
U32 column_config = gSavedSettings.getU32("FSInspectColumnConfig");
|
||||
|
||||
return (mColumnBits[column] & column_config);
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ class LLUICtrl;
|
|||
// [RLVa:KB] - Checked: RLVa-2.0.1
|
||||
class LLSelectNode;
|
||||
// [/RLVa:KB]
|
||||
class LLMenuButton; // <FS:Ansariel> FIRE-22292: Configurable columns
|
||||
|
||||
class LLFloaterInspect : public LLFloater
|
||||
{
|
||||
|
|
@ -88,6 +89,19 @@ private:
|
|||
LLSafeHandle<LLObjectSelection> mObjectSelection;
|
||||
boost::signals2::connection mOwnerNameCacheConnection;
|
||||
boost::signals2::connection mCreatorNameCacheConnection;
|
||||
|
||||
// <FS:Ansariel> FIRE-22292: Configurable columns
|
||||
void onColumnDisplayModeChanged();
|
||||
void onColumnVisibilityChecked(const LLSD& userdata);
|
||||
bool onEnableColumnVisibilityChecked(const LLSD& userdata);
|
||||
|
||||
LLMenuButton* mOptionsButton;
|
||||
LLHandle<LLView> mOptionsMenuHandle;
|
||||
|
||||
std::map<std::string, U32> mColumnBits;
|
||||
S32 mLastResizeDelta;
|
||||
boost::signals2::connection mFSInspectColumnConfigConnection;
|
||||
// </FS:Ansariel>
|
||||
};
|
||||
|
||||
#endif //LL_LLFLOATERINSPECT_H
|
||||
|
|
|
|||
|
|
@ -35,4 +35,5 @@ VRAM: [VRAM_USAGE] KB
|
|||
</scroll_list>
|
||||
<button label="Besitzerprofil einsehen..." name="button owner" tool_tip="Profil des Besitzers des markierten Objekts einsehen" width="155"/>
|
||||
<button label="Erstellerprofil einsehen..." left="175" name="button creator" tool_tip="Profil des ursprünglichen Erstellers des markierten Objekts einsehen" width="155"/>
|
||||
<menu_button name="options_btn" tool_tip="Optionen"/>
|
||||
</floater>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<toggleable_menu name="menu_group_plus">
|
||||
<menu_item_check label="Beschreibung" name="description"/>
|
||||
<menu_item_check label="Besitzer" name="owner_name"/>
|
||||
<menu_item_check label="Ersteller" name="creator_name"/>
|
||||
<menu_item_check label="Flächen" name="facecount"/>
|
||||
<menu_item_check label="Vertices" name="vertexcount"/>
|
||||
<menu_item_check label="Dreiecke" name="trianglecount"/>
|
||||
<menu_item_check label="TMem" name="tramcount"/>
|
||||
<menu_item_check label="VRAM" name="vramcount"/>
|
||||
<menu_item_check label="Erstellungsdatum" name="creation_date"/>
|
||||
</toggleable_menu>
|
||||
|
|
@ -107,12 +107,14 @@ VRAM: [VRAM_USAGE] KB
|
|||
label=""
|
||||
name="creation_date_sort"
|
||||
width="-1" />
|
||||
<scroll_list.commit_callback
|
||||
function="Inspect.SelectObject" />
|
||||
<scroll_list.commit_callback
|
||||
function="Inspect.SelectObject" />
|
||||
</scroll_list>
|
||||
<button
|
||||
follows="left|bottom"
|
||||
height="23"
|
||||
image_selected="Toolbar_Middle_Selected"
|
||||
image_unselected="Toolbar_Middle_Off"
|
||||
label="See Owner Profile..."
|
||||
layout="topleft"
|
||||
left="4"
|
||||
|
|
@ -120,20 +122,43 @@ VRAM: [VRAM_USAGE] KB
|
|||
tool_tip="See profile of the highlighted object's owner"
|
||||
top_pad="4"
|
||||
width="150">
|
||||
<button.commit_callback
|
||||
function="Inspect.OwnerProfile" />
|
||||
</button>
|
||||
<button.commit_callback
|
||||
function="Inspect.OwnerProfile" />
|
||||
</button>
|
||||
<button
|
||||
follows="left|bottom"
|
||||
height="23"
|
||||
image_selected="Toolbar_Middle_Selected"
|
||||
image_unselected="Toolbar_Middle_Off"
|
||||
label="See Creator Profile..."
|
||||
layout="topleft"
|
||||
left_pad="5"
|
||||
left_pad="2"
|
||||
name="button creator"
|
||||
tool_tip="See profile of the highlighted object's original creator"
|
||||
top_delta="0"
|
||||
width="150">
|
||||
<button.commit_callback
|
||||
function="Inspect.CreatorProfile" />
|
||||
</button>
|
||||
<button.commit_callback
|
||||
function="Inspect.CreatorProfile" />
|
||||
</button>
|
||||
<menu_button
|
||||
follows="left|bottom"
|
||||
height="23"
|
||||
image_hover_unselected="Toolbar_Middle_Over"
|
||||
image_overlay="Conv_toolbar_sort"
|
||||
image_selected="Toolbar_Middle_Selected"
|
||||
image_unselected="Toolbar_Middle_Off"
|
||||
layout="topleft"
|
||||
left_pad="2"
|
||||
name="options_btn"
|
||||
tool_tip="Options"
|
||||
top_delta="0"
|
||||
width="31" />
|
||||
<icon
|
||||
follows="left|right"
|
||||
image_name="Toolbar_Middle_Off"
|
||||
left_pad="2"
|
||||
name="dummy_icon"
|
||||
top_delta="0"
|
||||
height="23"
|
||||
right="-4"/>
|
||||
</floater>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<toggleable_menu
|
||||
name="menu_group_plus">
|
||||
<menu_item_check
|
||||
label="Description"
|
||||
name="description">
|
||||
<menu_item_check.on_check
|
||||
function="Inspect.EnableColumn"
|
||||
parameter="description"/>
|
||||
<menu_item_check.on_click
|
||||
function="Inspect.ToggleColumn"
|
||||
parameter="description"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Owner Name"
|
||||
name="owner_name">
|
||||
<menu_item_check.on_check
|
||||
function="Inspect.EnableColumn"
|
||||
parameter="owner_name"/>
|
||||
<menu_item_check.on_click
|
||||
function="Inspect.ToggleColumn"
|
||||
parameter="owner_name"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Creator Name"
|
||||
name="creator_name">
|
||||
<menu_item_check.on_check
|
||||
function="Inspect.EnableColumn"
|
||||
parameter="creator_name"/>
|
||||
<menu_item_check.on_click
|
||||
function="Inspect.ToggleColumn"
|
||||
parameter="creator_name"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Faces"
|
||||
name="facecount">
|
||||
<menu_item_check.on_check
|
||||
function="Inspect.EnableColumn"
|
||||
parameter="facecount"/>
|
||||
<menu_item_check.on_click
|
||||
function="Inspect.ToggleColumn"
|
||||
parameter="facecount"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Vertices"
|
||||
name="vertexcount">
|
||||
<menu_item_check.on_check
|
||||
function="Inspect.EnableColumn"
|
||||
parameter="vertexcount"/>
|
||||
<menu_item_check.on_click
|
||||
function="Inspect.ToggleColumn"
|
||||
parameter="vertexcount"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Triangles"
|
||||
name="trianglecount">
|
||||
<menu_item_check.on_check
|
||||
function="Inspect.EnableColumn"
|
||||
parameter="trianglecount"/>
|
||||
<menu_item_check.on_click
|
||||
function="Inspect.ToggleColumn"
|
||||
parameter="trianglecount"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="TMem"
|
||||
name="tramcount">
|
||||
<menu_item_check.on_check
|
||||
function="Inspect.EnableColumn"
|
||||
parameter="tramcount"/>
|
||||
<menu_item_check.on_click
|
||||
function="Inspect.ToggleColumn"
|
||||
parameter="tramcount"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="VRAM"
|
||||
name="vramcount">
|
||||
<menu_item_check.on_check
|
||||
function="Inspect.EnableColumn"
|
||||
parameter="vramcount"/>
|
||||
<menu_item_check.on_click
|
||||
function="Inspect.ToggleColumn"
|
||||
parameter="vramcount"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Creation Date"
|
||||
name="creation_date">
|
||||
<menu_item_check.on_check
|
||||
function="Inspect.EnableColumn"
|
||||
parameter="creation_date"/>
|
||||
<menu_item_check.on_click
|
||||
function="Inspect.ToggleColumn"
|
||||
parameter="creation_date"/>
|
||||
</menu_item_check>
|
||||
</toggleable_menu>
|
||||
Loading…
Reference in New Issue