[chronojump] Fixed Chronojump_mini compilation



commit e9029cd259216dc1a55bbc7c32b771533fcb8125
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Apr 12 15:31:20 2013 +0200

    Fixed Chronojump_mini compilation

 chronojump_server/Makefile.am |    1 +
 rdotnet/Makefile              |   20 +++++-----
 src/Makefile.am               |    4 +-
 src/chronojump.cs             |    8 ++--
 src/chronojump_mini.cs        |   12 +++---
 src/encoder.cs                |    2 +-
 src/exportSession.cs          |    2 +-
 src/gui/chronojump.cs         |    8 ++--
 src/gui/chronopic.cs          |    2 +-
 src/gui/eventExecute.cs       |    2 +-
 src/gui/helpPorts.cs          |    6 +-
 src/gui/language.cs           |    4 +-
 src/gui/preferences.cs        |    6 +-
 src/server.cs                 |    4 +-
 src/sqlite/main.cs            |    6 +-
 src/sqlite/preferences.cs     |    2 +-
 src/stats/main.cs             |    2 +-
 src/util.cs                   |   84 +++++------------------------------------
 src/utilDate.cs               |   18 ++++----
 19 files changed, 65 insertions(+), 128 deletions(-)
---
diff --git a/chronojump_server/Makefile.am b/chronojump_server/Makefile.am
index 6574d3a..6fe8324 100644
--- a/chronojump_server/Makefile.am
+++ b/chronojump_server/Makefile.am
@@ -23,6 +23,7 @@ FILES = \
        BCrypt.cs\
        ../src/sqlite/*.cs\
        ../src/util.cs\
+       ../src/utilAll.cs\
        ../src/utilDate.cs\
        ../src/encoder.cs\
        ../src/event.cs\
diff --git a/rdotnet/Makefile b/rdotnet/Makefile
index 3ad6652..5fba62a 100644
--- a/rdotnet/Makefile
+++ b/rdotnet/Makefile
@@ -49,8 +49,8 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-build_triplet = i686-pc-linux-gnu
-host_triplet = i686-pc-linux-gnu
+build_triplet = x86_64-unknown-linux-gnu
+host_triplet = x86_64-unknown-linux-gnu
 subdir = rdotnet
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -110,7 +110,7 @@ AUTOMAKE = ${SHELL} /home/xavier/informatica/progs_meus/chronojump/chronojump/mi
 AWK = gawk
 CC = gcc
 CCDEPMODE = depmode=gcc3
-CESARPLAYER_CFLAGS = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/i386-linux-gnu/gtk-2.0/include 
-I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 
-I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include 
-I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gstreamer-0.10 
-I/usr/include/libxml2  
+CESARPLAYER_CFLAGS = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include 
-I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 
-I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include 
-I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gstreamer-0.10 
-I/usr/include/libxml2  
 CESARPLAYER_LIBS = -pthread -lgtk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig -lgdk-x11-2.0 
-lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lcairo -lgio-2.0 -lgstaudio-0.10 -lgstvideo-0.10 
-lgstpbutils-0.10 -lgstinterfaces-0.10 -lgstapp-0.10 -lgstbase-0.10 -lgsttag-0.10 -lgstreamer-0.10 
-lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lxml2 -lglib-2.0  
 CFLAGS = -g -O2
 CPP = gcc -E
@@ -139,7 +139,7 @@ INSTALL_DATA = ${INSTALL} -m 644
 INSTALL_PROGRAM = ${INSTALL}
 INSTALL_SCRIPT = ${INSTALL}
 INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
-LD = /usr/bin/ld
+LD = /usr/bin/ld -m elf_x86_64
 LDFLAGS = 
 LIBOBJS = 
 LIBS = 
@@ -197,11 +197,11 @@ am__quote =
 am__tar = $${TAR-tar} chof - "$$tardir"
 am__untar = $${TAR-tar} xf -
 bindir = ${exec_prefix}/bin
-build = i686-pc-linux-gnu
+build = x86_64-unknown-linux-gnu
 build_alias = 
-build_cpu = i686
+build_cpu = x86_64
 build_os = linux-gnu
-build_vendor = pc
+build_vendor = unknown
 builddir = .
 datadir = ${datarootdir}
 datarootdir = ${prefix}/share
@@ -211,11 +211,11 @@ exec_prefix = /usr/local
 expanded_bindir = /usr/local/bin
 expanded_datadir = /usr/local/share
 expanded_libdir = /usr/local/lib
-host = i686-pc-linux-gnu
+host = x86_64-unknown-linux-gnu
 host_alias = 
-host_cpu = i686
+host_cpu = x86_64
 host_os = linux-gnu
-host_vendor = pc
+host_vendor = unknown
 htmldir = ${docdir}
 includedir = ${prefix}/include
 infodir = ${datarootdir}/info
diff --git a/src/Makefile.am b/src/Makefile.am
index 7089b57..4ebb1e6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -195,6 +195,7 @@ FILES = \
        treeViewReactionTime.cs\
        treeViewMultiChronopic.cs\
        util.cs\
+       utilAll.cs\
        utilDate.cs\
        utilGtk.cs\
        constants.cs\
@@ -214,8 +215,7 @@ FILES = \
 CHRONOJUMP_MINI_FILES=\
        chronojump_mini.cs\
        chronopic.cs\
-       encoder.cs\
-       util.cs\
+       utilAll.cs\
        utilDate.cs\
        log.cs\
        constants.cs
diff --git a/src/chronojump.cs b/src/chronojump.cs
index dbe9e38..c725874 100644
--- a/src/chronojump.cs
+++ b/src/chronojump.cs
@@ -71,7 +71,7 @@ public class ChronoJump
 */
 
                baseDirectory = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory,"../../");
-               if(Util.IsWindows())
+               if(UtilAll.IsWindows())
                        
Environment.SetEnvironmentVariable("GST_PLUGIN_PATH",RelativeToPrefix("lib\\gstreamer-0.10"));
 
                //this call has to be done to chronojump.prg
@@ -355,7 +355,7 @@ Log.WriteLine("doing backup");
                allSQLCallsDoneOnSqliteThingsThread = true;
                Log.WriteLine("all SQL calls done on sqliteThings thread");
                
-               Util.IsWindows();       //only as additional info here
+               UtilAll.IsWindows();    //only as additional info here
                
                //Application.Init();
                
@@ -568,7 +568,7 @@ Console.WriteLine("--6--");
                        
                string crashLogFile = Log.GetLast().Replace(".txt", "-crash.txt");
                //on vista there's no crash file because redirection is forbidden
-               if(Util.IsWindows() && File.Exists(crashLogFile)) 
+               if(UtilAll.IsWindows() && File.Exists(crashLogFile)) 
                        windowsTextLog = "\n" + crashLogFile;
                        */
 
@@ -674,7 +674,7 @@ Console.WriteLine("--6--");
                        pid = pid.TrimEnd(new char[1] {'\n'});
                        
                        string searchName = "mono";
-                       if(Util.IsWindows())
+                       if(UtilAll.IsWindows())
                                searchName = "Chronojump";
                                                
                        Process [] pids = Process.GetProcessesByName(searchName);
diff --git a/src/chronojump_mini.cs b/src/chronojump_mini.cs
index 11da485..7a0e04c 100644
--- a/src/chronojump_mini.cs
+++ b/src/chronojump_mini.cs
@@ -69,7 +69,7 @@ class ChronoJumpMini {
                Catalog.Init ("chronojump", "./locale");
 
                //parameters passing only on linux
-               if(! Util.IsWindows()) {
+               if(! UtilAll.IsWindows()) {
                        if(args.Length > 2) 
                                printSyntaxAndQuit();
 
@@ -90,7 +90,7 @@ class ChronoJumpMini {
                string messageInfo;
                //string messageDetected ="";
 
-               if(Util.IsWindows()) {
+               if(UtilAll.IsWindows()) {
                        messageInfo = Constants.PortNamesWindows;
                        /*
                        messageDetected = Catalog.GetString("Detected ports:") + "\n";
@@ -112,8 +112,8 @@ class ChronoJumpMini {
                Console.WriteLine("---------------------------");
 
                if(portName == "") {
-                       if( ! Util.IsWindows()) {
-                               Console.WriteLine(Util.DetectPortsLinux(false)); //formatting
+                       if( ! UtilAll.IsWindows()) {
+                               Console.WriteLine(UtilAll.DetectPortsLinux(false)); //formatting
                        }
                        Console.WriteLine(Catalog.GetString("Print the port name where chronopic is 
connected:"));
                        portName=Console.ReadLine();
@@ -244,7 +244,7 @@ class ChronoJumpMini {
        static void printSyntaxAndQuit() {
                Console.WriteLine(Catalog.GetString("Invalid args. Use:"));
 
-               if(Util.IsWindows()) {
+               if(UtilAll.IsWindows()) {
                        Console.WriteLine("chronojump_mini.bat [PORT=portName>] [FILE=outputFile]");
                        Console.WriteLine(Catalog.GetString("Examples:"));
                        Console.WriteLine("chronojump_mini.bat");
@@ -290,7 +290,7 @@ class ChronoJumpMini {
        }
 
        static string getOutputDir() {
-               return Util.GetApplicationDataDir();
+               return UtilAll.GetApplicationDataDir();
        }
 
        static string getFileName() {
diff --git a/src/encoder.cs b/src/encoder.cs
index 56318ad..0c99d99 100644
--- a/src/encoder.cs
+++ b/src/encoder.cs
@@ -303,7 +303,7 @@ public class EncoderSQL
                        in windows is separated by '\'
                        but R needs always '/', then do the conversion
                 */
-               if(convertPathToR && Util.IsWindows())
+               if(convertPathToR && UtilAll.IsWindows())
                        str = str.Replace("\\","/");
 
                return str;
diff --git a/src/exportSession.cs b/src/exportSession.cs
index e6a816b..52ee2bd 100644
--- a/src/exportSession.cs
+++ b/src/exportSession.cs
@@ -141,7 +141,7 @@ public class ExportSession
        {
                int posOfDot = myFile.LastIndexOf('.');
                if (posOfDot == -1) {
-                       if(Util.IsWindows())
+                       if(UtilAll.IsWindows())
                                myFile += ".htm";
                        else
                                myFile += ".html";
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index e51b5c5..9d02dc3 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -880,7 +880,7 @@ public partial class ChronoJumpWindow
 
 
                //change language works on windows. On Linux let's change the locale
-               //if(Util.IsWindows())
+               //if(UtilAll.IsWindows())
                //      languageChange();
 
                //pass to report
@@ -1246,7 +1246,7 @@ public partial class ChronoJumpWindow
        }
 
        private void on_menuitem_goto_server_website (object o, EventArgs args) {
-               if(Util.IsWindows())
+               if(UtilAll.IsWindows())
                        new DialogMessage(Constants.MessageTypes.INFO, 
                                        "http://www.chronojump.org/server.html"; + "\n" + 
                                        "http://www.chronojump.org/server_es.html";);
@@ -2152,7 +2152,7 @@ public partial class ChronoJumpWindow
 
        private void on_quit1_activate (object o, EventArgs args) {
                /*
-               if(chronopicCancelledTimes > 0 && Util.IsWindows()) {
+               if(chronopicCancelledTimes > 0 && UtilAll.IsWindows()) {
                        confirmWinJumpRun = ConfirmWindowJumpRun.Show( 
                                        Catalog.GetString("Attention, current version of Chronojump gets 
hanged on exit\nif user has cancelled detection of Chronopic."),
                                        Catalog.GetString("Sorry, you will have to close Chronojump using 
CTRL + ALT + DEL."));
@@ -2675,7 +2675,7 @@ public partial class ChronoJumpWindow
                                SqlitePreferences.Select("encoderSmoothCon") ) );
 
                //change language works on windows. On Linux let's change the locale
-               //if(Util.IsWindows()) 
+               //if(UtilAll.IsWindows()) 
                //      languageChange();
                
 
diff --git a/src/gui/chronopic.cs b/src/gui/chronopic.cs
index ac10719..22a4550 100644
--- a/src/gui/chronopic.cs
+++ b/src/gui/chronopic.cs
@@ -146,7 +146,7 @@ public class ChronopicWindow
                        
                UtilGtk.IconWindow(chronopic_window);
 
-               if(Util.IsWindows())
+               if(UtilAll.IsWindows())
                        isWindows = true;
                else
                        isWindows = false;
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 5f21b24..32855fc 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -208,7 +208,7 @@ public partial class ChronoJumpWindow
                eventExecuteHideAllTables();
                eventExecuteHideImages();
                
-               if(Util.IsWindows()) {
+               if(UtilAll.IsWindows()) {
                        event_execute_rightMargin = 50;
                        event_execute_arcSystemCorrection = 1;
                }
diff --git a/src/gui/helpPorts.cs b/src/gui/helpPorts.cs
index ce18f2d..4c2b099 100644
--- a/src/gui/helpPorts.cs
+++ b/src/gui/helpPorts.cs
@@ -51,7 +51,7 @@ public class HelpPorts
                string messageDetected = "";
                
                
-               if(Util.IsWindows()) {
+               if(UtilAll.IsWindows()) {
                        messageInfo = Constants.PortNamesWindows;
 
                        /*
@@ -66,7 +66,7 @@ public class HelpPorts
                        messageDetected = string.Format(Catalog.GetString("Auto-Detection currently 
disabled"));
                } else {
                        messageInfo = Constants.PortNamesLinux;
-                       messageDetected = Util.DetectPortsLinux(true); //formatting
+                       messageDetected = UtilAll.DetectPortsLinux(true); //formatting
                        button_check_port.Hide();
                        button_force_port.Hide();
                }
@@ -76,7 +76,7 @@ public class HelpPorts
                label_detected.Text = messageDetected;
                label_detected.UseMarkup = true;
        
-               if(Util.IsWindows()) {
+               if(UtilAll.IsWindows()) {
                        label_help_info.Text = 
                                Catalog.GetString("If you have problems connecting with Chronopic, ensure you 
have the <b>driver</b> installed at 'Windows Start Menu / Chronojump / Install Chronopic driver'.") + "\n\n" 
+ 
                                Catalog.GetString("Ports above COM4 may not work.") + "\n" + 
diff --git a/src/gui/language.cs b/src/gui/language.cs
index b2eaa61..1efe4ee 100644
--- a/src/gui/language.cs
+++ b/src/gui/language.cs
@@ -53,7 +53,7 @@ public class LanguageWindow
                LanguageWindowBox.createComboLanguage();
 
                /*
-               if(! Util.IsWindows())
+               if(! UtilAll.IsWindows())
                        LanguageWindowBox.label_linux_restart.Text =
                                Catalog.GetString("On GNU/Linux you will need to restart Chronojump");
                */
@@ -75,7 +75,7 @@ public class LanguageWindow
 
                combo_language.Active = UtilGtk.ComboMakeActive(Util.GetLanguagesNames(), 
Util.GetLanguageName(Constants.LanguageDefault));
 
-               //if(Util.IsWindows())
+               //if(UtilAll.IsWindows())
                        combo_language.Sensitive = true;
                //else 
                //      combo_language.Sensitive = false;
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index b5cdb8c..6e3e277 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -103,7 +103,7 @@ public class PreferencesWindow {
                }
 
                //PreferencesWindowBox.languageIni = language;
-               //if(Util.IsWindows())
+               //if(UtilAll.IsWindows())
                //      PreferencesWindowBox.createComboLanguage(language);
                //else 
                        PreferencesWindowBox.hideLanguageStuff();
@@ -204,7 +204,7 @@ public class PreferencesWindow {
                if(!found)
                        combo_language.Active = UtilGtk.ComboMakeActive(Constants.Languages, 
Util.GetLanguageName(Constants.LanguageDefault));
                
-               //if(Util.IsWindows())
+               //if(UtilAll.IsWindows())
                //      combo_language.Sensitive = true;
                //else 
                        combo_language.Sensitive = false;
@@ -376,7 +376,7 @@ public class PreferencesWindow {
                Sqlite.Close();
                
                /*
-               if(Util.IsWindows()) {
+               if(UtilAll.IsWindows()) {
                        //if language has changed
                        if(UtilGtk.ComboGetActive(PreferencesWindowBox.combo_language) != languageIni) {
                                string myLanguage = SqlitePreferences.Select("language");
diff --git a/src/server.cs b/src/server.cs
index 6687701..570724e 100644
--- a/src/server.cs
+++ b/src/server.cs
@@ -60,7 +60,7 @@ public class Server
                        int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
                        string machineID = SqlitePreferences.Select("machineID");
 
-                       ServerPing myPing = new ServerPing(evalSID, progName + " " + progVersion, 
Util.GetOS(), 
+                       ServerPing myPing = new ServerPing(evalSID, progName + " " + progVersion, 
UtilAll.GetOS(), 
                                        //getIP(), DateTime.Now); //evaluator IP, date
                                        machineID, DateTime.Now); //evaluator machineID, date
 
@@ -170,7 +170,7 @@ public class Server
                        int state = (int) Constants.ServerSessionStates.UPLOADINGSESSION;
                        //create ServerSession based on Session currentSession
                        ServerSession serverSession = new ServerSession(currentSession, evalSID, progName + " 
" + progVersion, 
-                                       Util.GetOS(), DateTime.Now, state); 
+                                       UtilAll.GetOS(), DateTime.Now, state); 
 
                        //if uploading session for first time
                        if(currentSession.ServerUniqueID == Constants.ServerUndefinedID) 
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 024233a..3a07372 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -220,7 +220,7 @@ class Sqlite
        {
                Log.WriteLine(connectionString);
 
-               string applicationDataDir = Util.GetApplicationDataDir();
+               string applicationDataDir = UtilAll.GetApplicationDataDir();
 
                if(!Directory.Exists(applicationDataDir)) {
                        Log.WriteLine("creating dir 1...");
@@ -365,7 +365,7 @@ class Sqlite
                //string sqlite3Str = "";
                string extension = "";
                try {
-                       if(Util.IsWindows()) {
+                       if(UtilAll.IsWindows()) {
                                myPath = Constants.UtilProgramsWindows;
                                extension = Constants.ExtensionProgramsWindows;
                                sqliteStr = "sqlite.exe";
@@ -1250,7 +1250,7 @@ class Sqlite
                if(myPort == "0") {
                        //if doesn't exist (for any reason, like old database)
                        dbcon.Open();
-                       if(Util.IsWindows() || creatingBlankDatabase)
+                       if(UtilAll.IsWindows() || creatingBlankDatabase)
                                SqlitePreferences.Insert ("chronopicPort", 
Constants.ChronopicDefaultPortWindows);
                        else
                                SqlitePreferences.Insert ("chronopicPort", 
Constants.ChronopicDefaultPortLinux);
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index 53e1ea8..9413899 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -39,7 +39,7 @@ class SqlitePreferences : Sqlite
        {
                Insert ("databaseVersion", databaseVersion); 
                        
-               if(Util.IsWindows() || creatingBlankDatabase)
+               if(UtilAll.IsWindows() || creatingBlankDatabase)
                        Insert ("chronopicPort", Constants.ChronopicDefaultPortWindows);
                else
                        Insert ("chronopicPort", Constants.ChronopicDefaultPortLinux);
diff --git a/src/stats/main.cs b/src/stats/main.cs
index eb89fc0..f3f3532 100644
--- a/src/stats/main.cs
+++ b/src/stats/main.cs
@@ -1392,7 +1392,7 @@ public class Stat
                        cexAxisString = ", cex.axis=" + Util.ConvertToPoint(gRO.XAxisFontSize);
                
                string rString = "";
-               if(Util.IsWindows()) 
+               if(UtilAll.IsWindows()) 
                        rString = "library(\"Cairo\")\n" + 
                                "Cairo(" + gRO.Width + ", " + gRO.Height + 
                                ", file = '" + fileName + "', type=\"png\", bg=\"white\")\n";
diff --git a/src/util.cs b/src/util.cs
index 4d78943..2f3b2c9 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -103,16 +103,6 @@ public class Util
                        return Math.Round(Convert.ToDouble(time), prefsDigitsNumber).ToString();
        }
 
-       //if passed (number=1, digits=4)
-       //takes 1 and returns "0001" 
-       public static string DigitsCreate (int number, int digits)
-       {
-               string str = number.ToString();
-               while(str.Length < digits)
-                       str = "0" + str;
-               return str;
-       }
-       
        public static double GetMax (string values)
        {
                string [] myStringFull = values.Split(new char[] {'='});
@@ -700,25 +690,6 @@ public class Util
                return (myInt % 2 == 0); //check if it's even (in spanish "par")
        }
 
-       //Adapted from Mono. A developer's notebook. p 244
-       
-       //this is used in chronojump for working with the ports,
-       //in chronojump we compile now for Linux with Mono and for Windows with .NET
-       //it should be something like IsDotNet()
-       public static bool IsWindows() {
-               string os = GetOS();
-               if(os.ToUpper().StartsWith("WIN"))
-                       return true;
-               else 
-                       return false;
-       }
-       
-       public static string GetOS() {
-               OperatingSystem os = Environment.OSVersion;
-               string osString =  string.Format("{0}, {1}", os.Platform, os.Version);
-               return osString;
-       }
-       
        public static string GetReallyOldDatabaseDir() {
                return Environment.GetEnvironmentVariable("HOME")+ Path.DirectorySeparatorChar + 
".chronojump";
        }
@@ -731,13 +702,7 @@ public class Util
                
                return ".." + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar + "database";
        }
-       
-       public static string GetApplicationDataDir() {
-               return Path.Combine(
-                               Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
-                               "Chronojump");
-       }
-       
+
        public static string GetDatabaseDir() {
                //fixing:
                //http://lists.ximian.com/pipermail/mono-list/2008-November/040480.html
@@ -971,7 +936,7 @@ public class Util
        
        
        private static string getEncoderScriptCapture() {
-               if(IsWindows())
+               if(UtilAll.IsWindows())
                        return System.IO.Path.Combine(GetPrefixDir(), 
                                "bin" + Path.DirectorySeparatorChar + "encoder", 
Constants.EncoderScriptCaptureWindows);
                else
@@ -1096,7 +1061,7 @@ public class Util
                if (File.Exists(outputFile))
                        File.Delete(outputFile);
  
-               if (IsWindows())
+               if (UtilAll.IsWindows())
                        rBin=System.IO.Path.Combine(GetPrefixDir(), "bin/R.exe");
 
                pinfo = new ProcessStartInfo();
@@ -1137,7 +1102,7 @@ public class Util
                on linux we execute python and call to the py file
                also on windows we need the full path to find R
                */
-               if (IsWindows()) {
+               if (UtilAll.IsWindows()) {
                        pBin=getEncoderScriptCapture();
                        pinfo.Arguments = title + " " + es.OutputData1 + " " + es.Ep.ToString1() + " " + port 
                                + " " + changeSpaceToSpaceMark(
@@ -1185,7 +1150,7 @@ public class Util
                        
                pBin="Rscript";
                //pBin="R";
-               if (IsWindows()) {
+               if (UtilAll.IsWindows()) {
                        //on Windows we need the \"str\" to call without problems in path with spaces
                        pBin = "\"" + System.IO.Path.Combine(GetPrefixDir(), "bin" + 
Path.DirectorySeparatorChar + "Rscript.exe") + "\"";
                        Log.WriteLine("pBin:" + pBin);
@@ -1210,7 +1175,7 @@ public class Util
                writer.Flush();
                ((IDisposable)writer).Dispose();
                
-               if (IsWindows()) {
+               if (UtilAll.IsWindows()) {
                        //On win32 R understands backlash as an escape character and 
                        //a file path uses Unix-like path separator '/'         
                        optionsFile = optionsFile.Replace("\\","/");
@@ -1458,7 +1423,7 @@ public class Util
 
        public static string GetImagePath(bool mini) {
                string returnString = "";
-               if (Util.IsWindows()) {
+               if (UtilAll.IsWindows()) {
                        if (mini) {
                                returnString = Constants.ImagesMiniWindows;
                        } else {
@@ -1475,7 +1440,7 @@ public class Util
        }
                
        public static string GetGladePath() {
-               if (Util.IsWindows())
+               if (UtilAll.IsWindows())
                        return Constants.GladeWindows;
                else
                        return Constants.GladeLinux;
@@ -1693,39 +1658,10 @@ public class Util
                return myString.Trim('-');
        }
 */
-       
-       public static string DetectPortsLinux(bool formatting) {
-               string startStr = "";
-               string midStr = "\n";
-               string endStr = "";
-               if(formatting) {
-                       startStr = "<i>";
-                       midStr = "\t";
-                       endStr = "</i>";
-               }
-               string detected = "";
-               string [] usbSerial = Directory.GetFiles("/dev/", "ttyUSB*");
-               if(usbSerial.Length > 0) {
-                       detected += Constants.FoundUSBSerialPortsString + " " + usbSerial.Length + "\n" + 
startStr;
-                       foreach(string myPort in usbSerial)
-                               detected += midStr + myPort;
-                       detected += endStr;
-               } 
-               /*
-                  else {
-                       detected += Constants.NotFoundUSBSerialPortsString + "\n";
-                       string [] serial = Directory.GetFiles("/dev/", "ttyS*");
-                       detected += Constants.FoundSerialPortsString + " " + serial.Length + "\n" + startStr;
-                       foreach(string myPort in serial)
-                               detected += midStr + myPort;
-                       detected += endStr;
-               }
-               */
-               return detected;
-       }
+
 
        public static string GetDefaultPort() {
-               if(Util.IsWindows())
+               if(UtilAll.IsWindows())
                        return Constants.ChronopicDefaultPortWindows;
                else
                        return Constants.ChronopicDefaultPortLinux;
diff --git a/src/utilDate.cs b/src/utilDate.cs
index 143701b..6daee7b 100644
--- a/src/utilDate.cs
+++ b/src/utilDate.cs
@@ -30,20 +30,20 @@ public class UtilDate
        //we use Year, Month and Day for not having any problem with locale
        public static string ToSql (DateTime dt)
        {
-               return Util.DigitsCreate(dt.Year,4) + "-" + 
-                       Util.DigitsCreate(dt.Month,2) + "-" + 
-                       Util.DigitsCreate(dt.Day,2);
+               return UtilAll.DigitsCreate(dt.Year,4) + "-" + 
+                       UtilAll.DigitsCreate(dt.Month,2) + "-" + 
+                       UtilAll.DigitsCreate(dt.Day,2);
        }
        
        //records date & time, useful to backup database without having strange chars on filename
        public static string ToFile (DateTime dt)
        {
-               return Util.DigitsCreate(dt.Year,4) + "-" + 
-                       Util.DigitsCreate(dt.Month,2) + "-" + 
-                       Util.DigitsCreate(dt.Day,2) + "_" +
-                       Util.DigitsCreate(dt.Hour,2) + "-" + 
-                       Util.DigitsCreate(dt.Minute,2) + "-" + 
-                       Util.DigitsCreate(dt.Second,2);
+               return UtilAll.DigitsCreate(dt.Year,4) + "-" + 
+                       UtilAll.DigitsCreate(dt.Month,2) + "-" + 
+                       UtilAll.DigitsCreate(dt.Day,2) + "_" +
+                       UtilAll.DigitsCreate(dt.Hour,2) + "-" + 
+                       UtilAll.DigitsCreate(dt.Minute,2) + "-" + 
+                       UtilAll.DigitsCreate(dt.Second,2);
        }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]