Rename AO sets finished, some better UI handling for checking of names and reloading sets.
parent
34e0f4b534
commit
f343623f0f
|
|
@ -37,6 +37,7 @@
|
|||
#include "llspinctrl.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewerinventory.h"
|
||||
#include <boost/graph/graph_concepts.hpp>
|
||||
|
||||
FloaterAO::FloaterAO(const LLSD& key)
|
||||
: LLTransientDockableFloater(NULL,true,key),
|
||||
|
|
@ -270,12 +271,17 @@ void FloaterAO::onOpen(const LLSD& key)
|
|||
|
||||
void FloaterAO::onSelectSet()
|
||||
{
|
||||
mSelectedSet=AOEngine::instance().getSetByName(mSetSelector->getSelectedItemLabel());
|
||||
if(mSelectedSet)
|
||||
AOSet* set=AOEngine::instance().getSetByName(mSetSelector->getSelectedItemLabel());
|
||||
if(!set)
|
||||
{
|
||||
updateSetParameters();
|
||||
updateAnimationList();
|
||||
onRenameSet();
|
||||
return;
|
||||
}
|
||||
|
||||
mSelectedSet=set;
|
||||
|
||||
updateSetParameters();
|
||||
updateAnimationList();
|
||||
}
|
||||
|
||||
void FloaterAO::onSelectSetSmall()
|
||||
|
|
@ -288,6 +294,37 @@ void FloaterAO::onSelectSetSmall()
|
|||
}
|
||||
}
|
||||
|
||||
void FloaterAO::onRenameSet()
|
||||
{
|
||||
if(!mSelectedSet)
|
||||
{
|
||||
llwarns << "Rename AO set without set selected." << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
std::string name=mSetSelector->getSimple();
|
||||
LLStringUtil::trim(name);
|
||||
|
||||
if(!name.empty())
|
||||
{
|
||||
if(name.find_first_of(":|")==std::string::npos)
|
||||
{
|
||||
if(AOEngine::instance().renameSet(mSelectedSet,name))
|
||||
{
|
||||
reloading(TRUE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LLSD args;
|
||||
args["AO_SET_NAME"]=name;
|
||||
LLNotificationsUtil::add("RenameAOCantContainColon",args);
|
||||
}
|
||||
}
|
||||
mSetSelector->setSimple(mSelectedSet->getName());
|
||||
}
|
||||
|
||||
void FloaterAO::onClickActivate()
|
||||
{
|
||||
lldebugs << "Set activated: " << mSetSelector->getSelectedItemLabel() << llendl;
|
||||
|
|
@ -371,11 +408,15 @@ BOOL FloaterAO::newSetCallback(const LLSD& notification,const LLSD& response)
|
|||
std::string newSetName=response["message"].asString();
|
||||
S32 option=LLNotificationsUtil::getSelectedOption(notification,response);
|
||||
|
||||
if(newSetName=="")
|
||||
LLStringUtil::trim(newSetName);
|
||||
|
||||
if(newSetName.empty())
|
||||
return FALSE;
|
||||
else if(newSetName.find(":")!=std::string::npos)
|
||||
else if(newSetName.find_first_of(":|")!=std::string::npos)
|
||||
{
|
||||
LLNotificationsUtil::add("NewAOCantContainColon",LLSD());
|
||||
LLSD args;
|
||||
args["AO_SET_NAME"]=newSetName;
|
||||
LLNotificationsUtil::add("NewAOCantContainColon",args);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ class FloaterAO
|
|||
|
||||
void onSelectSet();
|
||||
void onSelectSetSmall();
|
||||
void onRenameSet();
|
||||
void onSelectState();
|
||||
void onChangeAnimationSelection();
|
||||
void onClickReload();
|
||||
|
|
|
|||
|
|
@ -1047,6 +1047,19 @@ void AOEngine::saveSet(const AOSet* set)
|
|||
gInventory.notifyObservers();
|
||||
*/
|
||||
rename_category(&gInventory,set->getInventoryUUID(),setParams);
|
||||
|
||||
llwarns << "sending update signal" << llendl;
|
||||
mUpdatedSignal();
|
||||
}
|
||||
|
||||
BOOL AOEngine::renameSet(AOSet* set,const std::string name)
|
||||
{
|
||||
if(name.empty() || name.find(":")!=std::string::npos)
|
||||
return FALSE;
|
||||
set->setName(name);
|
||||
set->setDirty(TRUE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void AOEngine::saveState(const AOSet::AOState* state)
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ class AOEngine
|
|||
const std::vector<AOSet*> getSetList() const;
|
||||
const std::string getCurrentSetName() const;
|
||||
const AOSet* getDefaultSet() const;
|
||||
BOOL renameSet(AOSet* set,const std::string name);
|
||||
|
||||
void setDefaultSet(AOSet* set);
|
||||
void setOverrideSits(AOSet* set,BOOL yes);
|
||||
|
|
|
|||
|
|
@ -7032,7 +7032,7 @@ Reset WL settings for '[PARCEL_NAME]' to region default?
|
|||
name="NewAOSet"
|
||||
type="alertmodal">
|
||||
Specify a name for the new AO set:
|
||||
(The name may not contain a : character)
|
||||
(The name may not contain a ":" or "|" character)
|
||||
<form name="form">
|
||||
<input name="message" type="text">
|
||||
New AO Set
|
||||
|
|
@ -7053,8 +7053,19 @@ New AO Set
|
|||
icon="alertmodal.tga"
|
||||
name="NewAOCantContainColon"
|
||||
type="alertmodal">
|
||||
Could not create new AO set.
|
||||
The name may not contain ":" characters.
|
||||
Could not create new AO set "[AO_SET_NAME]".
|
||||
The name may not contain ":" or "|" characters.
|
||||
<usetemplate
|
||||
name="okbutton"
|
||||
yestext="OK"/>
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="RenameAOCantContainColon"
|
||||
type="alertmodal">
|
||||
Could not rename new AO set to "[AO_SET_NAME]".
|
||||
The name may not contain ":" or "|" characters.
|
||||
<usetemplate
|
||||
name="okbutton"
|
||||
yestext="OK"/>
|
||||
|
|
@ -7064,7 +7075,7 @@ The name may not contain ":" characters.
|
|||
icon="alertmodal.tga"
|
||||
name="RemoveAOSet"
|
||||
type="alertmodal">
|
||||
Remove AO set [AO_SET_NAME] from the list?
|
||||
Remove AO set "[AO_SET_NAME]" from the list?
|
||||
<usetemplate
|
||||
name="okcancelbuttons"
|
||||
notext="Cancel"
|
||||
|
|
|
|||
Loading…
Reference in New Issue