summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitsinventory.cpp
diff options
context:
space:
mode:
authorYuri Chebotarev <ychebotarev@productengine.com>2010-04-06 11:54:32 +0300
committerYuri Chebotarev <ychebotarev@productengine.com>2010-04-06 11:54:32 +0300
commit3da3ed2ccb9bab68be113bf7a79e6f95f7b73f9e (patch)
tree76bf2106cbbed09e02340b9cb0fa2fdee422b725 /indra/newview/llpaneloutfitsinventory.cpp
parent9dcdbf029c3a74de5aefca52262d4ed41626298d (diff)
parentcf94709c60949d5376f8c5dc14bf5472631cd6c9 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llpaneloutfitsinventory.cpp')
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp134
1 files changed, 45 insertions, 89 deletions
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index dd320f8328..075b22307d 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()
@@ -192,7 +131,7 @@ void LLPanelOutfitsInventory::updateVerbs()
if (mListCommands)
{
- mListCommands->childSetVisible("look_edit_btn",sShowDebugEditor);
+ mListCommands->childSetVisible("edit_current_outfit_btn",sShowDebugEditor);
updateListCommands();
}
}
@@ -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)
@@ -306,19 +269,12 @@ void LLPanelOutfitsInventory::onSelectionChange(const std::deque<LLFolderViewIte
}
}
-void LLPanelOutfitsInventory::onSelectorButtonClicked()
+void LLPanelOutfitsInventory::showEditOutfitPanel()
{
- LLFolderViewItem* cur_item = getRootFolder()->getCurSelectedItem();
-
- LLFolderViewEventListener* listenerp = cur_item->getListener();
- if (getIsCorrectType(listenerp))
- {
- LLSD key;
- key["type"] = "look";
- key["id"] = listenerp->getUUID();
-
- LLSideTray::getInstance()->showPanel("sidepanel_appearance", key);
- }
+ LLSD key;
+ key["type"] = "edit_outfit";
+
+ LLSideTray::getInstance()->showPanel("sidepanel_appearance", key);
}
LLFolderViewEventListener *LLPanelOutfitsInventory::getCorrectListenerForAction()
@@ -365,7 +321,7 @@ void LLPanelOutfitsInventory::initListCommandsHandlers()
mListCommands->childSetAction("make_outfit_btn", boost::bind(&LLPanelOutfitsInventory::onAddButtonClick, this));
mListCommands->childSetAction("wear_btn", boost::bind(&LLPanelOutfitsInventory::onWearButtonClick, this));
- mListCommands->childSetAction("look_edit_btn", boost::bind(&LLPanelOutfitsInventory::onSelectorButtonClicked, this));
+ mListCommands->childSetAction("edit_current_outfit_btn", boost::bind(&LLPanelOutfitsInventory::showEditOutfitPanel, this));
LLDragAndDropButton* trash_btn = mListCommands->getChild<LLDragAndDropButton>("trash_btn");
trash_btn->setDragAndDropHandler(boost::bind(&LLPanelOutfitsInventory::handleDragAndDropToTrash, this