aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelgeneral.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llpanelgeneral.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/llpanelgeneral.cpp')
-rw-r--r--linden/indra/newview/llpanelgeneral.cpp52
1 files changed, 23 insertions, 29 deletions
diff --git a/linden/indra/newview/llpanelgeneral.cpp b/linden/indra/newview/llpanelgeneral.cpp
index 2c68e9a..17fca4e 100644
--- a/linden/indra/newview/llpanelgeneral.cpp
+++ b/linden/indra/newview/llpanelgeneral.cpp
@@ -38,7 +38,7 @@
38#include "llrect.h" 38#include "llrect.h"
39#include "llfontgl.h" 39#include "llfontgl.h"
40#include "message.h" 40#include "message.h"
41#include "llvieweruictrlfactory.h" 41#include "lluictrlfactory.h"
42 42
43// project includes 43// project includes
44#include "llagent.h" 44#include "llagent.h"
@@ -58,6 +58,9 @@
58#include "llappviewer.h" 58#include "llappviewer.h"
59#include "llurlsimstring.h" 59#include "llurlsimstring.h"
60#include "llappviewer.h" 60#include "llappviewer.h"
61
62#include "llcheckboxctrl.h"
63#include "llradiogroup.h"
61// 64//
62// Imported globals 65// Imported globals
63// 66//
@@ -73,6 +76,13 @@ void set_start_location(LLUICtrl* ctrl, void* data);
73// 76//
74// Static functions 77// Static functions
75// 78//
79static void set_render_name_fade_out(LLUICtrl* ctrl, void* data)
80{
81 LLComboBox* combo = (LLComboBox*)ctrl;
82 if (!combo) return;
83 gSavedSettings.setS32("RenderName", combo->getCurrentIndex() );
84}
85
76void set_crash_behavior(LLUICtrl* ctrl, void* data) 86void set_crash_behavior(LLUICtrl* ctrl, void* data)
77{ 87{
78 LLAppViewer::instance()->setCrashBehavior(((LLComboBox*) ctrl)->getCurrentIndex()); 88 LLAppViewer::instance()->setCrashBehavior(((LLComboBox*) ctrl)->getCurrentIndex());
@@ -95,37 +105,18 @@ void LLPanelGeneral::set_specific_start_location(LLLineEditor* line_editor, void
95 105
96LLPanelGeneral::LLPanelGeneral() 106LLPanelGeneral::LLPanelGeneral()
97{ 107{
98 gUICtrlFactory->buildPanel(this, "panel_preferences_general.xml"); 108 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_general.xml");
99} 109}
100 110
101BOOL LLPanelGeneral::postBuild() 111BOOL LLPanelGeneral::postBuild()
102{ 112{
103 requires("location_combobox", WIDGET_TYPE_COMBO_BOX); 113 childSetCommitCallback("fade_out_combobox", set_render_name_fade_out);
104 requires("show_location_checkbox", WIDGET_TYPE_CHECKBOX);
105 requires("fade_out_radio", WIDGET_TYPE_RADIO_GROUP);
106 requires("show_my_name_checkbox", WIDGET_TYPE_CHECKBOX);
107 requires("show_my_title_checkbox", WIDGET_TYPE_CHECKBOX);
108 requires("small_avatar_names_checkbox", WIDGET_TYPE_CHECKBOX);
109 requires("effect_color_swatch", WIDGET_TYPE_COLOR_SWATCH);
110 requires("UI Scale", WIDGET_TYPE_SLIDER);
111 requires("ui_auto_scale", WIDGET_TYPE_CHECKBOX);
112 requires("afk_timeout_spinner", WIDGET_TYPE_SPINNER);
113 requires("rotate_mini_map_checkbox", WIDGET_TYPE_CHECKBOX);
114 requires("friends_online_notify_checkbox", WIDGET_TYPE_CHECKBOX);
115 requires("notify_money_change_checkbox", WIDGET_TYPE_CHECKBOX);
116 requires("use_system_color_picker_checkbox", WIDGET_TYPE_CHECKBOX);
117 requires("crash_behavior_combobox", WIDGET_TYPE_COMBO_BOX);
118
119 if (!checkRequirements())
120 {
121 return FALSE;
122 }
123 114
124 LLString region_name_prompt = getString("region_name_prompt"); 115 LLString region_name_prompt = getString("region_name_prompt");
125 116
126 117
127 // location combobox 118 // location combobox
128 LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(this, "location_combobox"); 119 LLComboBox* combo = getChild<LLComboBox>( "location_combobox");
129 if (combo) 120 if (combo)
130 { 121 {
131 if (!LLURLSimString::sInstance.mSimString.empty()) 122 if (!LLURLSimString::sInstance.mSimString.empty())
@@ -151,7 +142,7 @@ BOOL LLPanelGeneral::postBuild()
151 // Show location on login screen 142 // Show location on login screen
152 childSetCommitCallback("show_location_checkbox", &LLPanelGeneral::clickShowStartLocation); 143 childSetCommitCallback("show_location_checkbox", &LLPanelGeneral::clickShowStartLocation);
153 144
154 combo = LLUICtrlFactory::getComboBoxByName(this, "crash_behavior_combobox"); 145 combo = getChild<LLComboBox>( "crash_behavior_combobox");
155 if (combo) 146 if (combo)
156 { 147 {
157 combo->setCurrentByIndex( LLAppViewer::instance()->getCrashBehavior() ); 148 combo->setCurrentByIndex( LLAppViewer::instance()->getCrashBehavior() );
@@ -175,7 +166,7 @@ void LLPanelGeneral::refresh()
175{ 166{
176 LLPanel::refresh(); 167 LLPanel::refresh();
177 BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation"); 168 BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation");
178 LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(this, "location_combobox"); 169 LLComboBox* combo = getChild<LLComboBox>( "location_combobox");
179 if (combo) 170 if (combo)
180 { 171 {
181 if (!LLURLSimString::sInstance.mSimString.empty()) 172 if (!LLURLSimString::sInstance.mSimString.empty())
@@ -191,13 +182,19 @@ void LLPanelGeneral::refresh()
191 } 182 }
192 183
193 mCrashBehavior = LLAppViewer::instance()->getCrashBehavior(); 184 mCrashBehavior = LLAppViewer::instance()->getCrashBehavior();
194 combo = LLUICtrlFactory::getComboBoxByName(this, "crash_behavior_combobox"); 185 combo = getChild<LLComboBox>( "crash_behavior_combobox");
195 if (combo) 186 if (combo)
196 { 187 {
197 combo->setCurrentByIndex( LLAppViewer::instance()->getCrashBehavior() ); 188 combo->setCurrentByIndex( LLAppViewer::instance()->getCrashBehavior() );
198 } 189 }
199 190
200 mRenderName = gSavedSettings.getS32("RenderName"); 191 mRenderName = gSavedSettings.getS32("RenderName");
192 combo = getChild<LLComboBox>("fade_out_combobox");
193 if (combo)
194 {
195 combo->setCurrentByIndex( mRenderName );
196 }
197
201 mRenderNameHideSelf = gSavedSettings.getBOOL("RenderNameHideSelf"); 198 mRenderNameHideSelf = gSavedSettings.getBOOL("RenderNameHideSelf");
202 mSmallAvatarNames = gSavedSettings.getBOOL("SmallAvatarNames"); 199 mSmallAvatarNames = gSavedSettings.getBOOL("SmallAvatarNames");
203 mRenderHideGroupTitle = gSavedSettings.getBOOL("RenderHideGroupTitle"); 200 mRenderHideGroupTitle = gSavedSettings.getBOOL("RenderHideGroupTitle");
@@ -239,9 +236,6 @@ void LLPanelGeneral::cancel()
239 LLURLSimString::setString(mLoginLocation); 236 LLURLSimString::setString(mLoginLocation);
240 237
241 LLAppViewer::instance()->setCrashBehavior(mCrashBehavior); 238 LLAppViewer::instance()->setCrashBehavior(mCrashBehavior);
242
243 // make listener
244 //gAFKTimeout = away_timeout;
245} 239}
246 240
247void LLPanelGeneral::clickShowStartLocation(LLUICtrl*, void* user_data) 241void LLPanelGeneral::clickShowStartLocation(LLUICtrl*, void* user_data)