diff options
author | Jacek Antonelli | 2009-01-16 15:41:01 -0600 |
---|---|---|
committer | Jacek Antonelli | 2009-01-16 15:41:25 -0600 |
commit | a7ee24a9ed954a09632ebe9371a0c1783fee9dc3 (patch) | |
tree | b95b78a075a67b59a07878fd2371bd22d3374f1e /linden/indra/newview | |
parent | Fixed folders expanding when Show Filters is opened. (diff) | |
download | meta-impy-a7ee24a9ed954a09632ebe9371a0c1783fee9dc3.zip meta-impy-a7ee24a9ed954a09632ebe9371a0c1783fee9dc3.tar.gz meta-impy-a7ee24a9ed954a09632ebe9371a0c1783fee9dc3.tar.bz2 meta-impy-a7ee24a9ed954a09632ebe9371a0c1783fee9dc3.tar.xz |
Use UI callbacks to initiate rebuilding filter.
Instead of rebuilding from draw() every frame.
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llinventoryview.cpp | 47 | ||||
-rw-r--r-- | linden/indra/newview/llinventoryview.h | 4 |
2 files changed, 50 insertions, 1 deletions
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index 4576ff9..401d6e2 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp | |||
@@ -118,6 +118,21 @@ LLInventoryViewFinder::LLInventoryViewFinder(const std::string& name, | |||
118 | 118 | ||
119 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inventory_view_finder.xml"); | 119 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inventory_view_finder.xml"); |
120 | 120 | ||
121 | |||
122 | childSetCommitCallback("check_animation", onCheckFilterType, this); | ||
123 | childSetCommitCallback("check_bodypart", onCheckFilterType, this); | ||
124 | childSetCommitCallback("check_calling_card", onCheckFilterType, this); | ||
125 | childSetCommitCallback("check_clothing", onCheckFilterType, this); | ||
126 | childSetCommitCallback("check_gesture", onCheckFilterType, this); | ||
127 | childSetCommitCallback("check_landmark", onCheckFilterType, this); | ||
128 | childSetCommitCallback("check_notecard", onCheckFilterType, this); | ||
129 | childSetCommitCallback("check_object", onCheckFilterType, this); | ||
130 | childSetCommitCallback("check_script", onCheckFilterType, this); | ||
131 | childSetCommitCallback("check_sound", onCheckFilterType, this); | ||
132 | childSetCommitCallback("check_texture", onCheckFilterType, this); | ||
133 | childSetCommitCallback("check_snapshot", onCheckFilterType, this); | ||
134 | |||
135 | |||
121 | childSetAction("All", selectAllTypes, this); | 136 | childSetAction("All", selectAllTypes, this); |
122 | childSetAction("None", selectNoTypes, this); | 137 | childSetAction("None", selectNoTypes, this); |
123 | 138 | ||
@@ -127,6 +142,8 @@ LLInventoryViewFinder::LLInventoryViewFinder(const std::string& name, | |||
127 | mSpinSinceDays = getChild<LLSpinCtrl>("spin_days_ago"); | 142 | mSpinSinceDays = getChild<LLSpinCtrl>("spin_days_ago"); |
128 | childSetCommitCallback("spin_days_ago", onTimeAgo, this); | 143 | childSetCommitCallback("spin_days_ago", onTimeAgo, this); |
129 | 144 | ||
145 | childSetCommitCallback("check_show_empty", onCheckShowEmptyFolders, this); | ||
146 | |||
130 | // mCheckSinceLogoff = getChild<LLSpinCtrl>("check_since_logoff"); | 147 | // mCheckSinceLogoff = getChild<LLSpinCtrl>("check_since_logoff"); |
131 | childSetCommitCallback("check_since_logoff", onCheckSinceLogoff, this); | 148 | childSetCommitCallback("check_since_logoff", onCheckSinceLogoff, this); |
132 | 149 | ||
@@ -136,6 +153,16 @@ LLInventoryViewFinder::LLInventoryViewFinder(const std::string& name, | |||
136 | } | 153 | } |
137 | 154 | ||
138 | 155 | ||
156 | // Callback when an inventory type checkbox is changed. | ||
157 | void LLInventoryViewFinder::onCheckFilterType(LLUICtrl *ctrl, void *user_data) | ||
158 | { | ||
159 | LLInventoryViewFinder *self = (LLInventoryViewFinder *)user_data; | ||
160 | if (!self) return; | ||
161 | |||
162 | self->rebuildFilter(); | ||
163 | } | ||
164 | |||
165 | |||
139 | void LLInventoryViewFinder::onCheckSinceLogoff(LLUICtrl *ctrl, void *user_data) | 166 | void LLInventoryViewFinder::onCheckSinceLogoff(LLUICtrl *ctrl, void *user_data) |
140 | { | 167 | { |
141 | LLInventoryViewFinder *self = (LLInventoryViewFinder *)user_data; | 168 | LLInventoryViewFinder *self = (LLInventoryViewFinder *)user_data; |
@@ -148,6 +175,8 @@ void LLInventoryViewFinder::onCheckSinceLogoff(LLUICtrl *ctrl, void *user_data) | |||
148 | { | 175 | { |
149 | self->mSpinSinceHours->set(1.0f); | 176 | self->mSpinSinceHours->set(1.0f); |
150 | } | 177 | } |
178 | |||
179 | self->rebuildFilter(); | ||
151 | } | 180 | } |
152 | 181 | ||
153 | void LLInventoryViewFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) | 182 | void LLInventoryViewFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) |
@@ -161,8 +190,20 @@ void LLInventoryViewFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) | |||
161 | since_logoff = false; | 190 | since_logoff = false; |
162 | } | 191 | } |
163 | self->childSetValue("check_since_logoff", since_logoff); | 192 | self->childSetValue("check_since_logoff", since_logoff); |
193 | |||
194 | self->rebuildFilter(); | ||
195 | } | ||
196 | |||
197 | |||
198 | void LLInventoryViewFinder::onCheckShowEmptyFolders(LLUICtrl *ctrl, void *user_data) | ||
199 | { | ||
200 | LLInventoryViewFinder *self = (LLInventoryViewFinder *)user_data; | ||
201 | if (!self) return; | ||
202 | |||
203 | self->rebuildFilter(); | ||
164 | } | 204 | } |
165 | 205 | ||
206 | |||
166 | void LLInventoryViewFinder::changeFilter(LLInventoryFilter* filter) | 207 | void LLInventoryViewFinder::changeFilter(LLInventoryFilter* filter) |
167 | { | 208 | { |
168 | mFilter = filter; | 209 | mFilter = filter; |
@@ -203,7 +244,6 @@ void LLInventoryViewFinder::updateElementsFromFilter() | |||
203 | 244 | ||
204 | void LLInventoryViewFinder::draw() | 245 | void LLInventoryViewFinder::draw() |
205 | { | 246 | { |
206 | rebuildFilter(); | ||
207 | LLFloater::draw(); | 247 | LLFloater::draw(); |
208 | } | 248 | } |
209 | 249 | ||
@@ -362,6 +402,9 @@ void LLInventoryViewFinder::selectAllTypes(void* user_data) | |||
362 | self->mCheckSound->set(TRUE); | 402 | self->mCheckSound->set(TRUE); |
363 | self->mCheckTexture->set(TRUE); | 403 | self->mCheckTexture->set(TRUE); |
364 | self->mCheckSnapshot->set(TRUE);*/ | 404 | self->mCheckSnapshot->set(TRUE);*/ |
405 | |||
406 | self->rebuildFilter(); | ||
407 | |||
365 | } | 408 | } |
366 | 409 | ||
367 | //static | 410 | //static |
@@ -396,6 +439,8 @@ void LLInventoryViewFinder::selectNoTypes(void* user_data) | |||
396 | self->childSetValue("check_sound", FALSE); | 439 | self->childSetValue("check_sound", FALSE); |
397 | self->childSetValue("check_texture", FALSE); | 440 | self->childSetValue("check_texture", FALSE); |
398 | self->childSetValue("check_snapshot", FALSE); | 441 | self->childSetValue("check_snapshot", FALSE); |
442 | |||
443 | self->rebuildFilter(); | ||
399 | } | 444 | } |
400 | 445 | ||
401 | 446 | ||
diff --git a/linden/indra/newview/llinventoryview.h b/linden/indra/newview/llinventoryview.h index 26f3003..439f869 100644 --- a/linden/indra/newview/llinventoryview.h +++ b/linden/indra/newview/llinventoryview.h | |||
@@ -170,7 +170,11 @@ public: | |||
170 | BOOL getCheckShowEmpty(); | 170 | BOOL getCheckShowEmpty(); |
171 | BOOL getCheckSinceLogoff(); | 171 | BOOL getCheckSinceLogoff(); |
172 | 172 | ||
173 | /** Callback when an inventory type checkbox is changed. */ | ||
174 | static void onCheckFilterType(LLUICtrl *ctrl, void *user_data); | ||
175 | |||
173 | static void onTimeAgo(LLUICtrl*, void *); | 176 | static void onTimeAgo(LLUICtrl*, void *); |
177 | static void onCheckShowEmptyFolders(LLUICtrl*, void *); | ||
174 | static void onCheckSinceLogoff(LLUICtrl*, void *); | 178 | static void onCheckSinceLogoff(LLUICtrl*, void *); |
175 | static void onCloseBtn(void* user_data); | 179 | static void onCloseBtn(void* user_data); |
176 | static void selectAllTypes(void* user_data); | 180 | static void selectAllTypes(void* user_data); |