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 | |
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')
-rw-r--r-- | linden/indra/newview/llpanelgeneral.cpp | 62 | ||||
-rw-r--r-- | linden/indra/newview/llpanelgeneral.h | 2 | ||||
-rw-r--r-- | linden/indra/newview/llpanellogin.cpp | 2 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml | 29 |
4 files changed, 79 insertions, 16 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 | } | ||
diff --git a/linden/indra/newview/llpanelgeneral.h b/linden/indra/newview/llpanelgeneral.h index c5a1f63..e85fdf8 100644 --- a/linden/indra/newview/llpanelgeneral.h +++ b/linden/indra/newview/llpanelgeneral.h | |||
@@ -49,6 +49,8 @@ public: | |||
49 | 49 | ||
50 | private: | 50 | private: |
51 | static void onClickResetUISize(void*); | 51 | static void onClickResetUISize(void*); |
52 | static void onClickGrid(void*); | ||
53 | static void onLocationChanged(LLUICtrl* ctrl, void* data); | ||
52 | }; | 54 | }; |
53 | 55 | ||
54 | #endif | 56 | #endif |
diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index ea84fee..a95272a 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp | |||
@@ -721,7 +721,7 @@ void LLPanelLogin::refreshLocation( bool force_visible ) | |||
721 | 721 | ||
722 | if (LLURLSimString::parse()) | 722 | if (LLURLSimString::parse()) |
723 | { | 723 | { |
724 | combo->setCurrentByIndex( 3 ); // BUG? Maybe 2? | 724 | combo->setCurrentByIndex( 2 ); |
725 | combo->setTextEntry(LLURLSimString::sInstance.mSimString); | 725 | combo->setTextEntry(LLURLSimString::sInstance.mSimString); |
726 | } | 726 | } |
727 | else | 727 | else |
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml index cc87175..6b8f7aa 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml | |||
@@ -2,17 +2,24 @@ | |||
2 | <panel border="true" bottom="-409" enabled="true" follows="left|top|right|bottom" | 2 | <panel border="true" bottom="-409" enabled="true" follows="left|top|right|bottom" |
3 | height="408" label="General" left="102" mouse_opaque="true" | 3 | height="408" label="General" left="102" mouse_opaque="true" |
4 | name="general_panel" width="517"> | 4 | name="general_panel" width="517"> |
5 | <radio_group bottom="-45" draw_border="false" follows="left|bottom" height="40" left="151" | 5 | <combo_box name="default_location_combo" |
6 | name="default_start_location" width="220"> | 6 | bottom="-22" left="155" height="16" width="150" |
7 | <radio_item bottom="-20" height="20" left="0" name="MyHome" width="50" | 7 | follows="left|bottom" font="SansSerifSmall" |
8 | tool_tip="Log into my home location by default."> | 8 | mouse_opaque="true" allow_text_entry="true" max_chars="128"> |
9 | My home | 9 | <combo_item name="MyHome" value="My Home"> |
10 | </radio_item> | 10 | My Home |
11 | <radio_item bottom="-20" height="20" left="100" name="MyLastLocation" width="50" | 11 | </combo_item> |
12 | tool_tip="Log into my last location by default."> | 12 | <combo_item name="MyLastLocation" value="My Last Location"> |
13 | My last location | 13 | My Last Location |
14 | </radio_item> | 14 | </combo_item> |
15 | </radio_group> | 15 | <combo_item name="Typeregionname" value="<Type region name>"> |
16 | <Type region name> | ||
17 | </combo_item> | ||
18 | </combo_box> | ||
19 | <button name="grid_btn" label="Grid Manager" | ||
20 | bottom_delta="0" left="330" height="16" width="100" | ||
21 | follows="left|bottom" font="SansSerifSmall" halign="center" | ||
22 | mouse_opaque="true" scale_image="TRUE" /> | ||
16 | <check_box bottom="-44" enabled="true" follows="left|top" | 23 | <check_box bottom="-44" enabled="true" follows="left|top" |
17 | font="SansSerifSmall" height="16" initial_value="true" | 24 | font="SansSerifSmall" height="16" initial_value="true" |
18 | label="Show start location at login screen" left="151" mouse_opaque="true" | 25 | label="Show start location at login screen" left="151" mouse_opaque="true" |