Initial AISv3 merge. New HTTP messages not plugged in yet.

This commit is contained in:
Shyotl
2015-06-25 20:16:30 -05:00
parent 09f4528bfb
commit 9f10d9510d
71 changed files with 4962 additions and 3452 deletions

View File

@@ -71,6 +71,8 @@ typedef LLMemberListener<LLInventoryPanel> inventory_panel_listener_t;
bool LLInventoryAction::doToSelected(LLFolderView* folder, std::string action)
{
if (!folder)
return true;
LLInventoryModel* model = &gInventory;
if ("rename" == action)
{
@@ -133,43 +135,7 @@ bool LLInventoryAction::doToSelected(LLFolderView* folder, std::string action)
return true;
}
class LLDoToSelectedPanel : public object_inventory_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLPanelObjectInventory *panel = mPtr;
LLFolderView* folder = panel->getRootFolder();
if(!folder) return true;
return LLInventoryAction::doToSelected(folder, userdata.asString());
}
};
class LLDoToSelectedFloater : public inventory_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLInventoryPanel *panel = mPtr->getPanel();
LLFolderView* folder = panel->getRootFolder();
if(!folder) return true;
return LLInventoryAction::doToSelected(folder, userdata.asString());
}
};
class LLDoToSelected : public inventory_panel_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLInventoryPanel *panel = mPtr;
LLFolderView* folder = panel->getRootFolder();
if(!folder) return true;
return LLInventoryAction::doToSelected(folder, userdata.asString());
}
};
class LLNewWindow : public inventory_listener_t
struct LLNewWindow : public inventory_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
@@ -190,105 +156,10 @@ class LLNewWindow : public inventory_listener_t
}
};
class LLShowFilters : public inventory_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
mPtr->toggleFindOptions();
return true;
}
};
class LLResetFilter : public inventory_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
mPtr->resetFilters();
return true;
}
};
class LLCloseAllFolders : public inventory_panel_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
mPtr->closeAllFolders();
return true;
}
};
class LLCloseAllFoldersFloater : public inventory_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
mPtr->getPanel()->closeAllFolders();
return true;
}
};
class LLEmptyTrash : public inventory_panel_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLInventoryModel* model = mPtr->getModel();
if(!model) return false;
LLNotificationsUtil::add("ConfirmEmptyTrash", LLSD(), LLSD(), boost::bind(&LLEmptyTrash::callback_empty_trash, this, _1, _2));
return true;
}
bool callback_empty_trash(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
if (option == 0) // YES
{
LLInventoryModel* model = mPtr->getModel();
LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
model->purgeDescendentsOf(trash_id);
model->notifyObservers();
}
return false;
}
};
class LLEmptyLostAndFound : public inventory_panel_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLInventoryModel* model = mPtr->getModel();
if(!model) return false;
LLNotificationsUtil::add("ConfirmEmptyLostAndFound", LLSD(), LLSD(), boost::bind(&LLEmptyLostAndFound::callback_empty_lost_and_found, this, _1, _2));
return true;
}
bool callback_empty_lost_and_found(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
if (option == 0) // YES
{
LLInventoryModel* model = mPtr->getModel();
LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
model->purgeDescendentsOf(lost_and_found_id);
model->notifyObservers();
}
return false;
}
};
class LLEmptyTrashFloater : public inventory_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLInventoryModel* model = mPtr->getPanel()->getModel();
if(!model) return false;
LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
model->purgeDescendentsOf(trash_id);
model->notifyObservers();
return true;
}
};
void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type, LLFolderBridge *self = NULL)
void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, const LLSD& sdtype, LLFolderBridge *self = NULL)
{
const std::string& type = sdtype.asString();
LL_INFOS() << "self=0x" << std::hex << self << std::dec << LL_ENDL;
if ("category" == type)
{
LLUUID category;
@@ -343,31 +214,7 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type,
ptr->getRootFolder()->setNeedsAutoRename(TRUE);
}
class LLDoCreate : public inventory_panel_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLInventoryModel* model = mPtr->getModel();
if(!model) return false;
std::string type = userdata.asString();
do_create(model, mPtr, type, LLFolderBridge::sSelf.get());
return true;
}
};
class LLDoCreateFloater : public inventory_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLInventoryModel* model = mPtr->getPanel()->getModel();
if(!model) return false;
std::string type = userdata.asString();
do_create(model, mPtr->getPanel(), type);
return true;
}
};
class LLSetSortBy : public inventory_listener_t
struct LLSetSortBy : public inventory_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
@@ -426,20 +273,7 @@ class LLSetSortBy : public inventory_listener_t
return true;
}
};
class LLRefreshInvModel : public inventory_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLInventoryModel* model = mPtr->getPanel()->getModel();
if(!model) return false;
model->empty();
LLInventoryModelBackgroundFetch::instance().start();
return true;
}
};
class LLSetSearchType : public inventory_listener_t
struct LLSetSearchType : public inventory_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
@@ -451,7 +285,7 @@ class LLSetSearchType : public inventory_listener_t
}
};
class LLBeginIMSession : public inventory_panel_listener_t
struct LLBeginIMSession : public inventory_panel_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
@@ -572,7 +406,7 @@ class LLBeginIMSession : public inventory_panel_listener_t
}
};
class LLAttachObject : public inventory_panel_listener_t
struct LLAttachObject : public inventory_panel_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
@@ -628,42 +462,30 @@ class LLAttachObject : public inventory_panel_listener_t
void init_object_inventory_panel_actions(LLPanelObjectInventory *panel)
{
(new LLDoToSelectedPanel())->registerListener(panel, "Inventory.DoToSelected");
(new LLBindMemberListener(panel, "Inventory.DoToSelected", boost::bind(&LLInventoryAction::doToSelected, boost::bind(&LLPanelObjectInventory::getRootFolder, panel), _2)));
}
void init_inventory_actions(LLInventoryView *floater)
{
(new LLDoToSelectedFloater())->registerListener(floater, "Inventory.DoToSelected");
(new LLDoToSelectedFloater())->registerListener(floater, "Inventory.DoToSelected");
(new LLCloseAllFoldersFloater())->registerListener(floater, "Inventory.CloseAllFolders");
(new LLEmptyTrashFloater())->registerListener(floater, "Inventory.EmptyTrash");
(new LLDoCreateFloater())->registerListener(floater, "Inventory.DoCreate");
(new LLBindMemberListener(floater, "Inventory.DoToSelected", boost::bind(&LLInventoryAction::doToSelected, boost::bind(&LLInventoryView::getRootFolder, floater), _2)));
(new LLBindMemberListener(floater, "Inventory.CloseAllFolders", boost::bind(&LLInventoryPanel::closeAllFolders, boost::bind(&LLInventoryView::getPanel, floater))));
(new LLBindMemberListener(floater, "Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "", LLFolderType::FT_TRASH)));
(new LLBindMemberListener(floater, "Inventory.DoCreate", boost::bind(&do_create, &gInventory, boost::bind(&LLInventoryView::getPanel, floater), _2, (LLFolderBridge*)0)));
(new LLNewWindow())->registerListener(floater, "Inventory.NewWindow");
(new LLShowFilters())->registerListener(floater, "Inventory.ShowFilters");
(new LLResetFilter())->registerListener(floater, "Inventory.ResetFilter");
(new LLBindMemberListener(floater, "Inventory.ShowFilters", boost::bind(&LLInventoryView::toggleFindOptions, floater)));
(new LLBindMemberListener(floater, "Inventory.ResetFilter", boost::bind(&LLInventoryView::resetFilters, floater)));
(new LLSetSortBy())->registerListener(floater, "Inventory.SetSortBy");
(new LLSetSearchType())->registerListener(floater, "Inventory.SetSearchType");
}
class LLShare : public inventory_panel_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLAvatarActions::shareWithAvatars(mPtr);
return true;
}
};
void init_inventory_panel_actions(LLInventoryPanel *panel)
{
(new LLDoToSelected())->registerListener(panel, "Inventory.DoToSelected");
(new LLBindMemberListener(panel, "Inventory.DoToSelected", boost::bind(&LLInventoryAction::doToSelected, boost::bind(&LLInventoryPanel::getRootFolder, panel), _2)));
(new LLAttachObject())->registerListener(panel, "Inventory.AttachObject");
(new LLCloseAllFolders())->registerListener(panel, "Inventory.CloseAllFolders");
(new LLEmptyTrash())->registerListener(panel, "Inventory.EmptyTrash");
(new LLEmptyLostAndFound())->registerListener(panel, "Inventory.EmptyLostAndFound");
(new LLDoCreate())->registerListener(panel, "Inventory.DoCreate");
(new LLBindMemberListener(panel, "Inventory.CloseAllFolders", boost::bind(&LLInventoryPanel::closeAllFolders, panel)));
(new LLBindMemberListener(panel, "Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH)));
(new LLBindMemberListener(panel, "Inventory.EmptyLostAndFound", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND)));
(new LLBindMemberListener(panel, "Inventory.DoCreate", boost::bind(&do_create, &gInventory, panel, _2, boost::bind(&LLHandle<LLFolderBridge>::get, boost::cref(LLFolderBridge::sSelf)))));
(new LLBeginIMSession())->registerListener(panel, "Inventory.BeginIMSession");
(new LLShare())->registerListener(panel, "Inventory.Share");
(new LLBindMemberListener(panel, "Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, panel)));
}