summaryrefslogtreecommitdiffstats
path: root/application/pages/global
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-11-24 04:10:07 +0100
committerPetr Mrázek <peterix@gmail.com>2016-11-24 04:10:07 +0100
commit121e2fd46ca109e6aadef0924f8ef9fcd1931bc3 (patch)
treebe7e17ddbc72c58f471b7dd10a0729a140c50119 /application/pages/global
parent295c6e808ab15c8f10326d375c7c4cdd80531e5f (diff)
downloadMultiMC-121e2fd46ca109e6aadef0924f8ef9fcd1931bc3.tar
MultiMC-121e2fd46ca109e6aadef0924f8ef9fcd1931bc3.tar.gz
MultiMC-121e2fd46ca109e6aadef0924f8ef9fcd1931bc3.tar.lz
MultiMC-121e2fd46ca109e6aadef0924f8ef9fcd1931bc3.tar.xz
MultiMC-121e2fd46ca109e6aadef0924f8ef9fcd1931bc3.zip
NOISSUE add analytics settings (enable/disable)
Diffstat (limited to 'application/pages/global')
-rw-r--r--application/pages/global/MultiMCPage.cpp17
-rw-r--r--application/pages/global/MultiMCPage.ui70
2 files changed, 85 insertions, 2 deletions
diff --git a/application/pages/global/MultiMCPage.cpp b/application/pages/global/MultiMCPage.cpp
index 03b0c1be..11129d86 100644
--- a/application/pages/global/MultiMCPage.cpp
+++ b/application/pages/global/MultiMCPage.cpp
@@ -75,6 +75,11 @@ MultiMCPage::MultiMCPage(QWidget *parent) : QWidget(parent), ui(new Ui::MultiMCP
{
ui->updateSettingsBox->setHidden(true);
}
+ // Analytics
+ if(BuildConfig.ANALYTICS_ID.isEmpty())
+ {
+ ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->analyticsTab));
+ }
connect(ui->fontSizeBox, SIGNAL(valueChanged(int)), SLOT(refreshFontPreview()));
connect(ui->consoleFont, SIGNAL(currentFontChanged(QFont)), SLOT(refreshFontPreview()));
}
@@ -346,6 +351,12 @@ void MultiMCPage::applySettings()
s->set("InstSortMode", "Name");
break;
}
+
+ // Analytics
+ if(!BuildConfig.ANALYTICS_ID.isEmpty())
+ {
+ s->set("Analytics", ui->analyticsCheck->isChecked());
+ }
}
void MultiMCPage::loadSettings()
{
@@ -467,6 +478,12 @@ void MultiMCPage::loadSettings()
{
ui->sortByNameBtn->setChecked(true);
}
+
+ // Analytics
+ if(!BuildConfig.ANALYTICS_ID.isEmpty())
+ {
+ ui->analyticsCheck->setChecked(s->get("Analytics").toBool());
+ }
}
void MultiMCPage::refreshFontPreview()
diff --git a/application/pages/global/MultiMCPage.ui b/application/pages/global/MultiMCPage.ui
index 5336afdb..f9d74a38 100644
--- a/application/pages/global/MultiMCPage.ui
+++ b/application/pages/global/MultiMCPage.ui
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>487</width>
+ <width>458</width>
<height>614</height>
</rect>
</property>
@@ -31,6 +31,9 @@
</property>
<item>
<widget class="QTabWidget" name="tabWidget">
+ <property name="toolTip">
+ <string notr="true"/>
+ </property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
@@ -431,7 +434,7 @@
</item>
</layout>
</widget>
- <widget class="QWidget" name="tab">
+ <widget class="QWidget" name="consoleTab">
<attribute name="title">
<string>Console</string>
</attribute>
@@ -566,6 +569,69 @@
</item>
</layout>
</widget>
+ <widget class="QWidget" name="analyticsTab">
+ <attribute name="title">
+ <string>Analytics</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_8">
+ <item>
+ <widget class="QGroupBox" name="consoleSettingsBox_2">
+ <property name="title">
+ <string>Analytics Settings</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QCheckBox" name="analyticsCheck">
+ <property name="text">
+ <string>Send anonymous usage statistics?</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;
+&lt;body&gt;
+&lt;p&gt;MultiMC sends anonymous usage statistics on every start of the application.&lt;/p&gt;&lt;p&gt;The following data is collected:&lt;/p&gt;
+&lt;ul&gt;
+&lt;li&gt;MultiMC version.&lt;/li&gt;
+&lt;li&gt;Operating system name, version and architecture.&lt;/li&gt;
+&lt;li&gt;CPU architecture (kernel architecture on linux).&lt;/li&gt;
+&lt;li&gt;Size of system memory.&lt;/li&gt;
+&lt;li&gt;Java version, architecture and memory settings.&lt;/li&gt;
+&lt;/ul&gt;
+&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
</widget>
</item>
</layout>