aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llinventoryactions.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:50 -0500
committerJacek Antonelli2008-08-15 23:44:50 -0500
commit89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch)
treebcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/newview/llinventoryactions.cpp
parentSecond Life viewer sources 1.13.3.2 (diff)
downloadmeta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2
meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz
Second Life viewer sources 1.14.0.0
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llinventoryactions.cpp36
1 files changed, 30 insertions, 6 deletions
diff --git a/linden/indra/newview/llinventoryactions.cpp b/linden/indra/newview/llinventoryactions.cpp
index a10ccdf..756ba63 100644
--- a/linden/indra/newview/llinventoryactions.cpp
+++ b/linden/indra/newview/llinventoryactions.cpp
@@ -110,7 +110,7 @@ bool doToSelected(LLFolderView* folder, LLString action)
110 LLMultiPreview* multi_previewp = NULL; 110 LLMultiPreview* multi_previewp = NULL;
111 LLMultiProperties* multi_propertiesp = NULL; 111 LLMultiProperties* multi_propertiesp = NULL;
112 112
113 if ("open" == action && selected_items.size() > 1) 113 if (("task_open" == action || "open" == action) && selected_items.size() > 1)
114 { 114 {
115 S32 left, top; 115 S32 left, top;
116 gFloaterView->getNewFloaterPosition(&left, &top); 116 gFloaterView->getNewFloaterPosition(&left, &top);
@@ -121,7 +121,7 @@ bool doToSelected(LLFolderView* folder, LLString action)
121 LLFloater::setFloaterHost(multi_previewp); 121 LLFloater::setFloaterHost(multi_previewp);
122 122
123 } 123 }
124 else if ("properties" == action && selected_items.size() > 1) 124 else if (("task_properties" == action || "properties" == action) && selected_items.size() > 1)
125 { 125 {
126 S32 left, top; 126 S32 left, top;
127 gFloaterView->getNewFloaterPosition(&left, &top); 127 gFloaterView->getNewFloaterPosition(&left, &top);
@@ -145,13 +145,13 @@ bool doToSelected(LLFolderView* folder, LLString action)
145 } 145 }
146 146
147 LLFloater::setFloaterHost(NULL); 147 LLFloater::setFloaterHost(NULL);
148 if ("open" == action && selected_items.size() > 1) 148 if (multi_previewp)
149 { 149 {
150 multi_previewp->open(); 150 multi_previewp->open();
151 } 151 }
152 else if ("properties" == action && selected_items.size() > 1) 152 else if (multi_propertiesp)
153 { 153 {
154 multi_propertiesp->open(); 154 multi_propertiesp->open(); /*Flawfinder: ignore*/
155 } 155 }
156 156
157 return true; 157 return true;
@@ -209,7 +209,7 @@ class LLNewWindow : public inventory_listener_t
209 mPtr->getActivePanel()->getModel()); 209 mPtr->getActivePanel()->getModel());
210 iv->getActivePanel()->setFilterTypes(mPtr->getActivePanel()->getFilterTypes()); 210 iv->getActivePanel()->setFilterTypes(mPtr->getActivePanel()->getFilterTypes());
211 iv->getActivePanel()->setFilterSubString(mPtr->getActivePanel()->getFilterSubString()); 211 iv->getActivePanel()->setFilterSubString(mPtr->getActivePanel()->getFilterSubString());
212 iv->open(); 212 iv->open(); /*Flawfinder: ignore*/
213 213
214 // force onscreen 214 // force onscreen
215 gFloaterView->adjustToFitScreen(iv, FALSE); 215 gFloaterView->adjustToFitScreen(iv, FALSE);
@@ -283,6 +283,29 @@ class LLEmptyTrash : public inventory_panel_listener_t
283 } 283 }
284}; 284};
285 285
286class LLEmptyLostAndFound : public inventory_panel_listener_t
287{
288 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
289 {
290 LLInventoryModel* model = mPtr->getModel();
291 if(!model) return false;
292 gViewerWindow->alertXml("ConfirmEmptyLostAndFound", callback_empty_lost_and_found, this);
293 return true;
294 }
295
296 static void callback_empty_lost_and_found(S32 option, void* userdata)
297 {
298 LLEmptyLostAndFound* empty_lost_and_found = (LLEmptyLostAndFound*)userdata;
299 if (option == 0) // YES
300 {
301 LLInventoryModel* model = empty_lost_and_found->mPtr->getModel();
302 LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND);
303 model->purgeDescendentsOf(lost_and_found_id);
304 model->notifyObservers();
305 }
306 }
307};
308
286class LLEmptyTrashFloater : public inventory_listener_t 309class LLEmptyTrashFloater : public inventory_listener_t
287{ 310{
288 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 311 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -635,6 +658,7 @@ void init_inventory_panel_actions(LLInventoryPanel *panel)
635 (new LLAttachObject())->registerListener(panel, "Inventory.AttachObject"); 658 (new LLAttachObject())->registerListener(panel, "Inventory.AttachObject");
636 (new LLCloseAllFolders())->registerListener(panel, "Inventory.CloseAllFolders"); 659 (new LLCloseAllFolders())->registerListener(panel, "Inventory.CloseAllFolders");
637 (new LLEmptyTrash())->registerListener(panel, "Inventory.EmptyTrash"); 660 (new LLEmptyTrash())->registerListener(panel, "Inventory.EmptyTrash");
661 (new LLEmptyLostAndFound())->registerListener(panel, "Inventory.EmptyLostAndFound");
638 (new LLDoCreate())->registerListener(panel, "Inventory.DoCreate"); 662 (new LLDoCreate())->registerListener(panel, "Inventory.DoCreate");
639 (new LLBeginIMSession())->registerListener(panel, "Inventory.BeginIMSession"); 663 (new LLBeginIMSession())->registerListener(panel, "Inventory.BeginIMSession");
640} 664}