diff options
author | McCabe Maxsted | 2010-07-16 00:02:43 -0700 |
---|---|---|
committer | McCabe Maxsted | 2010-07-16 00:09:51 -0700 |
commit | 8c7db44a2a85f8ea907386bc1d1c74babbae99d8 (patch) | |
tree | 025932355bc6769b8df13f2e99fd1c8dfc13d6ee /linden/indra/newview/llpanelgeneral.cpp | |
parent | fix: don't change inventory floater title continously without need (take2) (diff) | |
download | meta-impy-8c7db44a2a85f8ea907386bc1d1c74babbae99d8.zip meta-impy-8c7db44a2a85f8ea907386bc1d1c74babbae99d8.tar.gz meta-impy-8c7db44a2a85f8ea907386bc1d1c74babbae99d8.tar.bz2 meta-impy-8c7db44a2a85f8ea907386bc1d1c74babbae99d8.tar.xz |
Feature #277: added the grid manager to Preferences > General and changed the start location to a pulldown to match the login screen
Diffstat (limited to 'linden/indra/newview/llpanelgeneral.cpp')
-rw-r--r-- | linden/indra/newview/llpanelgeneral.cpp | 62 |
1 files changed, 58 insertions, 4 deletions
diff --git a/linden/indra/newview/llpanelgeneral.cpp b/linden/indra/newview/llpanelgeneral.cpp index 8dfbe49..07c81fd 100644 --- a/linden/indra/newview/llpanelgeneral.cpp +++ b/linden/indra/newview/llpanelgeneral.cpp | |||
@@ -42,7 +42,9 @@ | |||
42 | #include "llurlsimstring.h" | 42 | #include "llurlsimstring.h" |
43 | #include "llviewercontrol.h" | 43 | #include "llviewercontrol.h" |
44 | 44 | ||
45 | #include "floatergridmanager.h" | ||
45 | #include "llagent.h" | 46 | #include "llagent.h" |
47 | #include "llpanellogin.h" | ||
46 | #include "llviewerregion.h" | 48 | #include "llviewerregion.h" |
47 | 49 | ||
48 | LLPanelGeneral::LLPanelGeneral() | 50 | LLPanelGeneral::LLPanelGeneral() |
@@ -55,7 +57,34 @@ BOOL LLPanelGeneral::postBuild() | |||
55 | LLComboBox* fade_out_combobox = getChild<LLComboBox>("fade_out_combobox"); | 57 | LLComboBox* fade_out_combobox = getChild<LLComboBox>("fade_out_combobox"); |
56 | fade_out_combobox->setCurrentByIndex(gSavedSettings.getS32("RenderName")); | 58 | fade_out_combobox->setCurrentByIndex(gSavedSettings.getS32("RenderName")); |
57 | 59 | ||
58 | childSetValue("default_start_location", gSavedSettings.getBOOL("LoginLastLocation") ? "MyLastLocation" : "MyHome"); | 60 | LLComboBox* combo = getChild<LLComboBox>("default_location_combo"); |
61 | childSetCommitCallback("default_location_combo", onLocationChanged, this); | ||
62 | combo->setAllowTextEntry(TRUE, 128, FALSE); | ||
63 | |||
64 | // The XML file loads the combo with the following labels: | ||
65 | // 0 - "My Home" | ||
66 | // 1 - "My Last Location" | ||
67 | // 2 - "<Type region name>" | ||
68 | |||
69 | BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation"); | ||
70 | std::string sim_string = LLURLSimString::sInstance.mSimString; | ||
71 | if (!sim_string.empty()) | ||
72 | { | ||
73 | // Replace "<Type region name>" with this region name | ||
74 | combo->remove(2); | ||
75 | combo->add( sim_string ); | ||
76 | combo->setTextEntry(sim_string); | ||
77 | combo->setCurrentByIndex( 2 ); | ||
78 | } | ||
79 | else if (login_last) | ||
80 | { | ||
81 | combo->setCurrentByIndex( 1 ); | ||
82 | } | ||
83 | else | ||
84 | { | ||
85 | combo->setCurrentByIndex( 0 ); | ||
86 | } | ||
87 | |||
59 | childSetValue("show_location_checkbox", gSavedSettings.getBOOL("ShowStartLocation")); | 88 | childSetValue("show_location_checkbox", gSavedSettings.getBOOL("ShowStartLocation")); |
60 | childSetValue("show_all_title_checkbox", gSavedSettings.getBOOL("RenderHideGroupTitleAll")); | 89 | childSetValue("show_all_title_checkbox", gSavedSettings.getBOOL("RenderHideGroupTitleAll")); |
61 | childSetValue("show_my_name_checkbox", gSavedSettings.getBOOL("RenderNameHideSelf")); | 90 | childSetValue("show_my_name_checkbox", gSavedSettings.getBOOL("RenderNameHideSelf")); |
@@ -103,6 +132,8 @@ BOOL LLPanelGeneral::postBuild() | |||
103 | 132 | ||
104 | childSetVisible("maturity_desired_combobox", can_choose); | 133 | childSetVisible("maturity_desired_combobox", can_choose); |
105 | childSetVisible("maturity_desired_textbox", !can_choose); | 134 | childSetVisible("maturity_desired_textbox", !can_choose); |
135 | |||
136 | childSetAction("grid_btn", onClickGrid, this); | ||
106 | 137 | ||
107 | return TRUE; | 138 | return TRUE; |
108 | } | 139 | } |
@@ -117,7 +148,15 @@ void LLPanelGeneral::apply() | |||
117 | LLComboBox* fade_out_combobox = getChild<LLComboBox>("fade_out_combobox"); | 148 | LLComboBox* fade_out_combobox = getChild<LLComboBox>("fade_out_combobox"); |
118 | gSavedSettings.setS32("RenderName", fade_out_combobox->getCurrentIndex()); | 149 | gSavedSettings.setS32("RenderName", fade_out_combobox->getCurrentIndex()); |
119 | 150 | ||
120 | gSavedSettings.setBOOL("LoginLastLocation", childGetValue("default_start_location").asString() == "MyLastLocation"); | 151 | LLComboBox* loc_combo = getChild<LLComboBox>("default_location_combo"); |
152 | gSavedSettings.setBOOL("LoginLastLocation", loc_combo->getCurrentIndex() == 1); | ||
153 | if (!loc_combo->getValue().asString().empty() && | ||
154 | loc_combo->getSelectedItemLabel() != "<Type region name>") | ||
155 | { | ||
156 | LLURLSimString::setString(loc_combo->getValue().asString()); | ||
157 | } | ||
158 | LLPanelLogin::refreshLocation(false); | ||
159 | |||
121 | gSavedSettings.setBOOL("ShowStartLocation", childGetValue("show_location_checkbox")); | 160 | gSavedSettings.setBOOL("ShowStartLocation", childGetValue("show_location_checkbox")); |
122 | gSavedSettings.setBOOL("RenderHideGroupTitleAll", childGetValue("show_all_title_checkbox")); | 161 | gSavedSettings.setBOOL("RenderHideGroupTitleAll", childGetValue("show_all_title_checkbox")); |
123 | gSavedSettings.setBOOL("RenderNameHideSelf", childGetValue("show_my_name_checkbox")); | 162 | gSavedSettings.setBOOL("RenderNameHideSelf", childGetValue("show_my_name_checkbox")); |
@@ -132,8 +171,6 @@ void LLPanelGeneral::apply() | |||
132 | gSavedSettings.setBOOL("UIAutoScale", childGetValue("ui_auto_scale")); | 171 | gSavedSettings.setBOOL("UIAutoScale", childGetValue("ui_auto_scale")); |
133 | gSavedSettings.setString("Language", childGetValue("language_combobox")); | 172 | gSavedSettings.setString("Language", childGetValue("language_combobox")); |
134 | 173 | ||
135 | LLURLSimString::setString(childGetValue("location_combobox")); | ||
136 | |||
137 | LLComboBox* crash_behavior_combobox = getChild<LLComboBox>("crash_behavior_combobox"); | 174 | LLComboBox* crash_behavior_combobox = getChild<LLComboBox>("crash_behavior_combobox"); |
138 | gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior_combobox->getCurrentIndex()); | 175 | gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior_combobox->getCurrentIndex()); |
139 | 176 | ||
@@ -170,3 +207,20 @@ void LLPanelGeneral::onClickResetUISize(void* user_data) | |||
170 | LLPanelGeneral* self = (LLPanelGeneral*)user_data; | 207 | LLPanelGeneral* self = (LLPanelGeneral*)user_data; |
171 | self->childSetValue("ui_scale_slider", 1.002f); | 208 | self->childSetValue("ui_scale_slider", 1.002f); |
172 | } | 209 | } |
210 | |||
211 | // static | ||
212 | void LLPanelGeneral::onClickGrid(void *) | ||
213 | { | ||
214 | FloaterGridManager::getInstance()->open(); | ||
215 | FloaterGridManager::getInstance()->center(); | ||
216 | } | ||
217 | |||
218 | // static | ||
219 | void LLPanelGeneral::onLocationChanged(LLUICtrl* ctrl, void* data) | ||
220 | { | ||
221 | LLPanelGeneral* self = (LLPanelGeneral*)data; | ||
222 | if (self->getChild<LLComboBox>("default_location_combo")->getCurrentIndex() == 2) | ||
223 | { | ||
224 | self->getChild<LLComboBox>("default_location_combo")->setTextEntry(LLURLSimString::sInstance.mSimString); | ||
225 | } | ||
226 | } | ||