diff options
author | Jacek Antonelli | 2008-11-22 01:21:22 -0600 |
---|---|---|
committer | Jacek Antonelli | 2008-11-22 01:35:33 -0600 |
commit | 7420e9f3599b8974cc86758af88eebc966e57214 (patch) | |
tree | a60d186cda955872c40a6002dc21effea09915ea | |
parent | Show Filters window refreshes properly. (diff) | |
download | meta-impy-7420e9f3599b8974cc86758af88eebc966e57214.zip meta-impy-7420e9f3599b8974cc86758af88eebc966e57214.tar.gz meta-impy-7420e9f3599b8974cc86758af88eebc966e57214.tar.bz2 meta-impy-7420e9f3599b8974cc86758af88eebc966e57214.tar.xz |
Quick Filter combo box refreshes properly.
-rw-r--r-- | ChangeLog.txt | 8 | ||||
-rw-r--r-- | linden/indra/newview/llinventoryview.cpp | 128 | ||||
-rw-r--r-- | linden/indra/newview/llinventoryview.h | 1 |
3 files changed, 137 insertions, 0 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index d9a1957..1768549 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt | |||
@@ -1,3 +1,11 @@ | |||
1 | 2008-11-22 Jacek Antonelli <jacek.antonelli@gmail.com> | ||
2 | |||
3 | * linden/indra/newview/llinventoryview.cpp: | ||
4 | Quick Filter combo box refreshes properly. | ||
5 | * linden/indra/newview/llinventoryview.h: | ||
6 | Ditto. | ||
7 | |||
8 | |||
1 | 2008-11-11 Jacek Antonelli <jacek.antonelli@gmail.com> | 9 | 2008-11-11 Jacek Antonelli <jacek.antonelli@gmail.com> |
2 | 10 | ||
3 | * linden/indra/newview/llinventoryview.cpp: | 11 | * linden/indra/newview/llinventoryview.cpp: |
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index 07b5115..97f4644 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp | |||
@@ -624,6 +624,11 @@ void LLInventoryView::draw() | |||
624 | { | 624 | { |
625 | mSearchEditor->setText(mActivePanel->getFilterSubString()); | 625 | mSearchEditor->setText(mActivePanel->getFilterSubString()); |
626 | } | 626 | } |
627 | if (mActivePanel && mQuickFilterCombo) | ||
628 | { | ||
629 | refreshQuickFilter( mQuickFilterCombo ); | ||
630 | } | ||
631 | |||
627 | LLFloater::draw(); | 632 | LLFloater::draw(); |
628 | } | 633 | } |
629 | 634 | ||
@@ -1091,6 +1096,129 @@ void LLInventoryView::onQuickFilterCommit(LLUICtrl* ctrl, void* user_data) | |||
1091 | } | 1096 | } |
1092 | 1097 | ||
1093 | 1098 | ||
1099 | |||
1100 | //static | ||
1101 | void LLInventoryView::refreshQuickFilter(LLUICtrl* ctrl) | ||
1102 | { | ||
1103 | |||
1104 | LLInventoryView* view = (LLInventoryView*)(ctrl->getParent()); | ||
1105 | if (!view->mActivePanel) | ||
1106 | { | ||
1107 | return; | ||
1108 | } | ||
1109 | |||
1110 | LLComboBox* quickfilter = view->getChild<LLComboBox>("Quick Filter"); | ||
1111 | if (!quickfilter) | ||
1112 | { | ||
1113 | return; | ||
1114 | } | ||
1115 | |||
1116 | |||
1117 | U32 filter_type = view->mActivePanel->getFilterTypes(); | ||
1118 | |||
1119 | |||
1120 | // Mask to extract only the bit fields we care about. | ||
1121 | // *TODO: There's probably a cleaner way to construct this mask. | ||
1122 | U32 filter_mask = 0; | ||
1123 | filter_mask |= (0x1 << LLInventoryType::IT_ANIMATION); | ||
1124 | filter_mask |= (0x1 << LLInventoryType::IT_CALLINGCARD); | ||
1125 | filter_mask |= (0x1 << LLInventoryType::IT_WEARABLE); | ||
1126 | filter_mask |= (0x1 << LLInventoryType::IT_GESTURE); | ||
1127 | filter_mask |= (0x1 << LLInventoryType::IT_LANDMARK); | ||
1128 | filter_mask |= (0x1 << LLInventoryType::IT_NOTECARD); | ||
1129 | filter_mask |= (0x1 << LLInventoryType::IT_OBJECT); | ||
1130 | filter_mask |= (0x1 << LLInventoryType::IT_LSL); | ||
1131 | filter_mask |= (0x1 << LLInventoryType::IT_SOUND); | ||
1132 | filter_mask |= (0x1 << LLInventoryType::IT_TEXTURE); | ||
1133 | filter_mask |= (0x1 << LLInventoryType::IT_SNAPSHOT); | ||
1134 | |||
1135 | |||
1136 | filter_type &= filter_mask; | ||
1137 | |||
1138 | |||
1139 | //llinfos << "filter_type: " << filter_type << llendl; | ||
1140 | |||
1141 | std::string selection; | ||
1142 | |||
1143 | |||
1144 | if (filter_type == filter_mask) | ||
1145 | { | ||
1146 | selection = "Show All Items"; | ||
1147 | } | ||
1148 | |||
1149 | else if (filter_type == (0x1 << LLInventoryType::IT_ANIMATION)) | ||
1150 | { | ||
1151 | selection = "Animations"; | ||
1152 | } | ||
1153 | |||
1154 | else if (filter_type == (0x1 << LLInventoryType::IT_CALLINGCARD)) | ||
1155 | { | ||
1156 | selection = "Calling Cards"; | ||
1157 | } | ||
1158 | |||
1159 | else if (filter_type == (0x1 << LLInventoryType::IT_WEARABLE)) | ||
1160 | { | ||
1161 | selection = "Clothing"; | ||
1162 | } | ||
1163 | |||
1164 | else if (filter_type == (0x1 << LLInventoryType::IT_GESTURE)) | ||
1165 | { | ||
1166 | selection = "Gestures"; | ||
1167 | } | ||
1168 | |||
1169 | else if (filter_type == (0x1 << LLInventoryType::IT_LANDMARK)) | ||
1170 | { | ||
1171 | selection = "Landmarks"; | ||
1172 | } | ||
1173 | |||
1174 | else if (filter_type == (0x1 << LLInventoryType::IT_NOTECARD)) | ||
1175 | { | ||
1176 | selection = "Notecards"; | ||
1177 | } | ||
1178 | |||
1179 | else if (filter_type == (0x1 << LLInventoryType::IT_OBJECT)) | ||
1180 | { | ||
1181 | selection = "Objects"; | ||
1182 | } | ||
1183 | |||
1184 | else if (filter_type == (0x1 << LLInventoryType::IT_LSL)) | ||
1185 | { | ||
1186 | selection = "Scripts"; | ||
1187 | } | ||
1188 | |||
1189 | else if (filter_type == (0x1 << LLInventoryType::IT_SOUND)) | ||
1190 | { | ||
1191 | selection = "Sounds"; | ||
1192 | } | ||
1193 | |||
1194 | else if (filter_type == (0x1 << LLInventoryType::IT_TEXTURE)) | ||
1195 | { | ||
1196 | selection = "Textures"; | ||
1197 | } | ||
1198 | |||
1199 | else if (filter_type == (0x1 << LLInventoryType::IT_SNAPSHOT)) | ||
1200 | { | ||
1201 | selection = "Snapshots"; | ||
1202 | } | ||
1203 | |||
1204 | else | ||
1205 | { | ||
1206 | selection = "Custom..."; | ||
1207 | } | ||
1208 | |||
1209 | |||
1210 | // Select the chosen item by label text | ||
1211 | BOOL result = quickfilter->setSimple( (selection) ); | ||
1212 | |||
1213 | if( !result ) | ||
1214 | { | ||
1215 | llinfos << "The item didn't exist: " << selection << llendl; | ||
1216 | } | ||
1217 | |||
1218 | } | ||
1219 | |||
1220 | |||
1221 | |||
1094 | // static | 1222 | // static |
1095 | // BOOL LLInventoryView::incrementalFind(LLFolderViewItem* first_item, const char *find_text, BOOL backward) | 1223 | // BOOL LLInventoryView::incrementalFind(LLFolderViewItem* first_item, const char *find_text, BOOL backward) |
1096 | // { | 1224 | // { |
diff --git a/linden/indra/newview/llinventoryview.h b/linden/indra/newview/llinventoryview.h index ec621ec..cce30aa 100644 --- a/linden/indra/newview/llinventoryview.h +++ b/linden/indra/newview/llinventoryview.h | |||
@@ -241,6 +241,7 @@ public: | |||
241 | static BOOL checkFoldersByName(void *user_data); | 241 | static BOOL checkFoldersByName(void *user_data); |
242 | static void onSearchEdit(const std::string& search_string, void* user_data ); | 242 | static void onSearchEdit(const std::string& search_string, void* user_data ); |
243 | static void onQuickFilterCommit(LLUICtrl* ctrl, void* user_data); | 243 | static void onQuickFilterCommit(LLUICtrl* ctrl, void* user_data); |
244 | static void refreshQuickFilter(LLUICtrl* ctrl); | ||
244 | static void onFilterSelected(void* userdata, bool from_click); | 245 | static void onFilterSelected(void* userdata, bool from_click); |
245 | static void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data); | 246 | static void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action, void* data); |
246 | 247 | ||