summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp113
-rw-r--r--indra/newview/llpaneloutfitsinventory.h2
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml22
3 files changed, 61 insertions, 76 deletions
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index dd320f8328..7137022447 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -48,6 +48,7 @@
#include "lllandmark.h"
#include "lllineeditor.h"
#include "llmodaldialog.h"
+#include "llnotificationsutil.h"
#include "llsidepanelappearance.h"
#include "llsidetray.h"
#include "lltabcontainer.h"
@@ -68,75 +69,13 @@ static const std::string COF_TAB_NAME = "cof_tab";
static LLRegisterPanelClassWrapper<LLPanelOutfitsInventory> t_inventory("panel_outfits_inventory");
bool LLPanelOutfitsInventory::sShowDebugEditor = false;
-class LLOutfitSaveAsDialog : public LLModalDialog
-{
-private:
- std::string mItemName;
- std::string mTempItemName;
-
- boost::signals2::signal<void (const std::string&)> mSaveAsSignal;
-
-public:
- LLOutfitSaveAsDialog( const LLSD& key )
- : LLModalDialog( key ),
- mTempItemName(key.asString())
- {
- }
-
- BOOL postBuild()
- {
- getChild<LLUICtrl>("Save")->setCommitCallback(boost::bind(&LLOutfitSaveAsDialog::onSave, this ));
- getChild<LLUICtrl>("Cancel")->setCommitCallback(boost::bind(&LLOutfitSaveAsDialog::onCancel, this ));
-
- childSetTextArg("name ed", "[DESC]", mTempItemName);
- return TRUE;
- }
-
- void setSaveAsCommit( const boost::signals2::signal<void (const std::string&)>::slot_type& cb )
- {
- mSaveAsSignal.connect(cb);
- }
-
- virtual void onOpen(const LLSD& key)
- {
- LLLineEditor* edit = getChild<LLLineEditor>("name ed");
- if (edit)
- {
- edit->setFocus(TRUE);
- edit->selectAll();
- }
- }
- void onSave()
- {
- mItemName = childGetValue("name ed").asString();
- LLStringUtil::trim(mItemName);
- if( !mItemName.empty() )
- {
- mSaveAsSignal(mItemName);
- closeFloater(); // destroys this object
- }
- }
-
- void onCancel()
- {
- closeFloater(); // destroys this object
- }
-};
-
LLPanelOutfitsInventory::LLPanelOutfitsInventory() :
mActivePanel(NULL),
mParent(NULL)
{
mSavedFolderState = new LLSaveFolderState();
mSavedFolderState->setApply(FALSE);
-
- static bool registered_dialog = false;
- if (!registered_dialog)
- {
- LLFloaterReg::add("outfit_save_as", "floater_outfit_save_as.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLOutfitSaveAsDialog>);
- registered_dialog = true;
- }
}
LLPanelOutfitsInventory::~LLPanelOutfitsInventory()
@@ -268,6 +207,31 @@ void LLPanelOutfitsInventory::onEdit()
{
}
+bool LLPanelOutfitsInventory::onSaveCommit(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (0 == option)
+ {
+ std::string outfit_name = response["message"].asString();
+ LLStringUtil::trim(outfit_name);
+ if( !outfit_name.empty() )
+ {
+ LLUUID outfit_folder = gAgentWearables.makeNewOutfitLinks(outfit_name);
+ LLSD key;
+ LLSideTray::getInstance()->showPanel("panel_outfits_inventory", key);
+
+ if (mAppearanceTabs)
+ {
+ mAppearanceTabs->selectTabByName(OUTFITS_TAB_NAME);
+ }
+ }
+ }
+
+ return false;
+}
+
+
+
void LLPanelOutfitsInventory::onSave()
{
std::string outfit_name;
@@ -277,23 +241,22 @@ void LLPanelOutfitsInventory::onSave()
outfit_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_OUTFIT);
}
+ LLSD args;
+ args["DESC"] = outfit_name;
+
+ LLSD payload;
+ //payload["ids"].append(*it);
+
+ LLNotificationsUtil::add("SaveOutfitAs", args, payload, boost::bind(&LLPanelOutfitsInventory::onSaveCommit, this, _1, _2));
+
+ //)
+
+/*
LLOutfitSaveAsDialog* save_as_dialog = LLFloaterReg::showTypedInstance<LLOutfitSaveAsDialog>("outfit_save_as", LLSD(outfit_name), TRUE);
if (save_as_dialog)
{
save_as_dialog->setSaveAsCommit(boost::bind(&LLPanelOutfitsInventory::onSaveCommit, this, _1 ));
- }
-}
-
-void LLPanelOutfitsInventory::onSaveCommit(const std::string& outfit_name)
-{
- LLUUID outfit_folder = gAgentWearables.makeNewOutfitLinks(outfit_name);
- LLSD key;
- LLSideTray::getInstance()->showPanel("panel_outfits_inventory", key);
-
- if (mAppearanceTabs)
- {
- mAppearanceTabs->selectTabByName(OUTFITS_TAB_NAME);
- }
+ }*/
}
void LLPanelOutfitsInventory::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action)
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index ab25ef0a49..a4d38df740 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -61,7 +61,7 @@ public:
void onEdit();
void onSave();
- void onSaveCommit(const std::string& item_name);
+ bool onSaveCommit(const LLSD& notification, const LLSD& response);
void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action);
void onSelectorButtonClicked();
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index c39a91281e..f52996724f 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -2024,6 +2024,28 @@ Would you be my friend?
</notification>
<notification
+ icon="alertmodal.tga"
+ label="Save Outfit"
+ name="SaveOutfitAs"
+ type="alertmodal">
+ Save what I'm wearing as a new Outfit:
+ <form name="form">
+ <input name="message" type="text">
+ [DESC] (new)
+ </input>
+ <button
+ default="true"
+ index="0"
+ name="Offer"
+ text="OK"/>
+ <button
+ index="1"
+ name="Cancel"
+ text="Cancel"/>
+ </form>
+ </notification>
+
+ <notification
icon="alertmodal.tga"
name="RemoveFromFriends"
type="alertmodal">