aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llprefsadvanced.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llprefsadvanced.cpp111
1 files changed, 12 insertions, 99 deletions
diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp
index 4a4b299..7fa694c 100644
--- a/linden/indra/newview/llprefsadvanced.cpp
+++ b/linden/indra/newview/llprefsadvanced.cpp
@@ -32,6 +32,7 @@
32 32
33#include "llcombobox.h" 33#include "llcombobox.h"
34 34
35#include "floatercommandline.h"
35#include "llagent.h" 36#include "llagent.h"
36#include "llprefsadvanced.h" 37#include "llprefsadvanced.h"
37#include "llviewercontrol.h" 38#include "llviewercontrol.h"
@@ -43,76 +44,6 @@
43 44
44#include "lluictrlfactory.h" 45#include "lluictrlfactory.h"
45 46
46////////begin drop utility/////////////
47//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48// Class JCInvDropTarget
49//
50// This handy class is a simple way to drop something on another
51// view. It handles drop events, always setting itself to the size of
52// its parent.
53//
54// altered to support a callback so i can slap it in things and it just return the item to a func of my choice
55//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56
57
58
59
60JCInvDropTarget::JCInvDropTarget(const std::string& name, const LLRect& rect,
61 void (*callback)(LLViewerInventoryItem*)) :
62LLView(name, rect, NOT_MOUSE_OPAQUE, FOLLOWS_ALL),
63mDownCallback(callback)
64{
65}
66
67JCInvDropTarget::~JCInvDropTarget()
68{
69}
70
71void JCInvDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data)
72{
73 llinfos << "JCInvDropTarget::doDrop()" << llendl;
74}
75
76BOOL JCInvDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
77 EDragAndDropType cargo_type,
78 void* cargo_data,
79 EAcceptance* accept,
80 std::string& tooltip_msg)
81{
82 BOOL handled = FALSE;
83 if(getParent())
84 {
85 handled = TRUE;
86 // check the type
87 //switch(cargo_type)
88 //{
89 //case DAD_ANIMATION:
90 //{
91 LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data;
92 if(gInventory.getItem(inv_item->getUUID()))
93 {
94 *accept = ACCEPT_YES_COPY_SINGLE;
95 if(drop)
96 {
97 //printchat("accepted");
98 mDownCallback(inv_item);
99 }
100 }
101 else
102 {
103 *accept = ACCEPT_NO;
104 }
105 // break;
106 //}
107 //default:
108 // *accept = ACCEPT_NO;
109 // break;
110 //}
111 }
112 return handled;
113}
114////////end drop utility///////////////
115
116LLPrefsAdvanced* LLPrefsAdvanced::sInstance; 47LLPrefsAdvanced* LLPrefsAdvanced::sInstance;
117 48
118LLPrefsAdvanced::LLPrefsAdvanced() 49LLPrefsAdvanced::LLPrefsAdvanced()
@@ -124,6 +55,7 @@ LLPrefsAdvanced::LLPrefsAdvanced()
124 childSetCommitCallback("speed_rez_check", onCommitCheckBox, this); 55 childSetCommitCallback("speed_rez_check", onCommitCheckBox, this);
125 56
126 childSetAction("reset_btn", onClickResetPrefs, this); 57 childSetAction("reset_btn", onClickResetPrefs, this);
58 childSetAction("command_line_btn", onClickCommandLine, this);
127} 59}
128 60
129LLPrefsAdvanced::~LLPrefsAdvanced() 61LLPrefsAdvanced::~LLPrefsAdvanced()
@@ -160,6 +92,7 @@ BOOL LLPrefsAdvanced::postBuild()
160 childSetValue("allow_mupose", gSavedSettings.getBOOL("AllowMUpose")); 92 childSetValue("allow_mupose", gSavedSettings.getBOOL("AllowMUpose"));
161 childSetValue("auto_close_ooc", gSavedSettings.getBOOL("AutoCloseOOC")); 93 childSetValue("auto_close_ooc", gSavedSettings.getBOOL("AutoCloseOOC"));
162 childSetValue("shadows_check", gSavedSettings.getBOOL("ShadowsEnabled")); 94 childSetValue("shadows_check", gSavedSettings.getBOOL("ShadowsEnabled"));
95 childSetValue("command_line_check", gSavedSettings.getBOOL("CmdLineChatbarEnabled"));
163 96
164 childSetValue("lightshare_combo", 97 childSetValue("lightshare_combo",
165 LLSD((S32)gSavedSettings.getU32("LightShareAllowed"))); 98 LLSD((S32)gSavedSettings.getU32("LightShareAllowed")));
@@ -167,22 +100,6 @@ BOOL LLPrefsAdvanced::postBuild()
167 LLComboBox* crash_behavior_combobox = getChild<LLComboBox>("crash_behavior_combobox"); 100 LLComboBox* crash_behavior_combobox = getChild<LLComboBox>("crash_behavior_combobox");
168 crash_behavior_combobox->setCurrentByIndex(gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING)); 101 crash_behavior_combobox->setCurrentByIndex(gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING));
169 102
170 childSetCommitCallback("EmeraldCmdLinePos", onCommitApplyControl);
171 childSetCommitCallback("EmeraldCmdLineGround", onCommitApplyControl);
172 childSetCommitCallback("EmeraldCmdLineHeight", onCommitApplyControl);
173 childSetCommitCallback("EmeraldCmdLineTeleportHome", onCommitApplyControl);
174 childSetCommitCallback("EmeraldCmdLineRezPlatform", onCommitApplyControl);
175 childSetCommitCallback("EmeraldCmdLineMapTo", onCommitApplyControl);
176 childSetCommitCallback("EmeraldCmdLineCalc", onCommitApplyControl);
177
178 childSetCommitCallback("EmeraldCmdLineDrawDistance", onCommitApplyControl);
179 childSetCommitCallback("EmeraldCmdTeleportToCam", onCommitApplyControl);
180 childSetCommitCallback("EmeraldCmdLineKeyToName", onCommitApplyControl);
181 childSetCommitCallback("EmeraldCmdLineOfferTp", onCommitApplyControl);
182 childSetCommitCallback("EmeraldCmdLineTP2", onCommitApplyControl);
183 childSetCommitCallback("EmeraldCmdLineAO", onCommitApplyControl);
184 childSetCommitCallback("EmeraldCmdLineClearChat", onCommitApplyControl);
185
186 getChild<LLComboBox>("EmeraldSpellBase")->setCommitCallback(onSpellBaseComboBoxCommit); 103 getChild<LLComboBox>("EmeraldSpellBase")->setCommitCallback(onSpellBaseComboBoxCommit);
187 getChild<LLButton>("EmSpell_EditCustom")->setClickedCallback(onSpellEditCustom, this); 104 getChild<LLButton>("EmSpell_EditCustom")->setClickedCallback(onSpellEditCustom, this);
188 getChild<LLButton>("EmSpell_GetMore")->setClickedCallback(onSpellGetMore, this); 105 getChild<LLButton>("EmSpell_GetMore")->setClickedCallback(onSpellGetMore, this);
@@ -191,7 +108,6 @@ BOOL LLPrefsAdvanced::postBuild()
191 108
192 getChild<LLButton>("ac_button")->setClickedCallback(onAutoCorrectButton,this); 109 getChild<LLButton>("ac_button")->setClickedCallback(onAutoCorrectButton,this);
193 110
194 initHelpBtn("EmeraldHelp_CmdLine", "EmeraldHelp_CmdLine");
195 initHelpBtn("EmeraldHelp_SpellCheck", "EmeraldHelp_SpellCheck"); 111 initHelpBtn("EmeraldHelp_SpellCheck", "EmeraldHelp_SpellCheck");
196 112
197 refresh(); 113 refresh();
@@ -277,6 +193,8 @@ void LLPrefsAdvanced::apply()
277 build_pie_menus(); 193 build_pie_menus();
278 } 194 }
279 195
196 gSavedSettings.setBOOL("CmdLineChatbarEnabled", childGetValue("command_line_check").asBoolean());
197
280 LLComboBox* crash_behavior_combobox = getChild<LLComboBox>("crash_behavior_combobox"); 198 LLComboBox* crash_behavior_combobox = getChild<LLComboBox>("crash_behavior_combobox");
281 gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior_combobox->getCurrentIndex()); 199 gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior_combobox->getCurrentIndex());
282} 200}
@@ -362,17 +280,6 @@ bool LLPrefsAdvanced::callbackReset(const LLSD& notification, const LLSD& respon
362 return false; 280 return false;
363} 281}
364 282
365//workaround for lineeditor dumbness in regards to control_name
366void LLPrefsAdvanced::onCommitApplyControl(LLUICtrl* caller, void* user_data)
367{
368 LLLineEditor* line = (LLLineEditor*)caller;
369 if(line)
370 {
371 LLControlVariable *var = line->findControl(line->getControlName());
372 if(var)var->setValue(line->getValue());
373 }
374}
375
376void LLPrefsAdvanced::onSpellAdd(void* data) 283void LLPrefsAdvanced::onSpellAdd(void* data)
377{ 284{
378 LLPrefsAdvanced* panel = (LLPrefsAdvanced*)data; 285 LLPrefsAdvanced* panel = (LLPrefsAdvanced*)data;
@@ -416,4 +323,10 @@ void LLPrefsAdvanced::onSpellBaseComboBoxCommit(LLUICtrl* ctrl, void* userdata)
416void LLPrefsAdvanced::onAutoCorrectButton(void * data) 323void LLPrefsAdvanced::onAutoCorrectButton(void * data)
417{ 324{
418 lggAutoCorrectFloaterStart::show(TRUE,data); 325 lggAutoCorrectFloaterStart::show(TRUE,data);
419} \ No newline at end of file 326}
327
328void LLPrefsAdvanced::onClickCommandLine(void* data)
329{
330 FloaterCommandLine::getInstance()->open();
331 FloaterCommandLine::getInstance()->center();
332}