2017-12-20 14:39:09 +01:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
2017-11-09 11:19:24 +01:00
|
|
|
*
|
2018-06-15 12:15:43 +02:00
|
|
|
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org>
|
2017-11-09 11:19:24 +01:00
|
|
|
*
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Calamares is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2020-05-19 10:42:25 +02:00
|
|
|
#ifndef TRACKING_TRACKINGJOBS_H
|
|
|
|
#define TRACKING_TRACKINGJOBS_H
|
2017-11-09 11:19:24 +01:00
|
|
|
|
|
|
|
#include "Job.h"
|
|
|
|
|
2020-05-19 10:42:25 +02:00
|
|
|
class InstallTrackingConfig;
|
|
|
|
class MachineTrackingConfig;
|
2020-05-25 15:56:32 +02:00
|
|
|
class UserTrackingConfig;
|
2020-05-19 10:42:25 +02:00
|
|
|
|
2017-11-09 11:19:24 +01:00
|
|
|
class QSemaphore;
|
|
|
|
|
2020-05-19 10:42:25 +02:00
|
|
|
/** @section Tracking Jobs
|
|
|
|
*
|
|
|
|
* The tracking jobs do the actual work of configuring tracking on the
|
|
|
|
* target machine. Tracking jobs may have *styles*, variations depending
|
|
|
|
* on the distro or environment of the target system. At the root of
|
|
|
|
* each family of tracking jobs (installation, machine, user) there is
|
|
|
|
* a class with static method `addJob()` that takes the configuration
|
|
|
|
* information from the relevant Config sub-object and optionally
|
|
|
|
* adds the right job (subclass!) to the list of jobs.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** @brief Install-tracking job (gets a URL)
|
|
|
|
*
|
|
|
|
* The install-tracking job (there is only one kind) does a GET
|
|
|
|
* on a configured URL with some additional information about
|
|
|
|
* the machine (if configured into the URL).
|
|
|
|
*
|
|
|
|
* No persistent tracking is done.
|
|
|
|
*/
|
2017-11-09 11:19:24 +01:00
|
|
|
class TrackingInstallJob : public Calamares::Job
|
|
|
|
{
|
2020-03-19 00:20:20 +01:00
|
|
|
Q_OBJECT
|
2017-11-09 11:19:24 +01:00
|
|
|
public:
|
|
|
|
TrackingInstallJob( const QString& url );
|
2018-01-13 21:19:08 +01:00
|
|
|
~TrackingInstallJob() override;
|
2017-11-09 11:19:24 +01:00
|
|
|
|
|
|
|
QString prettyName() const override;
|
|
|
|
QString prettyStatusMessage() const override;
|
|
|
|
Calamares::JobResult exec() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
const QString m_url;
|
|
|
|
};
|
|
|
|
|
2020-06-17 10:18:08 +02:00
|
|
|
/** @brief Tracking machines, update-manager style
|
2020-05-25 15:56:32 +02:00
|
|
|
*
|
|
|
|
* The machine has a machine-id, and this is sed(1)'ed into the
|
|
|
|
* update-manager configuration, to report the machine-id back
|
2020-06-17 10:18:08 +02:00
|
|
|
* to distro servers.
|
2020-05-25 15:56:32 +02:00
|
|
|
*/
|
2020-06-23 13:37:56 +02:00
|
|
|
class TrackingMachineUpdateManagerJob : public Calamares::Job
|
2017-11-22 13:39:52 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-06-23 13:37:56 +02:00
|
|
|
~TrackingMachineUpdateManagerJob() override;
|
|
|
|
|
2017-11-22 13:39:52 +01:00
|
|
|
QString prettyName() const override;
|
|
|
|
QString prettyStatusMessage() const override;
|
|
|
|
Calamares::JobResult exec() override;
|
|
|
|
};
|
|
|
|
|
2020-05-25 15:56:32 +02:00
|
|
|
/** @brief Turn on KUserFeedback in target system
|
|
|
|
*
|
|
|
|
* This writes suitable files for turning on KUserFeedback for the
|
|
|
|
* normal user configured in Calamares. The feedback can be reconfigured
|
|
|
|
* by the user through Plasma's user-feedback dialog.
|
|
|
|
*/
|
|
|
|
class TrackingKUserFeedbackJob : public Calamares::Job
|
|
|
|
{
|
|
|
|
public:
|
2020-06-17 15:11:11 +02:00
|
|
|
TrackingKUserFeedbackJob( const QString& username, const QStringList& areas );
|
2020-06-23 13:37:56 +02:00
|
|
|
~TrackingKUserFeedbackJob() override;
|
2020-06-17 15:11:11 +02:00
|
|
|
|
2020-05-25 15:56:32 +02:00
|
|
|
QString prettyName() const override;
|
|
|
|
QString prettyStatusMessage() const override;
|
|
|
|
Calamares::JobResult exec() override;
|
2020-06-17 15:11:11 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
QString m_username;
|
|
|
|
QStringList m_areas;
|
2020-05-25 15:56:32 +02:00
|
|
|
};
|
2017-11-22 13:39:52 +01:00
|
|
|
|
2020-06-23 13:37:56 +02:00
|
|
|
void addJob( Calamares::JobList& list, InstallTrackingConfig* config );
|
|
|
|
void addJob( Calamares::JobList& list, MachineTrackingConfig* config );
|
|
|
|
void addJob( Calamares::JobList& list, UserTrackingConfig* config );
|
|
|
|
|
2017-11-09 11:19:24 +01:00
|
|
|
#endif
|