diff options
author | Jacek Antonelli | 2008-12-08 02:52:38 -0600 |
---|---|---|
committer | Jacek Antonelli | 2008-12-08 02:52:38 -0600 |
commit | 021217838dd326c5273df44f766b7a5068c07a25 (patch) | |
tree | ec2c39f7d08e32cbeef08c4e38d6e44d842bb14f | |
parent | Recalculate ntype when changing type or flags. (diff) | |
download | meta-impy-021217838dd326c5273df44f766b7a5068c07a25.zip meta-impy-021217838dd326c5273df44f766b7a5068c07a25.tar.gz meta-impy-021217838dd326c5273df44f766b7a5068c07a25.tar.bz2 meta-impy-021217838dd326c5273df44f766b7a5068c07a25.tar.xz |
LLInventoryView uses new inventory type.
-rw-r--r-- | ChangeLog.txt | 4 | ||||
-rw-r--r-- | linden/indra/newview/llinventoryview.cpp | 122 |
2 files changed, 59 insertions, 67 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 7d7d2c3..35bbc9c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt | |||
@@ -1,5 +1,9 @@ | |||
1 | 2008-12-08 Jacek Antonelli <jacek.antonelli@gmail.com> | 1 | 2008-12-08 Jacek Antonelli <jacek.antonelli@gmail.com> |
2 | 2 | ||
3 | * linden/indra/newview/llinventoryview.cpp: | ||
4 | LLInventoryView uses new inventory type. | ||
5 | |||
6 | |||
3 | * linden/indra/llinventory/llinventory.cpp: | 7 | * linden/indra/llinventory/llinventory.cpp: |
4 | Recalculate ntype when changing type or flags. | 8 | Recalculate ntype when changing type or flags. |
5 | 9 | ||
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index f64dd0d..96603ae 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp | |||
@@ -182,18 +182,18 @@ void LLInventoryViewFinder::updateElementsFromFilter() | |||
182 | 182 | ||
183 | // update the ui elements | 183 | // update the ui elements |
184 | LLFloater::setTitle(mFilter->getName()); | 184 | LLFloater::setTitle(mFilter->getName()); |
185 | childSetValue("check_animation", (S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION)); | 185 | childSetValue("check_animation", (S32) (filter_types & LLInventoryType::NIT_ANIMATION)); |
186 | 186 | ||
187 | childSetValue("check_calling_card", (S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD)); | 187 | childSetValue("check_calling_card", (S32) (filter_types & LLInventoryType::NIT_CALLCARD)); |
188 | childSetValue("check_clothing", (S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE)); | 188 | childSetValue("check_clothing", (S32) (filter_types & LLInventoryType::NIT_WEARABLE)); |
189 | childSetValue("check_gesture", (S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE)); | 189 | childSetValue("check_gesture", (S32) (filter_types & LLInventoryType::NIT_GESTURE)); |
190 | childSetValue("check_landmark", (S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK)); | 190 | childSetValue("check_landmark", (S32) (filter_types & LLInventoryType::NIT_LANDMARK)); |
191 | childSetValue("check_notecard", (S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD)); | 191 | childSetValue("check_notecard", (S32) (filter_types & LLInventoryType::NIT_NOTECARD)); |
192 | childSetValue("check_object", (S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT)); | 192 | childSetValue("check_object", (S32) (filter_types & LLInventoryType::NIT_OBJECT)); |
193 | childSetValue("check_script", (S32) (filter_types & 0x1 << LLInventoryType::IT_LSL)); | 193 | childSetValue("check_script", (S32) (filter_types & LLInventoryType::NIT_SCRIPT_LSL2)); |
194 | childSetValue("check_sound", (S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND)); | 194 | childSetValue("check_sound", (S32) (filter_types & LLInventoryType::NIT_SOUND)); |
195 | childSetValue("check_texture", (S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE)); | 195 | childSetValue("check_texture", (S32) (filter_types & LLInventoryType::NIT_TEXTURE)); |
196 | childSetValue("check_snapshot", (S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT)); | 196 | childSetValue("check_snapshot", (S32) (filter_types & LLInventoryType::NIT_SNAPSHOT)); |
197 | childSetValue("check_show_empty", show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); | 197 | childSetValue("check_show_empty", show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); |
198 | childSetValue("check_since_logoff", mFilter->isSinceLogoff()); | 198 | childSetValue("check_since_logoff", mFilter->isSinceLogoff()); |
199 | mSpinSinceHours->set((F32)(hours % 24)); | 199 | mSpinSinceHours->set((F32)(hours % 24)); |
@@ -207,26 +207,26 @@ void LLInventoryViewFinder::draw() | |||
207 | 207 | ||
208 | if (!childGetValue("check_animation")) | 208 | if (!childGetValue("check_animation")) |
209 | { | 209 | { |
210 | filter &= ~(0x1 << LLInventoryType::IT_ANIMATION); | 210 | filter &= ~(LLInventoryType::NIT_ANIMATION); |
211 | filtered_by_all_types = FALSE; | 211 | filtered_by_all_types = FALSE; |
212 | } | 212 | } |
213 | 213 | ||
214 | 214 | ||
215 | if (!childGetValue("check_calling_card")) | 215 | if (!childGetValue("check_calling_card")) |
216 | { | 216 | { |
217 | filter &= ~(0x1 << LLInventoryType::IT_CALLINGCARD); | 217 | filter &= ~(LLInventoryType::NIT_CALLCARD); |
218 | filtered_by_all_types = FALSE; | 218 | filtered_by_all_types = FALSE; |
219 | } | 219 | } |
220 | 220 | ||
221 | if (!childGetValue("check_clothing")) | 221 | if (!childGetValue("check_clothing")) |
222 | { | 222 | { |
223 | filter &= ~(0x1 << LLInventoryType::IT_WEARABLE); | 223 | filter &= ~(LLInventoryType::NIT_WEARABLE); |
224 | filtered_by_all_types = FALSE; | 224 | filtered_by_all_types = FALSE; |
225 | } | 225 | } |
226 | 226 | ||
227 | if (!childGetValue("check_gesture")) | 227 | if (!childGetValue("check_gesture")) |
228 | { | 228 | { |
229 | filter &= ~(0x1 << LLInventoryType::IT_GESTURE); | 229 | filter &= ~(LLInventoryType::NIT_GESTURE); |
230 | filtered_by_all_types = FALSE; | 230 | filtered_by_all_types = FALSE; |
231 | } | 231 | } |
232 | 232 | ||
@@ -234,52 +234,53 @@ void LLInventoryViewFinder::draw() | |||
234 | 234 | ||
235 | 235 | ||
236 | { | 236 | { |
237 | filter &= ~(0x1 << LLInventoryType::IT_LANDMARK); | 237 | filter &= ~(LLInventoryType::NIT_LANDMARK); |
238 | filtered_by_all_types = FALSE; | 238 | filtered_by_all_types = FALSE; |
239 | } | 239 | } |
240 | 240 | ||
241 | if (!childGetValue("check_notecard")) | 241 | if (!childGetValue("check_notecard")) |
242 | { | 242 | { |
243 | filter &= ~(0x1 << LLInventoryType::IT_NOTECARD); | 243 | filter &= ~(LLInventoryType::NIT_NOTECARD); |
244 | filtered_by_all_types = FALSE; | 244 | filtered_by_all_types = FALSE; |
245 | } | 245 | } |
246 | 246 | ||
247 | if (!childGetValue("check_object")) | 247 | if (!childGetValue("check_object")) |
248 | { | 248 | { |
249 | filter &= ~(0x1 << LLInventoryType::IT_OBJECT); | 249 | filter &= ~(LLInventoryType::NIT_OBJECT); |
250 | filter &= ~(0x1 << LLInventoryType::IT_ATTACHMENT); | ||
251 | filtered_by_all_types = FALSE; | 250 | filtered_by_all_types = FALSE; |
252 | } | 251 | } |
253 | 252 | ||
254 | if (!childGetValue("check_script")) | 253 | if (!childGetValue("check_script")) |
255 | { | 254 | { |
256 | filter &= ~(0x1 << LLInventoryType::IT_LSL); | 255 | filter &= ~(LLInventoryType::NIT_SCRIPT_LSL2); |
257 | filtered_by_all_types = FALSE; | 256 | filtered_by_all_types = FALSE; |
258 | } | 257 | } |
259 | 258 | ||
260 | if (!childGetValue("check_sound")) | 259 | if (!childGetValue("check_sound")) |
261 | { | 260 | { |
262 | filter &= ~(0x1 << LLInventoryType::IT_SOUND); | 261 | filter &= ~(LLInventoryType::NIT_SOUND); |
263 | filtered_by_all_types = FALSE; | 262 | filtered_by_all_types = FALSE; |
264 | } | 263 | } |
265 | 264 | ||
266 | if (!childGetValue("check_texture")) | 265 | if (!childGetValue("check_texture")) |
267 | { | 266 | { |
268 | filter &= ~(0x1 << LLInventoryType::IT_TEXTURE); | 267 | filter &= ~(LLInventoryType::NIT_TEXTURE); |
269 | filtered_by_all_types = FALSE; | 268 | filtered_by_all_types = FALSE; |
270 | } | 269 | } |
271 | 270 | ||
272 | if (!childGetValue("check_snapshot")) | 271 | if (!childGetValue("check_snapshot")) |
273 | { | 272 | { |
274 | filter &= ~(0x1 << LLInventoryType::IT_SNAPSHOT); | 273 | filter &= ~(LLInventoryType::NIT_SNAPSHOT); |
275 | filtered_by_all_types = FALSE; | 274 | filtered_by_all_types = FALSE; |
276 | } | 275 | } |
277 | 276 | ||
277 | /* | ||
278 | if (!filtered_by_all_types) | 278 | if (!filtered_by_all_types) |
279 | { | 279 | { |
280 | // don't include folders in filter, unless I've selected everything | 280 | // don't include folders in filter, unless I've selected everything |
281 | filter &= ~(0x1 << LLInventoryType::IT_CATEGORY); | 281 | filter &= ~(LLInventoryType::NIT_CATEGORY); |
282 | } | 282 | } |
283 | */ | ||
283 | 284 | ||
284 | // update the panel, panel will update the filter | 285 | // update the panel, panel will update the filter |
285 | mInventoryView->mActivePanel->setShowFolderState(getCheckShowEmpty() ? | 286 | mInventoryView->mActivePanel->setShowFolderState(getCheckShowEmpty() ? |
@@ -1012,57 +1013,57 @@ void LLInventoryView::onQuickFilterCommit(LLUICtrl* ctrl, void* user_data) | |||
1012 | 1013 | ||
1013 | if (view->getString("filter_type_animation") == item_type) | 1014 | if (view->getString("filter_type_animation") == item_type) |
1014 | { | 1015 | { |
1015 | filter_type = 0x1 << LLInventoryType::IT_ANIMATION; | 1016 | filter_type = LLInventoryType::NIT_ANIMATION; |
1016 | } | 1017 | } |
1017 | 1018 | ||
1018 | else if (view->getString("filter_type_callingcard") == item_type) | 1019 | else if (view->getString("filter_type_callingcard") == item_type) |
1019 | { | 1020 | { |
1020 | filter_type = 0x1 << LLInventoryType::IT_CALLINGCARD; | 1021 | filter_type = LLInventoryType::NIT_CALLCARD; |
1021 | } | 1022 | } |
1022 | 1023 | ||
1023 | else if (view->getString("filter_type_wearable") == item_type) | 1024 | else if (view->getString("filter_type_wearable") == item_type) |
1024 | { | 1025 | { |
1025 | filter_type = 0x1 << LLInventoryType::IT_WEARABLE; | 1026 | filter_type = LLInventoryType::NIT_WEARABLE; |
1026 | } | 1027 | } |
1027 | 1028 | ||
1028 | else if (view->getString("filter_type_gesture") == item_type) | 1029 | else if (view->getString("filter_type_gesture") == item_type) |
1029 | { | 1030 | { |
1030 | filter_type = 0x1 << LLInventoryType::IT_GESTURE; | 1031 | filter_type = LLInventoryType::NIT_GESTURE; |
1031 | } | 1032 | } |
1032 | 1033 | ||
1033 | else if (view->getString("filter_type_landmark") == item_type) | 1034 | else if (view->getString("filter_type_landmark") == item_type) |
1034 | { | 1035 | { |
1035 | filter_type = 0x1 << LLInventoryType::IT_LANDMARK; | 1036 | filter_type = LLInventoryType::NIT_LANDMARK; |
1036 | } | 1037 | } |
1037 | 1038 | ||
1038 | else if (view->getString("filter_type_notecard") == item_type) | 1039 | else if (view->getString("filter_type_notecard") == item_type) |
1039 | { | 1040 | { |
1040 | filter_type = 0x1 << LLInventoryType::IT_NOTECARD; | 1041 | filter_type = LLInventoryType::NIT_NOTECARD; |
1041 | } | 1042 | } |
1042 | 1043 | ||
1043 | else if (view->getString("filter_type_object") == item_type) | 1044 | else if (view->getString("filter_type_object") == item_type) |
1044 | { | 1045 | { |
1045 | filter_type = 0x1 << LLInventoryType::IT_OBJECT; | 1046 | filter_type = LLInventoryType::NIT_OBJECT; |
1046 | } | 1047 | } |
1047 | 1048 | ||
1048 | else if (view->getString("filter_type_script") == item_type) | 1049 | else if (view->getString("filter_type_script") == item_type) |
1049 | { | 1050 | { |
1050 | filter_type = 0x1 << LLInventoryType::IT_LSL; | 1051 | filter_type = LLInventoryType::NIT_SCRIPT_LSL2; |
1051 | } | 1052 | } |
1052 | 1053 | ||
1053 | else if (view->getString("filter_type_sound") == item_type) | 1054 | else if (view->getString("filter_type_sound") == item_type) |
1054 | { | 1055 | { |
1055 | filter_type = 0x1 << LLInventoryType::IT_SOUND; | 1056 | filter_type = LLInventoryType::NIT_SOUND; |
1056 | } | 1057 | } |
1057 | 1058 | ||
1058 | else if (view->getString("filter_type_texture") == item_type) | 1059 | else if (view->getString("filter_type_texture") == item_type) |
1059 | { | 1060 | { |
1060 | filter_type = 0x1 << LLInventoryType::IT_TEXTURE; | 1061 | filter_type = LLInventoryType::NIT_TEXTURE; |
1061 | } | 1062 | } |
1062 | 1063 | ||
1063 | else if (view->getString("filter_type_snapshot") == item_type) | 1064 | else if (view->getString("filter_type_snapshot") == item_type) |
1064 | { | 1065 | { |
1065 | filter_type = 0x1 << LLInventoryType::IT_SNAPSHOT; | 1066 | filter_type = LLInventoryType::NIT_SNAPSHOT; |
1066 | } | 1067 | } |
1067 | 1068 | ||
1068 | else if (view->getString("filter_type_custom") == item_type) | 1069 | else if (view->getString("filter_type_custom") == item_type) |
@@ -1121,25 +1122,7 @@ void LLInventoryView::refreshQuickFilter(LLUICtrl* ctrl) | |||
1121 | 1122 | ||
1122 | 1123 | ||
1123 | U32 filter_type = view->mActivePanel->getFilterTypes(); | 1124 | U32 filter_type = view->mActivePanel->getFilterTypes(); |
1124 | 1125 | filter_type &= LLInventoryType::NIT_ALL; | |
1125 | |||
1126 | // Mask to extract only the bit fields we care about. | ||
1127 | // *TODO: There's probably a cleaner way to construct this mask. | ||
1128 | U32 filter_mask = 0; | ||
1129 | filter_mask |= (0x1 << LLInventoryType::IT_ANIMATION); | ||
1130 | filter_mask |= (0x1 << LLInventoryType::IT_CALLINGCARD); | ||
1131 | filter_mask |= (0x1 << LLInventoryType::IT_WEARABLE); | ||
1132 | filter_mask |= (0x1 << LLInventoryType::IT_GESTURE); | ||
1133 | filter_mask |= (0x1 << LLInventoryType::IT_LANDMARK); | ||
1134 | filter_mask |= (0x1 << LLInventoryType::IT_NOTECARD); | ||
1135 | filter_mask |= (0x1 << LLInventoryType::IT_OBJECT); | ||
1136 | filter_mask |= (0x1 << LLInventoryType::IT_LSL); | ||
1137 | filter_mask |= (0x1 << LLInventoryType::IT_SOUND); | ||
1138 | filter_mask |= (0x1 << LLInventoryType::IT_TEXTURE); | ||
1139 | filter_mask |= (0x1 << LLInventoryType::IT_SNAPSHOT); | ||
1140 | |||
1141 | |||
1142 | filter_type &= filter_mask; | ||
1143 | 1126 | ||
1144 | 1127 | ||
1145 | //llinfos << "filter_type: " << filter_type << llendl; | 1128 | //llinfos << "filter_type: " << filter_type << llendl; |
@@ -1147,62 +1130,67 @@ void LLInventoryView::refreshQuickFilter(LLUICtrl* ctrl) | |||
1147 | std::string selection; | 1130 | std::string selection; |
1148 | 1131 | ||
1149 | 1132 | ||
1150 | if (filter_type == filter_mask) | 1133 | if (filter_type == LLInventoryType::NIT_ALL) |
1151 | { | 1134 | { |
1152 | selection = view->getString("filter_type_all"); | 1135 | selection = view->getString("filter_type_all"); |
1153 | } | 1136 | } |
1154 | 1137 | ||
1155 | else if (filter_type == (0x1 << LLInventoryType::IT_ANIMATION)) | 1138 | else if (filter_type == LLInventoryType::NIT_NONE) |
1139 | { | ||
1140 | selection = view->getString("filter_type_custom"); | ||
1141 | } | ||
1142 | |||
1143 | else if (filter_type == (filter_type & LLInventoryType::NIT_ANIMATION)) | ||
1156 | { | 1144 | { |
1157 | selection = view->getString("filter_type_animation"); | 1145 | selection = view->getString("filter_type_animation"); |
1158 | } | 1146 | } |
1159 | 1147 | ||
1160 | else if (filter_type == (0x1 << LLInventoryType::IT_CALLINGCARD)) | 1148 | else if (filter_type == (filter_type & LLInventoryType::NIT_CALLCARD)) |
1161 | { | 1149 | { |
1162 | selection = view->getString("filter_type_callingcard"); | 1150 | selection = view->getString("filter_type_callingcard"); |
1163 | } | 1151 | } |
1164 | 1152 | ||
1165 | else if (filter_type == (0x1 << LLInventoryType::IT_WEARABLE)) | 1153 | else if (filter_type == (filter_type & LLInventoryType::NIT_WEARABLE)) |
1166 | { | 1154 | { |
1167 | selection = view->getString("filter_type_wearable"); | 1155 | selection = view->getString("filter_type_wearable"); |
1168 | } | 1156 | } |
1169 | 1157 | ||
1170 | else if (filter_type == (0x1 << LLInventoryType::IT_GESTURE)) | 1158 | else if (filter_type == (filter_type & LLInventoryType::NIT_GESTURE)) |
1171 | { | 1159 | { |
1172 | selection = view->getString("filter_type_gesture"); | 1160 | selection = view->getString("filter_type_gesture"); |
1173 | } | 1161 | } |
1174 | 1162 | ||
1175 | else if (filter_type == (0x1 << LLInventoryType::IT_LANDMARK)) | 1163 | else if (filter_type == (filter_type & LLInventoryType::NIT_LANDMARK)) |
1176 | { | 1164 | { |
1177 | selection = view->getString("filter_type_landmark"); | 1165 | selection = view->getString("filter_type_landmark"); |
1178 | } | 1166 | } |
1179 | 1167 | ||
1180 | else if (filter_type == (0x1 << LLInventoryType::IT_NOTECARD)) | 1168 | else if (filter_type == (filter_type & LLInventoryType::NIT_NOTECARD)) |
1181 | { | 1169 | { |
1182 | selection = view->getString("filter_type_notecard"); | 1170 | selection = view->getString("filter_type_notecard"); |
1183 | } | 1171 | } |
1184 | 1172 | ||
1185 | else if (filter_type == (0x1 << LLInventoryType::IT_OBJECT)) | 1173 | else if (filter_type == (filter_type & LLInventoryType::NIT_OBJECT)) |
1186 | { | 1174 | { |
1187 | selection = view->getString("filter_type_object"); | 1175 | selection = view->getString("filter_type_object"); |
1188 | } | 1176 | } |
1189 | 1177 | ||
1190 | else if (filter_type == (0x1 << LLInventoryType::IT_LSL)) | 1178 | else if (filter_type == (filter_type & LLInventoryType::NIT_SCRIPT_LSL2)) |
1191 | { | 1179 | { |
1192 | selection = view->getString("filter_type_script"); | 1180 | selection = view->getString("filter_type_script"); |
1193 | } | 1181 | } |
1194 | 1182 | ||
1195 | else if (filter_type == (0x1 << LLInventoryType::IT_SOUND)) | 1183 | else if (filter_type == (filter_type & LLInventoryType::NIT_SOUND)) |
1196 | { | 1184 | { |
1197 | selection = view->getString("filter_type_sound"); | 1185 | selection = view->getString("filter_type_sound"); |
1198 | } | 1186 | } |
1199 | 1187 | ||
1200 | else if (filter_type == (0x1 << LLInventoryType::IT_TEXTURE)) | 1188 | else if (filter_type == (filter_type & LLInventoryType::NIT_TEXTURE)) |
1201 | { | 1189 | { |
1202 | selection = view->getString("filter_type_texture"); | 1190 | selection = view->getString("filter_type_texture"); |
1203 | } | 1191 | } |
1204 | 1192 | ||
1205 | else if (filter_type == (0x1 << LLInventoryType::IT_SNAPSHOT)) | 1193 | else if (filter_type == (filter_type & LLInventoryType::NIT_SNAPSHOT)) |
1206 | { | 1194 | { |
1207 | selection = view->getString("filter_type_snapshot"); | 1195 | selection = view->getString("filter_type_snapshot"); |
1208 | } | 1196 | } |