summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-02-01 19:09:29 -0800
committerMerov Linden <merov@lindenlab.com>2012-02-01 19:09:29 -0800
commitc1636911c84f948e542f445d3c7495e6df185912 (patch)
tree6813798d77b782f834ee37c7df5b344f6d80386e /indra/newview
parent3249a1ced0a4d0bc45d04f5794c989e12e62033b (diff)
EXP-1862 : Make LLClipboard an LLSingleton and clean up the internals (set up for toolbar and never used)
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfavoritesbar.cpp2
-rw-r--r--indra/newview/llfloatergesture.cpp2
-rw-r--r--indra/newview/llpanelteleporthistory.cpp2
-rw-r--r--indra/newview/llpaneltopinfobar.cpp2
-rw-r--r--indra/newview/llpanelwearing.cpp2
-rw-r--r--indra/newview/lltoolbarview.cpp15
-rw-r--r--indra/newview/lltoolbarview.h3
-rw-r--r--indra/newview/lltooldraganddrop.cpp3
-rw-r--r--indra/newview/llurllineeditorctrl.cpp2
9 files changed, 25 insertions, 8 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index f4b6dc2c81..24bd2cf313 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1118,7 +1118,7 @@ BOOL LLFavoritesBarCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
}
void copy_slurl_to_clipboard_cb(std::string& slurl)
{
- gClipboard.copyFromString(utf8str_to_wstring(slurl));
+ LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(slurl));
LLSD args;
args["SLURL"] = slurl;
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp
index d495f20a9a..e025d6edb5 100644
--- a/indra/newview/llfloatergesture.cpp
+++ b/indra/newview/llfloatergesture.cpp
@@ -534,7 +534,7 @@ void LLFloaterGesture::onCopyPasteAction(const LLSD& command)
}
else if ("copy_uuid" == command_name)
{
- gClipboard.copyFromString(utf8str_to_wstring(mGestureList->getCurrentID().asString()), mGestureList->getCurrentID());
+ LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(mGestureList->getCurrentID().asString()), mGestureList->getCurrentID());
}
}
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index 1f1cccad85..a4c9af3fad 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -358,7 +358,7 @@ void LLTeleportHistoryPanel::ContextMenu::onInfo()
//static
void LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback(const std::string& slurl)
{
- gClipboard.copyFromString(utf8str_to_wstring(slurl));
+ LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(slurl));
}
void LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard()
diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp
index eb4c7572d4..0e3ff99066 100644
--- a/indra/newview/llpaneltopinfobar.cpp
+++ b/indra/newview/llpaneltopinfobar.cpp
@@ -467,7 +467,7 @@ void LLPanelTopInfoBar::onContextMenuItemClicked(const LLSD::String& item)
LLAgentUI::buildSLURL(slurl, false);
LLUIString location_str(slurl.getSLURLString());
- gClipboard.copyFromString(location_str);
+ LLClipboard::getInstance()->copyFromString(location_str);
}
}
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index e2801c09bd..1286756693 100644
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -302,6 +302,6 @@ void LLPanelWearing::copyToClipboard()
}
}
- gClipboard.copyFromString(utf8str_to_wstring(text));
+ LLClipboard::getInstance()->copyFromString(utf8str_to_wstring(text));
}
// EOF
diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp
index eccb2cf2f1..8a0b035234 100644
--- a/indra/newview/lltoolbarview.cpp
+++ b/indra/newview/lltoolbarview.cpp
@@ -75,6 +75,7 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p)
mDragStarted(false),
mShowToolbars(true),
mDragToolbarButton(NULL),
+ mDragItem(NULL),
mToolbarsLoaded(false)
{
for (S32 i = 0; i < TOOLBAR_COUNT; i++)
@@ -579,7 +580,7 @@ BOOL LLToolBarView::handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetTyp
uuid_vec_t cargo_ids;
types.push_back(DAD_WIDGET);
cargo_ids.push_back(uuid);
- gClipboard.setSourceObject(uuid,LLAssetType::AT_WIDGET);
+ LLClipboard::getInstance()->setSourceObject(uuid);
LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_VIEWER;
LLUUID srcID;
LLToolDragAndDrop::getInstance()->beginMultiDrag(types, cargo_ids, src, srcID);
@@ -662,6 +663,18 @@ void LLToolBarView::resetDragTool(LLToolBarButton* toolbarButton)
gToolBarView->mDragToolbarButton = toolbarButton;
}
+// Provide a handle on a free standing inventory item containing references to the tool.
+// This might be used by Drag and Drop to move around references to tool items.
+LLInventoryObject* LLToolBarView::getDragItem()
+{
+ if (mDragToolbarButton)
+ {
+ LLUUID item_uuid = mDragToolbarButton->getCommandId().uuid();
+ mDragItem = new LLInventoryObject (item_uuid, LLUUID::null, LLAssetType::AT_WIDGET, "");
+ }
+ return mDragItem;
+}
+
void LLToolBarView::setToolBarsVisible(bool visible)
{
mShowToolbars = visible;
diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h
index be66bcae36..9c4194ebed 100644
--- a/indra/newview/lltoolbarview.h
+++ b/indra/newview/lltoolbarview.h
@@ -31,6 +31,7 @@
#include "lluictrl.h"
#include "lltoolbar.h"
#include "llcommandmanager.h"
+#include "llinventory.h"
class LLUICtrlFactory;
@@ -106,6 +107,7 @@ public:
static BOOL handleDragTool(S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type);
static BOOL handleDropTool(void* cargo_data, S32 x, S32 y, LLToolBar* toolbar);
static void resetDragTool(LLToolBarButton* toolbarButton);
+ LLInventoryObject* getDragItem();
bool isModified() const;
@@ -129,6 +131,7 @@ private:
bool mDragStarted;
LLToolBarButton* mDragToolbarButton;
+ LLInventoryObject* mDragItem;
bool mShowToolbars;
};
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 8c32dfcb4d..f3637756fe 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -48,6 +48,7 @@
#include "llpreviewnotecard.h"
#include "llrootview.h"
#include "llselectmgr.h"
+#include "lltoolbarview.h"
#include "lltoolmgr.h"
#include "lltooltip.h"
#include "lltrans.h"
@@ -2527,7 +2528,7 @@ LLInventoryObject* LLToolDragAndDrop::locateInventory(
}
else if(mSource == SOURCE_VIEWER)
{
- item = (LLViewerInventoryItem*)gClipboard.getSourceObject();
+ item = (LLViewerInventoryItem*)gToolBarView->getDragItem();
}
if(item) return item;
if(cat) return cat;
diff --git a/indra/newview/llurllineeditorctrl.cpp b/indra/newview/llurllineeditorctrl.cpp
index 56b5bbf942..9d7e26d41c 100644
--- a/indra/newview/llurllineeditorctrl.cpp
+++ b/indra/newview/llurllineeditorctrl.cpp
@@ -89,5 +89,5 @@ void LLURLLineEditor::copyEscapedURLToClipboard()
else // human-readable location
text_to_copy = utf8str_to_wstring(unescaped_text);
- gClipboard.copyFromString( text_to_copy );
+ LLClipboard::getInstance()->copyFromString( text_to_copy );
}