diff options
author | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2013-01-14 09:31:57 -0800 |
---|---|---|
committer | simon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com> | 2013-01-14 09:31:57 -0800 |
commit | 4de7c27d9343d866a313ca16f3f102e2750ddb89 (patch) | |
tree | a5a49491169f87a891a41e8916dcaa4e5c03302c /indra/newview/llfloaterautoreplacesettings.cpp | |
parent | deb4dfbae5aa72c8e688f214f2e806b2345b93c5 (diff) | |
parent | cb676675335791d9dacd032c389a0346c725d9d7 (diff) |
Merge in viewer-development
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() |