StudioPlugin: Revamp splash screen

* "Learn More" links to Qt Privacy policy webpage
* Size changed
* Design adjusted
* The user now can choose between sending data and not sending data
* The screen closes after the user chooses one of the options using
  a button.

Task-number: QDS-6617
Change-Id: I8729f1bb6f9e7b74c6da8f1d62a4fc04456175c8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Thomas Hartmann
2022-04-11 14:28:43 +02:00
parent 0c1b5065c8
commit 803f299967
6 changed files with 204 additions and 256 deletions

View File

@@ -0,0 +1,108 @@
/****************************************************************************
**
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
/*
This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only.
It is supposed to be strictly declarative and only uses a subset of QML. If you edit
this file manually, you might introduce QML code that is not supported by Qt Design Studio.
Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files.
*/
import QtQuick 2.15
import QtQuick.Templates 2.15
import StudioFonts 1.0
Button {
id: control
implicitWidth: Math.max(
buttonBackground ? buttonBackground.implicitWidth : 0,
textItem.implicitWidth + leftPadding + rightPadding)
implicitHeight: Math.max(
buttonBackground ? buttonBackground.implicitHeight : 0,
textItem.implicitHeight + topPadding + bottomPadding)
leftPadding: 16
rightPadding: 16
text: "My Button"
font.family: StudioFonts.titilliumWeb_light
//property color accentColor: "#047eff"
property color accentColor: "#126491"
background: buttonBackground
Rectangle {
id: buttonBackground
color: "#00000000"
implicitWidth: 100
implicitHeight: 40
opacity: enabled ? 1 : 0.3
radius: 2
border.color: control.accentColor
}
contentItem: textItem
Text {
id: textItem
text: control.text
opacity: enabled ? 1.0 : 0.3
color: "#ffffff"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
states: [
State {
name: "normal"
when: !control.down
PropertyChanges {
target: buttonBackground
color: "#00000000"
border.color: control.accentColor
}
PropertyChanges {
target: textItem
color: "#ffffff"
}
},
State {
name: "down"
when: control.down
PropertyChanges {
target: textItem
color: "#ffffff"
}
PropertyChanges {
target: buttonBackground
color: control.accentColor
border.color: "#00000000"
}
}
]
}

View File

@@ -29,7 +29,7 @@ Rectangle {
id: splashBackground
width: 460
height: 480
color: "#11102d"
color: "transparent"
layer.enabled: true
layer.textureSize: Qt.size(width * 2, height * 2)
@@ -37,6 +37,7 @@ Rectangle {
Item {
id: composition
anchors.centerIn: parent
width: 460
height: 480
@@ -56,25 +57,4 @@ Rectangle {
}
}
}
Image {
id: highlight
x: -56
y: -19
width: 520
height: 506
fillMode: Image.PreserveAspectFit
source: "welcome_windows/highlight.png"
}
Image {
id: hand
x: 245
y: 227
width: 224
height: 264
visible: true
fillMode: Image.PreserveAspectFit
source: "welcome_windows/hand.png"
}
}

View File

@@ -32,8 +32,7 @@ import usagestatistics 1.0
Rectangle {
id: welcome_splash
width: 800
height: 480
anchors.fill: parent
gradient: Gradient {
orientation: Gradient.Horizontal
@@ -46,43 +45,27 @@ Rectangle {
signal closeClicked
signal configureClicked
property alias doNotShowAgain: doNotShowCheckBox.checked
property bool doNotShowAgain: true
property bool loadingPlugins: true
// called from C++
function onPluginInitialized(crashReportingEnabled: bool, crashReportingOn: bool)
{
loadingPlugins = false
if (crashReportingEnabled) {
var configureButton = "<a href='#' style='text-decoration:none;color:#ffff00'>"
+ qsTr("[Configure]") + "</a>";
var settingPath = Qt.platform.os === "osx"
? qsTr("Qt Creator > Preferences > Environment > System")
: qsTr("Tools > Options > Environment > System")
var strConfigure = qsTr("Qt Design Studio collects usage statistics and crash reports for the sole purpose of fixing bugs and improving the tool. "
+ "You can configure the crash reporter under %1. %2").arg(settingPath).arg(configureButton)
crash_reporting_text.text = strConfigure
crashReportCheckBox.visible = true
}
}
color: "#1d212a"
Image {
id: logo
x: 15
y: 11
width: 66
height: 50
anchors.top: parent.top
anchors.left: parent.left
anchors.margins: 10
width: 66 * 2
height: 50 * 2
smooth: true
source: "welcome_windows/logo.png"
}
Text {
id: qt_design_studio
x: 13
y: 81
width: 336
height: 46
id: qt_design_studio_text
anchors.top: logo.top
anchors.left: logo.right
anchors.leftMargin: 10
color: "#25709a"
text: qsTr("Qt Design Studio")
font.pixelSize: 36
@@ -90,260 +73,27 @@ Rectangle {
}
Text {
id: software_for_ui
x: 15
y: 126
width: 300
height: 30
color: "#ffffff"
text: qsTr("Software for UI and UX Designers")
renderType: Text.QtRendering
font.pixelSize: 15
id: qt_design_studio_version_text
anchors.left: qt_design_studio_text.right
anchors.baseline: qt_design_studio_text.baseline
anchors.leftMargin: 10
color: "#25709a"
text: usageStatisticModel.version
font.family: StudioFonts.titilliumWeb_light
font.pixelSize: 36
}
Text {
id: copyright
x: 15
y: 155
width: 270
height: 24
id: license_variant_text
anchors.left: qt_design_studio_text.left
anchors.top: qt_design_studio_text.bottom
anchors.leftMargin: 5
color: "#ffffff"
text: qsTr("Copyright 2008 - 2022 The Qt Company")
font.pixelSize: 14
font.family: StudioFonts.titilliumWeb_light
}
font.pixelSize: 20
Text {
id: all_rights_reserved
x: 15
y: 174
width: 250
height: 24
color: "#ffffff"
text: qsTr("All Rights Reserved")
font.pixelSize: 14
font.family: StudioFonts.titilliumWeb_light
}
Text {
id: marketing_1
x: 15
y: 206
width: 406
height: 31
color: "#ffffff"
text: qsTr("Multi-paradigm language for creating highly dynamic applications.")
wrapMode: Text.WordWrap
font.family: StudioFonts.titilliumWeb_light
font.pixelSize: 12
font.wordSpacing: 0
}
Text {
id: marketing_2
x: 15
y: 229
width: 341
height: 31
color: "#ffffff"
text: qsTr("Run your concepts and prototypes on your final hardware.")
wrapMode: Text.WordWrap
font.family: StudioFonts.titilliumWeb_light
font.pixelSize: 12
font.wordSpacing: 0
}
Text {
id: marketing_3
x: 15
y: 252
width: 336
height: 31
color: "#ffffff"
text: qsTr("Seamless integration between designer and developer.")
wrapMode: Text.WordWrap
font.family: StudioFonts.titilliumWeb_light
font.pixelSize: 12
font.wordSpacing: 0
}
Text {
id: crash_reporting_text
color: "#ffffff"
anchors.bottom: columnLayout.top
textFormat: Text.RichText
x: 15
y: 280
width: 311
wrapMode: Text.WordWrap
anchors.bottomMargin: 8
font.family: StudioFonts.titilliumWeb_light
font.pixelSize: 12
font.wordSpacing: 0
onLinkActivated: welcome_splash.configureClicked()
MouseArea { // show hand cursor on link hover
anchors.fill: parent
acceptedButtons: Qt.NoButton // don't eat clicks on the Text
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
Dof_Effect {
id: dof_Effect
x: 358
width: 442
height: 480
visible: true
maskBlurSamples: 64
maskBlurRadius: 32
Splash_Image25d {
id: animated_artwork
x: 358
y: 0
width: 442
height: 480
clip: true
}
}
Image {
id: close_window
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: 8
width: 13
height: 13
fillMode: Image.PreserveAspectFit
source: "welcome_windows/close.png"
opacity: area.containsMouse ? 1 : 0.8
MouseArea {
id: area
hoverEnabled: true
anchors.fill: parent
anchors.margins: -10
onClicked: welcome_splash.closeClicked()
}
}
ColumnLayout {
id: columnLayout
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.leftMargin: 16
anchors.bottomMargin: 10
spacing: 3
CheckBox {
id: usageStatisticCheckBox
text: qsTr("Enable Usage Statistics")
checked: usageStatisticModel.usageStatisticEnabled
padding: 0
spacing: 12
onCheckedChanged: usageStatisticModel.setTelemetryEnabled(usageStatisticCheckBox.checked)
contentItem: Text {
text: usageStatisticCheckBox.text
color: "#ffffff"
leftPadding: usageStatisticCheckBox.indicator.width + usageStatisticCheckBox.spacing
font.pixelSize: 12
}
}
CheckBox {
id: crashReportCheckBox
text: qsTr("Enable Crash Reports")
spacing: 12
checked: usageStatisticModel.crashReporterEnabled
visible: false
onCheckedChanged: {
usageStatisticModel.setCrashReporterEnabled(crashReportCheckBox.checked)
welcome_splash.onPluginInitialized(true, crashReportCheckBox.checked)
}
contentItem: Text {
color: "#ffffff"
text: crashReportCheckBox.text
leftPadding: crashReportCheckBox.indicator.width + crashReportCheckBox.spacing
font.pixelSize: 12
}
padding: 0
}
CheckBox {
id: doNotShowCheckBox
text: qsTr("Do not show this again")
padding: 0
spacing: 12
contentItem: Text {
text: doNotShowCheckBox.text
color: "#ffffff"
leftPadding: doNotShowCheckBox.indicator.width + doNotShowCheckBox.spacing
font.pixelSize: 12
}
}
}
RowLayout {
x: 16
y: 277
visible: welcome_splash.loadingPlugins
Text {
id: text1
color: "#ffffff"
text: qsTr("%")
font.pixelSize: 12
RotationAnimator {
target: text1
from: 0
to: 360
duration: 1800
running: true
loops: -1
}
}
Text {
id: loading_progress
color: "#ffffff"
text: qsTr("Loading Plugins")
font.family: StudioFonts.titilliumWeb_light
font.pixelSize: 16
}
Text {
id: text2
color: "#ffffff"
text: qsTr("%")
font.pixelSize: 12
RotationAnimator {
target: text2
from: 0
to: 360
duration: 2000
running: true
loops: -1
}
}
}
Text {
id: all_rights_reserved1
x: 15
y: 65
color: "#ffffff"
font.pixelSize: 13
font.family: StudioFonts.titilliumWeb_light
text: {
if (projectModel.communityVersion)
return qsTr("Community Edition")
@@ -360,4 +110,121 @@ Rectangle {
id: usageStatisticModel
}
}
Dof_Effect {
id: dof_effect
anchors.top: qt_design_studio_text.bottom
anchors.horizontalCenter: welcome_splash.horizontalCenter
width: 442
height: 480
maskBlurSamples: 64
maskBlurRadius: 32
Splash_Image25d {
id: animated_artwork
width: dof_effect.width
height: dof_effect.height
clip: true
}
}
Text {
id: help_us_text
anchors.left: welcome_splash.left
anchors.right: parent.right
anchors.leftMargin: 10
anchors.top: dof_effect.bottom
anchors.topMargin: 10
color: "#FFFFFF"
text: qsTr("Before we let you move on to your wonderful designs, help us make Qt Design Studio even better by letting us know how you're using it.")
font.family: StudioFonts.titilliumWeb_light
font.pixelSize: 18
wrapMode: Text.WordWrap
anchors.rightMargin: 10
}
ColumnLayout {
id: columnLayout
anchors.left: parent.left
anchors.top: help_us_text.bottom
anchors.leftMargin: 10
anchors.topMargin: 20
spacing: 3
CheckBox {
visible: false
id: usageStatisticCheckBox
text: qsTr("Send Usage Statistics")
checked: usageStatisticModel.usageStatisticEnabled
padding: 0
spacing: 12
onCheckedChanged: usageStatisticModel.setTelemetryEnabled(usageStatisticCheckBox.checked)
contentItem: Text {
text: usageStatisticCheckBox.text
color: "#ffffff"
leftPadding: usageStatisticCheckBox.indicator.width + usageStatisticCheckBox.spacing
font.pixelSize: 12
}
}
CheckBox {
visible: false
id: crashReportCheckBox
text: qsTr("Send Crash Reports")
spacing: 12
checked: usageStatisticModel.crashReporterEnabled
onCheckedChanged: {
usageStatisticModel.setCrashReporterEnabled(crashReportCheckBox.checked)
welcome_splash.onPluginInitialized(true, crashReportCheckBox.checked)
}
contentItem: Text {
color: "#ffffff"
text: crashReportCheckBox.text
leftPadding: crashReportCheckBox.indicator.width + crashReportCheckBox.spacing
font.pixelSize: 12
}
padding: 0
}
}
RowLayout {
anchors.right: parent.right
anchors.bottom: welcome_splash.bottom
anchors.rightMargin: 10
anchors.bottomMargin: 10
spacing: 20
CustomButton {
text: qsTr("Don't send")
onClicked: {
usageStatisticModel.setTelemetryEnabled(false)
usageStatisticModel.setCrashReporterEnabled(false)
welcome_splash.closeClicked()
}
}
CustomButton {
text: qsTr("Send analytics data")
onClicked: {
usageStatisticModel.setTelemetryEnabled(true)
usageStatisticModel.setCrashReporterEnabled(true)
welcome_splash.closeClicked()
}
}
}
CustomButton {
y: 430
text: qsTr("Learn More")
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.bottomMargin: 10
anchors.leftMargin: 10
onClicked: Qt.openUrlExternally("https://www.qt.io/terms-conditions/telemetry-privacy")
}
}

View File

@@ -27,8 +27,8 @@ import QtQuick 2.0
Item {
id: root
width: 800
height: 480
width: 720
height: 720
signal closeClicked
signal checkBoxToggled

View File

@@ -27,4 +27,5 @@ import QtQuick 2.0
QtObject {
property bool usageStatisticEnabled: false
property string version: "3.3.0"
}

View File

@@ -134,11 +134,13 @@ class UsageStatisticPluginModel : public QObject
Q_PROPERTY(bool usageStatisticEnabled MEMBER m_usageStatisticEnabled NOTIFY usageStatisticChanged)
Q_PROPERTY(bool crashReporterEnabled MEMBER m_crashReporterEnabled NOTIFY crashReporterEnabledChanged)
Q_PROPERTY(QString version MEMBER m_versionString CONSTANT)
public:
explicit UsageStatisticPluginModel(QObject *parent = nullptr)
: QObject(parent)
{
m_versionString = Core::Constants::IDE_VERSION_DISPLAY;
setupModel();
}
@@ -191,6 +193,7 @@ signals:
private:
bool m_usageStatisticEnabled = false;
bool m_crashReporterEnabled = false;
QString m_versionString;
};
class ProjectModel : public QAbstractListModel
@@ -620,17 +623,6 @@ bool StudioWelcomePlugin::delayedInitialize()
QTC_ASSERT(s_view->rootObject(), return true);
#ifdef ENABLE_CRASHPAD
const bool crashReportingEnabled = true;
const bool crashReportingOn = Core::ICore::settings()->value(CRASH_REPORTER_SETTING, false).toBool();
#else
const bool crashReportingEnabled = false;
const bool crashReportingOn = false;
#endif
QMetaObject::invokeMethod(s_view->rootObject(), "onPluginInitialized",
Q_ARG(bool, crashReportingEnabled), Q_ARG(bool, crashReportingOn));
return false;
}