Omnifilter: visual feedback on owner UUID validation, added a couple of tooltips, changed label of owner input box.

master
Zi Ree 2025-12-13 17:09:00 +01:00
parent 08ef996d32
commit ace3433d4b
3 changed files with 22 additions and 2 deletions

View File

@ -123,6 +123,7 @@ void Omnifilter::onSelectNeedle()
{ {
mOwnerCtrl->setText(needle->mOwnerID.asString()); mOwnerCtrl->setText(needle->mOwnerID.asString());
} }
onOwnerChanged();
mTypeNearbyBtn->setToggleState(needle->mTypes.find(OmnifilterEngine::eType::NearbyChat) != needle->mTypes.end()); mTypeNearbyBtn->setToggleState(needle->mTypes.find(OmnifilterEngine::eType::NearbyChat) != needle->mTypes.end());
mTypeIMBtn->setToggleState(needle->mTypes.find(OmnifilterEngine::eType::InstantMessage) != needle->mTypes.end()); mTypeIMBtn->setToggleState(needle->mTypes.find(OmnifilterEngine::eType::InstantMessage) != needle->mTypes.end());
@ -256,6 +257,20 @@ void Omnifilter::onNeedleCheckboxChanged(LLUICtrl* ctrl)
OmnifilterEngine::getInstance()->setDirty(true); OmnifilterEngine::getInstance()->setDirty(true);
} }
void Omnifilter::onOwnerChanged()
{
static LLColor4 default_text_color = mOwnerCtrl->getFgColor();
if (LLUUID::validate(mOwnerCtrl->getValue()))
{
mOwnerCtrl->setFgColor(default_text_color);
}
else
{
mOwnerCtrl->setFgColor(LLUIColorTable::getInstance()->getColor("EmphasisColor"));
}
}
void Omnifilter::onLogLine(time_t time, const std::string& log_line) void Omnifilter::onLogLine(time_t time, const std::string& log_line)
{ {
LLDate date((F64)time); LLDate date((F64)time);
@ -368,6 +383,7 @@ bool Omnifilter::postBuild()
mButtonReplyCtrl->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this)); mButtonReplyCtrl->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this));
mTextBoxReplyCtrl->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this)); mTextBoxReplyCtrl->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this));
mOwnerCtrl->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this)); mOwnerCtrl->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this));
mOwnerCtrl->setKeystrokeCallback(boost::bind(&Omnifilter::onOwnerChanged, this), nullptr);
mTypeNearbyBtn->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this)); mTypeNearbyBtn->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this));
mTypeIMBtn->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this)); mTypeIMBtn->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this));
mTypeGroupIMBtn->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this)); mTypeGroupIMBtn->setCommitCallback(boost::bind(&Omnifilter::onNeedleChanged, this));

View File

@ -58,6 +58,7 @@ class Omnifilter
void onRemoveNeedleClicked(); void onRemoveNeedleClicked();
void onNeedleNameChanged(); void onNeedleNameChanged();
void onNeedleCheckboxChanged(LLUICtrl* ctrl); void onNeedleCheckboxChanged(LLUICtrl* ctrl);
void onOwnerChanged();
void onLogLine(time_t time, const std::string& logLine); void onLogLine(time_t time, const std::string& logLine);

View File

@ -330,7 +330,8 @@
follows="left|right|bottom" follows="left|right|bottom"
height="20" height="20"
left_pad="4" left_pad="4"
right="-4"/> right="-4"
tool_tip="The region name of the source. Only available for inventory offers."/>
<text <text
name="owner_label" name="owner_label"
layout="topleft" layout="topleft"
@ -338,14 +339,16 @@
height="20" height="20"
width="100" width="100"
left="0" left="0"
tool_tip="For group invites: The group's UUID. For object chat, owner say, debug chat or direct chat: The UUID of the object. For object IMs: The UUID of the object owner. For everything else, the UUID of the sender avatar."
top_pad="2" top_pad="2"
valign="center" valign="center"
value="Owner:"/> value="Owner Key:"/>
<line_editor <line_editor
name="owner_uuid" name="owner_uuid"
layout="topleft" layout="topleft"
follows="left|right|bottom" follows="left|right|bottom"
height="20" height="20"
label="00000000-0000-0000-0000-000000000000"
left_pad="4" left_pad="4"
right="-4"/> right="-4"/>
<text <text