Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
b3c1e967
Commit
b3c1e967
authored
13 years ago
by
Merov Linden
Browse files
Options
Downloads
Patches
Plain Diff
EXP-1354 : FIX. Force loading the default toolbars if the user toolbar loading fails somewhat.
parent
ab9d1982
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/lltoolbarview.cpp
+24
-8
24 additions, 8 deletions
indra/newview/lltoolbarview.cpp
with
24 additions
and
8 deletions
indra/newview/lltoolbarview.cpp
+
24
−
8
View file @
b3c1e967
...
@@ -151,6 +151,7 @@ bool LLToolBarView::addCommand(const LLCommandId& command, LLToolBar* toolbar)
...
@@ -151,6 +151,7 @@ bool LLToolBarView::addCommand(const LLCommandId& command, LLToolBar* toolbar)
bool
LLToolBarView
::
loadToolbars
(
bool
force_default
)
bool
LLToolBarView
::
loadToolbars
(
bool
force_default
)
{
{
LLToolBarView
::
ToolbarSet
toolbar_set
;
LLToolBarView
::
ToolbarSet
toolbar_set
;
bool
err
=
false
;
// Load the toolbars.xml file
// Load the toolbars.xml file
std
::
string
toolbar_file
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_PER_SL_ACCOUNT
,
"toolbars.xml"
);
std
::
string
toolbar_file
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_PER_SL_ACCOUNT
,
"toolbars.xml"
);
...
@@ -165,24 +166,39 @@ bool LLToolBarView::loadToolbars(bool force_default)
...
@@ -165,24 +166,39 @@ bool LLToolBarView::loadToolbars(bool force_default)
}
}
LLXMLNodePtr
root
;
LLXMLNodePtr
root
;
if
(
!
LLXMLNode
::
parseFile
(
toolbar_file
,
root
,
NULL
))
if
(
!
LLXMLNode
::
parseFile
(
toolbar_file
,
root
,
NULL
))
{
{
llwarns
<<
"Unable to load toolbars from file: "
<<
toolbar_file
<<
llendl
;
llwarns
<<
"Unable to load toolbars from file: "
<<
toolbar_file
<<
llendl
;
return
fals
e
;
err
=
tru
e
;
}
}
if
(
!
root
->
hasName
(
"toolbars"
))
if
(
!
err
&&
!
root
->
hasName
(
"toolbars"
))
{
{
llwarns
<<
toolbar_file
<<
" is not a valid toolbars definition file"
<<
llendl
;
llwarns
<<
toolbar_file
<<
" is not a valid toolbars definition file"
<<
llendl
;
return
fals
e
;
err
=
tru
e
;
}
}
// Parse the toolbar settings
// Parse the toolbar settings
LLXUIParser
parser
;
LLXUIParser
parser
;
parser
.
readXUI
(
root
,
toolbar_set
,
toolbar_file
);
if
(
!
err
)
if
(
!
toolbar_set
.
validateBlock
())
{
{
llerrs
<<
"Unable to validate toolbars from file: "
<<
toolbar_file
<<
llendl
;
parser
.
readXUI
(
root
,
toolbar_set
,
toolbar_file
);
return
false
;
}
if
(
!
err
&&
!
toolbar_set
.
validateBlock
())
{
llwarns
<<
"Unable to validate toolbars from file: "
<<
toolbar_file
<<
llendl
;
err
=
true
;
}
if
(
err
)
{
if
(
force_default
)
{
llerrs
<<
"Unable to load toolbars from default file : "
<<
toolbar_file
<<
llendl
;
return
false
;
}
// Try to load the default toolbars
return
loadToolbars
(
true
);
}
}
// Clear the toolbars now before adding the loaded commands and settings
// Clear the toolbars now before adding the loaded commands and settings
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment