summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfolderview.cpp40
-rw-r--r--indra/llui/llfolderview.h2
-rw-r--r--indra/llui/llnotifications.cpp8
-rw-r--r--indra/llui/llstyle.cpp7
-rw-r--r--indra/llui/llstyle.h1
-rw-r--r--indra/llui/lltextbase.cpp10
-rw-r--r--indra/llui/lltextbox.cpp3
-rw-r--r--indra/llui/lltransutil.cpp2
8 files changed, 55 insertions, 18 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 42a9e267d2..a059c4d741 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -28,6 +28,7 @@
#include "llfolderview.h"
#include "llfolderviewmodel.h"
+#include "llcallbacklist.h"
#include "llclipboard.h" // *TODO: remove this once hack below gone.
#include "llkeyboard.h"
#include "lllineeditor.h"
@@ -274,7 +275,11 @@ LLFolderView::~LLFolderView( void )
mRenamer = NULL;
mStatusTextBox = NULL;
- if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die();
+ if (mPopupMenuHandle.get())
+ {
+ mPopupMenuHandle.get()->die();
+ gIdleCallbacks.deleteFunction(onIdleUpdateMenu, this);
+ }
mPopupMenuHandle.markDead();
mAutoOpenItems.removeAllNodes();
@@ -1095,7 +1100,10 @@ bool LLFolderView::handleKeyHere( KEY key, MASK mask )
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
if (menu && menu->isOpen())
{
- LLMenuGL::sMenuContainer->hideMenus();
+ if (LLMenuGL::sMenuContainer->hideMenus())
+ {
+ gIdleCallbacks.deleteFunction(onIdleUpdateMenu, this);
+ }
}
switch( key )
@@ -1340,7 +1348,10 @@ bool LLFolderView::handleUnicodeCharHere(llwchar uni_char)
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
if (menu && menu->isOpen())
{
- LLMenuGL::sMenuContainer->hideMenus();
+ if (LLMenuGL::sMenuContainer->hideMenus())
+ {
+ gIdleCallbacks.deleteFunction(onIdleUpdateMenu, this);
+ }
}
//do text search
@@ -1612,7 +1623,11 @@ void LLFolderView::deleteAllChildren()
{
LLUI::getInstance()->removePopup(mRenamer);
}
- if (mPopupMenuHandle.get()) mPopupMenuHandle.get()->die();
+ if (mPopupMenuHandle.get())
+ {
+ mPopupMenuHandle.get()->die();
+ gIdleCallbacks.deleteFunction(onIdleUpdateMenu, this);
+ }
mPopupMenuHandle.markDead();
mScrollContainer = NULL;
mRenameItem = NULL;
@@ -1979,9 +1994,24 @@ void LLFolderView::updateMenu()
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
if (menu && menu->getVisible())
{
- updateMenuOptions(menu);
+ // When fetching folders in bulk or in parts, each callback
+ // cause updateMenu individually, so make sure it gets called
+ // only once per frame, after callbacks are done.
+ // gIdleCallbacks has built in dupplicate protection.
+ gIdleCallbacks.addFunction(onIdleUpdateMenu, this);
+ }
+}
+
+void LLFolderView::onIdleUpdateMenu(void* user_data)
+{
+ LLFolderView* self = (LLFolderView*)user_data;
+ LLMenuGL* menu = (LLMenuGL*)self->mPopupMenuHandle.get();
+ if (menu)
+ {
+ self->updateMenuOptions(menu);
menu->needsArrange(); // update menu height if needed
}
+ gIdleCallbacks.deleteFunction(onIdleUpdateMenu, NULL);
}
bool LLFolderView::isFolderSelected()
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h
index 62ef2a0626..7ed10d9223 100644
--- a/indra/llui/llfolderview.h
+++ b/indra/llui/llfolderview.h
@@ -266,6 +266,7 @@ public:
private:
void updateMenuOptions(LLMenuGL* menu);
void updateRenamerPosition();
+ static void onIdleUpdateMenu(void* user_data);
protected:
LLScrollContainer* mScrollContainer; // NULL if this is not a child of a scroll container.
@@ -414,6 +415,7 @@ public:
virtual void doItem(LLFolderViewItem* item) {}
void setApply(bool apply);
void clearOpenFolders() { mOpenFolders.clear(); }
+ bool hasOpenFolders() { return !mOpenFolders.empty(); }
protected:
std::set<LLUUID> mOpenFolders;
bool mApply;
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index cd80e7f63f..7405413a3d 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1555,7 +1555,7 @@ bool LLNotifications::loadTemplates()
gDirUtilp->findSkinnedFilenames(LLDir::XUI, "notifications.xml", LLDir::ALL_SKINS);
if (search_paths.empty())
{
- LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"));
+ LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"), LLError::LLUserWarningMsg::ERROR_MISSING_FILES);
LL_ERRS() << "Problem finding notifications.xml" << LL_ENDL;
}
@@ -1565,7 +1565,7 @@ bool LLNotifications::loadTemplates()
if (!success || root.isNull() || !root->hasName( "notifications" ))
{
- LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"));
+ LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"), LLError::LLUserWarningMsg::ERROR_MISSING_FILES);
LL_ERRS() << "Problem reading XML from UI Notifications file: " << base_filename << LL_ENDL;
return false;
}
@@ -1576,7 +1576,7 @@ bool LLNotifications::loadTemplates()
if(!params.validateBlock())
{
- LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"));
+ LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"), LLError::LLUserWarningMsg::ERROR_MISSING_FILES);
LL_ERRS() << "Problem reading XUI from UI Notifications file: " << base_filename << LL_ENDL;
return false;
}
@@ -1643,7 +1643,7 @@ bool LLNotifications::loadVisibilityRules()
if(!params.validateBlock())
{
- LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"));
+ LLError::LLUserWarningMsg::show(LLTrans::getString("MBMissingFile"), LLError::LLUserWarningMsg::ERROR_MISSING_FILES);
LL_ERRS() << "Problem reading UI Notification Visibility Rules file: " << full_filename << LL_ENDL;
return false;
}
diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp
index df4b0ef6a0..4714665e8b 100644
--- a/indra/llui/llstyle.cpp
+++ b/indra/llui/llstyle.cpp
@@ -39,7 +39,7 @@ LLStyle::Params::Params()
readonly_color("readonly_color", LLColor4::black),
selected_color("selected_color", LLColor4::black),
alpha("alpha", 1.f),
- font("font", LLFontGL::getFontMonospace()),
+ font("font", LLStyle::getDefaultFont()),
image("image"),
link_href("href"),
is_link("is_link")
@@ -70,6 +70,11 @@ const LLFontGL* LLStyle::getFont() const
return mFont;
}
+const LLFontGL* LLStyle::getDefaultFont()
+{
+ return LLFontGL::getFontMonospace();
+}
+
void LLStyle::setLinkHREF(const std::string& href)
{
mLink = href;
diff --git a/indra/llui/llstyle.h b/indra/llui/llstyle.h
index e506895de5..0c78fe5a9f 100644
--- a/indra/llui/llstyle.h
+++ b/indra/llui/llstyle.h
@@ -72,6 +72,7 @@ public:
void setFont(const LLFontGL* font);
const LLFontGL* getFont() const;
+ static const LLFontGL* getDefaultFont();
const std::string& getLinkHREF() const { return mLink; }
void setLinkHREF(const std::string& href);
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index cbbf83d679..fae22fd248 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1438,7 +1438,8 @@ void LLTextBase::onVisibilityChange( bool new_visibility )
//virtual
void LLTextBase::setValue(const LLSD& value )
{
- setText(value.asString());
+ static const LLStyle::Params input_params = LLStyle::Params();
+ setText(value.asString(), input_params);
}
//virtual
@@ -3880,8 +3881,7 @@ bool LLInlineViewSegment::getDimensionsF32(S32 first_char, S32 num_chars, F32& w
if (mForceNewLine)
{
// Chat, string can't be smaller then font height even if it is empty
- LLStyleSP s(new LLStyle(LLStyle::Params().visible(true)));
- height = s->getFont()->getLineHeight();
+ height = LLStyle::getDefaultFont()->getLineHeight();
return true; // new line
}
@@ -3945,9 +3945,7 @@ void LLInlineViewSegment::linkToDocument(LLTextBase* editor)
LLLineBreakTextSegment::LLLineBreakTextSegment(S32 pos):LLTextSegment(pos,pos+1)
{
- LLStyleSP s( new LLStyle(LLStyle::Params().visible(true)));
-
- mFontHeight = s->getFont()->getLineHeight();
+ mFontHeight = LLStyle::getDefaultFont()->getLineHeight();
}
LLLineBreakTextSegment::LLLineBreakTextSegment(LLStyleConstSP style,S32 pos):LLTextSegment(pos,pos+1)
{
diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp
index 05af36b71e..9f945d3735 100644
--- a/indra/llui/lltextbox.cpp
+++ b/indra/llui/lltextbox.cpp
@@ -159,7 +159,8 @@ LLSD LLTextBox::getValue() const
bool LLTextBox::setTextArg( const std::string& key, const LLStringExplicit& text )
{
mText.setArg(key, text);
- LLTextBase::setText(mText.getString());
+ static const LLStyle::Params input_params = LLStyle::Params();
+ LLTextBase::setText(mText.getString(), input_params);
return true;
}
diff --git a/indra/llui/lltransutil.cpp b/indra/llui/lltransutil.cpp
index 4af5376a8b..e82af0b96f 100644
--- a/indra/llui/lltransutil.cpp
+++ b/indra/llui/lltransutil.cpp
@@ -48,7 +48,7 @@ bool LLTransUtil::parseStrings(const std::string& xml_filename, const std::set<s
"Second Life viewer couldn't access some of the files it needs and will be closed."
"\n\nPlease reinstall viewer from https://secondlife.com/support/downloads/ and "
"contact https://support.secondlife.com if issue persists after reinstall.";
- LLError::LLUserWarningMsg::show(error_string);
+ LLError::LLUserWarningMsg::show(error_string, LLError::LLUserWarningMsg::ERROR_MISSING_FILES);
gDirUtilp->dumpCurrentDirectories(LLError::LEVEL_WARN);
LL_ERRS() << "Couldn't load string table " << xml_filename << " " << errno << LL_ENDL;
return false;