diff --git a/src/modules/tracking/CMakeLists.txt b/src/modules/tracking/CMakeLists.txt index d99d09446..270866933 100644 --- a/src/modules/tracking/CMakeLists.txt +++ b/src/modules/tracking/CMakeLists.txt @@ -6,6 +6,8 @@ calamares_add_plugin( tracking TrackingPage.cpp UI page_trackingstep.ui + RESOURCES + page_trackingstep.qrc LINK_PRIVATE_LIBRARIES calamaresui SHARED_LIB diff --git a/src/modules/tracking/TrackingPage.cpp b/src/modules/tracking/TrackingPage.cpp index 512b743d4..93c7697b4 100644 --- a/src/modules/tracking/TrackingPage.cpp +++ b/src/modules/tracking/TrackingPage.cpp @@ -42,3 +42,29 @@ TrackingPage::TrackingPage(QWidget *parent) ui->setupUi( this ); } +void TrackingPage::showTrackingOption(TrackingType t, bool show) +{ + QGroupBox *group = nullptr; + + cDebug() << "Showing tracking option" << int(t) << show; + switch ( t ) + { + case TrackingType::InstallTracking: + group = ui->installTrackingBox; + break; + case TrackingType::MachineTracking: + group = ui->machineTrackingBox; + break; + case TrackingType::UserTracking: + group = ui->UserTrackingBox; + break; + } + + if ( group != nullptr ) + if ( show ) + group->show(); + else + group->hide(); + else + cDebug() << " .. unknown option" << int(t); +} diff --git a/src/modules/tracking/TrackingPage.h b/src/modules/tracking/TrackingPage.h index ccacb6415..791f1039d 100644 --- a/src/modules/tracking/TrackingPage.h +++ b/src/modules/tracking/TrackingPage.h @@ -33,6 +33,15 @@ class TrackingPage : public QWidget public: explicit TrackingPage( QWidget* parent = nullptr ); + enum class TrackingType + { + InstallTracking, + MachineTracking, + UserTracking + } ; + + void showTrackingOption( TrackingType t, bool show ); + private: Ui::TrackingPage* ui; }; diff --git a/src/modules/tracking/TrackingViewStep.cpp b/src/modules/tracking/TrackingViewStep.cpp index a78b6c5b8..108b113c6 100644 --- a/src/modules/tracking/TrackingViewStep.cpp +++ b/src/modules/tracking/TrackingViewStep.cpp @@ -19,6 +19,7 @@ #include "JobQueue.h" #include "GlobalStorage.h" #include "utils/Logger.h" +#include "utils/CalamaresUtils.h" #include "TrackingViewStep.h" #include "TrackingPage.h" @@ -45,7 +46,7 @@ TrackingViewStep::~TrackingViewStep() QString TrackingViewStep::prettyName() const { - return tr( "Telemetry and Tracking" ); + return tr( "Telemetry" ); } @@ -71,8 +72,7 @@ TrackingViewStep::back() bool TrackingViewStep::isNextEnabled() const { -// return m_widget->isNextEnabled(); - return false; + return true; } @@ -100,10 +100,38 @@ TrackingViewStep::isAtEnd() const QList< Calamares::job_ptr > TrackingViewStep::jobs() const { + cDebug() << "Tracking jobs .."; return QList< Calamares::job_ptr >(); } + +static +bool getTrackingEnabled( const QVariantMap& configurationMap, const QString& key, TrackingEnabled& track ) +{ + cDebug() << "Tracking configuration" << key; + + // Switch it off by default + track.settingEnabled = false; + track.userEnabled = false; + + bool success = false; + auto config = CalamaresUtils::getSubMap( configurationMap, key, success ); + + if ( success ) + { + track.settingEnabled = CalamaresUtils::getBool( config, "enabled", false ); + track.userEnabled = track.settingEnabled && CalamaresUtils::getBool( config, "default", false ); + } + cDebug() << " .. Install tracking: enabled=" < + + machine.png + ../../../data/images/information.svgz + binoculars.png + phone.png + + diff --git a/src/modules/tracking/page_trackingstep.ui b/src/modules/tracking/page_trackingstep.ui index f42133624..d27ff0570 100644 --- a/src/modules/tracking/page_trackingstep.ui +++ b/src/modules/tracking/page_trackingstep.ui @@ -25,11 +25,57 @@ - - - Explanation of install-tracking. - - + + + + + + 64 + 64 + + + + + 64 + 64 + + + + + + + :/tracking/phone.png + + + + + + + <html><head/><body><p>Installation tracking helps %1 count how many people use it. If you enable install-tracking, at the end of the installation, information about your hardware will be sent <span style=" font-weight:600;">one time only</span> to our servers. To see what will be sent, click on the help-icon.</p></body></html> + + + Qt::RichText + + + true + + + + + + + ... + + + + :/tracking/data/images/information.svgz:/tracking/data/images/information.svgz + + + Qt::NoArrow + + + + @@ -52,11 +98,51 @@ - - - Explanation of machine-tracking. - - + + + + + + 64 + 64 + + + + + 64 + 64 + + + + + + + :/tracking/machine.png + + + + + + + <html><head/><body><p>Machine tracking helps %1 count how many people use it on an ongoing basis. If you enable machine-tracking, the system will send limited information about your hardware and installed software <span style=" font-weight:600;">periodically</span> to our servers. For information about the kind of information being sent, click on the help icon.</p></body></html> + + + true + + + + + + + ... + + + + :/tracking/data/images/information.svgz:/tracking/data/images/information.svgz + + + + @@ -79,11 +165,51 @@ - - - Explanation of user-tracking. - - + + + + + + 64 + 64 + + + + + 64 + 64 + + + + + + + :/tracking/binoculars.png + + + + + + + <html><head/><body><p>User tracking helps %1 understand how people use the system and the applications. If you enable user-tracking, the system will send information about your use of the installed software <span style=" font-weight:600;">regularly</span> to our servers. For information about the kind of information being sent and the policies that apply, click on the help icon.</p></body></html> + + + true + + + + + + + ... + + + + :/tracking/data/images/information.svgz:/tracking/data/images/information.svgz + + + + @@ -101,6 +227,8 @@ - + + + diff --git a/src/modules/tracking/phone.png b/src/modules/tracking/phone.png new file mode 100644 index 000000000..91fb6228e Binary files /dev/null and b/src/modules/tracking/phone.png differ