diff options
Diffstat (limited to 'linden/indra/newview/llfloaterland.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterland.cpp | 61 |
1 files changed, 43 insertions, 18 deletions
diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp index 32344ff..5af46f3 100644 --- a/linden/indra/newview/llfloaterland.cpp +++ b/linden/indra/newview/llfloaterland.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2002-2007, Linden Research, Inc. | 7 | * Copyright (c) 2002-2008, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -2547,7 +2547,7 @@ LLPanelLandAccess::LLPanelLandAccess(LLParcelSelectionHandle& parcel) | |||
2547 | 2547 | ||
2548 | BOOL LLPanelLandAccess::postBuild() | 2548 | BOOL LLPanelLandAccess::postBuild() |
2549 | { | 2549 | { |
2550 | childSetCommitCallback("public_access", onCommitAny, this); | 2550 | childSetCommitCallback("public_access", onCommitPublicAccess, this); |
2551 | childSetCommitCallback("limit_payment", onCommitAny, this); | 2551 | childSetCommitCallback("limit_payment", onCommitAny, this); |
2552 | childSetCommitCallback("limit_age_verified", onCommitAny, this); | 2552 | childSetCommitCallback("limit_age_verified", onCommitAny, this); |
2553 | childSetCommitCallback("GroupCheck", onCommitAny, this); | 2553 | childSetCommitCallback("GroupCheck", onCommitAny, this); |
@@ -2778,7 +2778,7 @@ void LLPanelLandAccess::refresh_ui() | |||
2778 | { | 2778 | { |
2779 | childSetToolTip("Only Allow", LLString()); | 2779 | childSetToolTip("Only Allow", LLString()); |
2780 | } | 2780 | } |
2781 | childSetEnabled("GroupCheck", TRUE); // Should always be an option (overrides age, payment restrictions) | 2781 | childSetEnabled("GroupCheck", FALSE); |
2782 | childSetEnabled("PassCheck", FALSE); | 2782 | childSetEnabled("PassCheck", FALSE); |
2783 | childSetEnabled("pass_combo", FALSE); | 2783 | childSetEnabled("pass_combo", FALSE); |
2784 | childSetEnabled("AccessList", FALSE); | 2784 | childSetEnabled("AccessList", FALSE); |
@@ -2837,6 +2837,29 @@ void LLPanelLandAccess::draw() | |||
2837 | LLPanel::draw(); | 2837 | LLPanel::draw(); |
2838 | } | 2838 | } |
2839 | 2839 | ||
2840 | // static | ||
2841 | void LLPanelLandAccess::onCommitPublicAccess(LLUICtrl *ctrl, void *userdata) | ||
2842 | { | ||
2843 | LLPanelLandAccess *self = (LLPanelLandAccess *)userdata; | ||
2844 | LLParcel* parcel = self->mParcel->getParcel(); | ||
2845 | if (!parcel) | ||
2846 | { | ||
2847 | return; | ||
2848 | } | ||
2849 | |||
2850 | // If we disabled public access, enable group access by default (if applicable) | ||
2851 | BOOL public_access = self->childGetValue("public_access").asBoolean(); | ||
2852 | if (public_access == FALSE) | ||
2853 | { | ||
2854 | char group_name[MAX_STRING]; /*Flawfinder: ignore*/ | ||
2855 | if (gCacheName->getGroupName(parcel->getGroupID(), group_name)) | ||
2856 | { | ||
2857 | self->childSetValue("GroupCheck", public_access ? FALSE : TRUE); | ||
2858 | } | ||
2859 | } | ||
2860 | |||
2861 | onCommitAny(ctrl, userdata); | ||
2862 | } | ||
2840 | 2863 | ||
2841 | // static | 2864 | // static |
2842 | void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) | 2865 | void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) |
@@ -2851,37 +2874,39 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
2851 | 2874 | ||
2852 | // Extract data from UI | 2875 | // Extract data from UI |
2853 | BOOL public_access = self->childGetValue("public_access").asBoolean(); | 2876 | BOOL public_access = self->childGetValue("public_access").asBoolean(); |
2877 | BOOL use_access_group = self->childGetValue("GroupCheck").asBoolean(); | ||
2878 | if (use_access_group) | ||
2879 | { | ||
2880 | char group_name[MAX_STRING]; /*Flawfinder: ignore*/ | ||
2881 | if (!gCacheName->getGroupName(parcel->getGroupID(), group_name)) | ||
2882 | { | ||
2883 | use_access_group = FALSE; | ||
2884 | } | ||
2885 | } | ||
2886 | |||
2854 | BOOL limit_payment = FALSE, limit_age_verified = FALSE; | 2887 | BOOL limit_payment = FALSE, limit_age_verified = FALSE; |
2855 | BOOL use_access_group = FALSE; | ||
2856 | BOOL use_access_list = FALSE; | 2888 | BOOL use_access_list = FALSE; |
2857 | BOOL use_pass_list = FALSE; | 2889 | BOOL use_pass_list = FALSE; |
2890 | |||
2858 | if (public_access) | 2891 | if (public_access) |
2859 | { | 2892 | { |
2860 | use_access_list = FALSE; | 2893 | use_access_list = FALSE; |
2894 | use_access_group = FALSE; | ||
2861 | limit_payment = self->childGetValue("limit_payment").asBoolean(); | 2895 | limit_payment = self->childGetValue("limit_payment").asBoolean(); |
2862 | limit_age_verified = self->childGetValue("limit_age_verified").asBoolean(); | 2896 | limit_age_verified = self->childGetValue("limit_age_verified").asBoolean(); |
2863 | } | 2897 | } |
2864 | else | 2898 | else |
2865 | { | 2899 | { |
2866 | use_access_list = TRUE; | 2900 | use_access_list = TRUE; |
2867 | use_access_group = self->childGetValue("GroupCheck").asBoolean(); | ||
2868 | use_pass_list = self->childGetValue("PassCheck").asBoolean(); | 2901 | use_pass_list = self->childGetValue("PassCheck").asBoolean(); |
2869 | if (use_access_group) | 2902 | if (use_access_group && use_pass_list) |
2870 | { | 2903 | { |
2871 | char group_name[MAX_STRING]; /*Flawfinder: ignore*/ | 2904 | LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); |
2872 | if (!gCacheName->getGroupName(parcel->getGroupID(), group_name)) | 2905 | if (passcombo) |
2873 | { | 2906 | { |
2874 | use_access_group = FALSE; | 2907 | if (passcombo->getSimpleSelectedValue().asString() == "group") |
2875 | } | ||
2876 | if (use_pass_list) | ||
2877 | { | ||
2878 | LLCtrlSelectionInterface* passcombo = self->childGetSelectionInterface("pass_combo"); | ||
2879 | if (passcombo) | ||
2880 | { | 2908 | { |
2881 | if (passcombo->getSimpleSelectedValue().asString() == "group") | 2909 | use_access_list = FALSE; |
2882 | { | ||
2883 | use_access_list = FALSE; | ||
2884 | } | ||
2885 | } | 2910 | } |
2886 | } | 2911 | } |
2887 | } | 2912 | } |