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

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

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

2
src/Main/GlobalAssemblyInfo.template

@ -33,4 +33,6 @@ internal static class RevisionClass
public const string MainVersion = Major + "." + Minor; public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; 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
{ {
public class SplashScreenForm : Form public class SplashScreenForm : Form
{ {
public const string VersionText = "Mirador (4.0) build " + RevisionClass.Revision;
static SplashScreenForm splashScreen; static SplashScreenForm splashScreen;
static List<string> requestedFileList = new List<string>(); static List<string> requestedFileList = new List<string>();
static List<string> parameterList = new List<string>(); static List<string> parameterList = new List<string>();
@ -32,20 +30,23 @@ namespace ICSharpCode.SharpDevelop
public SplashScreenForm() public SplashScreenForm()
{ {
const string versionText = "SharpDevelop"
+ (RevisionClass.BranchName != null ? "-" + RevisionClass.BranchName : "")
+ " " + RevisionClass.FullVersion
#if DEBUG
+ " (debug)"
#endif
;
FormBorderStyle = FormBorderStyle.None; FormBorderStyle = FormBorderStyle.None;
StartPosition = FormStartPosition.CenterScreen; StartPosition = FormStartPosition.CenterScreen;
ShowInTaskbar = false; ShowInTaskbar = false;
#if DEBUG
string versionText = VersionText + " (debug)";
#else
string versionText = VersionText;
#endif
// Stream must be kept open for the lifetime of the bitmap // Stream must be kept open for the lifetime of the bitmap
bitmap = new Bitmap(typeof(SplashScreenForm).Assembly.GetManifestResourceStream("Resources.SplashScreen.jpg")); bitmap = new Bitmap(typeof(SplashScreenForm).Assembly.GetManifestResourceStream("Resources.SplashScreen.jpg"));
this.ClientSize = bitmap.Size; this.ClientSize = bitmap.Size;
using (Font font = new Font("Sans Serif", 4)) { using (Font font = new Font("Sans Serif", 4)) {
using (Graphics g = Graphics.FromImage(bitmap)) { 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; BackgroundImage = bitmap;

Loading…
Cancel
Save