summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2017-09-22 09:18:34 -0700
committerRider Linden <rider@lindenlab.com>2017-09-22 09:18:34 -0700
commit5d3599f5d155dc112c8f05197c8fc73397084e71 (patch)
tree1b67cdb5944a222c1de6de3b974caea78a019762 /indra/llui
parent150fba7c5cd24ad9ab343e762bfd15032e6a9462 (diff)
parent38d9454cbf30f470a723d912be2080f63ae3fa47 (diff)
Merge
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llaccordionctrltab.cpp5
-rw-r--r--indra/llui/llfolderview.cpp12
-rw-r--r--indra/llui/llfolderview.h12
-rw-r--r--indra/llui/llfolderviewitem.cpp5
-rw-r--r--indra/llui/llmenugl.cpp3
-rw-r--r--indra/llui/llnotifications.cpp24
-rw-r--r--indra/llui/llnotifications.h8
-rw-r--r--indra/llui/llnotificationtemplate.h3
-rw-r--r--indra/llui/llscrolllistctrl.cpp15
-rw-r--r--indra/llui/llscrolllistctrl.h2
-rw-r--r--indra/llui/llspinctrl.cpp26
-rw-r--r--indra/llui/llspinctrl.h1
12 files changed, 112 insertions, 4 deletions
diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp
index f8ef5289db..eaf1284237 100644
--- a/indra/llui/llaccordionctrltab.cpp
+++ b/indra/llui/llaccordionctrltab.cpp
@@ -823,6 +823,11 @@ BOOL LLAccordionCtrlTab::handleKey(KEY key, MASK mask, BOOL called_from_parent)
void LLAccordionCtrlTab::showAndFocusHeader()
{
+ if (!mHeader)
+ {
+ return;
+ }
+
mHeader->setFocus(true);
mHeader->setSelected(mSelectionEnabled);
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index f9664e0658..895753aeae 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -102,6 +102,18 @@ void LLCloseAllFoldersFunctor::doFolder(LLFolderViewFolder* folder)
void LLCloseAllFoldersFunctor::doItem(LLFolderViewItem* item)
{ }
+//---------------------------------------------------------------------------
+
+void LLAllDescendentsPassedFilter::doFolder(LLFolderViewFolder* folder)
+{
+ mAllDescendentsPassedFilter &= (folder) && (folder->passedFilter()) && (folder->descendantsPassedFilter());
+}
+
+void LLAllDescendentsPassedFilter::doItem(LLFolderViewItem* item)
+{
+ mAllDescendentsPassedFilter &= (item) && (item->passedFilter());
+}
+
///----------------------------------------------------------------------------
/// Class LLFolderViewScrollContainer
///----------------------------------------------------------------------------
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h
index b5deefd653..2926e160d0 100644
--- a/indra/llui/llfolderview.h
+++ b/indra/llui/llfolderview.h
@@ -400,6 +400,18 @@ public:
virtual void doItem(LLFolderViewItem* item);
};
+class LLAllDescendentsPassedFilter : public LLFolderViewFunctor
+{
+public:
+ LLAllDescendentsPassedFilter() : mAllDescendentsPassedFilter(true) {}
+ /*virtual*/ ~LLAllDescendentsPassedFilter() {}
+ /*virtual*/ void doFolder(LLFolderViewFolder* folder);
+ /*virtual*/ void doItem(LLFolderViewItem* item);
+ bool allDescendentsPassedFilter() const { return mAllDescendentsPassedFilter; }
+protected:
+ bool mAllDescendentsPassedFilter;
+};
+
// Flags for buildContextMenu()
const U32 SUPPRESS_OPEN_ITEM = 0x1;
const U32 FIRST_SELECTED_ITEM = 0x2;
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 3d618548c4..0510e472c5 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -1176,6 +1176,11 @@ BOOL LLFolderViewFolder::needsArrange()
return mLastArrangeGeneration < getRoot()->getArrangeGeneration();
}
+bool LLFolderViewFolder::descendantsPassedFilter(S32 filter_generation)
+{
+ return getViewModelItem()->descendantsPassedFilter(filter_generation);
+}
+
// Passes selection information on to children and record selection
// information if necessary.
BOOL LLFolderViewFolder::setSelection(LLFolderViewItem* selection, BOOL openitem,
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 022f814bbc..0d42f726fa 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -3331,6 +3331,7 @@ BOOL LLMenuBarGL::handleAcceleratorKey(KEY key, MASK mask)
if (getHighlightedItem())
{
clearHoverItem();
+ LLMenuGL::setKeyboardMode(FALSE);
}
else
{
@@ -3777,10 +3778,10 @@ BOOL LLMenuHolderGL::hideMenus()
{
return FALSE;
}
+ LLMenuGL::setKeyboardMode(FALSE);
BOOL menu_visible = hasVisibleMenu();
if (menu_visible)
{
- LLMenuGL::setKeyboardMode(FALSE);
// clicked off of menu, hide them all
for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
{
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 604092d536..7bafd711cb 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -67,7 +67,8 @@ LLNotificationForm::FormIgnore::FormIgnore()
: text("text"),
control("control"),
invert_control("invert_control", false),
- save_option("save_option", false)
+ save_option("save_option", false),
+ session_only("session_only", false)
{}
LLNotificationForm::FormButton::FormButton()
@@ -125,6 +126,7 @@ bool handleIgnoredNotification(const LLSD& payload)
switch(form->getIgnoreType())
{
case LLNotificationForm::IGNORE_WITH_DEFAULT_RESPONSE:
+ case LLNotificationForm::IGNORE_WITH_DEFAULT_RESPONSE_SESSION_ONLY:
response = pNotif->getResponseTemplate(LLNotification::WITH_DEFAULT_BUTTON);
break;
case LLNotificationForm::IGNORE_WITH_LAST_RESPONSE:
@@ -197,7 +199,7 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLNotifica
if (!p.ignore.save_option)
{
- mIgnore = IGNORE_WITH_DEFAULT_RESPONSE;
+ mIgnore = p.ignore.session_only ? IGNORE_WITH_DEFAULT_RESPONSE_SESSION_ONLY : IGNORE_WITH_DEFAULT_RESPONSE;
}
else
{
@@ -426,6 +428,7 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
mLogToChat(p.log_to_chat),
mLogToIM(p.log_to_im),
mShowToast(p.show_toast),
+ mFadeToast(p.fade_toast),
mSoundName("")
{
if (p.sound.isProvided()
@@ -942,6 +945,11 @@ bool LLNotification::canShowToast() const
return mTemplatep->mShowToast;
}
+bool LLNotification::canFadeToast() const
+{
+ return mTemplatep->mFadeToast;
+}
+
bool LLNotification::hasFormElements() const
{
return mTemplatep->mForm->getNumElements() != 0;
@@ -1792,6 +1800,18 @@ bool LLNotifications::getIgnoreAllNotifications()
{
return mIgnoreAllNotifications;
}
+
+void LLNotifications::setIgnored(const std::string& name, bool ignored)
+{
+ LLNotificationTemplatePtr templatep = getTemplate(name);
+ templatep->mForm->setIgnored(ignored);
+}
+
+bool LLNotifications::getIgnored(const std::string& name)
+{
+ LLNotificationTemplatePtr templatep = getTemplate(name);
+ return (mIgnoreAllNotifications) || ( (templatep->mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO) && (templatep->mForm->getIgnored()) );
+}
bool LLNotifications::isVisibleByRules(LLNotificationPtr n)
{
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 024332ee65..ccdfb90054 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -179,6 +179,7 @@ public:
Optional<bool> save_option;
Optional<std::string> control;
Optional<bool> invert_control;
+ Optional<bool> session_only;
FormIgnore();
};
@@ -232,7 +233,8 @@ public:
typedef enum e_ignore_type
{
IGNORE_NO,
- IGNORE_WITH_DEFAULT_RESPONSE,
+ IGNORE_WITH_DEFAULT_RESPONSE,
+ IGNORE_WITH_DEFAULT_RESPONSE_SESSION_ONLY,
IGNORE_WITH_LAST_RESPONSE,
IGNORE_SHOW_AGAIN
} EIgnoreType;
@@ -558,6 +560,7 @@ public:
bool canLogToChat() const;
bool canLogToIM() const;
bool canShowToast() const;
+ bool canFadeToast() const;
bool hasFormElements() const;
void playSound();
@@ -963,6 +966,9 @@ public:
void setIgnoreAllNotifications(bool ignore);
bool getIgnoreAllNotifications();
+ void setIgnored(const std::string& name, bool ignored);
+ bool getIgnored(const std::string& name);
+
bool isVisibleByRules(LLNotificationPtr pNotification);
private:
diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h
index bed29254d8..20cbc89ede 100644
--- a/indra/llui/llnotificationtemplate.h
+++ b/indra/llui/llnotificationtemplate.h
@@ -177,6 +177,7 @@ struct LLNotificationTemplate
Optional<bool> persist,
log_to_im,
show_toast,
+ fade_toast,
log_to_chat,
force_urls_external;
Optional<std::string> functor,
@@ -199,6 +200,7 @@ struct LLNotificationTemplate
Params()
: name("name"),
persist("persist", false),
+ fade_toast("fade_toast", true),
log_to_im("log_to_im", false),
show_toast("show_toast", true),
log_to_chat("log_to_chat", true),
@@ -316,6 +318,7 @@ struct LLNotificationTemplate
bool mLogToChat;
bool mLogToIM;
bool mShowToast;
+ bool mFadeToast;
};
#endif //LL_LLNOTIFICATION_TEMPLATE_H
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 0afa8d43f1..7c1f4a4dca 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -345,6 +345,21 @@ S32 LLScrollListCtrl::getItemCount() const
return mItemList.size();
}
+BOOL LLScrollListCtrl::hasSelectedItem() const
+{
+ item_list::iterator iter;
+ for (iter = mItemList.begin(); iter < mItemList.end(); )
+ {
+ LLScrollListItem* itemp = *iter;
+ if (itemp && itemp->getSelected())
+ {
+ return TRUE;
+ }
+ iter++;
+ }
+ return FALSE;
+}
+
// virtual LLScrolListInterface function (was deleteAllItems)
void LLScrollListCtrl::clearRows()
{
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index 8343750a54..699a8744e1 100644
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -201,6 +201,8 @@ public:
virtual BOOL isSelected(const LLSD& value) const;
+ BOOL hasSelectedItem() const;
+
BOOL handleClick(S32 x, S32 y, MASK mask);
BOOL selectFirstItem();
BOOL selectNthItem( S32 index );
diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp
index d49e216898..f6831c6d5e 100644
--- a/indra/llui/llspinctrl.cpp
+++ b/indra/llui/llspinctrl.cpp
@@ -130,6 +130,7 @@ LLSpinCtrl::LLSpinCtrl(const LLSpinCtrl::Params& p)
params.follows.flags(FOLLOWS_LEFT | FOLLOWS_BOTTOM);
mEditor = LLUICtrlFactory::create<LLLineEditor> (params);
mEditor->setFocusReceivedCallback( boost::bind(&LLSpinCtrl::onEditorGainFocus, _1, this ));
+ mEditor->setFocusLostCallback( boost::bind(&LLSpinCtrl::onEditorLostFocus, _1, this ));
if (p.allow_digits_only)
{
mEditor->setPrevalidateInput(LLTextValidate::validateNonNegativeS32NoSpace);
@@ -239,6 +240,31 @@ void LLSpinCtrl::onEditorGainFocus( LLFocusableElement* caller, void *userdata )
self->onFocusReceived();
}
+// static
+void LLSpinCtrl::onEditorLostFocus( LLFocusableElement* caller, void *userdata )
+{
+ LLSpinCtrl* self = (LLSpinCtrl*) userdata;
+ llassert( caller == self->mEditor );
+
+ self->onFocusLost();
+
+ std::string text = self->mEditor->getText();
+
+ LLLocale locale(LLLocale::USER_LOCALE);
+ F32 val = (F32)atof(text.c_str());
+
+ F32 saved_val = self->getValueF32();
+ if (saved_val != val && !self->mEditor->isDirty())
+ {
+ // Editor was focused when value update arrived, string
+ // in editor is different from one in spin control.
+ // Since editor is not dirty, it won't commit, so either
+ // attempt to commit value from editor or revert to a more
+ // recent value from spin control
+ self->updateEditor();
+ }
+}
+
void LLSpinCtrl::setValue(const LLSD& value )
{
F32 v = (F32)value.asReal();
diff --git a/indra/llui/llspinctrl.h b/indra/llui/llspinctrl.h
index e34add879d..cab99c35bd 100644
--- a/indra/llui/llspinctrl.h
+++ b/indra/llui/llspinctrl.h
@@ -93,6 +93,7 @@ public:
void onEditorCommit(const LLSD& data);
static void onEditorGainFocus(LLFocusableElement* caller, void *userdata);
+ static void onEditorLostFocus(LLFocusableElement* caller, void *userdata);
static void onEditorChangeFocus(LLUICtrl* caller, S32 direction, void *userdata);
void onUpBtn(const LLSD& data);