Fully combine voice with tos stuffs
Removes separate voice license code Cleans up tos code
This commit is contained in:
@@ -927,7 +927,6 @@ P2(groupProposalBallotResponder, transfer_300s);
|
||||
P(homeLocationResponder);
|
||||
P2(HTTPGetResponder, reply_15s);
|
||||
P(iamHere);
|
||||
P(iamHereVoice);
|
||||
P2(BGFolderHttpHandler, transfer_300s);
|
||||
P(BGItemHttpHandler);
|
||||
P(lcl_responder);
|
||||
|
||||
@@ -88,7 +88,6 @@ set(viewer_SOURCE_FILES
|
||||
daeexport.cpp
|
||||
floaterao.cpp
|
||||
floaterlocalassetbrowse.cpp
|
||||
floatervoicelicense.cpp
|
||||
generichandlers.cpp
|
||||
groupchatlistener.cpp
|
||||
hbfloatergrouptitles.cpp
|
||||
@@ -625,7 +624,6 @@ set(viewer_HEADER_FILES
|
||||
daeexport.h
|
||||
floaterao.h
|
||||
floaterlocalassetbrowse.h
|
||||
floatervoicelicense.h
|
||||
generichandlers.h
|
||||
groupchatlistener.h
|
||||
hbfloatergrouptitles.h
|
||||
|
||||
@@ -1,244 +0,0 @@
|
||||
/**
|
||||
* @file floatervoicelicense.cpp
|
||||
* @brief prompts user to agree to the Vivox license in order to enable voice
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2010, McCabe Maxsted
|
||||
*
|
||||
* Imprudence Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided to you
|
||||
* under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
|
||||
* this distribution, or online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "floatervoicelicense.h"
|
||||
|
||||
// viewer includes
|
||||
#include "llagent.h"
|
||||
#include "llappviewer.h"
|
||||
#include "llstartup.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewerstats.h"
|
||||
#include "llviewertexteditor.h"
|
||||
#include "llviewerwindow.h"
|
||||
|
||||
// linden library includes
|
||||
#include "llbutton.h"
|
||||
#include "llhttpclient.h"
|
||||
#include "llhttpstatuscodes.h" // for HTTP_FOUND
|
||||
#include "llradiogroup.h"
|
||||
#include "lltextbox.h"
|
||||
#include "llui.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llvfile.h"
|
||||
#include "message.h"
|
||||
|
||||
class AIHTTPTimeoutPolicy;
|
||||
extern AIHTTPTimeoutPolicy iamHereVoice_timeout;
|
||||
|
||||
FloaterVoiceLicense::FloaterVoiceLicense(const LLSD& key)
|
||||
: LLModalDialog( std::string(" "), 100, 100 ),
|
||||
mLoadCompleteCount( 0 )
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_voice_license.xml");
|
||||
}
|
||||
|
||||
// helper class that trys to download a URL from a web site and calls a method
|
||||
// on parent class indicating if the web server is working or not
|
||||
class LLIamHereVoice : public LLHTTPClient::ResponderWithResult
|
||||
{
|
||||
private:
|
||||
LLIamHereVoice( FloaterVoiceLicense* parent ) :
|
||||
mParent( parent )
|
||||
{}
|
||||
|
||||
FloaterVoiceLicense* mParent;
|
||||
|
||||
public:
|
||||
static boost::intrusive_ptr< LLIamHereVoice > build( FloaterVoiceLicense* parent )
|
||||
{
|
||||
return boost::intrusive_ptr< LLIamHereVoice >( new LLIamHereVoice( parent ) );
|
||||
};
|
||||
|
||||
virtual void setParent( FloaterVoiceLicense* parentIn )
|
||||
{
|
||||
mParent = parentIn;
|
||||
};
|
||||
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
{
|
||||
if ( mParent )
|
||||
mParent->setSiteIsAlive( true );
|
||||
};
|
||||
|
||||
/*virtual*/ void httpFailure(void)
|
||||
{
|
||||
if ( mParent )
|
||||
{
|
||||
// *HACK: For purposes of this alive check, 302 Found
|
||||
// (aka Moved Temporarily) is considered alive. The web site
|
||||
// redirects this link to a "cache busting" temporary URL. JC
|
||||
bool alive = (mStatus == HTTP_FOUND);
|
||||
mParent->setSiteIsAlive( alive );
|
||||
}
|
||||
};
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return iamHereVoice_timeout; }
|
||||
/*virtual*/ bool pass_redirect_status(void) const { return true; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLIamHereVoice"; }
|
||||
};
|
||||
|
||||
// this is global and not a class member to keep crud out of the header file
|
||||
namespace {
|
||||
boost::intrusive_ptr< LLIamHereVoice > gResponsePtr = 0;
|
||||
};
|
||||
|
||||
BOOL FloaterVoiceLicense::postBuild()
|
||||
{
|
||||
childSetAction("Continue", onContinue, this);
|
||||
childSetAction("Cancel", onCancel, this);
|
||||
childSetCommitCallback("agree_chk", updateAgree, this);
|
||||
|
||||
// disable Agree to License radio button until the page has fully loaded
|
||||
LLCheckBoxCtrl* license_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
|
||||
license_agreement->setEnabled( false );
|
||||
|
||||
// hide the SL text widget if we're displaying license with using a browser widget.
|
||||
LLTextEditor *editor = getChild<LLTextEditor>("license_text");
|
||||
editor->setVisible( FALSE );
|
||||
|
||||
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("license_html");
|
||||
if ( web_browser )
|
||||
{
|
||||
// start to observe it so we see navigate complete events
|
||||
web_browser->addObserver( this );
|
||||
std::string url = getString( "real_url" );
|
||||
if(url.substr(0,4) == "http") {
|
||||
gResponsePtr = LLIamHereVoice::build( this );
|
||||
LLHTTPClient::get( url, gResponsePtr );
|
||||
} else {
|
||||
setSiteIsAlive(false);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void FloaterVoiceLicense::setSiteIsAlive( bool alive )
|
||||
{
|
||||
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("license_html");
|
||||
// if the contents of the site was retrieved
|
||||
if ( alive )
|
||||
{
|
||||
if ( web_browser )
|
||||
{
|
||||
// navigate to the "real" page
|
||||
std::string real_url = getString( "real_url" );
|
||||
web_browser->navigateTo(real_url);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
web_browser->navigateToLocalPage("license", getString("fallback_html"));
|
||||
// normally this is set when navigation to license page completes (so you can't accept before it loads)
|
||||
// but if the page is unavailable, we need to do this now
|
||||
LLCheckBoxCtrl* license_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
|
||||
license_agreement->setEnabled( true );
|
||||
}
|
||||
}
|
||||
|
||||
FloaterVoiceLicense::~FloaterVoiceLicense()
|
||||
{
|
||||
|
||||
// tell the responder we're not here anymore
|
||||
if ( gResponsePtr )
|
||||
{
|
||||
gResponsePtr->setParent( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
// virtual
|
||||
void FloaterVoiceLicense::draw()
|
||||
{
|
||||
// draw children
|
||||
LLModalDialog::draw();
|
||||
}
|
||||
|
||||
// static
|
||||
void FloaterVoiceLicense::updateAgree(LLUICtrl*, void* userdata )
|
||||
{
|
||||
FloaterVoiceLicense* self = (FloaterVoiceLicense*) userdata;
|
||||
bool agree = self->childGetValue("agree_chk").asBoolean();
|
||||
self->childSetEnabled("Continue", agree);
|
||||
}
|
||||
|
||||
// static
|
||||
void FloaterVoiceLicense::onContinue( void* userdata )
|
||||
{
|
||||
FloaterVoiceLicense* self = (FloaterVoiceLicense*) userdata;
|
||||
LL_INFOS() << "User agreed to the Vivox personal license" << LL_ENDL;
|
||||
|
||||
// enabling voice by default here seems like the best behavior
|
||||
gSavedSettings.setBOOL("EnableVoiceChat", TRUE);
|
||||
gSavedSettings.setBOOL("VivoxLicenseAccepted", TRUE);
|
||||
|
||||
// save these settings in case something bad happens later
|
||||
gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
|
||||
|
||||
if (LLStartUp::getStartupState() == STATE_LOGIN_VOICE_LICENSE)
|
||||
{
|
||||
LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); // Go back and finish authentication
|
||||
}
|
||||
self->close(); // destroys this object
|
||||
}
|
||||
|
||||
// static
|
||||
void FloaterVoiceLicense::onCancel( void* userdata )
|
||||
{
|
||||
FloaterVoiceLicense* self = (FloaterVoiceLicense*) userdata;
|
||||
LL_INFOS() << "User disagreed with the vivox personal license" << LL_ENDL;
|
||||
gSavedSettings.setBOOL("EnableVoiceChat", FALSE);
|
||||
gSavedSettings.setBOOL("VivoxLicenseAccepted", FALSE);
|
||||
|
||||
if (LLStartUp::getStartupState() == STATE_LOGIN_VOICE_LICENSE)
|
||||
{
|
||||
LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); // Go back and finish authentication
|
||||
}
|
||||
self->mLoadCompleteCount = 0; // reset counter for next time we come here
|
||||
self->close(); // destroys this object
|
||||
}
|
||||
|
||||
//virtual
|
||||
void FloaterVoiceLicense::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent event)
|
||||
{
|
||||
if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
|
||||
{
|
||||
// skip past the loading screen navigate complete
|
||||
if ( ++mLoadCompleteCount == 2 )
|
||||
{
|
||||
LL_INFOS() << "NAVIGATE COMPLETE" << LL_ENDL;
|
||||
// enable Agree to License radio button now that page has loaded
|
||||
LLCheckBoxCtrl * license_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
|
||||
license_agreement->setEnabled( true );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
/**
|
||||
* @file floatervoicelicense.h
|
||||
* @brief prompts user to agree to the Vivox license in order to enable voice
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2010, McCabe Maxsted
|
||||
*
|
||||
* Imprudence Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided to you
|
||||
* under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
|
||||
* this distribution, or online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef FLOATERVOICELICENSE_H
|
||||
#define FLOATERVOICELICENSE_H
|
||||
|
||||
#include "llfloater.h"
|
||||
|
||||
#include "llmodaldialog.h"
|
||||
#include "llassetstorage.h"
|
||||
#include "llmediactrl.h"
|
||||
|
||||
class LLButton;
|
||||
class LLRadioGroup;
|
||||
class LLVFS;
|
||||
class LLTextEditor;
|
||||
class LLUUID;
|
||||
|
||||
class FloaterVoiceLicense :
|
||||
public LLModalDialog,
|
||||
public LLViewerMediaObserver,
|
||||
public LLFloaterSingleton<FloaterVoiceLicense>
|
||||
{
|
||||
public:
|
||||
FloaterVoiceLicense(const LLSD& key);
|
||||
virtual ~FloaterVoiceLicense();
|
||||
|
||||
BOOL postBuild();
|
||||
|
||||
virtual void draw();
|
||||
|
||||
static void updateAgree( LLUICtrl *, void* userdata );
|
||||
static void onContinue( void* userdata );
|
||||
static void onCancel( void* userdata );
|
||||
|
||||
void setSiteIsAlive( bool alive );
|
||||
|
||||
// inherited from LLViewerMediaObserver
|
||||
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
|
||||
|
||||
private:
|
||||
int mLoadCompleteCount;
|
||||
};
|
||||
|
||||
#endif // FLOATERVOICELICENSE_H
|
||||
@@ -45,8 +45,8 @@
|
||||
#include "llviewercontrol.h"
|
||||
#include "llui.h"
|
||||
#include "llappviewer.h"
|
||||
#include "llfloatertos.h"
|
||||
#include "lltracker.h"
|
||||
#include "floatervoicelicense.h"
|
||||
#include "llstartup.h"
|
||||
|
||||
#include "hippogridmanager.h"
|
||||
@@ -303,8 +303,9 @@ void LLFirstUse::voiceLicenseAgreement()
|
||||
{
|
||||
gSavedSettings.setWarning("FirstVoiceLicense", FALSE);
|
||||
|
||||
FloaterVoiceLicense::getInstance()->open();
|
||||
FloaterVoiceLicense::getInstance()->center();
|
||||
auto inst = LLFloaterTOS::show(LLFloaterTOS::TOS_VOICE);
|
||||
inst->open();
|
||||
inst->center();
|
||||
}
|
||||
else // currently in STATE_LOGIN_VOICE_LICENSE when arriving here
|
||||
{
|
||||
|
||||
@@ -1,34 +1,33 @@
|
||||
/**
|
||||
* @file llfloatertos.cpp
|
||||
* @brief Terms of Service Agreement dialog
|
||||
*
|
||||
* $LicenseInfo:firstyear=2003&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2003-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
* @file llfloatertos.cpp
|
||||
* @brief Terms of Service Agreement dialog
|
||||
*
|
||||
* $LicenseInfo:firstyear=2003&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2003-2009, Linden Research, Inc.; 2010, McCabe Maxsted; 2019, Liru Faers
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
@@ -58,23 +57,20 @@ class AIHTTPTimeoutPolicy;
|
||||
extern AIHTTPTimeoutPolicy iamHere_timeout;
|
||||
|
||||
// static
|
||||
LLFloaterTOS* LLFloaterTOS::sInstance = NULL;
|
||||
LLFloaterTOS* LLFloaterTOS::sInstance = nullptr;
|
||||
|
||||
// static
|
||||
LLFloaterTOS* LLFloaterTOS::show(ETOSType type, const std::string & message)
|
||||
{
|
||||
if (sInstance)
|
||||
{
|
||||
delete sInstance;
|
||||
}
|
||||
if (sInstance) delete sInstance;
|
||||
return sInstance = new LLFloaterTOS(type, message);
|
||||
}
|
||||
|
||||
|
||||
LLFloaterTOS::LLFloaterTOS(ETOSType type, const std::string& message)
|
||||
: LLModalDialog( std::string(" "), 100, 100 ),
|
||||
: LLModalDialog(std::string(" "), 100, 100),
|
||||
mType(type),
|
||||
mLoadCompleteCount( 0 )
|
||||
mLoadCompleteCount(0)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this,
|
||||
mType == TOS_CRITICAL_MESSAGE ? "floater_critical.xml"
|
||||
@@ -85,11 +81,11 @@ LLFloaterTOS::LLFloaterTOS(ETOSType type, const std::string& message)
|
||||
{
|
||||
// this displays the critical message
|
||||
LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
|
||||
editor->setHandleEditKeysDirectly( TRUE );
|
||||
editor->setEnabled( FALSE );
|
||||
editor->setHandleEditKeysDirectly(TRUE);
|
||||
editor->setEnabled(FALSE);
|
||||
editor->setWordWrap(TRUE);
|
||||
editor->setFocus(TRUE);
|
||||
editor->setValue(LLSD(message));
|
||||
editor->setValue(message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,50 +94,49 @@ LLFloaterTOS::LLFloaterTOS(ETOSType type, const std::string& message)
|
||||
class LLIamHere : public LLHTTPClient::ResponderWithResult
|
||||
{
|
||||
private:
|
||||
LLIamHere( LLFloaterTOS* parent ) :
|
||||
mParent( parent )
|
||||
LLIamHere(LLFloaterTOS* parent) :
|
||||
mParent(parent->getDerivedHandle<LLFloaterTOS>())
|
||||
{}
|
||||
|
||||
LLFloaterTOS* mParent;
|
||||
LLHandle<LLFloaterTOS> mParent;
|
||||
|
||||
public:
|
||||
|
||||
static boost::intrusive_ptr< LLIamHere > build( LLFloaterTOS* parent )
|
||||
static boost::intrusive_ptr<LLIamHere> build(LLFloaterTOS* parent)
|
||||
{
|
||||
return boost::intrusive_ptr< LLIamHere >( new LLIamHere( parent ) );
|
||||
};
|
||||
return boost::intrusive_ptr<LLIamHere>(new LLIamHere(parent));
|
||||
}
|
||||
|
||||
virtual void setParent( LLFloaterTOS* parentIn )
|
||||
virtual void setParent(LLFloaterTOS* parentIn)
|
||||
{
|
||||
mParent = parentIn;
|
||||
};
|
||||
mParent = parentIn->getDerivedHandle<LLFloaterTOS>();
|
||||
}
|
||||
|
||||
/*virtual*/ void httpSuccess(void)
|
||||
/*virtual*/ void httpSuccess()
|
||||
{
|
||||
if ( mParent )
|
||||
mParent->setSiteIsAlive( true );
|
||||
};
|
||||
if (!mParent.isDead())
|
||||
mParent.get()->setSiteIsAlive( true );
|
||||
}
|
||||
|
||||
/*virtual*/ void httpFailure(void)
|
||||
/*virtual*/ void httpFailure()
|
||||
{
|
||||
if ( mParent )
|
||||
if (!mParent.isDead())
|
||||
{
|
||||
// *HACK: For purposes of this alive check, 302 Found
|
||||
// (aka Moved Temporarily) is considered alive. The web site
|
||||
// redirects this link to a "cache busting" temporary URL. JC
|
||||
bool alive = (mStatus == HTTP_FOUND);
|
||||
mParent->setSiteIsAlive( alive );
|
||||
mParent.get()->setSiteIsAlive(alive);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return iamHere_timeout; }
|
||||
/*virtual*/ bool pass_redirect_status(void) const { return true; }
|
||||
/*virtual*/ char const* getName(void) const { return "LLIamHere"; }
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy() const { return iamHere_timeout; }
|
||||
/*virtual*/ bool pass_redirect_status() const { return true; }
|
||||
/*virtual*/ char const* getName() const { return "LLIamHere"; }
|
||||
};
|
||||
|
||||
// this is global and not a class member to keep crud out of the header file
|
||||
namespace {
|
||||
boost::intrusive_ptr< LLIamHere > gResponsePtr = 0;
|
||||
boost::intrusive_ptr<LLIamHere> gResponsePtr = 0;
|
||||
};
|
||||
|
||||
BOOL LLFloaterTOS::postBuild()
|
||||
@@ -150,28 +145,23 @@ BOOL LLFloaterTOS::postBuild()
|
||||
childSetAction("Cancel", onCancel, this);
|
||||
childSetCommitCallback("agree_chk", updateAgree, this);
|
||||
|
||||
if ( mType == TOS_CRITICAL_MESSAGE )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if (mType == TOS_CRITICAL_MESSAGE) return TRUE;
|
||||
|
||||
// disable Agree to TOS radio button until the page has fully loaded
|
||||
LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
|
||||
tos_agreement->setEnabled( false );
|
||||
tos_agreement->setEnabled(false);
|
||||
|
||||
bool voice = mType == TOS_VOICE;
|
||||
// hide the SL text widget if we're displaying TOS with using a browser widget.
|
||||
LLTextEditor *editor = getChild<LLTextEditor>(mType == TOS_VOICE ? "license_text" : "tos_text");
|
||||
editor->setVisible( FALSE );
|
||||
getChild<LLTextEditor>(voice ? "license_text" : "tos_text")->setVisible(FALSE);
|
||||
|
||||
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>(mType == TOS_VOICE ? "license_html" : "tos_html");
|
||||
if ( web_browser )
|
||||
if (LLMediaCtrl* web_browser = getChild<LLMediaCtrl>(voice ? "license_html" : "tos_html"))
|
||||
{
|
||||
// start to observe it so we see navigate complete events
|
||||
web_browser->addObserver(this);
|
||||
std::string url = getString( "real_url" );
|
||||
|
||||
if (mType != TOS_VOICE || url.substr(0,4) == "http") {
|
||||
gResponsePtr = LLIamHere::build( this );
|
||||
LLHTTPClient::get(url, gResponsePtr);
|
||||
if (!voice || url.substr(0,4) == "http") {
|
||||
LLHTTPClient::get(url, gResponsePtr = LLIamHere::build(this));
|
||||
} else {
|
||||
setSiteIsAlive(false);
|
||||
}
|
||||
@@ -180,28 +170,28 @@ BOOL LLFloaterTOS::postBuild()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterTOS::setSiteIsAlive( bool alive )
|
||||
void LLFloaterTOS::setSiteIsAlive(bool alive)
|
||||
{
|
||||
// only do this for TOS pages
|
||||
if ( mType != TOS_CRITICAL_MESSAGE )
|
||||
if (mType != TOS_CRITICAL_MESSAGE)
|
||||
{
|
||||
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>(mType == TOS_VOICE ? "license_html" : "tos_html");
|
||||
bool voice = mType == TOS_VOICE;
|
||||
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>(voice ? "license_html" : "tos_html");
|
||||
// if the contents of the site was retrieved
|
||||
if ( alive )
|
||||
if (alive)
|
||||
{
|
||||
if ( web_browser )
|
||||
if (web_browser)
|
||||
{
|
||||
// navigate to the "real" page
|
||||
web_browser->navigateTo( getString( "real_url" ) );
|
||||
web_browser->navigateTo(getString("real_url"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mType == TOS_VOICE) web_browser->navigateToLocalPage("license", getString("fallback_html"));
|
||||
if (voice) web_browser->navigateToLocalPage("license", getString("fallback_html"));
|
||||
// normally this is set when navigation to TOS page navigation completes (so you can't accept before TOS loads)
|
||||
// but if the page is unavailable, we need to do this now
|
||||
LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
|
||||
tos_agreement->setEnabled( true );
|
||||
getChild<LLCheckBoxCtrl>("agree_chk")->setEnabled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,10 +199,8 @@ void LLFloaterTOS::setSiteIsAlive( bool alive )
|
||||
LLFloaterTOS::~LLFloaterTOS()
|
||||
{
|
||||
// tell the responder we're not here anymore
|
||||
if ( gResponsePtr )
|
||||
gResponsePtr->setParent( 0 );
|
||||
|
||||
LLFloaterTOS::sInstance = NULL;
|
||||
if (gResponsePtr) gResponsePtr->setParent(0);
|
||||
sInstance = nullptr;
|
||||
}
|
||||
|
||||
// virtual
|
||||
@@ -231,7 +219,7 @@ void LLFloaterTOS::updateAgree(LLUICtrl*, void* userdata )
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterTOS::onContinue( void* userdata )
|
||||
void LLFloaterTOS::onContinue(void* userdata)
|
||||
{
|
||||
LLFloaterTOS* self = (LLFloaterTOS*) userdata;
|
||||
bool voice = self->mType == TOS_VOICE;
|
||||
@@ -271,7 +259,7 @@ void LLFloaterTOS::onContinue( void* userdata )
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterTOS::onCancel( void* userdata )
|
||||
void LLFloaterTOS::onCancel(void* userdata)
|
||||
{
|
||||
LLFloaterTOS* self = (LLFloaterTOS*) userdata;
|
||||
if (self->mType == TOS_VOICE)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
@@ -58,7 +58,6 @@ public:
|
||||
TOS_VOICE = 2
|
||||
};
|
||||
|
||||
// Asset_id is overwritten with LLUUID::null when agree is clicked.
|
||||
static LLFloaterTOS* show(ETOSType type, const std::string& message = LLStringUtil::null);
|
||||
|
||||
BOOL postBuild();
|
||||
@@ -75,12 +74,9 @@ public:
|
||||
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
|
||||
|
||||
private:
|
||||
// Asset_id is overwritten with LLUUID::null when agree is clicked.
|
||||
LLFloaterTOS(ETOSType type, const std::string & message);
|
||||
LLFloaterTOS(ETOSType type, const std::string& message);
|
||||
|
||||
private:
|
||||
ETOSType mType;
|
||||
std::string mMessage;
|
||||
int mLoadCompleteCount;
|
||||
|
||||
static LLFloaterTOS* sInstance;
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
|
||||
#include "llprefsvoice.h"
|
||||
|
||||
#include "floatervoicelicense.h"
|
||||
#include "llcheckboxctrl.h"
|
||||
#include "llfloatertos.h"
|
||||
#include "llfocusmgr.h"
|
||||
#include "llkeyboard.h"
|
||||
#include "llmodaldialog.h"
|
||||
@@ -158,8 +158,9 @@ void LLPrefsVoice::apply()
|
||||
if (enable_voice && !gSavedSettings.getBOOL("VivoxLicenseAccepted"))
|
||||
{
|
||||
// This window enables voice chat if license is accepted
|
||||
FloaterVoiceLicense::getInstance()->open();
|
||||
FloaterVoiceLicense::getInstance()->center();
|
||||
auto inst = LLFloaterTOS::show(LLFloaterTOS::TOS_VOICE);
|
||||
inst->open();
|
||||
inst->center();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user