diff options
author | Jacek Antonelli | 2008-12-01 17:39:58 -0600 |
---|---|---|
committer | Jacek Antonelli | 2008-12-01 17:40:06 -0600 |
commit | 7abecb48babe6a6f09bf6692ba55076546cfced9 (patch) | |
tree | 8d18a88513fb97adf32c10aae78f4be1984942db /linden/indra/newview/llpanelgeneral.cpp | |
parent | Second Life viewer sources 1.21.6 (diff) | |
download | meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.zip meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.gz meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.bz2 meta-impy-7abecb48babe6a6f09bf6692ba55076546cfced9.tar.xz |
Second Life viewer sources 1.22.0-RC
Diffstat (limited to 'linden/indra/newview/llpanelgeneral.cpp')
-rw-r--r-- | linden/indra/newview/llpanelgeneral.cpp | 226 |
1 files changed, 50 insertions, 176 deletions
diff --git a/linden/indra/newview/llpanelgeneral.cpp b/linden/indra/newview/llpanelgeneral.cpp index 256f02a..43b0f4c 100644 --- a/linden/indra/newview/llpanelgeneral.cpp +++ b/linden/indra/newview/llpanelgeneral.cpp | |||
@@ -31,75 +31,15 @@ | |||
31 | 31 | ||
32 | #include "llviewerprecompiledheaders.h" | 32 | #include "llviewerprecompiledheaders.h" |
33 | 33 | ||
34 | //file include | ||
34 | #include "llpanelgeneral.h" | 35 | #include "llpanelgeneral.h" |
35 | 36 | ||
36 | // linden library includes | ||
37 | #include "llerror.h" | ||
38 | #include "llrect.h" | ||
39 | #include "llfontgl.h" | ||
40 | #include "message.h" | ||
41 | #include "lluictrlfactory.h" | ||
42 | |||
43 | // project includes | 37 | // project includes |
44 | #include "llagent.h" | ||
45 | #include "llviewerwindow.h" | ||
46 | #include "llcolorswatch.h" | 38 | #include "llcolorswatch.h" |
47 | #include "llcombobox.h" | 39 | #include "llcombobox.h" |
48 | #include "llconsole.h" | 40 | #include "lluictrlfactory.h" |
49 | #include "lllineeditor.h" | ||
50 | #include "llpanellogin.h" | ||
51 | #include "llnetmap.h" | ||
52 | #include "llresmgr.h" | ||
53 | #include "llspinctrl.h" | ||
54 | #include "lltextbox.h" | ||
55 | #include "llui.h" | ||
56 | #include "llurlsimstring.h" | 41 | #include "llurlsimstring.h" |
57 | #include "llviewercontrol.h" | 42 | #include "llviewercontrol.h" |
58 | #include "llurlsimstring.h" | ||
59 | |||
60 | #include "llcheckboxctrl.h" | ||
61 | #include "llradiogroup.h" | ||
62 | // | ||
63 | // Imported globals | ||
64 | // | ||
65 | |||
66 | void set_crash_behavior(LLUICtrl* ctrl, void* data); | ||
67 | void set_start_location(LLUICtrl* ctrl, void* data); | ||
68 | |||
69 | |||
70 | // | ||
71 | // Globals | ||
72 | // | ||
73 | |||
74 | // | ||
75 | // Static functions | ||
76 | // | ||
77 | static void set_render_name_fade_out(LLUICtrl* ctrl, void* data) | ||
78 | { | ||
79 | LLComboBox* combo = (LLComboBox*)ctrl; | ||
80 | if (!combo) return; | ||
81 | gSavedSettings.setS32("RenderName", combo->getCurrentIndex() ); | ||
82 | } | ||
83 | |||
84 | void set_crash_behavior(LLUICtrl* ctrl, void* data) | ||
85 | { | ||
86 | gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, ((LLComboBox*) ctrl)->getCurrentIndex()); | ||
87 | } | ||
88 | |||
89 | void set_language(LLUICtrl* ctrl, void* data) | ||
90 | { | ||
91 | gSavedSettings.setString("Language", ctrl->getValue().asString()); | ||
92 | } | ||
93 | |||
94 | void LLPanelGeneral::set_start_location(LLUICtrl* ctrl, void* data) | ||
95 | { | ||
96 | LLURLSimString::setString(ctrl->getValue().asString()); | ||
97 | } | ||
98 | |||
99 | void LLPanelGeneral::set_specific_start_location(LLLineEditor* line_editor, void* data) | ||
100 | { | ||
101 | LLURLSimString::setString(line_editor->getValue().asString()); | ||
102 | } | ||
103 | 43 | ||
104 | LLPanelGeneral::LLPanelGeneral() | 44 | LLPanelGeneral::LLPanelGeneral() |
105 | { | 45 | { |
@@ -108,50 +48,33 @@ LLPanelGeneral::LLPanelGeneral() | |||
108 | 48 | ||
109 | BOOL LLPanelGeneral::postBuild() | 49 | BOOL LLPanelGeneral::postBuild() |
110 | { | 50 | { |
111 | childSetCommitCallback("fade_out_combobox", set_render_name_fade_out); | 51 | LLComboBox* fade_out_combobox = getChild<LLComboBox>("fade_out_combobox"); |
112 | 52 | fade_out_combobox->setCurrentByIndex(gSavedSettings.getS32("RenderName")); | |
113 | std::string region_name_prompt = getString("region_name_prompt"); | 53 | |
114 | 54 | childSetValue("default_start_location", gSavedSettings.getBOOL("LoginLastLocation") ? "MyLastLocation" : "MyHome"); | |
115 | 55 | childSetValue("show_location_checkbox", gSavedSettings.getBOOL("ShowStartLocation")); | |
116 | // location combobox | 56 | childSetValue("show_all_title_checkbox", gSavedSettings.getBOOL("RenderHideGroupTitleAll")); |
117 | LLComboBox* combo = getChild<LLComboBox>( "location_combobox"); | 57 | childSetValue("language_is_public", gSavedSettings.getBOOL("LanguageIsPublic")); |
118 | if (combo) | 58 | |
119 | { | 59 | childSetValue("show_my_name_checkbox", gSavedSettings.getBOOL("RenderNameHideSelf")); |
120 | if (!LLURLSimString::sInstance.mSimString.empty()) | 60 | childSetValue("small_avatar_names_checkbox", gSavedSettings.getBOOL("SmallAvatarNames")); |
121 | { | 61 | childSetValue("show_my_title_checkbox", gSavedSettings.getBOOL("RenderHideGroupTitle")); |
122 | combo->setTextEntry(LLURLSimString::sInstance.mSimString); | 62 | childSetValue("afk_timeout_spinner", gSavedSettings.getF32("AFKTimeout")); |
123 | } | 63 | childSetValue("rotate_mini_map_checkbox", gSavedSettings.getBOOL("MiniMapRotate")); |
124 | 64 | childSetValue("notify_money_change_checkbox", gSavedSettings.getBOOL("NotifyMoneyChange")); | |
125 | BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation"); | 65 | childSetValue("use_system_color_picker_checkbox", gSavedSettings.getBOOL("UseDefaultColorPicker")); |
126 | if (!LLURLSimString::sInstance.mSimString.empty()) | 66 | childSetValue("show_search_panel", gSavedSettings.getBOOL("ShowSearchBar")); |
127 | { | 67 | |
128 | combo->add( LLURLSimString::sInstance.mSimString ); | 68 | getChild<LLColorSwatchCtrl>("effect_color_swatch")->set(gSavedSettings.getColor4("EffectColor")); |
129 | combo->setCurrentByIndex( 2 ); | 69 | |
130 | } | 70 | childSetValue("ui_scale_slider", gSavedSettings.getF32("UIScaleFactor")); |
131 | else | 71 | childSetValue("ui_auto_scale", gSavedSettings.getBOOL("UIAutoScale")); |
132 | { | 72 | |
133 | combo->add( region_name_prompt ); | 73 | LLComboBox* crash_behavior_combobox = getChild<LLComboBox>("crash_behavior_combobox"); |
134 | combo->setCurrentByIndex( login_last ? 1 : 0 ); | 74 | crash_behavior_combobox->setCurrentByIndex(gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING)); |
135 | } | ||
136 | combo->setCommitCallback( &set_start_location ); | ||
137 | combo->setTextEntryCallback( &set_specific_start_location ); | ||
138 | } | ||
139 | |||
140 | // Show location on login screen | ||
141 | childSetCommitCallback("show_location_checkbox", &LLPanelGeneral::clickShowStartLocation); | ||
142 | |||
143 | combo = getChild<LLComboBox>( "crash_behavior_combobox"); | ||
144 | if (combo) | ||
145 | { | ||
146 | combo->setCurrentByIndex( gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING) ); | ||
147 | combo->setCommitCallback( &set_crash_behavior ); | ||
148 | } | ||
149 | 75 | ||
150 | childSetCommitCallback("language_combobox", set_language ); | ||
151 | childSetValue("language_combobox", gSavedSettings.getString("Language")); | 76 | childSetValue("language_combobox", gSavedSettings.getString("Language")); |
152 | 77 | ||
153 | refresh(); | ||
154 | |||
155 | return TRUE; | 78 | return TRUE; |
156 | } | 79 | } |
157 | 80 | ||
@@ -160,83 +83,34 @@ LLPanelGeneral::~LLPanelGeneral() | |||
160 | // Children all cleaned up by default view destructor. | 83 | // Children all cleaned up by default view destructor. |
161 | } | 84 | } |
162 | 85 | ||
163 | void LLPanelGeneral::refresh() | ||
164 | { | ||
165 | LLPanel::refresh(); | ||
166 | BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation"); | ||
167 | LLComboBox* combo = getChild<LLComboBox>( "location_combobox"); | ||
168 | if (combo) | ||
169 | { | ||
170 | if (!LLURLSimString::sInstance.mSimString.empty()) | ||
171 | { | ||
172 | combo->setCurrentByIndex( 2 ); | ||
173 | } | ||
174 | else | ||
175 | { | ||
176 | combo->setCurrentByIndex( login_last ? 1 : 0 ); | ||
177 | } | ||
178 | //save current settings in case cancel is clicked | ||
179 | mLoginLocation = combo->getValue().asString(); | ||
180 | } | ||
181 | |||
182 | mOldCrashBehavior = gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING); | ||
183 | combo = getChild<LLComboBox>( "crash_behavior_combobox"); | ||
184 | if (combo) | ||
185 | { | ||
186 | combo->setCurrentByIndex( mOldCrashBehavior ); | ||
187 | } | ||
188 | |||
189 | mRenderName = gSavedSettings.getS32("RenderName"); | ||
190 | combo = getChild<LLComboBox>("fade_out_combobox"); | ||
191 | if (combo) | ||
192 | { | ||
193 | combo->setCurrentByIndex( mRenderName ); | ||
194 | } | ||
195 | |||
196 | mRenderNameHideSelf = gSavedSettings.getBOOL("RenderNameHideSelf"); | ||
197 | mSmallAvatarNames = gSavedSettings.getBOOL("SmallAvatarNames"); | ||
198 | mRenderHideGroupTitle = gSavedSettings.getBOOL("RenderHideGroupTitle"); | ||
199 | mChatOnlineNotification = gSavedSettings.getBOOL("ChatOnlineNotification"); | ||
200 | mAFKTimeout = gSavedSettings.getF32("AFKTimeout"); | ||
201 | mMiniMapRotate = gSavedSettings.getBOOL("MiniMapRotate"); | ||
202 | mNotifyMoney = gSavedSettings.getBOOL("NotifyMoneyChange"); | ||
203 | mUseDefaultColor = gSavedSettings.getBOOL("UseDefaultColorPicker"); | ||
204 | mEffectColor = gSavedSettings.getColor4("EffectColor"); | ||
205 | mShowSearch = gSavedSettings.getBOOL("ShowSearchBar"); | ||
206 | |||
207 | mUIScaleFactor = gSavedSettings.getF32("UIScaleFactor"); | ||
208 | mUIAutoScale = gSavedSettings.getBOOL("UIAutoScale"); | ||
209 | |||
210 | mLanguage = gSavedSettings.getString("Language"); | ||
211 | } | ||
212 | |||
213 | void LLPanelGeneral::apply() | 86 | void LLPanelGeneral::apply() |
214 | { | 87 | { |
215 | } | 88 | LLComboBox* fade_out_combobox = getChild<LLComboBox>("fade_out_combobox"); |
216 | 89 | gSavedSettings.setS32("RenderName", fade_out_combobox->getCurrentIndex()); | |
217 | void LLPanelGeneral::cancel() | ||
218 | { | ||
219 | gSavedSettings.setS32("RenderName", mRenderName); | ||
220 | gSavedSettings.setBOOL("RenderNameHideSelf", mRenderNameHideSelf ); | ||
221 | gSavedSettings.setBOOL("SmallAvatarNames", mSmallAvatarNames ); | ||
222 | gSavedSettings.setBOOL("RenderHideGroupTitle", mRenderHideGroupTitle ); | ||
223 | gSavedSettings.setBOOL("ChatOnlineNotification", mChatOnlineNotification ); | ||
224 | gSavedSettings.setF32("AFKTimeout", mAFKTimeout ); | ||
225 | gSavedSettings.setBOOL("MiniMapRotate", mMiniMapRotate ); | ||
226 | gSavedSettings.setBOOL("NotifyMoneyChange", mNotifyMoney ); | ||
227 | gSavedSettings.setBOOL("UseDefaultColorPicker", mUseDefaultColor ); | ||
228 | gSavedSettings.setBOOL("ShowSearchBar", mShowSearch); | ||
229 | gSavedSettings.setColor4("EffectColor", mEffectColor ); | ||
230 | gSavedSettings.setF32("UIScaleFactor", mUIScaleFactor); | ||
231 | gSavedSettings.setBOOL("UIAutoScale", mUIAutoScale); | ||
232 | gSavedSettings.setString("Language", mLanguage); | ||
233 | 90 | ||
234 | LLURLSimString::setString(mLoginLocation); | 91 | gSavedSettings.setBOOL("LoginLastLocation", childGetValue("default_start_location").asString() == "MyLastLocation"); |
235 | 92 | gSavedSettings.setBOOL("ShowStartLocation", childGetValue("show_location_checkbox")); | |
236 | gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, mOldCrashBehavior); | 93 | gSavedSettings.setBOOL("RenderHideGroupTitleAll", childGetValue("show_all_title_checkbox")); |
94 | gSavedSettings.setBOOL("LanguageIsPublic", childGetValue("language_is_public")); | ||
95 | gSavedSettings.setBOOL("RenderNameHideSelf", childGetValue("show_my_name_checkbox")); | ||
96 | gSavedSettings.setBOOL("SmallAvatarNames", childGetValue("small_avatar_names_checkbox")); | ||
97 | gSavedSettings.setBOOL("RenderHideGroupTitle", childGetValue("show_my_title_checkbox")); | ||
98 | gSavedSettings.setF32("AFKTimeout", childGetValue("afk_timeout_spinner").asReal()); | ||
99 | gSavedSettings.setBOOL("MiniMapRotate", childGetValue("rotate_mini_map_checkbox")); | ||
100 | gSavedSettings.setBOOL("NotifyMoneyChange", childGetValue("notify_money_change_checkbox")); | ||
101 | gSavedSettings.setBOOL("UseDefaultColorPicker", childGetValue("use_system_color_picker_checkbox")); | ||
102 | gSavedSettings.setBOOL("ShowSearchBar", childGetValue("show_search_panel")); | ||
103 | gSavedSettings.setColor4("EffectColor", childGetValue("effect_color_swatch")); | ||
104 | gSavedSettings.setF32("UIScaleFactor", childGetValue("ui_scale_slider").asReal()); | ||
105 | gSavedSettings.setBOOL("UIAutoScale", childGetValue("ui_auto_scale")); | ||
106 | gSavedSettings.setString("Language", childGetValue("language_combobox")); | ||
107 | |||
108 | LLURLSimString::setString(childGetValue("location_combobox")); | ||
109 | |||
110 | LLComboBox* crash_behavior_combobox = getChild<LLComboBox>("crash_behavior_combobox"); | ||
111 | gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior_combobox->getCurrentIndex()); | ||
237 | } | 112 | } |
238 | 113 | ||
239 | void LLPanelGeneral::clickShowStartLocation(LLUICtrl*, void* user_data) | 114 | void LLPanelGeneral::cancel() |
240 | { | 115 | { |
241 | LLPanelLogin::refreshLocation( false ); // in case LLPanelLogin is visible | ||
242 | } | 116 | } |