PageRenderTime 35ms CodeModel.GetById 11ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1
  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. #include "llfloatersounddevices.h"
  29. #include "lldraghandle.h"
  30. #include "llpanelvoicedevicesettings.h"
  31. // Library includes
  32. #include "indra_constants.h"
  33. // protected
  34. LLFloaterSoundDevices::LLFloaterSoundDevices(const LLSD& key)
  35. : LLTransientDockableFloater(NULL, false, key)
  36. {
  37. LLTransientFloaterMgr::getInstance()->addControlView(this);
  38. // force docked state since this floater doesn't save it between recreations
  39. setDocked(true);
  40. }
  41. LLFloaterSoundDevices::~LLFloaterSoundDevices()
  42. {
  43. LLTransientFloaterMgr::getInstance()->removeControlView(this);
  44. }
  45. // virtual
  46. BOOL LLFloaterSoundDevices::postBuild()
  47. {
  48. LLTransientDockableFloater::postBuild();
  49. updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730)
  50. LLPanelVoiceDeviceSettings* panel = findChild<LLPanelVoiceDeviceSettings>("device_settings_panel");
  51. if (panel)
  52. {
  53. panel->setUseTuningMode(false);
  54. getChild<LLUICtrl>("voice_input_device")->setCommitCallback(boost::bind(&LLPanelVoiceDeviceSettings::apply, panel));
  55. getChild<LLUICtrl>("voice_output_device")->setCommitCallback(boost::bind(&LLPanelVoiceDeviceSettings::apply, panel));
  56. getChild<LLUICtrl>("mic_volume_slider")->setCommitCallback(boost::bind(&LLPanelVoiceDeviceSettings::apply, panel));
  57. }
  58. return TRUE;
  59. }
  60. //virtual
  61. void LLFloaterSoundDevices::setDocked(bool docked, bool pop_on_undock/* = true*/)
  62. {
  63. LLTransientDockableFloater::setDocked(docked, pop_on_undock);
  64. }
  65. // virtual
  66. void LLFloaterSoundDevices::setFocus( BOOL b )
  67. {
  68. LLTransientDockableFloater::setFocus(b);
  69. // Force using active floater transparency
  70. // We have to override setFocus() for because selecting an item of the
  71. // combobox causes the floater to lose focus and thus become transparent.
  72. updateTransparency(TT_ACTIVE);
  73. }