diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-06-02 00:17:54 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-06-02 00:20:30 +0300 |
commit | 3efe64619b772ce8cab596d7e74de48dcc7f6c20 (patch) | |
tree | b951db7f2784ab5af8301151b01cccff5a7bd0b0 /indra/newview/llpanelprofilepicks.cpp | |
parent | d7459d87e0b7507b3452aa4effa4dc97e06e8551 (diff) |
SL-15312 Confirm usaved changes dialog when closing floater
Diffstat (limited to 'indra/newview/llpanelprofilepicks.cpp')
-rw-r--r-- | indra/newview/llpanelprofilepicks.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index f5c0fb46c8..7142051f17 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -229,7 +229,7 @@ void LLPanelProfilePicks::onClickDelete() LLSD payload; payload["pick_id"] = pick_id; payload["tab_idx"] = mTabContainer->getCurrentPanelIndex(); - LLNotificationsUtil::add("DeleteAvatarPick", args, payload, + LLNotificationsUtil::add("ProfileDeletePick", args, payload, boost::bind(&LLPanelProfilePicks::callbackDeletePick, this, _1, _2)); } } @@ -400,6 +400,31 @@ void LLPanelProfilePicks::updateData() } } +bool LLPanelProfilePicks::hasUnsavedChanges() +{ + for (S32 tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx) + { + LLPanelProfilePick* pick_panel = dynamic_cast<LLPanelProfilePick*>(mTabContainer->getPanelByIndex(tab_idx)); + if (pick_panel && (pick_panel->isDirty() || pick_panel->isDirty())) + { + return true; + } + } + return false; +} + +void LLPanelProfilePicks::commitUnsavedChanges() +{ + for (S32 tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx) + { + LLPanelProfilePick* pick_panel = dynamic_cast<LLPanelProfilePick*>(mTabContainer->getPanelByIndex(tab_idx)); + if (pick_panel) + { + pick_panel->apply(); + } + } +} + bool LLPanelProfilePicks::canAddNewPick() { return (!LLAgentPicksInfo::getInstance()->isPickLimitReached() && |