PageRenderTime 22ms CodeModel.GetById 2ms app.highlight 15ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llfloatersounddevices.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 86 lines | 38 code | 13 blank | 35 comment | 1 complexity | a12a4d9c48c746ebdc68f4a5da1ed6ca MD5 | raw file
 1/** 
 2 * @file llfloatersounddevices.cpp
 3 * @author Leyla Farazha
 4 * @brief Sound Preferences used for minimal skin
 5 *
 6* $LicenseInfo:firstyear=2011&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2010, Linden Research, Inc.
 9 * 
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation;
13 * version 2.1 of the License only.
14 * 
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 * 
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 * 
24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25 * $/LicenseInfo$
26 */
27#include "llviewerprecompiledheaders.h"
28
29#include "llfloatersounddevices.h"
30
31#include "lldraghandle.h"
32
33#include "llpanelvoicedevicesettings.h"
34
35// Library includes
36#include "indra_constants.h"
37
38// protected
39LLFloaterSoundDevices::LLFloaterSoundDevices(const LLSD& key)
40:	LLTransientDockableFloater(NULL, false, key)
41{
42	LLTransientFloaterMgr::getInstance()->addControlView(this);
43
44	// force docked state since this floater doesn't save it between recreations
45	setDocked(true);
46}
47
48LLFloaterSoundDevices::~LLFloaterSoundDevices()
49{
50	LLTransientFloaterMgr::getInstance()->removeControlView(this);
51}
52
53// virtual
54BOOL LLFloaterSoundDevices::postBuild()
55{
56	LLTransientDockableFloater::postBuild();
57
58	updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730)
59
60	LLPanelVoiceDeviceSettings* panel = findChild<LLPanelVoiceDeviceSettings>("device_settings_panel");
61	if (panel)
62	{
63		panel->setUseTuningMode(false);
64		getChild<LLUICtrl>("voice_input_device")->setCommitCallback(boost::bind(&LLPanelVoiceDeviceSettings::apply, panel));
65		getChild<LLUICtrl>("voice_output_device")->setCommitCallback(boost::bind(&LLPanelVoiceDeviceSettings::apply, panel));
66		getChild<LLUICtrl>("mic_volume_slider")->setCommitCallback(boost::bind(&LLPanelVoiceDeviceSettings::apply, panel));
67	}
68	return TRUE;
69}
70
71//virtual
72void LLFloaterSoundDevices::setDocked(bool docked, bool pop_on_undock/* = true*/)
73{
74	LLTransientDockableFloater::setDocked(docked, pop_on_undock);
75}
76
77// virtual
78void LLFloaterSoundDevices::setFocus( BOOL b )
79{
80	LLTransientDockableFloater::setFocus(b);
81
82	// Force using active floater transparency
83	// We have to override setFocus() for because selecting an item of the
84	// combobox causes the floater to lose focus and thus become transparent.
85	updateTransparency(TT_ACTIVE);
86}