summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2022-01-13 19:46:28 +0100
committerThomas Hartmann <thomas.hartmann@qt.io>2022-01-14 12:29:48 +0000
commit17deadf5c378bd1c78fb5876fb4d5aa148f3f751 (patch)
tree9f9895cd887a5e5aaaceb1afba33a8ddfac9d49e
parentcbcdf4c2f24610b82a2b2b36e1bedef2e09b964a (diff)
downloadqt-creator-17deadf5c378bd1c78fb5876fb4d5aa148f3f751.tar.gz
StudioWelcome: Show combobox for crash reporter
This highlights to the user if the crash reporter is enabled. The patch also includes some adjustments for the design. Change-Id: I1a0be0d2b98df937dbeeb6bf8063f1aaa78793f5 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
-rw-r--r--src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml132
-rw-r--r--src/plugins/studiowelcome/studiowelcomeplugin.cpp27
2 files changed, 106 insertions, 53 deletions
diff --git a/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml b/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml
index e7ef726611..412ceb7733 100644
--- a/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml
+++ b/src/plugins/studiowelcome/qml/splashscreen/Welcome_splash.qml
@@ -38,8 +38,8 @@ Rectangle {
gradient: Gradient {
orientation: Gradient.Horizontal
- GradientStop { position: 0.0; color: "#333d56" }
- GradientStop { position: 1.0; color: "#000728" }
+ GradientStop { position: 0.0; color: "#1d212a" }
+ GradientStop { position: 1.0; color: "#232c56" }
}
signal goNext
@@ -56,33 +56,36 @@ Rectangle {
if (crashReportingEnabled) {
var configureButton = "<a href='#' style='text-decoration:none;color:#ffff00'>"
- + qsTr("[Configure]") + "</a>";
+ + qsTr("[Configure]") + "</a>";
var settingPath = Qt.platform.os === "osx"
- ? qsTr("Qt Creator > Preferences > Environment > System")
- : qsTr("Tools > Options > Environment > System")
+ ? qsTr("Qt Creator > Preferences > Environment > System")
+ : qsTr("Tools > Options > Environment > System")
var strOn = qsTr("Qt Design Studio collects crash reports for the sole purpose of fixing bugs. "
- + "You can disable this feature under %1. %2").arg(settingPath).arg(configureButton)
- var strOff = qsTr("Qt Design Studio can collect crash reports for the sole purpose of fixing bugs. "
- + "You can enable this feature under %1. %2").arg(settingPath).arg(configureButton)
+ + "You can disable this feature under %1. %2").arg(settingPath).arg(configureButton)
+ var strOff = qsTr("Qt Design Studio can collect crash reports for the sole purpose of fixing bugs. "
+ + "You can enable this feature under %1. %2").arg(settingPath).arg(configureButton)
crash_reporting_text.text = crashReportingOn ? strOn : strOff;
+ crashReportCheckBox.visible = true
}
}
Image {
id: logo
- x: 16
- y: 16
+ x: 15
+ y: 11
+ width: 66
+ height: 50
source: "welcome_windows/logo.png"
}
Text {
id: qt_design_studio
- x: 16
- y: 93
- width: 250
- height: 55
- color: "#4cd265"
+ x: 13
+ y: 81
+ width: 336
+ height: 46
+ color: "#25709a"
text: qsTr("Qt Design Studio")
font.pixelSize: 36
font.family: StudioFonts.titilliumWeb_light
@@ -90,46 +93,46 @@ Rectangle {
Text {
id: software_for_ui
- x: 16
- y: 141
- width: 250
+ x: 15
+ y: 124
+ width: 300
height: 30
color: "#ffffff"
text: qsTr("Software for UI and UX Designers")
renderType: Text.QtRendering
- font.pixelSize: 18
+ font.pixelSize: 15
font.family: StudioFonts.titilliumWeb_light
}
Text {
id: copyright
- x: 16
- y: 183
+ x: 15
+ y: 155
width: 270
height: 24
color: "#ffffff"
- text: qsTr("Copyright 2008 - 2021 The Qt Company")
- font.pixelSize: 16
+ text: qsTr("Copyright 2008 - 2022 The Qt Company")
+ font.pixelSize: 14
font.family: StudioFonts.titilliumWeb_light
}
Text {
id: all_rights_reserved
- x: 16
- y: 207
+ x: 15
+ y: 174
width: 250
height: 24
color: "#ffffff"
text: qsTr("All Rights Reserved")
- font.pixelSize: 16
+ font.pixelSize: 14
font.family: StudioFonts.titilliumWeb_light
}
Text {
id: marketing_1
- x: 16
- y: 252
- width: 355
+ x: 15
+ y: 206
+ width: 406
height: 31
color: "#ffffff"
text: qsTr("Multi-paradigm language for creating highly dynamic applications.")
@@ -141,9 +144,9 @@ Rectangle {
Text {
id: marketing_2
- x: 16
- y: 273
- width: 311
+ x: 15
+ y: 229
+ width: 341
height: 31
color: "#ffffff"
text: qsTr("Run your concepts and prototypes on your final hardware.")
@@ -155,9 +158,9 @@ Rectangle {
Text {
id: marketing_3
- x: 16
- y: 294
- width: 311
+ x: 15
+ y: 252
+ width: 336
height: 31
color: "#ffffff"
text: qsTr("Seamless integration between designer and developer.")
@@ -171,8 +174,8 @@ Rectangle {
id: crash_reporting_text
color: "#ffffff"
textFormat: Text.RichText
- x: 16
- y: 330
+ x: 15
+ y: 280
width: 311
wrapMode: Text.WordWrap
font.family: StudioFonts.titilliumWeb_light
@@ -229,41 +232,66 @@ Rectangle {
ColumnLayout {
anchors.left: parent.left
anchors.bottom: parent.bottom
- anchors.margins: 16
+ anchors.leftMargin: 16
+ anchors.bottomMargin: 10
+ spacing: 3
CheckBox {
- id: doNotShowCheckBox
- text: qsTr("Do not show this again")
+ id: usageStatisticCheckBox
+ text: qsTr("Enable Usage Statistics")
+ checked: usageStatisticModel.usageStatisticEnabled
padding: 0
spacing: 12
+ onCheckedChanged: usageStatisticModel.setTelemetryEnabled(usageStatisticCheckBox.checked)
+
contentItem: Text {
- text: doNotShowCheckBox.text
+ text: usageStatisticCheckBox.text
color: "#ffffff"
- leftPadding: doNotShowCheckBox.indicator.width + doNotShowCheckBox.spacing
+ leftPadding: usageStatisticCheckBox.indicator.width + usageStatisticCheckBox.spacing
+ font.pixelSize: 12
}
}
CheckBox {
- id: usageStatisticCheckBox
- text: qsTr("Enable Usage Statistics")
- checked: usageStatisticModel.usageStatisticEnabled
- padding: 0
+ id: crashReportCheckBox
+ text: qsTr("Enable Crash Reports")
spacing: 12
+ checked: usageStatisticModel.crashReporterEnabled
+ visible: false
- onCheckedChanged: usageStatisticModel.setTelemetryEnabled(usageStatisticCheckBox.checked)
+ onCheckedChanged: {
+ usageStatisticModel.setCrashReporterEnabled(crashReportCheckBox.checked)
+ welcome_splash.onPluginInitialized(true, crashReportCheckBox.checked)
+ }
contentItem: Text {
- text: usageStatisticCheckBox.text
color: "#ffffff"
- leftPadding: usageStatisticCheckBox.indicator.width + usageStatisticCheckBox.spacing
+ 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: 330
+ y: 277
visible: welcome_splash.loadingPlugins
Text {
@@ -309,8 +337,8 @@ Rectangle {
Text {
id: all_rights_reserved1
- x: 16
- y: 75
+ x: 15
+ y: 65
color: "#ffffff"
text: qsTr("Community Edition")
font.pixelSize: 13
diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp
index bead95e667..d88dbf5072 100644
--- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp
+++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp
@@ -88,6 +88,7 @@ const char DO_NOT_SHOW_SPLASHSCREEN_AGAIN_KEY[] = "StudioSplashScreen";
const char DETAILED_USAGE_STATISTICS[] = "DetailedUsageStatistics";
const char STATISTICS_COLLECTION_MODE[] = "StatisticsCollectionMode";
const char NO_TELEMETRY[] = "NoTelemetry";
+const char CRASH_REPORTER_SETTING[] = "CrashReportingEnabled";
QPointer<QQuickWidget> s_view = nullptr;
static StudioWelcomePlugin *s_pluginInstance = nullptr;
@@ -122,6 +123,8 @@ class UsageStatisticPluginModel : public QObject
Q_OBJECT
Q_PROPERTY(bool usageStatisticEnabled MEMBER m_usageStatisticEnabled NOTIFY usageStatisticChanged)
+ Q_PROPERTY(bool crashReporterEnabled MEMBER m_crashReporterEnabled NOTIFY crashReporterEnabledChanged)
+
public:
explicit UsageStatisticPluginModel(QObject *parent = nullptr)
: QObject(parent)
@@ -135,7 +138,27 @@ public:
QVariant value = settings->value(STATISTICS_COLLECTION_MODE);
m_usageStatisticEnabled = value.isValid() && value.toString() == DETAILED_USAGE_STATISTICS;
+ m_crashReporterEnabled = Core::ICore::settings()->value(CRASH_REPORTER_SETTING, false).toBool();
+
emit usageStatisticChanged();
+ emit crashReporterEnabledChanged();
+ }
+
+ Q_INVOKABLE void setCrashReporterEnabled(bool b)
+ {
+ if (m_crashReporterEnabled == b)
+ return;
+
+ Core::ICore::settings()->setValue(CRASH_REPORTER_SETTING, b);
+
+ s_pluginInstance->pauseRemoveSplashTimer();
+
+ const QString restartText = tr("The change will take effect after restart.");
+ Core::RestartDialog restartDialog(Core::ICore::dialogParent(), restartText);
+ restartDialog.exec();
+
+ s_pluginInstance->resumeRemoveSplashTimer();
+ setupModel();
}
Q_INVOKABLE void setTelemetryEnabled(bool b)
@@ -160,9 +183,11 @@ public:
signals:
void usageStatisticChanged();
+ void crashReporterEnabledChanged();
private:
bool m_usageStatisticEnabled = false;
+ bool m_crashReporterEnabled = false;
};
class ProjectModel : public QAbstractListModel
@@ -564,7 +589,7 @@ bool StudioWelcomePlugin::delayedInitialize()
#ifdef ENABLE_CRASHPAD
const bool crashReportingEnabled = true;
- const bool crashReportingOn = Core::ICore::settings()->value("CrashReportingEnabled", false).toBool();
+ const bool crashReportingOn = Core::ICore::settings()->value(CRASH_REPORTER_SETTING, false).toBool();
#else
const bool crashReportingEnabled = false;
const bool crashReportingOn = false;