[chronojump] 0.8.10 better version management. Fixed m4 dir on make dist
- From: Xavier de Blas <xaviblas src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [chronojump] 0.8.10 better version management. Fixed m4 dir on make dist
- Date: Mon, 21 Sep 2009 18:20:18 +0000 (UTC)
commit b29a228e1a15a2db1f55e0a3b9f640665f9ab477
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Sep 21 20:19:45 2009 +0200
0.8.10 better version management. Fixed m4 dir on make dist
chronojump_server/ChronojumpServer.cs | 70 +++++++++++++++++++++-
chronojump_server/bin/chronojumpServer.dll | Bin 273920 -> 273920 bytes
chronojump_server/chronojumpServerCSharp.cs | 30 ++++++++-
configure.ac | 2 +-
src/AssemblyInfo.cs | 2 +-
src/gui/chronojump.cs | 3 +-
src/server.cs | 4 +-
src/util.cs | 23 -------
windows_zip_releases/chronojump-0.6.zip | Bin 2353857 -> 0 bytes
windows_zip_releases/chronojump-0.62.zip | Bin 2442689 -> 0 bytes
windows_zip_releases/chronojump_windows_0_47.zip | Bin 510210 -> 0 bytes
windows_zip_releases/chronojump_windows_0_48.zip | Bin 560762 -> 0 bytes
windows_zip_releases/chronojump_windows_0_5.zip | Bin 606981 -> 0 bytes
windows_zip_releases/chronojump_windows_0_51.zip | Bin 846989 -> 0 bytes
windows_zip_releases/chronojump_windows_0_52.zip | Bin 902760 -> 0 bytes
15 files changed, 100 insertions(+), 34 deletions(-)
---
diff --git a/chronojump_server/ChronojumpServer.cs b/chronojump_server/ChronojumpServer.cs
index ec2aa02..62acafa 100644
--- a/chronojump_server/ChronojumpServer.cs
+++ b/chronojump_server/ChronojumpServer.cs
@@ -28,6 +28,8 @@ public class ChronojumpServer : System.Web.Services.Protocols.SoapHttpClientProt
private System.Threading.SendOrPostCallback CanIOperationCompleted;
+ private System.Threading.SendOrPostCallback CanINewOperationCompleted;
+
private System.Threading.SendOrPostCallback QueryOperationCompleted;
private System.Threading.SendOrPostCallback StatsOperationCompleted;
@@ -82,6 +84,8 @@ public class ChronojumpServer : System.Web.Services.Protocols.SoapHttpClientProt
private event CanICompletedEventHandler CanICompleted;
+ private event CanINewCompletedEventHandler CanINewCompleted;
+
private event QueryCompletedEventHandler QueryCompleted;
private event StatsCompletedEventHandler StatsCompleted;
@@ -201,6 +205,48 @@ public class ChronojumpServer : System.Web.Services.Protocols.SoapHttpClientProt
/// <remarks>
///Check actions that client can do depending on it's version)
///</remarks>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://server.chronojump.org/CanINew", RequestNamespace="http://server.chronojump.org/", ResponseNamespace="http://server.chronojump.org/", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+ public bool CanINew(string action, string clientVersion) {
+ object[] results = this.Invoke("CanINew", new object[] {
+ action,
+ clientVersion});
+ return ((bool)(results[0]));
+ }
+
+ public System.IAsyncResult BeginCanINew(string action, string clientVersion, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("CanINew", new object[] {
+ action,
+ clientVersion}, callback, asyncState);
+ }
+
+ public bool EndCanINew(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((bool)(results[0]));
+ }
+
+ public void CanINewAsync(string action, string clientVersion) {
+ this.CanINewAsync(action, clientVersion, null);
+ }
+
+ public void CanINewAsync(string action, string clientVersion, object userState) {
+ if ((this.CanINewOperationCompleted == null)) {
+ this.CanINewOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCanINewCompleted);
+ }
+ this.InvokeAsync("CanINew", new object[] {
+ action,
+ clientVersion}, this.CanINewOperationCompleted, userState);
+ }
+
+ private void OnCanINewCompleted(object arg) {
+ if ((this.CanINewCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.CanINewCompleted(this, new CanINewCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
+ /// <remarks>
+///Check actions that client can do depending on it's version)
+///</remarks>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://server.chronojump.org/CanI", RequestNamespace="http://server.chronojump.org/", ResponseNamespace="http://server.chronojump.org/", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
public bool CanI(string action, double clientVersion) {
object[] results = this.Invoke("CanI", new object[] {
@@ -1189,11 +1235,11 @@ public class DisConnectDatabaseCompletedEventArgs : System.ComponentModel.AsyncC
public delegate void DisConnectDatabaseCompletedEventHandler(object sender, DisConnectDatabaseCompletedEventArgs args);
-public class CanICompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+public class CanINewCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
- internal CanICompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
+ internal CanINewCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
@@ -1206,7 +1252,7 @@ public class CanICompletedEventArgs : System.ComponentModel.AsyncCompletedEventA
}
}
-public delegate void CanICompletedEventHandler(object sender, CanICompletedEventArgs args);
+public delegate void CanINewCompletedEventHandler(object sender, CanINewCompletedEventArgs args);
public class QueryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
@@ -1224,6 +1270,24 @@ public class QueryCompletedEventArgs : System.ComponentModel.AsyncCompletedEvent
}
}
}
+public class CanICompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal CanICompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
+ base(exception, cancelled, userState) {
+ this.results = results;
+ }
+
+ public bool Result {
+ get {
+ this.RaiseExceptionIfNecessary();
+ return ((bool)(this.results[0]));
+ }
+ }
+}
+
+public delegate void CanICompletedEventHandler(object sender, CanICompletedEventArgs args);
public delegate void QueryCompletedEventHandler(object sender, QueryCompletedEventArgs args);
diff --git a/chronojump_server/bin/chronojumpServer.dll b/chronojump_server/bin/chronojumpServer.dll
index 2749295..8f34dc0 100755
Binary files a/chronojump_server/bin/chronojumpServer.dll and b/chronojump_server/bin/chronojumpServer.dll differ
diff --git a/chronojump_server/chronojumpServerCSharp.cs b/chronojump_server/chronojumpServerCSharp.cs
index e0eba05..4dcda38 100755
--- a/chronojump_server/chronojumpServerCSharp.cs
+++ b/chronojump_server/chronojumpServerCSharp.cs
@@ -60,13 +60,37 @@ public class ChronojumpServer {
}
[WebMethod(Description="Check actions that client can do depending on it's version)")]
+ public bool CanINew(string action, string clientVersion)
+ {
+ Version cv = new Version(clientVersion);
+ if(action == Constants.ServerActionUploadSession && cv >= new Version(0,8,9,6))
+ return true;
+ else if(action == Constants.ServerActionStats && cv >= new Version(0,8))
+ return true;
+ else if(action == Constants.ServerActionQuery && cv >= new Version(0,8,9,6))
+ return true;
+
+ return false;
+ }
+
+ [WebMethod(Description="Check actions that client can do depending on it's version)")]
public bool CanI(string action, double clientVersion)
{
- if(action == Constants.ServerActionUploadSession && clientVersion >= 0.896)
+ //comes something like 0.898
+ //ONLY used on 0.8.9.7, 0.8.9.8
+ Version cv;
+ if(clientVersion == 0.897)
+ cv = new Version(0,8,9,7);
+ else if(clientVersion == 0.898)
+ cv = new Version(0,8,9,8);
+ else
+ return false; //"for if the flyes"
+
+ if(action == Constants.ServerActionUploadSession && cv >= new Version(0,8,9,6))
return true;
- else if(action == Constants.ServerActionStats && clientVersion >= 0.8)
+ else if(action == Constants.ServerActionStats && cv >= new Version(0,8))
return true;
- else if(action == Constants.ServerActionQuery && clientVersion >= 0.896) //0.8.9.6
+ else if(action == Constants.ServerActionQuery && cv >= new Version(0,8,9,6))
return true;
return false;
diff --git a/configure.ac b/configure.ac
index 82ec143..d3b6c4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
dnl Warning: This is an automatically generated file, do not edit!
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.54])
-AC_INIT([chronojump], [0.8.9.8])
+AC_INIT([chronojump], [0.8.10])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_MACRO_DIR([m4])
diff --git a/src/AssemblyInfo.cs b/src/AssemblyInfo.cs
index b2a12e5..84d4da8 100755
--- a/src/AssemblyInfo.cs
+++ b/src/AssemblyInfo.cs
@@ -23,7 +23,7 @@ using System.Runtime.CompilerServices;
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
-[assembly: AssemblyVersion("0.8.9.8")]
+[assembly: AssemblyVersion("0.8.10")]
// The following attributes specify the key for the sign of your assembly. See the
// .NET Framework documentation for more information about signing.
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index a71bd27..aeb0eea 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -991,7 +991,8 @@ public class ChronoJumpWindow
private bool connectedAndCanI (string serverAction) {
string versionAvailable = Server.Ping(false, "", ""); //false: don't do insertion
if(versionAvailable != Constants.ServerOffline) { //false: don't do insertion
- if(Server.CanI(serverAction, Util.VersionToDouble(progVersion)))
+ //if(Server.CanI(serverAction, Util.VersionToDouble(progVersion)))
+ if(Server.CanI(serverAction, progVersion))
return true;
else
new DialogMessage(Constants.MessageTypes.WARNING,
diff --git a/src/server.cs b/src/server.cs
index b3472ee..53184fb 100644
--- a/src/server.cs
+++ b/src/server.cs
@@ -33,10 +33,10 @@ using System.Collections;
public class Server
{
- public static bool CanI(string action, double clientVersion) {
+ public static bool CanI(string action, string clientVersion) {
try {
ChronojumpServer myServer = new ChronojumpServer();
- return myServer.CanI(action, clientVersion);
+ return myServer.CanINew(action, clientVersion);
} catch {
return false;
}
diff --git a/src/util.cs b/src/util.cs
index 7da2c09..fddcd2e 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -28,29 +28,6 @@ using System.IO; //for detect OS
//this class tries to be a space for methods that are used in different classes
public class Util
{
-
- //TODO: this still doesn't work for knowing that:
- //0.8.1.10 is bigger than 0.8.1.9
- public static double VersionToDouble (string version)
- {
- //find first dec
- int firstDec = version.IndexOf('.');
- if(firstDec == -1) //no '.' found
- return Convert.ToDouble(version);
-
- bool shouldExit = false;
- do {
- int lastDec = version.LastIndexOf('.');
- if(lastDec == firstDec) //there's only a dec
- shouldExit = true;
- else
- version = version.Remove(lastDec,1);
- } while ( ! shouldExit);
-
- return Convert.ToDouble(ChangeDecimalSeparator(version));
- }
-
-
//all numbers are saved in database with '.' as decimal separator (method for numbers)
public static string ConvertToPoint (double myDouble)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]