1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-01 03:40:16 +02:00

Show legal indemnity warning, and link to the legal page on the web site. Only displays the first time you go online (unless you don't accept it, of course).

This commit is contained in:
Jeff Mitchell
2011-03-27 16:09:56 -04:00
parent 474b9bc604
commit c4302e5f49
3 changed files with 29 additions and 0 deletions

View File

@@ -89,6 +89,17 @@ TomahawkSettings::hasScannerPath() const
return contains( "scannerpath" ); return contains( "scannerpath" );
} }
void
TomahawkSettings::setAcceptedLegalWarning( bool accept )
{
setValue( "acceptedLegalWarning", accept );
}
bool
TomahawkSettings::acceptedLegalWarning() const
{
return value( "acceptedLegalWarning", false ).toBool();
}
bool bool
TomahawkSettings::httpEnabled() const TomahawkSettings::httpEnabled() const

View File

@@ -45,6 +45,9 @@ public:
void setScannerPath( const QString& path ); void setScannerPath( const QString& path );
bool hasScannerPath() const; bool hasScannerPath() const;
bool acceptedLegalWarning() const;
void setAcceptedLegalWarning( bool accept );
/// UI settings /// UI settings
QByteArray mainWindowGeometry() const; QByteArray mainWindowGeometry() const;
void setMainWindowGeometry( const QByteArray& geom ); void setMainWindowGeometry( const QByteArray& geom );

View File

@@ -28,6 +28,7 @@
#include "network/controlconnection.h" #include "network/controlconnection.h"
#include "sourcelist.h" #include "sourcelist.h"
#include "tomahawksettings.h" #include "tomahawksettings.h"
#include "tomahawk/tomahawkapp.h"
#include "config.h" #include "config.h"
@@ -168,6 +169,20 @@ SipHandler::pluginLoaded( const QString& name ) const
void void
SipHandler::connectPlugins( bool startup, const QString &pluginName ) SipHandler::connectPlugins( bool startup, const QString &pluginName )
{ {
#ifndef TOMAHAWK_HEADLESS
if ( !TomahawkSettings::instance()->acceptedLegalWarning() )
{
int result = QMessageBox::question(
TomahawkApp::instance()->mainWindow(), "Legal Warning",
"By pressing OK below, you agree that your use of Tomahawk will be in accordance with any applicable laws, including copyright and intellectual property laws, in effect in your country of residence, and indemify the Tomahawk developers and project from liability should you choose to break those laws.\n\nFor more information, please see http://gettomahawk.com/legal",
"I Do Not Agree", "I Agree"
);
if ( result != 1 )
return;
else
TomahawkSettings::instance()->setAcceptedLegalWarning( true );
}
#endif
foreach( SipPlugin* sip, m_plugins ) foreach( SipPlugin* sip, m_plugins )
{ {
if ( pluginName.isEmpty() || ( !pluginName.isEmpty() && sip->name() == pluginName ) ) if ( pluginName.isEmpty() || ( !pluginName.isEmpty() && sip->name() == pluginName ) )