aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvoiceremotectrl.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/llvoiceremotectrl.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 '')
-rw-r--r--linden/indra/newview/llvoiceremotectrl.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/linden/indra/newview/llvoiceremotectrl.cpp b/linden/indra/newview/llvoiceremotectrl.cpp
index f4adc8f..3779ffd 100644
--- a/linden/indra/newview/llvoiceremotectrl.cpp
+++ b/linden/indra/newview/llvoiceremotectrl.cpp
@@ -35,7 +35,7 @@
35#include "llagent.h" 35#include "llagent.h"
36#include "llui.h" 36#include "llui.h"
37#include "llbutton.h" 37#include "llbutton.h"
38#include "llvieweruictrlfactory.h" 38#include "lluictrlfactory.h"
39#include "llviewercontrol.h" 39#include "llviewercontrol.h"
40#include "llvoiceclient.h" 40#include "llvoiceclient.h"
41#include "llimpanel.h" 41#include "llimpanel.h"
@@ -51,11 +51,11 @@ LLVoiceRemoteCtrl::LLVoiceRemoteCtrl (const LLString& name) : LLPanel(name)
51 51
52 if (gSavedSettings.getBOOL("ShowVoiceChannelPopup")) 52 if (gSavedSettings.getBOOL("ShowVoiceChannelPopup"))
53 { 53 {
54 gUICtrlFactory->buildPanel(this, "panel_voice_remote_expanded.xml"); 54 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_voice_remote_expanded.xml");
55 } 55 }
56 else 56 else
57 { 57 {
58 gUICtrlFactory->buildPanel(this, "panel_voice_remote.xml"); 58 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_voice_remote.xml");
59 } 59 }
60 60
61 setFocusRoot(TRUE); 61 setFocusRoot(TRUE);
@@ -67,23 +67,23 @@ LLVoiceRemoteCtrl::~LLVoiceRemoteCtrl()
67 67
68BOOL LLVoiceRemoteCtrl::postBuild() 68BOOL LLVoiceRemoteCtrl::postBuild()
69{ 69{
70 mTalkBtn = LLUICtrlFactory::getButtonByName(this, "push_to_talk"); 70 mTalkBtn = getChild<LLButton>("push_to_talk");
71 mTalkBtn->setClickedCallback(onBtnTalkClicked); 71 mTalkBtn->setClickedCallback(onBtnTalkClicked);
72 mTalkBtn->setHeldDownCallback(onBtnTalkHeld); 72 mTalkBtn->setHeldDownCallback(onBtnTalkHeld);
73 mTalkBtn->setMouseUpCallback(onBtnTalkReleased); 73 mTalkBtn->setMouseUpCallback(onBtnTalkReleased);
74 74
75 mTalkLockBtn = LLUICtrlFactory::getButtonByName(this, "ptt_lock"); 75 mTalkLockBtn = getChild<LLButton>("ptt_lock");
76 mTalkLockBtn->setClickedCallback(onBtnLock); 76 mTalkLockBtn->setClickedCallback(onBtnLock);
77 mTalkLockBtn->setCallbackUserData(this); 77 mTalkLockBtn->setCallbackUserData(this);
78 78
79 mSpeakersBtn = LLUICtrlFactory::getButtonByName(this, "speakers_btn"); 79 mSpeakersBtn = getChild<LLButton>("speakers_btn");
80 mSpeakersBtn->setClickedCallback(onClickSpeakers); 80 mSpeakersBtn->setClickedCallback(onClickSpeakers);
81 mSpeakersBtn->setCallbackUserData(this); 81 mSpeakersBtn->setCallbackUserData(this);
82 82
83 childSetAction("show_channel", onClickPopupBtn, this); 83 childSetAction("show_channel", onClickPopupBtn, this);
84 childSetAction("end_call_btn", onClickEndCall, this); 84 childSetAction("end_call_btn", onClickEndCall, this);
85 85
86 LLTextBox* text = LLUICtrlFactory::getTextBoxByName(this, "channel_label"); 86 LLTextBox* text = getChild<LLTextBox>("channel_label");
87 if (text) 87 if (text)
88 { 88 {
89 text->setUseEllipses(TRUE); 89 text->setUseEllipses(TRUE);
@@ -116,14 +116,14 @@ void LLVoiceRemoteCtrl::draw()
116 mSpeakersBtn->setToggleState(LLFloaterActiveSpeakers::instanceVisible(LLSD())); 116 mSpeakersBtn->setToggleState(LLFloaterActiveSpeakers::instanceVisible(LLSD()));
117 mTalkLockBtn->setToggleState(!gSavedSettings.getBOOL("PTTCurrentlyEnabled")); 117 mTalkLockBtn->setToggleState(!gSavedSettings.getBOOL("PTTCurrentlyEnabled"));
118 118
119 LLUUID talk_blip_image_id; 119 LLString talk_blip_image;
120 if (gVoiceClient->getIsSpeaking(gAgent.getID())) 120 if (gVoiceClient->getIsSpeaking(gAgent.getID()))
121 { 121 {
122 F32 voice_power = gVoiceClient->getCurrentPower(gAgent.getID()); 122 F32 voice_power = gVoiceClient->getCurrentPower(gAgent.getID());
123 123
124 if (voice_power > LLVoiceClient::OVERDRIVEN_POWER_LEVEL) 124 if (voice_power > LLVoiceClient::OVERDRIVEN_POWER_LEVEL)
125 { 125 {
126 talk_blip_image_id = LLUUID(gViewerArt.getString("icn_voice_ptt-on-lvl3.tga")); 126 talk_blip_image = "icn_voice_ptt-on-lvl3.tga";
127 } 127 }
128 else 128 else
129 { 129 {
@@ -133,26 +133,26 @@ void LLVoiceRemoteCtrl::draw()
133 switch(icon_image_idx) 133 switch(icon_image_idx)
134 { 134 {
135 case 0: 135 case 0:
136 talk_blip_image_id = LLUUID(gViewerArt.getString("icn_voice_ptt-on.tga")); 136 talk_blip_image = "icn_voice_ptt-on.tga";
137 break; 137 break;
138 case 1: 138 case 1:
139 talk_blip_image_id = LLUUID(gViewerArt.getString("icn_voice_ptt-on-lvl1.tga")); 139 talk_blip_image = "icn_voice_ptt-on-lvl1.tga";
140 break; 140 break;
141 case 2: 141 case 2:
142 talk_blip_image_id = LLUUID(gViewerArt.getString("icn_voice_ptt-on-lvl2.tga")); 142 talk_blip_image = "icn_voice_ptt-on-lvl2.tga";
143 break; 143 break;
144 } 144 }
145 } 145 }
146 } 146 }
147 else 147 else
148 { 148 {
149 talk_blip_image_id = LLUUID(gViewerArt.getString("icn_voice_ptt-off.tga")); 149 talk_blip_image = "icn_voice_ptt-off.tga";
150 } 150 }
151 151
152 LLIconCtrl* icon = LLUICtrlFactory::getIconByName(this, "voice_volume"); 152 LLIconCtrl* icon = getChild<LLIconCtrl>("voice_volume");
153 if (icon) 153 if (icon)
154 { 154 {
155 icon->setImage(talk_blip_image_id); 155 icon->setImage(talk_blip_image);
156 } 156 }
157 157
158 LLFloater* voice_floater = LLFloaterChatterBox::getInstance()->getCurrentVoiceFloater(); 158 LLFloater* voice_floater = LLFloaterChatterBox::getInstance()->getCurrentVoiceFloater();
@@ -173,13 +173,13 @@ void LLVoiceRemoteCtrl::draw()
173 173
174 if (current_channel) 174 if (current_channel)
175 { 175 {
176 LLIconCtrl* voice_channel_icon = LLUICtrlFactory::getIconByName(this, "voice_channel_icon"); 176 LLIconCtrl* voice_channel_icon = getChild<LLIconCtrl>("voice_channel_icon");
177 if (voice_channel_icon && voice_floater) 177 if (voice_channel_icon && voice_floater)
178 { 178 {
179 voice_channel_icon->setImage(LLUUID(gViewerArt.getString(voice_floater->getUIString("voice_icon")))); 179 voice_channel_icon->setImage(voice_floater->getUIString("voice_icon"));
180 } 180 }
181 181
182 LLButton* voice_channel_bg = LLUICtrlFactory::getButtonByName(this, "voice_channel_bg"); 182 LLButton* voice_channel_bg = getChild<LLButton>("voice_channel_bg");
183 if (voice_channel_bg) 183 if (voice_channel_bg)
184 { 184 {
185 LLColor4 bg_color; 185 LLColor4 bg_color;
@@ -199,7 +199,7 @@ void LLVoiceRemoteCtrl::draw()
199 } 199 }
200 } 200 }
201 201
202 LLButton* expand_button = LLUICtrlFactory::getButtonByName(this, "show_channel"); 202 LLButton* expand_button = getChild<LLButton>("show_channel");
203 if (expand_button) 203 if (expand_button)
204 { 204 {
205 if (expand_button->getToggleState()) 205 if (expand_button->getToggleState())
@@ -257,11 +257,11 @@ void LLVoiceRemoteCtrl::onClickPopupBtn(void* user_data)
257 remotep->deleteAllChildren(); 257 remotep->deleteAllChildren();
258 if (gSavedSettings.getBOOL("ShowVoiceChannelPopup")) 258 if (gSavedSettings.getBOOL("ShowVoiceChannelPopup"))
259 { 259 {
260 gUICtrlFactory->buildPanel(remotep, "panel_voice_remote_expanded.xml"); 260 LLUICtrlFactory::getInstance()->buildPanel(remotep, "panel_voice_remote_expanded.xml");
261 } 261 }
262 else 262 else
263 { 263 {
264 gUICtrlFactory->buildPanel(remotep, "panel_voice_remote.xml"); 264 LLUICtrlFactory::getInstance()->buildPanel(remotep, "panel_voice_remote.xml");
265 } 265 }
266 gOverlayBar->layoutButtons(); 266 gOverlayBar->layoutButtons();
267} 267}