aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
authorMcCabe Maxsted2011-04-10 22:56:40 -0700
committerMcCabe Maxsted2011-04-11 13:15:57 -0700
commit8f27533c22c940ef22d2c9f5170742a488a1da9a (patch)
tree9769b15339d2bf832fd30c9287b09ae5dc001168 /linden/indra
parentInitialize the upload price to 0 in case a grid doesn't send this info (at le... (diff)
downloadmeta-impy-8f27533c22c940ef22d2c9f5170742a488a1da9a.zip
meta-impy-8f27533c22c940ef22d2c9f5170742a488a1da9a.tar.gz
meta-impy-8f27533c22c940ef22d2c9f5170742a488a1da9a.tar.bz2
meta-impy-8f27533c22c940ef22d2c9f5170742a488a1da9a.tar.xz
Added search to the Debug Settings
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/llui/llcombobox.cpp7
-rw-r--r--linden/indra/llui/llcombobox.h1
-rw-r--r--linden/indra/newview/llfloatersettingsdebug.cpp69
-rw-r--r--linden/indra/newview/llfloatersettingsdebug.h9
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_settings_debug.xml10
5 files changed, 81 insertions, 15 deletions
diff --git a/linden/indra/llui/llcombobox.cpp b/linden/indra/llui/llcombobox.cpp
index a93dc9b..f3ef83e 100644
--- a/linden/indra/llui/llcombobox.cpp
+++ b/linden/indra/llui/llcombobox.cpp
@@ -591,6 +591,13 @@ void LLComboBox::updateLayout()
591 } 591 }
592} 592}
593 593
594
595void LLComboBox::getAllData(std::vector<LLScrollListItem*>& item_list) const
596{
597 item_list = mList->getAllData();
598}
599
600
594void* LLComboBox::getCurrentUserdata() 601void* LLComboBox::getCurrentUserdata()
595{ 602{
596 LLScrollListItem* item = mList->getFirstSelected(); 603 LLScrollListItem* item = mList->getFirstSelected();
diff --git a/linden/indra/llui/llcombobox.h b/linden/indra/llui/llcombobox.h
index 596f659..f92fe44 100644
--- a/linden/indra/llui/llcombobox.h
+++ b/linden/indra/llui/llcombobox.h
@@ -169,6 +169,7 @@ public:
169 169
170 //======================================================================== 170 //========================================================================
171 171
172 void getAllData(std::vector<LLScrollListItem*>& item_list) const;
172 void* getCurrentUserdata(); 173 void* getCurrentUserdata();
173 174
174 void setPrearrangeCallback( void (*cb)(LLUICtrl*,void*) ) { mPrearrangeCallback = cb; } 175 void setPrearrangeCallback( void (*cb)(LLUICtrl*,void*) ) { mPrearrangeCallback = cb; }
diff --git a/linden/indra/newview/llfloatersettingsdebug.cpp b/linden/indra/newview/llfloatersettingsdebug.cpp
index 0aa0607..9e4a04c 100644
--- a/linden/indra/newview/llfloatersettingsdebug.cpp
+++ b/linden/indra/newview/llfloatersettingsdebug.cpp
@@ -36,6 +36,8 @@
36#include "lluictrlfactory.h" 36#include "lluictrlfactory.h"
37#include "llfirstuse.h" 37#include "llfirstuse.h"
38#include "llcombobox.h" 38#include "llcombobox.h"
39#include "lllineeditor.h"
40#include "llscrolllistctrl.h"
39#include "llspinctrl.h" 41#include "llspinctrl.h"
40#include "llcolorswatch.h" 42#include "llcolorswatch.h"
41#include "llviewercontrol.h" 43#include "llviewercontrol.h"
@@ -58,7 +60,8 @@ LLFloaterSettingsDebug::~LLFloaterSettingsDebug()
58 60
59BOOL LLFloaterSettingsDebug::postBuild() 61BOOL LLFloaterSettingsDebug::postBuild()
60{ 62{
61 LLComboBox* settings_combo = getChild<LLComboBox>("settings_combo"); 63 mSettingsNames.clear();
64 mComboNames = getChild<LLComboBox>("settings_combo");
62 65
63 struct f : public LLControlGroup::ApplyFunctor 66 struct f : public LLControlGroup::ApplyFunctor
64 { 67 {
@@ -71,16 +74,16 @@ BOOL LLFloaterSettingsDebug::postBuild()
71 combo->add(name, (void*)control); 74 combo->add(name, (void*)control);
72 } 75 }
73 } 76 }
74 } func(settings_combo); 77 } func(mComboNames);
75 78
76 gSavedSettings.applyToAll(&func); 79 gSavedSettings.applyToAll(&func);
77 gSavedPerAccountSettings.applyToAll(&func); 80 gSavedPerAccountSettings.applyToAll(&func);
78 gColors.applyToAll(&func); 81 gColors.applyToAll(&func);
79 82
80 settings_combo->sortByName(); 83 mComboNames->sortByName();
81 settings_combo->setCommitCallback(onSettingSelect); 84 mComboNames->setCommitCallback(onSettingSelect);
82 settings_combo->setCallbackUserData(this); 85 mComboNames->setCallbackUserData(this);
83 settings_combo->updateSelection(); 86 //mComboNames->updateSelection();
84 87
85 childSetCommitCallback("val_spinner_1", onCommitSettings); 88 childSetCommitCallback("val_spinner_1", onCommitSettings);
86 childSetUserData("val_spinner_1", this); 89 childSetUserData("val_spinner_1", this);
@@ -98,14 +101,23 @@ BOOL LLFloaterSettingsDebug::postBuild()
98 childSetUserData("color_swatch", this); 101 childSetUserData("color_swatch", this);
99 childSetAction("default_btn", onClickDefault, this); 102 childSetAction("default_btn", onClickDefault, this);
100 mComment = getChild<LLTextEditor>("comment_text"); 103 mComment = getChild<LLTextEditor>("comment_text");
104
105 getChild<LLSearchEditor>("control_search")->setSearchCallback(onSearchEdit, this);
106
107 // There really are many better ways to do this, but laziness... she is powerful... -- MC
108 mComboNames->getAllData(mSettingsNames);
109 getChild<LLSearchEditor>("control_search")->setEnabled(!(mSettingsNames.empty()));
110
101 return TRUE; 111 return TRUE;
102} 112}
103 113
104void LLFloaterSettingsDebug::draw() 114void LLFloaterSettingsDebug::draw()
105{ 115{
106 LLComboBox* settings_combo = getChild<LLComboBox>("settings_combo"); 116 if (mComboNames)
107 LLControlVariable* controlp = (LLControlVariable*)settings_combo->getCurrentUserdata(); 117 {
108 updateControl(controlp); 118 LLControlVariable* controlp = (LLControlVariable*)mComboNames->getCurrentUserdata();
119 updateControl(controlp);
120 }
109 121
110 LLFloater::draw(); 122 LLFloater::draw();
111} 123}
@@ -134,11 +146,46 @@ void LLFloaterSettingsDebug::onSettingSelect(LLUICtrl* ctrl, void* user_data)
134} 146}
135 147
136//static 148//static
149void LLFloaterSettingsDebug::onSearchEdit(const std::string& search_string, void* user_data)
150{
151 if (search_string.empty())
152 {
153 return;
154 }
155
156 LLFloaterSettingsDebug* self = (LLFloaterSettingsDebug*)user_data;
157 if (!self || !self->mComboNames)
158 {
159 return;
160 }
161
162 std::string search_text = search_string;
163 LLStringUtil::trim(search_text);
164 LLStringUtil::toUpper(search_text);
165
166 std::string settings_name("");
167 size_t found;
168 for (std::vector<LLScrollListItem*>::iterator vIt = self->mSettingsNames.begin();
169 vIt != self->mSettingsNames.end(); ++vIt)
170 {
171 settings_name = (*vIt)->getValue().asString();
172 LLStringUtil::toUpper(settings_name);
173 found = settings_name.find(search_text);
174 if (found != std::string::npos)
175 {
176 // search and update combo on partial matches
177 self->mComboNames->selectByValue((*vIt)->getValue());
178 break;
179 }
180 }
181}
182
183//static
137void LLFloaterSettingsDebug::onCommitSettings(LLUICtrl* ctrl, void* user_data) 184void LLFloaterSettingsDebug::onCommitSettings(LLUICtrl* ctrl, void* user_data)
138{ 185{
139 LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data; 186 LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data;
140 187
141 LLComboBox* settings_combo = floaterp->getChild<LLComboBox>("settings_combo"); 188 LLComboBox* settings_combo = floaterp->mComboNames;
142 LLControlVariable* controlp = (LLControlVariable*)settings_combo->getCurrentUserdata(); 189 LLControlVariable* controlp = (LLControlVariable*)settings_combo->getCurrentUserdata();
143 190
144 LLVector3 vector; 191 LLVector3 vector;
@@ -212,7 +259,7 @@ void LLFloaterSettingsDebug::onCommitSettings(LLUICtrl* ctrl, void* user_data)
212void LLFloaterSettingsDebug::onClickDefault(void* user_data) 259void LLFloaterSettingsDebug::onClickDefault(void* user_data)
213{ 260{
214 LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data; 261 LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data;
215 LLComboBox* settings_combo = floaterp->getChild<LLComboBox>("settings_combo"); 262 LLComboBox* settings_combo = floaterp->mComboNames;
216 LLControlVariable* controlp = (LLControlVariable*)settings_combo->getCurrentUserdata(); 263 LLControlVariable* controlp = (LLControlVariable*)settings_combo->getCurrentUserdata();
217 264
218 if (controlp) 265 if (controlp)
diff --git a/linden/indra/newview/llfloatersettingsdebug.h b/linden/indra/newview/llfloatersettingsdebug.h
index e08e6b5..3e14eaa 100644
--- a/linden/indra/newview/llfloatersettingsdebug.h
+++ b/linden/indra/newview/llfloatersettingsdebug.h
@@ -37,6 +37,9 @@
37#include "llfloater.h" 37#include "llfloater.h"
38#include "lltexteditor.h" 38#include "lltexteditor.h"
39 39
40class LLComboBox;
41class LLScrollListItem;
42
40class LLFloaterSettingsDebug : public LLFloater 43class LLFloaterSettingsDebug : public LLFloater
41{ 44{
42public: 45public:
@@ -56,6 +59,12 @@ public:
56protected: 59protected:
57 static LLFloaterSettingsDebug* sInstance; 60 static LLFloaterSettingsDebug* sInstance;
58 LLTextEditor* mComment; 61 LLTextEditor* mComment;
62
63private:
64 LLComboBox* mComboNames;
65 std::vector<LLScrollListItem*> mSettingsNames;
66
67 static void onSearchEdit(const std::string& search_string, void* user_data);
59}; 68};
60 69
61#endif //LLFLOATERDEBUGSETTINGS_H 70#endif //LLFLOATERDEBUGSETTINGS_H
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_settings_debug.xml b/linden/indra/newview/skins/default/xui/en-us/floater_settings_debug.xml
index a8c0840..1dc8a5e 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_settings_debug.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_settings_debug.xml
@@ -1,10 +1,12 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater can_close="true" can_drag_on_left="false" can_minimize="false" 2<floater can_close="true" can_drag_on_left="false" can_minimize="false"
3 can_resize="false" height="215" name="settings_debug" 3 can_resize="false" height="235" name="settings_debug"
4 title="Debug Settings" width="350"> 4 title="Debug Settings" width="350">
5 <combo_box allow_text_entry="true" bottom="-50" follows="top|left" font="SansSerifSmall" 5 <search_editor bottom="-45" height="20" name="control_search" visible="true" width="320"
6 left="15" label="Type here to search" />
7 <combo_box allow_text_entry="false" bottom_delta="-30" follows="top|left" font="SansSerifSmall"
6 height="20" left="15" max_chars="255" name="settings_combo" /> 8 height="20" left="15" max_chars="255" name="settings_combo" />
7 <text_editor bottom_delta="-75" enabled="false" height="60" width="320" hide_scrollbar="true" 9 <text_editor bottom_delta="-70" enabled="false" height="60" width="320" hide_scrollbar="true"
8 name="comment_text" word_wrap="true" /> 10 name="comment_text" word_wrap="true" />
9 <combo_box bottom_delta="-30" follows="top|left" font="SansSerifSmall" height="20" 11 <combo_box bottom_delta="-30" follows="top|left" font="SansSerifSmall" height="20"
10 left="15" name="boolean_combo" visible="false"> 12 left="15" name="boolean_combo" visible="false">
@@ -15,7 +17,7 @@
15 FALSE 17 FALSE
16 </combo_item> 18 </combo_item>
17 </combo_box> 19 </combo_box>
18 <line_editor bottom_delta="0" height="20" name="val_text" visible="false" width="300" /> 20 <line_editor bottom_delta="0" height="20" name="val_text" visible="false" width="320" />
19 <color_swatch bottom="30" can_apply_immediately="true" height="55" label="Color" 21 <color_swatch bottom="30" can_apply_immediately="true" height="55" label="Color"
20 name="color_swatch" visible="true" width="37" /> 22 name="color_swatch" visible="true" width="37" />
21 <spinner bottom_delta="25" height="20" label="x" label_width="40" max_val="10000000" 23 <spinner bottom_delta="25" height="20" label="x" label_width="40" max_val="10000000"