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
1129c725
Commit
1129c725
authored
15 years ago
by
Dmitry Zaporozhan
Browse files
Options
Downloads
Patches
Plain Diff
Fixed normal bug EXT-4817 - Preferences > Chat > Alert color preference is broken
--HG-- branch : product-engine
parent
d3d389c6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llui/lluicolortable.cpp
+14
-14
14 additions, 14 deletions
indra/llui/lluicolortable.cpp
indra/llui/lluicolortable.h
+6
-3
6 additions, 3 deletions
indra/llui/lluicolortable.h
with
20 additions
and
17 deletions
indra/llui/lluicolortable.cpp
+
14
−
14
View file @
1129c725
...
@@ -56,7 +56,7 @@ LLUIColorTable::Params::Params()
...
@@ -56,7 +56,7 @@ LLUIColorTable::Params::Params()
{
{
}
}
void
LLUIColorTable
::
insertFromParams
(
const
Params
&
p
)
void
LLUIColorTable
::
insertFromParams
(
const
Params
&
p
,
string_color_map_t
&
table
)
{
{
// this map will contain all color references after the following loop
// this map will contain all color references after the following loop
typedef
std
::
map
<
std
::
string
,
std
::
string
>
string_string_map_t
;
typedef
std
::
map
<
std
::
string
,
std
::
string
>
string_string_map_t
;
...
@@ -69,14 +69,7 @@ void LLUIColorTable::insertFromParams(const Params& p)
...
@@ -69,14 +69,7 @@ void LLUIColorTable::insertFromParams(const Params& p)
ColorEntryParams
color_entry
=
*
it
;
ColorEntryParams
color_entry
=
*
it
;
if
(
color_entry
.
color
.
value
.
isChosen
())
if
(
color_entry
.
color
.
value
.
isChosen
())
{
{
if
(
mUserSetColors
.
find
(
color_entry
.
name
)
!=
mUserSetColors
.
end
())
setColor
(
color_entry
.
name
,
color_entry
.
color
.
value
,
table
);
{
setColor
(
color_entry
.
name
,
color_entry
.
color
.
value
);
}
else
{
setColor
(
color_entry
.
name
,
color_entry
.
color
.
value
,
mLoadedColors
);
}
}
}
else
else
{
{
...
@@ -220,16 +213,16 @@ bool LLUIColorTable::loadFromSettings()
...
@@ -220,16 +213,16 @@ bool LLUIColorTable::loadFromSettings()
bool
result
=
false
;
bool
result
=
false
;
std
::
string
default_filename
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_DEFAULT_SKIN
,
"colors.xml"
);
std
::
string
default_filename
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_DEFAULT_SKIN
,
"colors.xml"
);
result
|=
loadFromFilename
(
default_filename
);
result
|=
loadFromFilename
(
default_filename
,
mLoadedColors
);
std
::
string
current_filename
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_TOP_SKIN
,
"colors.xml"
);
std
::
string
current_filename
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_TOP_SKIN
,
"colors.xml"
);
if
(
current_filename
!=
default_filename
)
if
(
current_filename
!=
default_filename
)
{
{
result
|=
loadFromFilename
(
current_filename
);
result
|=
loadFromFilename
(
current_filename
,
mLoadedColors
);
}
}
std
::
string
user_filename
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_USER_SETTINGS
,
"colors.xml"
);
std
::
string
user_filename
=
gDirUtilp
->
getExpandedFilename
(
LL_PATH_USER_SETTINGS
,
"colors.xml"
);
loadFromFilename
(
user_filename
);
loadFromFilename
(
user_filename
,
mUserSetColors
);
return
result
;
return
result
;
}
}
...
@@ -299,7 +292,7 @@ void LLUIColorTable::setColor(const std::string& name, const LLColor4& color, st
...
@@ -299,7 +292,7 @@ void LLUIColorTable::setColor(const std::string& name, const LLColor4& color, st
}
}
}
}
bool
LLUIColorTable
::
loadFromFilename
(
const
std
::
string
&
filename
)
bool
LLUIColorTable
::
loadFromFilename
(
const
std
::
string
&
filename
,
string_color_map_t
&
table
)
{
{
LLXMLNodePtr
root
;
LLXMLNodePtr
root
;
...
@@ -320,7 +313,7 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename)
...
@@ -320,7 +313,7 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename)
if
(
params
.
validateBlock
())
if
(
params
.
validateBlock
())
{
{
insertFromParams
(
params
);
insertFromParams
(
params
,
table
);
}
}
else
else
{
{
...
@@ -330,3 +323,10 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename)
...
@@ -330,3 +323,10 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename)
return
true
;
return
true
;
}
}
void
LLUIColorTable
::
insertFromParams
(
const
Params
&
p
)
{
insertFromParams
(
p
,
mUserSetColors
);
}
// EOF
\ No newline at end of file
This diff is collapsed.
Click to expand it.
indra/llui/lluicolortable.h
+
6
−
3
View file @
1129c725
...
@@ -45,6 +45,10 @@ class LLUIColor;
...
@@ -45,6 +45,10 @@ class LLUIColor;
class
LLUIColorTable
:
public
LLSingleton
<
LLUIColorTable
>
class
LLUIColorTable
:
public
LLSingleton
<
LLUIColorTable
>
{
{
LOG_CLASS
(
LLUIColorTable
);
LOG_CLASS
(
LLUIColorTable
);
// consider using sorted vector, can be much faster
typedef
std
::
map
<
std
::
string
,
LLUIColor
>
string_color_map_t
;
public:
public:
struct
ColorParams
:
LLInitParam
::
Choice
<
ColorParams
>
struct
ColorParams
:
LLInitParam
::
Choice
<
ColorParams
>
{
{
...
@@ -91,10 +95,9 @@ LOG_CLASS(LLUIColorTable);
...
@@ -91,10 +95,9 @@ LOG_CLASS(LLUIColorTable);
void
saveUserSettings
()
const
;
void
saveUserSettings
()
const
;
private
:
private
:
bool
loadFromFilename
(
const
std
::
string
&
filename
);
bool
loadFromFilename
(
const
std
::
string
&
filename
,
string_color_map_t
&
table
);
// consider using sorted vector, can be much faster
void
insertFromParams
(
const
Params
&
p
,
string_color_map_t
&
table
);
typedef
std
::
map
<
std
::
string
,
LLUIColor
>
string_color_map_t
;
void
clearTable
(
string_color_map_t
&
table
);
void
clearTable
(
string_color_map_t
&
table
);
void
setColor
(
const
std
::
string
&
name
,
const
LLColor4
&
color
,
string_color_map_t
&
table
);
void
setColor
(
const
std
::
string
&
name
,
const
LLColor4
&
color
,
string_color_map_t
&
table
);
...
...
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