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
66fee673
Commit
66fee673
authored
12 years ago
by
Oz Linden
Browse files
Options
Downloads
Patches
Plain Diff
MAINT-2051: Implement replacement of an existing autoreplace list
parent
a9ada0cc
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/newview/llautoreplace.cpp
+40
-0
40 additions, 0 deletions
indra/newview/llautoreplace.cpp
indra/newview/llautoreplace.h
+3
-0
3 additions, 0 deletions
indra/newview/llautoreplace.h
indra/newview/llfloaterautoreplacesettings.cpp
+14
-3
14 additions, 3 deletions
indra/newview/llfloaterautoreplacesettings.cpp
with
57 additions
and
3 deletions
indra/newview/llautoreplace.cpp
+
40
−
0
View file @
66fee673
...
...
@@ -536,6 +536,46 @@ LLAutoReplaceSettings::AddListResult LLAutoReplaceSettings::addList(const LLSD&
return
result
;
}
LLAutoReplaceSettings
::
AddListResult
LLAutoReplaceSettings
::
replaceList
(
const
LLSD
&
newList
)
{
AddListResult
result
=
AddListInvalidList
;
if
(
listIsValid
(
newList
)
)
{
std
::
string
listName
=
newList
[
AUTOREPLACE_LIST_NAME
].
asString
();
bool
listFound
=
false
;
S32
search_index
;
LLSD
targetList
;
// The following is working around the fact that LLSD arrays containing maps also seem to have undefined entries... see LLSD-30
for
(
search_index
=
0
,
targetList
=
mLists
[
0
];
!
listFound
&&
search_index
<
mLists
.
size
();
search_index
+=
1
,
targetList
=
mLists
[
search_index
]
)
{
if
(
targetList
.
isMap
()
)
{
if
(
listNameMatches
(
targetList
,
listName
)
)
{
LL_DEBUGS
(
"AutoReplace"
)
<<
"list to replace found at "
<<
search_index
<<
LL_ENDL
;
mLists
.
erase
(
search_index
);
mLists
.
insert
(
search_index
,
newList
);
listFound
=
true
;
result
=
AddListOk
;
}
}
}
if
(
!
listFound
)
{
LL_WARNS
(
"AutoReplace"
)
<<
"attempt to replace unconfigured list"
<<
LL_ENDL
;
}
}
else
{
LL_WARNS
(
"AutoReplace"
)
<<
"attempt to add invalid list"
<<
LL_ENDL
;
}
return
result
;
}
bool
LLAutoReplaceSettings
::
removeReplacementList
(
std
::
string
listName
)
{
bool
found
=
false
;
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llautoreplace.h
+
3
−
0
View file @
66fee673
...
...
@@ -67,6 +67,9 @@ class LLAutoReplaceSettings
/// Inserts a new list at the end of the priority order
AddListResult
addList
(
const
LLSD
&
newList
);
/// Inserts a list in place of an existing list of the same name
AddListResult
replaceList
(
const
LLSD
&
newList
);
/// Removes the named list, @returns false if not found
bool
removeReplacementList
(
std
::
string
listName
);
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llfloaterautoreplacesettings.cpp
+
14
−
3
View file @
66fee673
...
...
@@ -478,14 +478,25 @@ bool LLFloaterAutoReplaceSettings::callbackNewListName(const LLSD& notification,
bool
LLFloaterAutoReplaceSettings
::
callbackListNameConflict
(
const
LLSD
&
notification
,
const
LLSD
&
response
)
{
LLSD
newList
=
notification
[
"payload"
][
"list"
];
std
::
string
listName
=
LLAutoReplaceSettings
::
getListName
(
newList
);
S32
option
=
LLNotificationsUtil
::
getSelectedOption
(
notification
,
response
);
switch
(
option
)
{
case
0
:
// Replace current list
LL_INFOS
(
"AutoReplace"
)
<<
"option 'replace current list' selected"
<<
LL_ENDL
;
if
(
LLAutoReplaceSettings
::
AddListOk
==
mSettings
.
replaceList
(
newList
)
)
{
LL_INFOS
(
"AutoReplace"
)
<<
"replaced list '"
<<
listName
<<
"'"
<<
LL_ENDL
;
mSelectedListName
=
listName
;
updateListNames
();
updateListNamesControls
();
updateReplacementsList
();
}
else
{
LL_WARNS
(
"AutoReplace"
)
<<
"failed to replace list '"
<<
listName
<<
"'"
<<
LL_ENDL
;
}
break
;
case
1
:
...
...
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