summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorRichard Nelson <richard@lindenlab.com>2009-08-04 01:12:59 +0000
committerRichard Nelson <richard@lindenlab.com>2009-08-04 01:12:59 +0000
commiteb853f55c07ae4a3c3f2aa05fbabcf2e4b4dc115 (patch)
tree7707fccb8d0946b6257d5ed7c5dfd3941c53eec0 /indra/newview/llfloaterpreference.cpp
parentdb5cda26676f376f18816013c0c5e3fbad5b20d0 (diff)
svn merge -r 128442:129343 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/skinning-18 into svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r--indra/newview/llfloaterpreference.cpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 903471ea94..8a7b2d84c0 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -124,9 +124,9 @@ class LLVoiceSetKeyDialog : public LLModalDialog
};
LLVoiceSetKeyDialog::LLVoiceSetKeyDialog(LLFloaterPreference* parent)
-: LLModalDialog(LLStringUtil::null, 240, 100), mParent(parent)
+: LLModalDialog(LLSD(), 240, 100), mParent(parent)
{
- LLUICtrlFactory::getInstance()->buildFloater(this, "floater_select_key.xml");
+ LLUICtrlFactory::getInstance()->buildFloater(this, "floater_select_key.xml", NULL);
childSetAction("Cancel", onCancel, this);
childSetFocus("Cancel");
@@ -367,6 +367,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
BOOL LLFloaterPreference::postBuild()
{
+ mCloseSignal.connect(boost::bind(&LLFloaterPreference::onClose, this));
+
LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core");
if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab")))
tabcontainer->selectFirstTab();
@@ -418,7 +420,11 @@ void LLFloaterPreference::apply()
panel->apply();
}
// hardware menu apply
- LLFloaterHardwareSettings::instance()->apply();
+ LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::findTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings");
+ if (hardware_settings)
+ {
+ hardware_settings->apply();
+ }
LLFloaterVoiceDeviceSettings* voice_device_settings = LLFloaterReg::findTypedInstance<LLFloaterVoiceDeviceSettings>("pref_voicedevicesettings");
if(voice_device_settings)
@@ -506,7 +512,11 @@ void LLFloaterPreference::cancel()
LLFloaterReg::hideInstance("pref_joystick");
// cancel hardware menu
- LLFloaterHardwareSettings::instance()->cancel(); // TODO: angela change the build of the floater to floater reg
+ LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::findTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings");
+ if (hardware_settings)
+ {
+ hardware_settings->cancel();
+ }
// reverts any changes to current skin
gSavedSettings.setString("SkinCurrent", sSkin);
@@ -539,16 +549,17 @@ void LLFloaterPreference::setHardwareDefaults()
LLFeatureManager::getInstance()->applyRecommendedSettings();
refreshEnabledGraphics();
}
-void LLFloaterPreference::onClose(bool app_quitting)
+
+void LLFloaterPreference::onClose()
{
gSavedSettings.setS32("LastPrefTab", getChild<LLTabContainer>("pref core")->getCurrentPanelIndex());
LLPanelLogin::setAlwaysRefresh(false);
cancel(); // will be a no-op if OK or apply was performed just prior.
- destroy();
}
+
void LLFloaterPreference::onOpenHardwareSettings()
{
- LLFloaterHardwareSettings::show();
+ LLFloaterReg::showInstance("prefs_hardware_settings");
}
// static
void LLFloaterPreference::onBtnOK()
@@ -634,9 +645,13 @@ void LLFloaterPreference::refreshEnabledGraphics()
LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
if(instance)
{
- LLFloaterHardwareSettings::instance()->refreshEnabledState();
instance->refreshEnabledState();
}
+ LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::findTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings");
+ if (hardware_settings)
+ {
+ hardware_settings->refreshEnabledState();
+ }
}
void LLFloaterPreference::updateMeterText(LLUICtrl* ctrl)