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
e9257f03
Commit
e9257f03
authored
9 years ago
by
Rider Linden
Browse files
Options
Downloads
Patches
Plain Diff
Object default perm floater
parent
f7fa3b5f
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/newview/llfloaterperms.cpp
+54
-52
54 additions, 52 deletions
indra/newview/llfloaterperms.cpp
indra/newview/llfloaterperms.h
+4
-0
4 additions, 0 deletions
indra/newview/llfloaterperms.h
with
58 additions
and
52 deletions
indra/newview/llfloaterperms.cpp
+
54
−
52
View file @
e9257f03
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include
"llnotificationsutil.h"
#include
"llnotificationsutil.h"
#include
"llsdserialize.h"
#include
"llsdserialize.h"
#include
"llvoavatar.h"
#include
"llvoavatar.h"
#include
"llcorehttputil.h"
LLFloaterPerms
::
LLFloaterPerms
(
const
LLSD
&
seed
)
LLFloaterPerms
::
LLFloaterPerms
(
const
LLSD
&
seed
)
:
LLFloater
(
seed
)
:
LLFloater
(
seed
)
...
@@ -166,41 +167,6 @@ void LLFloaterPermsDefault::onCommitCopy(const LLSD& user_data)
...
@@ -166,41 +167,6 @@ void LLFloaterPermsDefault::onCommitCopy(const LLSD& user_data)
xfer
->
setEnabled
(
copyable
);
xfer
->
setEnabled
(
copyable
);
}
}
class
LLFloaterPermsResponder
:
public
LLHTTPClient
::
Responder
{
public:
LLFloaterPermsResponder
()
:
LLHTTPClient
::
Responder
()
{}
private
:
static
std
::
string
sPreviousReason
;
void
httpFailure
()
{
const
std
::
string
&
reason
=
getReason
();
// Do not display the same error more than once in a row
if
(
reason
!=
sPreviousReason
)
{
sPreviousReason
=
reason
;
LLSD
args
;
args
[
"REASON"
]
=
reason
;
LLNotificationsUtil
::
add
(
"DefaultObjectPermissions"
,
args
);
}
}
void
httpSuccess
()
{
//const LLSD& content = getContent();
//dump_sequential_xml("perms_responder_result.xml", content);
// Since we have had a successful POST call be sure to display the next error message
// even if it is the same as a previous one.
sPreviousReason
=
""
;
LLFloaterPermsDefault
::
setCapSent
(
true
);
LL_INFOS
(
"ObjectPermissionsFloater"
)
<<
"Default permissions successfully sent to simulator"
<<
LL_ENDL
;
}
};
std
::
string
LLFloaterPermsResponder
::
sPreviousReason
;
void
LLFloaterPermsDefault
::
sendInitialPerms
()
void
LLFloaterPermsDefault
::
sendInitialPerms
()
{
{
if
(
!
mCapSent
)
if
(
!
mCapSent
)
...
@@ -215,23 +181,8 @@ void LLFloaterPermsDefault::updateCap()
...
@@ -215,23 +181,8 @@ void LLFloaterPermsDefault::updateCap()
if
(
!
object_url
.
empty
())
if
(
!
object_url
.
empty
())
{
{
LLSD
report
=
LLSD
::
emptyMap
();
LLCoros
::
instance
().
launch
(
"LLFloaterPermsDefault::updateCapCoro"
,
report
[
"default_object_perm_masks"
][
"Group"
]
=
boost
::
bind
(
&
LLFloaterPermsDefault
::
updateCapCoro
,
_1
,
object_url
));
(
LLSD
::
Integer
)
LLFloaterPerms
::
getGroupPerms
(
sCategoryNames
[
CAT_OBJECTS
]);
report
[
"default_object_perm_masks"
][
"Everyone"
]
=
(
LLSD
::
Integer
)
LLFloaterPerms
::
getEveryonePerms
(
sCategoryNames
[
CAT_OBJECTS
]);
report
[
"default_object_perm_masks"
][
"NextOwner"
]
=
(
LLSD
::
Integer
)
LLFloaterPerms
::
getNextOwnerPerms
(
sCategoryNames
[
CAT_OBJECTS
]);
{
LL_DEBUGS
(
"ObjectPermissionsFloater"
)
<<
"Sending default permissions to '"
<<
object_url
<<
"'
\n
"
;
std
::
ostringstream
sent_perms_log
;
LLSDSerialize
::
toPrettyXML
(
report
,
sent_perms_log
);
LL_CONT
<<
sent_perms_log
.
str
()
<<
LL_ENDL
;
}
LLHTTPClient
::
post
(
object_url
,
report
,
new
LLFloaterPermsResponder
());
}
}
else
else
{
{
...
@@ -239,6 +190,57 @@ void LLFloaterPermsDefault::updateCap()
...
@@ -239,6 +190,57 @@ void LLFloaterPermsDefault::updateCap()
}
}
}
}
/*static*/
void
LLFloaterPermsDefault
::
updateCapCoro
(
LLCoros
::
self
&
self
,
std
::
string
url
)
{
static
std
::
string
previousReason
;
LLCore
::
HttpRequest
::
policy_t
httpPolicy
(
LLCore
::
HttpRequest
::
DEFAULT_POLICY_ID
);
LLCoreHttpUtil
::
HttpCoroutineAdapter
::
ptr_t
httpAdapter
(
new
LLCoreHttpUtil
::
HttpCoroutineAdapter
(
"genericPostCoro"
,
httpPolicy
));
LLCore
::
HttpRequest
::
ptr_t
httpRequest
(
new
LLCore
::
HttpRequest
);
LLSD
postData
=
LLSD
::
emptyMap
();
postData
[
"default_object_perm_masks"
][
"Group"
]
=
(
LLSD
::
Integer
)
LLFloaterPerms
::
getGroupPerms
(
sCategoryNames
[
CAT_OBJECTS
]);
postData
[
"default_object_perm_masks"
][
"Everyone"
]
=
(
LLSD
::
Integer
)
LLFloaterPerms
::
getEveryonePerms
(
sCategoryNames
[
CAT_OBJECTS
]);
postData
[
"default_object_perm_masks"
][
"NextOwner"
]
=
(
LLSD
::
Integer
)
LLFloaterPerms
::
getNextOwnerPerms
(
sCategoryNames
[
CAT_OBJECTS
]);
{
LL_DEBUGS
(
"ObjectPermissionsFloater"
)
<<
"Sending default permissions to '"
<<
url
<<
"'
\n
"
;
std
::
ostringstream
sent_perms_log
;
LLSDSerialize
::
toPrettyXML
(
postData
,
sent_perms_log
);
LL_CONT
<<
sent_perms_log
.
str
()
<<
LL_ENDL
;
}
LLSD
result
=
httpAdapter
->
postAndYield
(
self
,
httpRequest
,
url
,
postData
);
LLSD
httpResults
=
result
[
LLCoreHttpUtil
::
HttpCoroutineAdapter
::
HTTP_RESULTS
];
LLCore
::
HttpStatus
status
=
LLCoreHttpUtil
::
HttpCoroutineAdapter
::
getStatusFromLLSD
(
httpResults
);
if
(
!
status
)
{
const
std
::
string
&
reason
=
status
.
toString
();
// Do not display the same error more than once in a row
if
(
reason
!=
previousReason
)
{
previousReason
=
reason
;
LLSD
args
;
args
[
"REASON"
]
=
reason
;
LLNotificationsUtil
::
add
(
"DefaultObjectPermissions"
,
args
);
}
return
;
}
// Since we have had a successful POST call be sure to display the next error message
// even if it is the same as a previous one.
previousReason
.
clear
();
LLFloaterPermsDefault
::
setCapSent
(
true
);
LL_INFOS
(
"ObjectPermissionsFloater"
)
<<
"Default permissions successfully sent to simulator"
<<
LL_ENDL
;
}
void
LLFloaterPermsDefault
::
setCapSent
(
bool
cap_sent
)
void
LLFloaterPermsDefault
::
setCapSent
(
bool
cap_sent
)
{
{
mCapSent
=
cap_sent
;
mCapSent
=
cap_sent
;
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llfloaterperms.h
+
4
−
0
View file @
e9257f03
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
#define LL_LLFLOATERPERMPREFS_H
#define LL_LLFLOATERPERMPREFS_H
#include
"llfloater.h"
#include
"llfloater.h"
#include
"lleventcoro.h"
#include
"llcoros.h"
class
LLFloaterPerms
:
public
LLFloater
class
LLFloaterPerms
:
public
LLFloater
{
{
...
@@ -80,6 +82,8 @@ enum Categories
...
@@ -80,6 +82,8 @@ enum Categories
void
refresh
();
void
refresh
();
static
const
std
::
string
sCategoryNames
[
CAT_LAST
];
static
const
std
::
string
sCategoryNames
[
CAT_LAST
];
static
void
LLFloaterPermsDefault
::
updateCapCoro
(
LLCoros
::
self
&
self
,
std
::
string
url
);
// cached values only for implementing cancel.
// cached values only for implementing cancel.
bool
mShareWithGroup
[
CAT_LAST
];
bool
mShareWithGroup
[
CAT_LAST
];
...
...
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