diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llfloaterreleasemsg.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloaterreleasemsg.cpp | 174 |
1 files changed, 0 insertions, 174 deletions
diff --git a/linden/indra/newview/llfloaterreleasemsg.cpp b/linden/indra/newview/llfloaterreleasemsg.cpp deleted file mode 100644 index fc35e5c..0000000 --- a/linden/indra/newview/llfloaterreleasemsg.cpp +++ /dev/null | |||
@@ -1,174 +0,0 @@ | |||
1 | /** | ||
2 | * @file llfloaterreleasemsg.cpp | ||
3 | * @brief In-world HTML dialog | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2005&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2005-2008, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | #include "llviewerprecompiledheaders.h" | ||
33 | |||
34 | #include "lluictrlfactory.h" | ||
35 | #include "llviewerwindow.h" | ||
36 | #include "llviewercontrol.h" | ||
37 | #include "llfloaterreleasemsg.h" | ||
38 | #include "llagent.h" | ||
39 | #include "llviewerregion.h" | ||
40 | #include "llappviewer.h" | ||
41 | |||
42 | extern LLAgent gAgent; | ||
43 | |||
44 | |||
45 | LLFloaterReleaseMsg* LLFloaterReleaseMsg::sInstance = 0; | ||
46 | bool LLFloaterReleaseMsg::sDisplayMessage = false; | ||
47 | |||
48 | //////////////////////////////////////////////////////////////////////////////// | ||
49 | // | ||
50 | LLFloaterReleaseMsg* LLFloaterReleaseMsg::getInstance() | ||
51 | { | ||
52 | if ( ! sInstance ) | ||
53 | sInstance = new LLFloaterReleaseMsg; | ||
54 | |||
55 | return sInstance; | ||
56 | } | ||
57 | |||
58 | //////////////////////////////////////////////////////////////////////////////// | ||
59 | // | ||
60 | LLFloaterReleaseMsg::LLFloaterReleaseMsg() | ||
61 | : LLFloater( "Release Message Floater" ) | ||
62 | |||
63 | , | ||
64 | mWebBrowser( 0 ) | ||
65 | { | ||
66 | // create floater from its XML definition | ||
67 | LLUICtrlFactory::getInstance()->buildFloater( this, "floater_sim_release_message.xml" ); | ||
68 | |||
69 | mTitleBase = getTitle(); | ||
70 | |||
71 | // reposition floater from saved settings | ||
72 | LLRect rect = gSavedSettings.getRect( "HtmlReleaseMessage" ); | ||
73 | reshape( rect.getWidth(), rect.getHeight(), FALSE ); | ||
74 | setRect( rect ); | ||
75 | |||
76 | mWebBrowser = getChild<LLWebBrowserCtrl>("release_message_floater_browser" ); | ||
77 | if ( mWebBrowser ) | ||
78 | { | ||
79 | // observe browser events | ||
80 | mWebBrowser->addObserver( this ); | ||
81 | |||
82 | // make links open in external browser | ||
83 | mWebBrowser->setOpenInExternalBrowser( true ); | ||
84 | |||
85 | // don't automatically open secondlife links since we want to catch | ||
86 | // special ones that do other stuff (like open F1 Help) | ||
87 | //mWebBrowser->setOpenSecondLifeLinksInMap( false ); | ||
88 | } | ||
89 | |||
90 | childSetAction("close_btn", onClickClose, this); | ||
91 | setDefaultBtn("close_btn"); | ||
92 | } | ||
93 | |||
94 | //////////////////////////////////////////////////////////////////////////////// | ||
95 | // | ||
96 | LLFloaterReleaseMsg::~LLFloaterReleaseMsg() | ||
97 | { | ||
98 | // stop observing browser events | ||
99 | if ( mWebBrowser ) | ||
100 | mWebBrowser->remObserver( this ); | ||
101 | |||
102 | // save position of floater | ||
103 | gSavedSettings.setRect( "HtmlReleaseMessage", getRect() ); | ||
104 | |||
105 | sInstance = 0; | ||
106 | } | ||
107 | |||
108 | //////////////////////////////////////////////////////////////////////////////// | ||
109 | // | ||
110 | void LLFloaterReleaseMsg::show() | ||
111 | { | ||
112 | |||
113 | std::string url = gAgent.getRegion()->getCapability("ServerReleaseNotes"); | ||
114 | |||
115 | if (url.empty()) return; | ||
116 | |||
117 | llinfos << "Release message url: " << url << llendl; | ||
118 | |||
119 | if (!sInstance) | ||
120 | { | ||
121 | sInstance = new LLFloaterReleaseMsg(); | ||
122 | sInstance->center(); | ||
123 | } | ||
124 | |||
125 | sInstance->setTitle(sInstance->mTitleBase + " " + gLastVersionChannel); | ||
126 | sInstance->open(); | ||
127 | |||
128 | // navigate to the URL | ||
129 | if ( sInstance->mWebBrowser ) | ||
130 | sInstance->mWebBrowser->navigateTo( url ); | ||
131 | |||
132 | // make floater appear | ||
133 | sInstance->setVisibleAndFrontmost(); | ||
134 | } | ||
135 | |||
136 | |||
137 | //////////////////////////////////////////////////////////////////////////////// | ||
138 | // | ||
139 | void LLFloaterReleaseMsg::onClickClose( void* data ) | ||
140 | { | ||
141 | LLFloaterReleaseMsg* self = ( LLFloaterReleaseMsg* )data; | ||
142 | |||
143 | self->setVisible( false ); | ||
144 | } | ||
145 | |||
146 | |||
147 | //////////////////////////////////////////////////////////////////////////////// | ||
148 | // | ||
149 | |||
150 | // return true if it's a new version and we should display a notification | ||
151 | bool LLFloaterReleaseMsg::checkVersion(const LLString& version_channel) | ||
152 | { | ||
153 | bool res = false; | ||
154 | if (gLastVersionChannel != version_channel) | ||
155 | { | ||
156 | res = !gLastVersionChannel.empty(); // don't show message on initial login | ||
157 | gLastVersionChannel = version_channel; | ||
158 | } | ||
159 | return res; | ||
160 | } | ||
161 | |||
162 | void LLFloaterReleaseMsg::displayMessage(const LLString& version_channel) | ||
163 | { | ||
164 | //if we have the capability already, display the url, otherwise wait on it | ||
165 | if (gAgent.getRegion()->getCapability("ServerReleaseNotes").empty()) | ||
166 | { | ||
167 | sDisplayMessage = true; | ||
168 | } | ||
169 | else | ||
170 | { | ||
171 | sDisplayMessage = false; | ||
172 | show(); | ||
173 | } | ||
174 | } | ||