[tracking] Polish UI a bit
- add icons for graphical display of actions - extend description of tracking options - add debug logging - enable next button - show/hide tracking options based on configuration
This commit is contained in:
parent
806799ece4
commit
20a2465cc7
@ -6,6 +6,8 @@ calamares_add_plugin( tracking
|
|||||||
TrackingPage.cpp
|
TrackingPage.cpp
|
||||||
UI
|
UI
|
||||||
page_trackingstep.ui
|
page_trackingstep.ui
|
||||||
|
RESOURCES
|
||||||
|
page_trackingstep.qrc
|
||||||
LINK_PRIVATE_LIBRARIES
|
LINK_PRIVATE_LIBRARIES
|
||||||
calamaresui
|
calamaresui
|
||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
|
@ -42,3 +42,29 @@ TrackingPage::TrackingPage(QWidget *parent)
|
|||||||
ui->setupUi( this );
|
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);
|
||||||
|
}
|
||||||
|
@ -33,6 +33,15 @@ class TrackingPage : public QWidget
|
|||||||
public:
|
public:
|
||||||
explicit TrackingPage( QWidget* parent = nullptr );
|
explicit TrackingPage( QWidget* parent = nullptr );
|
||||||
|
|
||||||
|
enum class TrackingType
|
||||||
|
{
|
||||||
|
InstallTracking,
|
||||||
|
MachineTracking,
|
||||||
|
UserTracking
|
||||||
|
} ;
|
||||||
|
|
||||||
|
void showTrackingOption( TrackingType t, bool show );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::TrackingPage* ui;
|
Ui::TrackingPage* ui;
|
||||||
};
|
};
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
#include "utils/CalamaresUtils.h"
|
||||||
|
|
||||||
#include "TrackingViewStep.h"
|
#include "TrackingViewStep.h"
|
||||||
#include "TrackingPage.h"
|
#include "TrackingPage.h"
|
||||||
@ -45,7 +46,7 @@ TrackingViewStep::~TrackingViewStep()
|
|||||||
QString
|
QString
|
||||||
TrackingViewStep::prettyName() const
|
TrackingViewStep::prettyName() const
|
||||||
{
|
{
|
||||||
return tr( "Telemetry and Tracking" );
|
return tr( "Telemetry" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -71,8 +72,7 @@ TrackingViewStep::back()
|
|||||||
bool
|
bool
|
||||||
TrackingViewStep::isNextEnabled() const
|
TrackingViewStep::isNextEnabled() const
|
||||||
{
|
{
|
||||||
// return m_widget->isNextEnabled();
|
return true;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -100,10 +100,38 @@ TrackingViewStep::isAtEnd() const
|
|||||||
QList< Calamares::job_ptr >
|
QList< Calamares::job_ptr >
|
||||||
TrackingViewStep::jobs() const
|
TrackingViewStep::jobs() const
|
||||||
{
|
{
|
||||||
|
cDebug() << "Tracking jobs ..";
|
||||||
return QList< Calamares::job_ptr >();
|
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=" <<track.settingEnabled << "default=" << track.userEnabled;
|
||||||
|
|
||||||
|
return track.settingEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TrackingViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
TrackingViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
{
|
{
|
||||||
|
getTrackingEnabled( configurationMap, "install", m_installTracking );
|
||||||
|
getTrackingEnabled( configurationMap, "machine", m_machineTracking );
|
||||||
|
getTrackingEnabled( configurationMap, "user", m_userTracking );
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,12 @@
|
|||||||
|
|
||||||
class TrackingPage;
|
class TrackingPage;
|
||||||
|
|
||||||
|
struct TrackingEnabled
|
||||||
|
{
|
||||||
|
bool settingEnabled; // Enabled in config file
|
||||||
|
bool userEnabled; // User checked "yes"
|
||||||
|
};
|
||||||
|
|
||||||
class PLUGINDLLEXPORT TrackingViewStep : public Calamares::ViewStep
|
class PLUGINDLLEXPORT TrackingViewStep : public Calamares::ViewStep
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -56,6 +62,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
TrackingPage* m_widget;
|
TrackingPage* m_widget;
|
||||||
|
|
||||||
|
TrackingEnabled m_installTracking, m_machineTracking, m_userTracking;
|
||||||
};
|
};
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( TrackingViewStepFactory )
|
CALAMARES_PLUGIN_FACTORY_DECLARATION( TrackingViewStepFactory )
|
||||||
|
BIN
src/modules/tracking/binoculars.png
Normal file
BIN
src/modules/tracking/binoculars.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 430 B |
BIN
src/modules/tracking/machine.png
Normal file
BIN
src/modules/tracking/machine.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 505 B |
8
src/modules/tracking/page_trackingstep.qrc
Normal file
8
src/modules/tracking/page_trackingstep.qrc
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="tracking">
|
||||||
|
<file>machine.png</file>
|
||||||
|
<file>../../../data/images/information.svgz</file>
|
||||||
|
<file>binoculars.png</file>
|
||||||
|
<file>phone.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
@ -25,12 +25,58 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="installActionIcon">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="baseSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Explanation of install-tracking.</string>
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap resource="page_trackingstep.qrc">:/tracking/phone.png</pixmap>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="installExplanation">
|
||||||
|
<property name="text">
|
||||||
|
<string><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></string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="toolButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="page_trackingstep.qrc">
|
||||||
|
<normaloff>:/tracking/data/images/information.svgz</normaloff>:/tracking/data/images/information.svgz</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="arrowType">
|
||||||
|
<enum>Qt::NoArrow</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBox">
|
<widget class="QCheckBox" name="checkBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -52,12 +98,52 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="machineActionIcon">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="baseSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Explanation of machine-tracking.</string>
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap resource="page_trackingstep.qrc">:/tracking/machine.png</pixmap>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="machineExplanation">
|
||||||
|
<property name="text">
|
||||||
|
<string><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></string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="toolButton_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="page_trackingstep.qrc">
|
||||||
|
<normaloff>:/tracking/data/images/information.svgz</normaloff>:/tracking/data/images/information.svgz</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBox_2">
|
<widget class="QCheckBox" name="checkBox_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -79,12 +165,52 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="userActionIcon">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="baseSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Explanation of user-tracking.</string>
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap resource="page_trackingstep.qrc">:/tracking/binoculars.png</pixmap>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="userExplanation">
|
||||||
|
<property name="text">
|
||||||
|
<string><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></string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="toolButton_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="page_trackingstep.qrc">
|
||||||
|
<normaloff>:/tracking/data/images/information.svgz</normaloff>:/tracking/data/images/information.svgz</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBox_3">
|
<widget class="QCheckBox" name="checkBox_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -101,6 +227,8 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="page_trackingstep.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
BIN
src/modules/tracking/phone.png
Normal file
BIN
src/modules/tracking/phone.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 459 B |
Loading…
Reference in New Issue
Block a user