diff options
Diffstat (limited to 'linden/indra/newview/llpanelgeneral.cpp')
-rw-r--r-- | linden/indra/newview/llpanelgeneral.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/linden/indra/newview/llpanelgeneral.cpp b/linden/indra/newview/llpanelgeneral.cpp index 9cdf919..007e2ff 100644 --- a/linden/indra/newview/llpanelgeneral.cpp +++ b/linden/indra/newview/llpanelgeneral.cpp | |||
@@ -46,6 +46,7 @@ | |||
46 | #include "llcolorswatch.h" | 46 | #include "llcolorswatch.h" |
47 | #include "llcombobox.h" | 47 | #include "llcombobox.h" |
48 | #include "llconsole.h" | 48 | #include "llconsole.h" |
49 | #include "lllineeditor.h" | ||
49 | #include "llpanellogin.h" | 50 | #include "llpanellogin.h" |
50 | #include "llnetmap.h" | 51 | #include "llnetmap.h" |
51 | #include "llresmgr.h" | 52 | #include "llresmgr.h" |
@@ -54,8 +55,9 @@ | |||
54 | #include "llui.h" | 55 | #include "llui.h" |
55 | #include "llurlsimstring.h" | 56 | #include "llurlsimstring.h" |
56 | #include "llviewercontrol.h" | 57 | #include "llviewercontrol.h" |
57 | #include "viewer.h" // gCrashBehavior | 58 | #include "llappviewer.h" |
58 | 59 | #include "llurlsimstring.h" | |
60 | #include "llappviewer.h" | ||
59 | // | 61 | // |
60 | // Imported globals | 62 | // Imported globals |
61 | // | 63 | // |
@@ -63,6 +65,7 @@ | |||
63 | void set_crash_behavior(LLUICtrl* ctrl, void* data); | 65 | void set_crash_behavior(LLUICtrl* ctrl, void* data); |
64 | void set_start_location(LLUICtrl* ctrl, void* data); | 66 | void set_start_location(LLUICtrl* ctrl, void* data); |
65 | 67 | ||
68 | |||
66 | // | 69 | // |
67 | // Globals | 70 | // Globals |
68 | // | 71 | // |
@@ -72,8 +75,7 @@ void set_start_location(LLUICtrl* ctrl, void* data); | |||
72 | // | 75 | // |
73 | void set_crash_behavior(LLUICtrl* ctrl, void* data) | 76 | void set_crash_behavior(LLUICtrl* ctrl, void* data) |
74 | { | 77 | { |
75 | gCrashBehavior = ((LLComboBox*) ctrl)->getCurrentIndex(); | 78 | LLAppViewer::instance()->setCrashBehavior(((LLComboBox*) ctrl)->getCurrentIndex()); |
76 | gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, gCrashBehavior); | ||
77 | } | 79 | } |
78 | 80 | ||
79 | void set_language(LLUICtrl* ctrl, void* data) | 81 | void set_language(LLUICtrl* ctrl, void* data) |
@@ -86,6 +88,11 @@ void LLPanelGeneral::set_start_location(LLUICtrl* ctrl, void* data) | |||
86 | LLURLSimString::setString(ctrl->getValue().asString()); | 88 | LLURLSimString::setString(ctrl->getValue().asString()); |
87 | } | 89 | } |
88 | 90 | ||
91 | void LLPanelGeneral::set_specific_start_location(LLLineEditor* line_editor, void* data) | ||
92 | { | ||
93 | LLURLSimString::setString(line_editor->getValue().asString()); | ||
94 | } | ||
95 | |||
89 | LLPanelGeneral::LLPanelGeneral() | 96 | LLPanelGeneral::LLPanelGeneral() |
90 | { | 97 | { |
91 | gUICtrlFactory->buildPanel(this, "panel_preferences_general.xml"); | 98 | gUICtrlFactory->buildPanel(this, "panel_preferences_general.xml"); |
@@ -137,6 +144,7 @@ BOOL LLPanelGeneral::postBuild() | |||
137 | combo->setCurrentByIndex( login_last ? 1 : 0 ); | 144 | combo->setCurrentByIndex( login_last ? 1 : 0 ); |
138 | } | 145 | } |
139 | combo->setCommitCallback( &set_start_location ); | 146 | combo->setCommitCallback( &set_start_location ); |
147 | combo->setTextEntryCallback( &set_specific_start_location ); | ||
140 | } | 148 | } |
141 | 149 | ||
142 | // Show location on login screen | 150 | // Show location on login screen |
@@ -145,7 +153,7 @@ BOOL LLPanelGeneral::postBuild() | |||
145 | combo = LLUICtrlFactory::getComboBoxByName(this, "crash_behavior_combobox"); | 153 | combo = LLUICtrlFactory::getComboBoxByName(this, "crash_behavior_combobox"); |
146 | if (combo) | 154 | if (combo) |
147 | { | 155 | { |
148 | combo->setCurrentByIndex( gCrashBehavior ); | 156 | combo->setCurrentByIndex( LLAppViewer::instance()->getCrashBehavior() ); |
149 | combo->setCommitCallback( &set_crash_behavior ); | 157 | combo->setCommitCallback( &set_crash_behavior ); |
150 | } | 158 | } |
151 | 159 | ||
@@ -181,11 +189,11 @@ void LLPanelGeneral::refresh() | |||
181 | mLoginLocation = combo->getValue().asString(); | 189 | mLoginLocation = combo->getValue().asString(); |
182 | } | 190 | } |
183 | 191 | ||
184 | mCrashBehavior = gCrashBehavior; | 192 | mCrashBehavior = LLAppViewer::instance()->getCrashBehavior(); |
185 | combo = LLUICtrlFactory::getComboBoxByName(this, "crash_behavior_combobox"); | 193 | combo = LLUICtrlFactory::getComboBoxByName(this, "crash_behavior_combobox"); |
186 | if (combo) | 194 | if (combo) |
187 | { | 195 | { |
188 | combo->setCurrentByIndex( gCrashBehavior ); | 196 | combo->setCurrentByIndex( LLAppViewer::instance()->getCrashBehavior() ); |
189 | } | 197 | } |
190 | 198 | ||
191 | mRenderName = gSavedSettings.getS32("RenderName"); | 199 | mRenderName = gSavedSettings.getS32("RenderName"); |
@@ -222,8 +230,7 @@ void LLPanelGeneral::cancel() | |||
222 | 230 | ||
223 | LLURLSimString::setString(mLoginLocation); | 231 | LLURLSimString::setString(mLoginLocation); |
224 | 232 | ||
225 | gCrashBehavior = mCrashBehavior; | 233 | LLAppViewer::instance()->setCrashBehavior(mCrashBehavior); |
226 | gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, gCrashBehavior); | ||
227 | 234 | ||
228 | // make listener | 235 | // make listener |
229 | //gAFKTimeout = away_timeout; | 236 | //gAFKTimeout = away_timeout; |
@@ -231,5 +238,5 @@ void LLPanelGeneral::cancel() | |||
231 | 238 | ||
232 | void LLPanelGeneral::clickShowStartLocation(LLUICtrl*, void* user_data) | 239 | void LLPanelGeneral::clickShowStartLocation(LLUICtrl*, void* user_data) |
233 | { | 240 | { |
234 | LLPanelLogin::refreshLocation( false ); // in case LLPanelLogin is visible | 241 | LLPanelLogin::loadLoginPage(); |
235 | } | 242 | } |