Browse Source

UDC: Upload name of feature branch

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5888 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 15 years ago
parent
commit
6378f749d5
  1. 10
      src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/AnalyticsMonitor.cs
  2. 10
      src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataUploader.cs
  3. 2
      src/Main/GlobalAssemblyInfo.template
  4. 17
      src/Main/StartUp/Project/Dialogs/SplashScreen.cs

10
src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/AnalyticsMonitor.cs

@ -25,6 +25,7 @@ namespace ICSharpCode.UsageDataCollector @@ -25,6 +25,7 @@ namespace ICSharpCode.UsageDataCollector
public sealed class AnalyticsMonitor : IAnalyticsMonitor
{
const string UploadUrl = "http://usagedatacollector.sharpdevelop.net/upload/UploadUsageData.svc";
const string ProductName = "sharpdevelop";
public static readonly Uri PrivacyStatementUrl = new Uri("http://www.icsharpcode.net/OpenSource/SD/UsageDataCollector/");
public static readonly AnalyticsMonitor Instance = new AnalyticsMonitor();
@ -110,7 +111,7 @@ namespace ICSharpCode.UsageDataCollector @@ -110,7 +111,7 @@ namespace ICSharpCode.UsageDataCollector
}
}
if (sessionOpened) {
UsageDataUploader uploader = new UsageDataUploader(dbFileName);
UsageDataUploader uploader = new UsageDataUploader(dbFileName, ProductName);
uploader.EnvironmentDataForDummySession = appEnvironmentProperties;
ThreadPool.QueueUserWorkItem(delegate { uploader.StartUpload(UploadUrl); });
}
@ -131,6 +132,11 @@ namespace ICSharpCode.UsageDataCollector @@ -131,6 +132,11 @@ namespace ICSharpCode.UsageDataCollector
if (!string.IsNullOrEmpty(PROCESSOR_ARCHITECTURE)) {
properties.Add(new UsageDataEnvironmentProperty { Name = "architecture", Value = PROCESSOR_ARCHITECTURE });
}
#pragma warning disable 0162
if (RevisionClass.BranchName != null) {
properties.Add(new UsageDataEnvironmentProperty { Name = "branch", Value = RevisionClass.BranchName });
}
#pragma warning restore 0162
#if DEBUG
properties.Add(new UsageDataEnvironmentProperty { Name = "debug", Value = "true" });
#endif
@ -148,7 +154,7 @@ namespace ICSharpCode.UsageDataCollector @@ -148,7 +154,7 @@ namespace ICSharpCode.UsageDataCollector
if (session != null)
session.Flush();
}
UsageDataUploader uploader = new UsageDataUploader(dbFileName);
UsageDataUploader uploader = new UsageDataUploader(dbFileName, ProductName);
return uploader.GetTextForStoredData();
}

10
src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataUploader.cs

@ -28,13 +28,19 @@ namespace ICSharpCode.UsageDataCollector @@ -28,13 +28,19 @@ namespace ICSharpCode.UsageDataCollector
public class UsageDataUploader
{
string databaseFileName;
string productName;
/// <summary>
/// Creates a new UsageDataUploader.
/// </summary>
public UsageDataUploader(string databaseFileName)
public UsageDataUploader(string databaseFileName, string productName)
{
if (databaseFileName == null)
throw new ArgumentNullException("databaseFileName");
if (productName == null)
throw new ArgumentNullException("productName");
this.databaseFileName = databaseFileName;
this.productName = productName;
}
/// <summary>
@ -140,7 +146,7 @@ namespace ICSharpCode.UsageDataCollector @@ -140,7 +146,7 @@ namespace ICSharpCode.UsageDataCollector
UdcProxy.UDCUploadServiceClient client = new UdcProxy.UDCUploadServiceClient(binding, endpoint);
try {
client.BeginUploadUsageData("sharpdevelop", new MemoryStream(data),
client.BeginUploadUsageData(productName, new MemoryStream(data),
ar => UsageDataUploaded(ar, client, commaSeparatedSessionIDList), null);
} catch (CommunicationException) {
// ignore error (maybe currently not connected to network)

2
src/Main/GlobalAssemblyInfo.template

@ -33,4 +33,6 @@ internal static class RevisionClass @@ -33,4 +33,6 @@ internal static class RevisionClass
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
public const string BranchName = null;
}

17
src/Main/StartUp/Project/Dialogs/SplashScreen.cs

@ -14,8 +14,6 @@ namespace ICSharpCode.SharpDevelop @@ -14,8 +14,6 @@ namespace ICSharpCode.SharpDevelop
{
public class SplashScreenForm : Form
{
public const string VersionText = "Mirador (4.0) build " + RevisionClass.Revision;
static SplashScreenForm splashScreen;
static List<string> requestedFileList = new List<string>();
static List<string> parameterList = new List<string>();
@ -32,20 +30,23 @@ namespace ICSharpCode.SharpDevelop @@ -32,20 +30,23 @@ namespace ICSharpCode.SharpDevelop
public SplashScreenForm()
{
const string versionText = "SharpDevelop"
+ (RevisionClass.BranchName != null ? "-" + RevisionClass.BranchName : "")
+ " " + RevisionClass.FullVersion
#if DEBUG
+ " (debug)"
#endif
;
FormBorderStyle = FormBorderStyle.None;
StartPosition = FormStartPosition.CenterScreen;
ShowInTaskbar = false;
#if DEBUG
string versionText = VersionText + " (debug)";
#else
string versionText = VersionText;
#endif
// Stream must be kept open for the lifetime of the bitmap
bitmap = new Bitmap(typeof(SplashScreenForm).Assembly.GetManifestResourceStream("Resources.SplashScreen.jpg"));
this.ClientSize = bitmap.Size;
using (Font font = new Font("Sans Serif", 4)) {
using (Graphics g = Graphics.FromImage(bitmap)) {
g.DrawString(versionText, font, Brushes.Black, 100, 142);
g.DrawString(versionText, font, Brushes.Black, 166 - 3 * versionText.Length, 142);
}
}
BackgroundImage = bitmap;

Loading…
Cancel
Save