summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-02-25 16:51:29 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-02-25 16:51:29 +0200
commit645651813520c29c9f898ad531e0b3de65f33b67 (patch)
treeb2e1a31d2ff909ae7be0ed745285e557c8459078 /indra/newview
parent0aa46bb013e888d437054bfb31efe5fa1136d1ba (diff)
SL-1945 Autoselection and some crash fixing
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp7
-rw-r--r--indra/newview/lltrackpicker.cpp10
2 files changed, 15 insertions, 2 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 18f22bf2d2..f712901795 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -1322,6 +1322,11 @@ void LLFloaterEditExtDayCycle::updateSlider()
mFramesSlider->clear();
mSliderKeyMap.clear();
+ if (!mEditDay)
+ {
+ return;
+ }
+
LLSettingsDay::CycleTrack_t track = mEditDay->getCycleTrack(mCurrentTrack);
for (auto &track_frame : track)
{
@@ -1723,7 +1728,7 @@ bool LLFloaterEditExtDayCycle::isRemovingFrameAllowed()
bool LLFloaterEditExtDayCycle::isAddingFrameAllowed()
{
- if (!mFramesSlider->getCurSlider().empty()) return false;
+ if (!mFramesSlider->getCurSlider().empty() || !mEditDay) return false;
LLSettingsBase::Seconds frame(mTimeSlider->getCurSliderValue());
if ((mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR)).second)
diff --git a/indra/newview/lltrackpicker.cpp b/indra/newview/lltrackpicker.cpp
index bc918f4bd7..15bc591b37 100644
--- a/indra/newview/lltrackpicker.cpp
+++ b/indra/newview/lltrackpicker.cpp
@@ -81,13 +81,21 @@ void LLFloaterTrackPicker::showPicker(const LLSD &args)
LLSD::array_const_iterator iter;
LLSD::array_const_iterator end = args.endArray();
+ bool select_item = true;
for (iter = args.beginArray(); iter != end; ++iter)
{
S32 track_id = (*iter)["id"].asInteger();
bool can_enable = (*iter)["enabled"].asBoolean();
- LLView *view = getChild<LLCheckBoxCtrl>(RDO_TRACK_PREFIX + llformat("%d", track_id), true);
+ LLCheckBoxCtrl *view = getChild<LLCheckBoxCtrl>(RDO_TRACK_PREFIX + llformat("%d", track_id), true);
view->setEnabled(can_enable);
view->setLabelArg("[ALT]", (*iter).has("altitude") ? ((*iter)["altitude"].asString() + "m") : " ");
+
+ // Mark first avaliable item as selected
+ if (can_enable && select_item)
+ {
+ select_item = false;
+ view->set(TRUE);
+ }
}
openFloater(getKey());