diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llfloaterdaycycle.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llfloaterdaycycle.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterdaycycle.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/linden/indra/newview/llfloaterdaycycle.cpp b/linden/indra/newview/llfloaterdaycycle.cpp index f517439..c0f8a48 100644 --- a/linden/indra/newview/llfloaterdaycycle.cpp +++ b/linden/indra/newview/llfloaterdaycycle.cpp | |||
@@ -59,10 +59,10 @@ | |||
59 | 59 | ||
60 | 60 | ||
61 | LLFloaterDayCycle* LLFloaterDayCycle::sDayCycle = NULL; | 61 | LLFloaterDayCycle* LLFloaterDayCycle::sDayCycle = NULL; |
62 | std::map<LLString, LLWLSkyKey> LLFloaterDayCycle::sSliderToKey; | 62 | std::map<std::string, LLWLSkyKey> LLFloaterDayCycle::sSliderToKey; |
63 | const F32 LLFloaterDayCycle::sHoursPerDay = 24.0f; | 63 | const F32 LLFloaterDayCycle::sHoursPerDay = 24.0f; |
64 | 64 | ||
65 | LLFloaterDayCycle::LLFloaterDayCycle() : LLFloater("Day Cycle Floater") | 65 | LLFloaterDayCycle::LLFloaterDayCycle() : LLFloater(std::string("Day Cycle Floater")) |
66 | { | 66 | { |
67 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_day_cycle_options.xml"); | 67 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_day_cycle_options.xml"); |
68 | 68 | ||
@@ -75,7 +75,7 @@ LLFloaterDayCycle::LLFloaterDayCycle() : LLFloater("Day Cycle Floater") | |||
75 | LLWLParamManager::instance()->mParamList.begin(); | 75 | LLWLParamManager::instance()->mParamList.begin(); |
76 | for(; mIt != LLWLParamManager::instance()->mParamList.end(); mIt++) | 76 | for(; mIt != LLWLParamManager::instance()->mParamList.end(); mIt++) |
77 | { | 77 | { |
78 | keyCombo->add(LLString(mIt->first)); | 78 | keyCombo->add(std::string(mIt->first)); |
79 | } | 79 | } |
80 | 80 | ||
81 | // set defaults on combo boxes | 81 | // set defaults on combo boxes |
@@ -97,11 +97,10 @@ LLFloaterDayCycle::~LLFloaterDayCycle() | |||
97 | 97 | ||
98 | void LLFloaterDayCycle::onClickHelp(void* data) | 98 | void LLFloaterDayCycle::onClickHelp(void* data) |
99 | { | 99 | { |
100 | |||
101 | LLFloaterDayCycle* self = LLFloaterDayCycle::instance(); | 100 | LLFloaterDayCycle* self = LLFloaterDayCycle::instance(); |
101 | const std::string* xml_alert = (std::string*)data; | ||
102 | 102 | ||
103 | const char* xml_alert = (const char*) data; | 103 | LLAlertDialog* dialogp = gViewerWindow->alertXml(*xml_alert); |
104 | LLAlertDialog* dialogp = gViewerWindow->alertXml(xml_alert); | ||
105 | if (dialogp) | 104 | if (dialogp) |
106 | { | 105 | { |
107 | LLFloater* root_floater = gFloaterView->getParentFloater(self); | 106 | LLFloater* root_floater = gFloaterView->getParentFloater(self); |
@@ -110,11 +109,12 @@ void LLFloaterDayCycle::onClickHelp(void* data) | |||
110 | root_floater->addDependentFloater(dialogp); | 109 | root_floater->addDependentFloater(dialogp); |
111 | } | 110 | } |
112 | } | 111 | } |
112 | delete xml_alert; | ||
113 | } | 113 | } |
114 | 114 | ||
115 | void LLFloaterDayCycle::initHelpBtn(const char* name, const char* xml_alert) | 115 | void LLFloaterDayCycle::initHelpBtn(const std::string& name, const std::string& xml_alert) |
116 | { | 116 | { |
117 | childSetAction(name, onClickHelp, (void*)xml_alert); | 117 | childSetAction(name, onClickHelp, new std::string(xml_alert)); |
118 | } | 118 | } |
119 | 119 | ||
120 | void LLFloaterDayCycle::initCallbacks(void) | 120 | void LLFloaterDayCycle::initCallbacks(void) |
@@ -193,7 +193,7 @@ void LLFloaterDayCycle::syncSliderTrack() | |||
193 | LLWLParamManager::instance()->mDay.mTimeMap.begin(); | 193 | LLWLParamManager::instance()->mDay.mTimeMap.begin(); |
194 | for(; mIt != LLWLParamManager::instance()->mDay.mTimeMap.end(); mIt++) | 194 | for(; mIt != LLWLParamManager::instance()->mDay.mTimeMap.end(); mIt++) |
195 | { | 195 | { |
196 | addSliderKey(mIt->first * sHoursPerDay, mIt->second.c_str()); | 196 | addSliderKey(mIt->first * sHoursPerDay, mIt->second); |
197 | } | 197 | } |
198 | } | 198 | } |
199 | 199 | ||
@@ -218,7 +218,7 @@ void LLFloaterDayCycle::syncTrack() | |||
218 | LLWLParamManager::instance()->mDay.clearKeys(); | 218 | LLWLParamManager::instance()->mDay.clearKeys(); |
219 | 219 | ||
220 | // add the keys one by one | 220 | // add the keys one by one |
221 | std::map<LLString, LLWLSkyKey>::iterator mIt = sSliderToKey.begin(); | 221 | std::map<std::string, LLWLSkyKey>::iterator mIt = sSliderToKey.begin(); |
222 | for(; mIt != sSliderToKey.end(); mIt++) | 222 | for(; mIt != sSliderToKey.end(); mIt++) |
223 | { | 223 | { |
224 | LLWLParamManager::instance()->mDay.addKey(mIt->second.time / sHoursPerDay, | 224 | LLWLParamManager::instance()->mDay.addKey(mIt->second.time / sHoursPerDay, |
@@ -379,7 +379,7 @@ void LLFloaterDayCycle::onKeyTimeMoved(LLUICtrl* ctrl, void* userData) | |||
379 | } | 379 | } |
380 | 380 | ||
381 | // make sure we have a slider | 381 | // make sure we have a slider |
382 | const LLString& curSldr = sldr->getCurSlider(); | 382 | const std::string& curSldr = sldr->getCurSlider(); |
383 | if(curSldr == "") { | 383 | if(curSldr == "") { |
384 | return; | 384 | return; |
385 | } | 385 | } |
@@ -387,7 +387,7 @@ void LLFloaterDayCycle::onKeyTimeMoved(LLUICtrl* ctrl, void* userData) | |||
387 | F32 time = sldr->getCurSliderValue(); | 387 | F32 time = sldr->getCurSliderValue(); |
388 | 388 | ||
389 | // check to see if a key exists | 389 | // check to see if a key exists |
390 | LLString presetName = sSliderToKey[curSldr].presetName; | 390 | std::string presetName = sSliderToKey[curSldr].presetName; |
391 | sSliderToKey[curSldr].time = time; | 391 | sSliderToKey[curSldr].time = time; |
392 | 392 | ||
393 | // if it exists, turn on check box | 393 | // if it exists, turn on check box |
@@ -428,12 +428,12 @@ void LLFloaterDayCycle::onKeyTimeChanged(LLUICtrl* ctrl, void* userData) | |||
428 | F32 min = minSpin->get(); | 428 | F32 min = minSpin->get(); |
429 | F32 val = hour + min / 60.0f; | 429 | F32 val = hour + min / 60.0f; |
430 | 430 | ||
431 | const LLString& curSldr = sldr->getCurSlider(); | 431 | const std::string& curSldr = sldr->getCurSlider(); |
432 | sldr->setCurSliderValue(val, TRUE); | 432 | sldr->setCurSliderValue(val, TRUE); |
433 | F32 time = sldr->getCurSliderValue() / sHoursPerDay; | 433 | F32 time = sldr->getCurSliderValue() / sHoursPerDay; |
434 | 434 | ||
435 | // now set the key's time in the sliderToKey map | 435 | // now set the key's time in the sliderToKey map |
436 | LLString presetName = sSliderToKey[curSldr].presetName; | 436 | std::string presetName = sSliderToKey[curSldr].presetName; |
437 | sSliderToKey[curSldr].time = time; | 437 | sSliderToKey[curSldr].time = time; |
438 | 438 | ||
439 | syncTrack(); | 439 | syncTrack(); |
@@ -453,8 +453,8 @@ void LLFloaterDayCycle::onKeyPresetChanged(LLUICtrl* ctrl, void* userData) | |||
453 | } | 453 | } |
454 | 454 | ||
455 | // change the map | 455 | // change the map |
456 | LLString newPreset(comboBox->getSelectedValue().asString()); | 456 | std::string newPreset(comboBox->getSelectedValue().asString()); |
457 | const LLString& curSldr = sldr->getCurSlider(); | 457 | const std::string& curSldr = sldr->getCurSlider(); |
458 | 458 | ||
459 | // if null, don't use | 459 | // if null, don't use |
460 | if(curSldr == "") { | 460 | if(curSldr == "") { |
@@ -506,7 +506,7 @@ void LLFloaterDayCycle::onAddKey(void* userData) | |||
506 | llassert_always(sSliderToKey.size() == kSldr->getValue().size()); | 506 | llassert_always(sSliderToKey.size() == kSldr->getValue().size()); |
507 | 507 | ||
508 | // get the values | 508 | // get the values |
509 | LLString newPreset(comboBox->getSelectedValue().asString()); | 509 | std::string newPreset(comboBox->getSelectedValue().asString()); |
510 | 510 | ||
511 | // add the slider key | 511 | // add the slider key |
512 | addSliderKey(tSldr->getCurSliderValue(), newPreset); | 512 | addSliderKey(tSldr->getCurSliderValue(), newPreset); |
@@ -514,13 +514,13 @@ void LLFloaterDayCycle::onAddKey(void* userData) | |||
514 | syncTrack(); | 514 | syncTrack(); |
515 | } | 515 | } |
516 | 516 | ||
517 | void LLFloaterDayCycle::addSliderKey(F32 time, const LLString & presetName) | 517 | void LLFloaterDayCycle::addSliderKey(F32 time, const std::string & presetName) |
518 | { | 518 | { |
519 | LLMultiSliderCtrl* kSldr = sDayCycle->getChild<LLMultiSliderCtrl>( | 519 | LLMultiSliderCtrl* kSldr = sDayCycle->getChild<LLMultiSliderCtrl>( |
520 | "WLDayCycleKeys"); | 520 | "WLDayCycleKeys"); |
521 | 521 | ||
522 | // make a slider | 522 | // make a slider |
523 | const LLString& sldrName = kSldr->addSlider(time); | 523 | const std::string& sldrName = kSldr->addSlider(time); |
524 | if(sldrName == "") { | 524 | if(sldrName == "") { |
525 | return; | 525 | return; |
526 | } | 526 | } |
@@ -530,21 +530,21 @@ void LLFloaterDayCycle::addSliderKey(F32 time, const LLString & presetName) | |||
530 | newKey.presetName = presetName; | 530 | newKey.presetName = presetName; |
531 | newKey.time = kSldr->getCurSliderValue(); | 531 | newKey.time = kSldr->getCurSliderValue(); |
532 | 532 | ||
533 | llassert_always(sldrName != LLString::null); | 533 | llassert_always(sldrName != LLStringUtil::null); |
534 | 534 | ||
535 | // add to map | 535 | // add to map |
536 | sSliderToKey.insert(std::pair<LLString, LLWLSkyKey>(sldrName, newKey)); | 536 | sSliderToKey.insert(std::pair<std::string, LLWLSkyKey>(sldrName, newKey)); |
537 | 537 | ||
538 | llassert_always(sSliderToKey.size() == kSldr->getValue().size()); | 538 | llassert_always(sSliderToKey.size() == kSldr->getValue().size()); |
539 | 539 | ||
540 | } | 540 | } |
541 | 541 | ||
542 | void LLFloaterDayCycle::deletePreset(LLString& presetName) | 542 | void LLFloaterDayCycle::deletePreset(std::string& presetName) |
543 | { | 543 | { |
544 | LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); | 544 | LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); |
545 | 545 | ||
546 | /// delete any reference | 546 | /// delete any reference |
547 | std::map<LLString, LLWLSkyKey>::iterator curr_preset, next_preset; | 547 | std::map<std::string, LLWLSkyKey>::iterator curr_preset, next_preset; |
548 | for(curr_preset = sSliderToKey.begin(); curr_preset != sSliderToKey.end(); curr_preset = next_preset) | 548 | for(curr_preset = sSliderToKey.begin(); curr_preset != sSliderToKey.end(); curr_preset = next_preset) |
549 | { | 549 | { |
550 | next_preset = curr_preset; | 550 | next_preset = curr_preset; |
@@ -568,8 +568,8 @@ void LLFloaterDayCycle::onDeleteKey(void* userData) | |||
568 | LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); | 568 | LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); |
569 | 569 | ||
570 | // delete from map | 570 | // delete from map |
571 | const LLString& sldrName = sldr->getCurSlider(); | 571 | const std::string& sldrName = sldr->getCurSlider(); |
572 | std::map<LLString, LLWLSkyKey>::iterator mIt = sSliderToKey.find(sldrName); | 572 | std::map<std::string, LLWLSkyKey>::iterator mIt = sSliderToKey.find(sldrName); |
573 | sSliderToKey.erase(mIt); | 573 | sSliderToKey.erase(mIt); |
574 | 574 | ||
575 | sldr->deleteCurSlider(); | 575 | sldr->deleteCurSlider(); |
@@ -578,7 +578,7 @@ void LLFloaterDayCycle::onDeleteKey(void* userData) | |||
578 | return; | 578 | return; |
579 | } | 579 | } |
580 | 580 | ||
581 | const LLString& name = sldr->getCurSlider(); | 581 | const std::string& name = sldr->getCurSlider(); |
582 | comboBox->selectByValue(sSliderToKey[name].presetName); | 582 | comboBox->selectByValue(sSliderToKey[name].presetName); |
583 | F32 time = sSliderToKey[name].time; | 583 | F32 time = sSliderToKey[name].time; |
584 | 584 | ||