diff options
Diffstat (limited to 'indra/newview/llfloaterautoreplacesettings.cpp')
-rw-r--r-- | indra/newview/llfloaterautoreplacesettings.cpp | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/indra/newview/llfloaterautoreplacesettings.cpp b/indra/newview/llfloaterautoreplacesettings.cpp index 7d1bcba978..6e56e929df 100644 --- a/indra/newview/llfloaterautoreplacesettings.cpp +++ b/indra/newview/llfloaterautoreplacesettings.cpp @@ -478,14 +478,25 @@ bool LLFloaterAutoReplaceSettings::callbackNewListName(const LLSD& notification, bool LLFloaterAutoReplaceSettings::callbackListNameConflict(const LLSD& notification, const LLSD& response) { LLSD newList = notification["payload"]["list"]; - + std::string listName = LLAutoReplaceSettings::getListName(newList); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); switch ( option ) { case 0: // Replace current list - LL_INFOS("AutoReplace")<<"option 'replace current list' selected"<<LL_ENDL; - + if ( LLAutoReplaceSettings::AddListOk == mSettings.replaceList(newList) ) + { + LL_INFOS("AutoReplace") << "replaced list '"<<listName<<"'"<<LL_ENDL; + mSelectedListName = listName; + updateListNames(); + updateListNamesControls(); + updateReplacementsList(); + } + else + { + LL_WARNS("AutoReplace")<<"failed to replace list '"<<listName<<"'"<<LL_ENDL; + } break; case 1: @@ -503,14 +514,27 @@ bool LLFloaterAutoReplaceSettings::callbackListNameConflict(const LLSD& notifica void LLFloaterAutoReplaceSettings::onDeleteList() { - std::string listName= mListNames->getFirstSelected()->getColumn(0)->getValue().asString(); - mSettings.removeReplacementList(listName); // remove from the copy of settings - mReplacementsList->deleteSelectedItems(); // remove from the scrolling list - - mSelectedListName.clear(); - updateListNames(); - updateListNamesControls(); - updateReplacementsList(); + std::string listName = mListNames->getSelectedValue().asString(); + if ( ! listName.empty() ) + { + if ( mSettings.removeReplacementList(listName) ) + { + LL_INFOS("AutoReplace")<<"deleted list '"<<listName<<"'"<<LL_ENDL; + mReplacementsList->deleteSelectedItems(); // remove from the scrolling list + mSelectedListName.clear(); + updateListNames(); + updateListNamesControls(); + updateReplacementsList(); + } + else + { + LL_WARNS("AutoReplace")<<"failed to delete list '"<<listName<<"'"<<LL_ENDL; + } + } + else + { + LL_DEBUGS("AutoReplace")<<"no list selected for delete"<<LL_ENDL; + } } void LLFloaterAutoReplaceSettings::onExportList() |