diff --git a/src/util.cpp b/src/util.cpp index 939f12b5..2dd5d3cd 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -349,12 +349,12 @@ CAboutDlg::CAboutDlg ( QWidget* parent ) : QDialog ( parent ) txvCredits->setOpenExternalLinks ( true ); txvCredits->setText ( "

" // general description of software - "" + tr( "The " ) + APP_NAME + + "" + tr ( "The " ) + APP_NAME + tr ( " software enables musicians to perform real-time jam sessions " "over the internet. There is a " ) + APP_NAME + tr ( " " "server which collects the audio data from each " ) + APP_NAME + tr ( " client, mixes the audio data and sends the mix back " - "to each client.") + "


" + "to each client." ) + "


" "

" // GPL header text "This program is free software; you can redistribute it and/or modify " "it under the terms of the GNU General Public License as published by " @@ -439,6 +439,85 @@ QString CAboutDlg::GetVersionAndNameStr ( const bool bWithHtml ) } +// Licence dialog -------------------------------------------------------------- +CLicenceDlg::CLicenceDlg ( QWidget* parent ) : QDialog ( parent ) +{ +/* + The licence dialog is structured as follows: + - text box with the licence text on the top + - check box: I &agree to the above licence terms + - Accept button (disabled if check box not checked) + - Decline button +*/ + setWindowIcon ( QIcon ( QString::fromUtf8 ( ":/png/main/res/mainicon.png" ) ) ); + resize ( 700, 450 ); + + QVBoxLayout* pLayout = new QVBoxLayout; + QHBoxLayout* pSubLayout = new QHBoxLayout; + QTextBrowser* txvLicence = new QTextBrowser ( this ); + QCheckBox* chbAgree = new QCheckBox ( "I &agree to the above licence terms", this ); + butAccept = new QPushButton ( "Accept", this ); + QPushButton* butDecline = new QPushButton ( "Decline", this ); + + pSubLayout->addStretch(); + pSubLayout->addWidget ( chbAgree ); + pSubLayout->addWidget ( butAccept ); + pSubLayout->addWidget ( butDecline ); + pLayout->addWidget ( txvLicence ); + pLayout->addLayout ( pSubLayout ); + setLayout ( pLayout ); + + // set some properties + butAccept->setEnabled ( false ); + butAccept->setDefault ( true ); + txvLicence->setOpenExternalLinks ( true ); + + // define the licence text (similar to what we have in Ninjam) + txvLicence->setText ( + "

" + tr ( + "By connecting to this server and agreeing to this notice, you agree to the " + "following:" ) + "

" + tr ( + "You agree that all data, sounds, or other works transmitted to this server " + "are owned and created by you or your licensors, and that you are making these " + "data, sounds or other works available via the following Creative Commons " + "License (for more information on this license, see " + "" + "http://creativecommons.org/licenses/by-nc-sa/4.0):" ) + "

" + + "

Attribution-NonCommercial-ShareAlike 4.0

" + + "

" + tr ( "You are free to:" ) + + "

" + tr ( "The licensor cannot revoke these freedoms as long as you follow the " + "license terms." ) + "

" + "

" + tr ( "Under the following terms:" ) + + "

" + tr ( "No additional restrictions" ) + " — " + + tr ( "You may not apply legal terms or technological measures that legally restrict " + "others from doing anything the license permits." ) + "

" ); + + QObject::connect ( chbAgree, SIGNAL ( stateChanged ( int ) ), + this, SLOT ( OnAgreeStateChanged ( int ) ) ); + + QObject::connect ( butAccept, SIGNAL ( clicked() ), + this, SLOT ( accept() ) ); + + QObject::connect ( butDecline, SIGNAL ( clicked() ), + this, SLOT ( reject() ) ); +} + + // Help menu ------------------------------------------------------------------- CHelpMenu::CHelpMenu ( QWidget* parent ) : QMenu ( "&?", parent ) { diff --git a/src/util.h b/src/util.h index 35423d82..6ca26f34 100755 --- a/src/util.h +++ b/src/util.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -408,6 +409,22 @@ public: }; +// Licence dialog -------------------------------------------------------------- +class CLicenceDlg : public QDialog +{ + Q_OBJECT + +public: + CLicenceDlg ( QWidget* parent = 0 ); + +protected: + QPushButton* butAccept; + +public slots: + void OnAgreeStateChanged ( int value ) { butAccept->setEnabled ( value == Qt::Checked ); } +}; + + // Help menu ------------------------------------------------------------------- class CHelpMenu : public QMenu {