diff options
Diffstat (limited to 'linden/indra/newview/llfloaterland.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterland.cpp | 73 |
1 files changed, 70 insertions, 3 deletions
diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp index 78e5e70..a98c835 100644 --- a/linden/indra/newview/llfloaterland.cpp +++ b/linden/indra/newview/llfloaterland.cpp | |||
@@ -42,6 +42,7 @@ | |||
42 | #include "llfloateravatarpicker.h" | 42 | #include "llfloateravatarpicker.h" |
43 | #include "llbutton.h" | 43 | #include "llbutton.h" |
44 | #include "llcheckboxctrl.h" | 44 | #include "llcheckboxctrl.h" |
45 | #include "llradiogroup.h" | ||
45 | #include "llcombobox.h" | 46 | #include "llcombobox.h" |
46 | #include "llfloaterauction.h" | 47 | #include "llfloaterauction.h" |
47 | #include "llfloateravatarinfo.h" | 48 | #include "llfloateravatarinfo.h" |
@@ -110,6 +111,14 @@ static const char RAW_HTML[] = "Raw HTML"; | |||
110 | static const BOOL BUY_GROUP_LAND = TRUE; | 111 | static const BOOL BUY_GROUP_LAND = TRUE; |
111 | static const BOOL BUY_PERSONAL_LAND = FALSE; | 112 | static const BOOL BUY_PERSONAL_LAND = FALSE; |
112 | 113 | ||
114 | // Values for the parcel voice settings radio group | ||
115 | enum | ||
116 | { | ||
117 | kRadioVoiceChatEstate = 0, | ||
118 | kRadioVoiceChatPrivate = 1, | ||
119 | kRadioVoiceChatDisable = 2 | ||
120 | }; | ||
121 | |||
113 | // Statics | 122 | // Statics |
114 | LLFloaterLand* LLFloaterLand::sInstance = NULL; | 123 | LLFloaterLand* LLFloaterLand::sInstance = NULL; |
115 | LLParcelSelectionObserver* LLFloaterLand::sObserver = NULL; | 124 | LLParcelSelectionObserver* LLFloaterLand::sObserver = NULL; |
@@ -828,9 +837,20 @@ void LLPanelLandGeneral::draw() | |||
828 | // static | 837 | // static |
829 | void LLPanelLandGeneral::onClickSetGroup(void* userdata) | 838 | void LLPanelLandGeneral::onClickSetGroup(void* userdata) |
830 | { | 839 | { |
831 | LLFloaterGroups* fg; | 840 | LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)userdata; |
832 | fg = LLFloaterGroups::show(gAgent.getID(), LLFloaterGroups::CHOOSE_ONE); | 841 | LLFloaterGroupPicker* fg; |
833 | fg->setOkCallback( cbGroupID, userdata ); | 842 | |
843 | LLFloater* parent_floater = gFloaterView->getParentFloater(panelp); | ||
844 | |||
845 | fg = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); | ||
846 | fg->setSelectCallback( cbGroupID, userdata ); | ||
847 | |||
848 | if (parent_floater) | ||
849 | { | ||
850 | LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, fg); | ||
851 | fg->setOrigin(new_rect.mLeft, new_rect.mBottom); | ||
852 | parent_floater->addDependentFloater(fg); | ||
853 | } | ||
834 | } | 854 | } |
835 | 855 | ||
836 | // static | 856 | // static |
@@ -2339,6 +2359,9 @@ BOOL LLPanelLandMedia::postBuild() | |||
2339 | mCheckSoundLocal = LLUICtrlFactory::getCheckBoxByName(this, "check sound local"); | 2359 | mCheckSoundLocal = LLUICtrlFactory::getCheckBoxByName(this, "check sound local"); |
2340 | childSetCommitCallback("check sound local", onCommitAny, this); | 2360 | childSetCommitCallback("check sound local", onCommitAny, this); |
2341 | 2361 | ||
2362 | mRadioVoiceChat = LLUICtrlFactory::getRadioGroupByName(this, "parcel_voice_channel"); | ||
2363 | childSetCommitCallback("parcel_voice_channel", onCommitAny, this); | ||
2364 | |||
2342 | mMusicURLEdit = LLUICtrlFactory::getLineEditorByName(this, "music_url"); | 2365 | mMusicURLEdit = LLUICtrlFactory::getLineEditorByName(this, "music_url"); |
2343 | childSetCommitCallback("music_url", onCommitAny, this); | 2366 | childSetCommitCallback("music_url", onCommitAny, this); |
2344 | 2367 | ||
@@ -2382,6 +2405,9 @@ void LLPanelLandMedia::refresh() | |||
2382 | mCheckSoundLocal->set(FALSE); | 2405 | mCheckSoundLocal->set(FALSE); |
2383 | mCheckSoundLocal->setEnabled(FALSE); | 2406 | mCheckSoundLocal->setEnabled(FALSE); |
2384 | 2407 | ||
2408 | mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatEstate); | ||
2409 | mRadioVoiceChat->setEnabled(FALSE); | ||
2410 | |||
2385 | mMusicURLEdit->setText(""); | 2411 | mMusicURLEdit->setText(""); |
2386 | mMusicURLEdit->setEnabled(FALSE); | 2412 | mMusicURLEdit->setEnabled(FALSE); |
2387 | 2413 | ||
@@ -2409,6 +2435,20 @@ void LLPanelLandMedia::refresh() | |||
2409 | mCheckSoundLocal->set( parcel->getSoundLocal() ); | 2435 | mCheckSoundLocal->set( parcel->getSoundLocal() ); |
2410 | mCheckSoundLocal->setEnabled( can_change_media ); | 2436 | mCheckSoundLocal->setEnabled( can_change_media ); |
2411 | 2437 | ||
2438 | if(parcel->getVoiceEnabled()) | ||
2439 | { | ||
2440 | if(parcel->getVoiceUseEstateChannel()) | ||
2441 | mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatEstate); | ||
2442 | else | ||
2443 | mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatPrivate); | ||
2444 | } | ||
2445 | else | ||
2446 | { | ||
2447 | mRadioVoiceChat->setSelectedIndex(kRadioVoiceChatDisable); | ||
2448 | } | ||
2449 | |||
2450 | mRadioVoiceChat->setEnabled( can_change_media ); | ||
2451 | |||
2412 | // don't display urls if you're not able to change it | 2452 | // don't display urls if you're not able to change it |
2413 | // much requested change in forums so people can't 'steal' urls | 2453 | // much requested change in forums so people can't 'steal' urls |
2414 | // NOTE: bug#2009 means this is still vunerable - however, bug | 2454 | // NOTE: bug#2009 means this is still vunerable - however, bug |
@@ -2468,12 +2508,39 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl *ctrl, void *userdata) | |||
2468 | 2508 | ||
2469 | // Extract data from UI | 2509 | // Extract data from UI |
2470 | BOOL sound_local = self->mCheckSoundLocal->get(); | 2510 | BOOL sound_local = self->mCheckSoundLocal->get(); |
2511 | int voice_setting = self->mRadioVoiceChat->getSelectedIndex(); | ||
2471 | std::string music_url = self->mMusicURLEdit->getText(); | 2512 | std::string music_url = self->mMusicURLEdit->getText(); |
2472 | std::string media_url = self->mMediaURLEdit->getText(); | 2513 | std::string media_url = self->mMediaURLEdit->getText(); |
2473 | U8 media_auto_scale = self->mMediaAutoScaleCheck->get(); | 2514 | U8 media_auto_scale = self->mMediaAutoScaleCheck->get(); |
2474 | LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); | 2515 | LLUUID media_id = self->mMediaTextureCtrl->getImageAssetID(); |
2475 | 2516 | ||
2517 | BOOL voice_enabled; | ||
2518 | BOOL voice_estate_chan; | ||
2519 | |||
2520 | switch(voice_setting) | ||
2521 | { | ||
2522 | default: | ||
2523 | case kRadioVoiceChatEstate: | ||
2524 | voice_enabled = TRUE; | ||
2525 | voice_estate_chan = TRUE; | ||
2526 | break; | ||
2527 | case kRadioVoiceChatPrivate: | ||
2528 | voice_enabled = TRUE; | ||
2529 | voice_estate_chan = FALSE; | ||
2530 | break; | ||
2531 | case kRadioVoiceChatDisable: | ||
2532 | voice_enabled = FALSE; | ||
2533 | voice_estate_chan = FALSE; | ||
2534 | break; | ||
2535 | } | ||
2536 | |||
2537 | // Remove leading/trailing whitespace (common when copying/pasting) | ||
2538 | LLString::trim(music_url); | ||
2539 | LLString::trim(media_url); | ||
2540 | |||
2476 | // Push data into current parcel | 2541 | // Push data into current parcel |
2542 | parcel->setParcelFlag(PF_ALLOW_VOICE_CHAT, voice_enabled); | ||
2543 | parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan); | ||
2477 | parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local); | 2544 | parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local); |
2478 | parcel->setMusicURL(music_url.c_str()); | 2545 | parcel->setMusicURL(music_url.c_str()); |
2479 | parcel->setMediaURL(media_url.c_str()); | 2546 | parcel->setMediaURL(media_url.c_str()); |