PageRenderTime 22ms CodeModel.GetById 1ms app.highlight 15ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llpanelplacestab.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 82 lines | 44 code | 13 blank | 25 comment | 3 complexity | 17648b85df03e2a2e9ccd6bf6b183015 MD5 | raw file
 1/** 
 2 * @file llpanelplacestab.cpp
 3 * @brief Tabs interface for Side Bar "Places" panel
 4 *
 5 * $LicenseInfo:firstyear=2009&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#include "llviewerprecompiledheaders.h"
28
29#include "llpanelplacestab.h"
30
31#include "llbutton.h"
32#include "llnotificationsutil.h"
33
34#include "llwindow.h"
35
36#include "llpanelplaces.h"
37#include "llslurl.h"
38#include "llworldmap.h"
39
40std::string LLPanelPlacesTab::sFilterSubString = LLStringUtil::null;
41
42bool LLPanelPlacesTab::isTabVisible()
43{
44	LLUICtrl* parent = getParentUICtrl();
45	if (!parent) return false;
46	if (!parent->getVisible()) return false;
47	return true;
48}
49
50void LLPanelPlacesTab::setPanelPlacesButtons(LLPanelPlaces* panel)
51{
52	mTeleportBtn = panel->getChild<LLButton>("teleport_btn");
53	mShowOnMapBtn = panel->getChild<LLButton>("map_btn");
54	mShowProfile = panel->getChild<LLButton>("profile_btn");
55}
56
57void LLPanelPlacesTab::onRegionResponse(const LLVector3d& landmark_global_pos,
58										U64 region_handle,
59										const std::string& url,
60										const LLUUID& snapshot_id,
61										bool teleport)
62{
63	std::string sim_name;
64	bool gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( landmark_global_pos, sim_name );
65
66	std::string sl_url;
67	if ( gotSimName )
68	{
69		sl_url = LLSLURL(sim_name, landmark_global_pos).getSLURLString();
70	}
71	else
72	{
73		sl_url = "";
74	}
75
76	LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(sl_url));
77		
78	LLSD args;
79	args["SLURL"] = sl_url;
80
81	LLNotificationsUtil::add("CopySLURL", args);
82}