statistics refresh

This commit is contained in:
sergey.vasiliev
2011-03-16 19:15:46 +03:00
parent cf225226e9
commit 57e38844c5
3 changed files with 9 additions and 7 deletions
@@ -30,6 +30,7 @@
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<selected value="true"/>
<text value="Allow to send usages statistics to JetBrains"/>
</properties>
</component>
@@ -18,6 +18,7 @@ package com.intellij.internal.statistic.persistence;
import com.intellij.internal.statistic.configurable.SendPeriod;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.components.ApplicationComponent;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.State;
@@ -40,7 +41,7 @@ import java.util.Set;
storages = {
@Storage(
id = "usages",
file = "$APP_CONFIG$/usages.statistics.xml"
file = "$APP_CONFIG$/usage.statistics.xml"
)}
)
public class UsageStatisticsPersistenceComponent extends BasicSentUsagesPersistenceComponent
@@ -65,6 +66,9 @@ public class UsageStatisticsPersistenceComponent extends BasicSentUsagesPersiste
}
public UsageStatisticsPersistenceComponent() {
if (ApplicationManagerEx.getApplicationEx().isInternal()) {
isShowNotification = false;
}
}
public void loadState(final Element element) {
@@ -93,7 +97,7 @@ public class UsageStatisticsPersistenceComponent extends BasicSentUsagesPersiste
final String isShowNotificationValue = element.getAttributeValue(SHOW_NOTIFICATION_ATTR);
setShowNotification(StringUtil.isEmptyOrSpaces(isShowNotificationValue) ? true : Boolean.parseBoolean(isShowNotificationValue));
setPeriod(parsePeriod(element.getAttributeValue(SHOW_NOTIFICATION_ATTR)));
setPeriod(parsePeriod(element.getAttributeValue(PERIOD_ATTR)));
}
public Element getState() {
@@ -30,11 +30,8 @@ public class StatisticsNotificationManager {
private static String getText() {
return
"<html>Please click <a href='allow'>Agree</a> if you want to help make "+ ApplicationNamesInfo.getInstance().getFullProductName() +
" better or <a href='decline'>Don't agree</a> otherwise." +
"<br/>" +
"You can customize settings on <a href='settings'>IDE Settings -> Usage Statistics</a> pane" +
"</html>";
"<html>Please click <a href='allow'>I agree</a> if you want to help make "+ ApplicationNamesInfo.getInstance().getFullProductName() +
" better or <a href='decline'>I don't agree</a> otherwise. <a href='settings'>more...</a></html>";
}
private static String getTitle() {