Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-mono-tools.git;a=commitdiff;h=63b37b7eb12fde73a71f9c9b827ff6d03cf195d6
commit 63b37b7eb12fde73a71f9c9b827ff6d03cf195d6 Author: bouleetbil <bouleet...@frogdev.info> Date: Thu Sep 2 14:20:16 2010 +0000 *vte fix *splash fix *service fix *gui fix diff --git a/frugal-mono-tools/Main.cs b/frugal-mono-tools/Main.cs index d5f9065..e5fe7b9 100644 --- a/frugal-mono-tools/Main.cs +++ b/frugal-mono-tools/Main.cs @@ -42,6 +42,7 @@ namespace frugalmonotools public static bool updatePkg = false; public static void checktest() { + Console.WriteLine("Thread started"); if (configuration.Get_CheckUpdate()) { updatePkg=Update.CheckUpdate(); diff --git a/frugal-mono-tools/MainWindow.cs b/frugal-mono-tools/MainWindow.cs index 5a3820b..6002e05 100644 --- a/frugal-mono-tools/MainWindow.cs +++ b/frugal-mono-tools/MainWindow.cs @@ -87,8 +87,10 @@ public partial class MainWindow : Gtk.Window ColumnServiceOnBoot.PackStart (ServiceOnBootCell, true); TREE_Services.AppendColumn (ColumnServiceOnBoot); ColumnServiceOnBoot.AddAttribute (ServiceOnBootCell, "text", 2); + foreach(Service service in ServicesRc.Services) { + Console.WriteLine(service.Get_Name()); string Etat = "yes"; if (!service.IsStarted()) Etat="No"; string OnBoot = "yes"; @@ -150,7 +152,7 @@ public partial class MainWindow : Gtk.Window } else { - //BTN_Setup.Visible=true; + BTN_Setup.Visible=true; LIB_Setup.Visible=false; } string dmesgOutput=Outils.getoutput("dmesg"); @@ -735,11 +737,8 @@ public partial class MainWindow : Gtk.Window if(packageSelected=="") return; VteConsole vte = new VteConsole(); vte.Show(); - string[] args=new string[3]; - args[0]=" "; - args[1]="-Rc"; - args[2]=packageSelected; - vte.Execute("pacman-g2",args,false); + + vte.Execute("pacman-g2"," -Rc "+packageSelected); } protected virtual void OnBTNInstallClicked (object sender, System.EventArgs e) @@ -747,21 +746,15 @@ public partial class MainWindow : Gtk.Window if(packageSelected=="") return; VteConsole vte = new VteConsole(); vte.Show(); - string[] args=new string[3]; - args[0]=" "; - args[1]="-Sy"; - args[2]=packageSelected; - vte.Execute("pacman-g2",args,false); + vte.Execute("pacman-g2"," -Sy "+packageSelected); } protected virtual void OnBTNUpdateClicked (object sender, System.EventArgs e) { VteConsole vte = new VteConsole(); vte.Show(); - string[] args=new string[2]; - args[0]=" "; - args[1]="-Syu"; - vte.Execute("pacman-g2",args,false); + + vte.Execute("pacman-g2"," -Syu"); } protected virtual void OnBTNPrinterClicked (object sender, System.EventArgs e) @@ -773,21 +766,17 @@ public partial class MainWindow : Gtk.Window { VteConsole vte = new VteConsole(); vte.Show(); - string[] args=new string[3]; - args[0]=" "; - args[1]="-Sy"; - args[2]="xf86-input-synaptics"; - vte.Execute("pacman-g2",args,false); + + vte.Execute("pacman-g2","- Sy xf86-input-synaptics"); } protected virtual void OnBTNSetupClicked (object sender, System.EventArgs e) { + VteConsole vte = new VteConsole(); vte.Show(); - string[] args=new string[2]; - args[1]=@"/sbin/setup"; - args[0]=""; - vte.Execute("exec",args,false); + + vte.Execute("/sbin/setup",""); } protected virtual void OnBTNSaveConfClicked (object sender, System.EventArgs e) diff --git a/frugal-mono-tools/Service.cs b/frugal-mono-tools/Service.cs index 5ddf535..ef718e5 100644 --- a/frugal-mono-tools/Service.cs +++ b/frugal-mono-tools/Service.cs @@ -33,19 +33,22 @@ namespace frugalmonotools } public bool IsStarted() { - string strSatus=Outils.getoutput("/sbin/service "+this.Get_Name()+" status"); - if(Regex.Matches(strSatus," ON ").Count>0) - { - return true; - } - if(Regex.Matches(strSatus," OFF").Count>0) + try { + string strSatus=Outils.getoutput("/sbin/service "+this.Get_Name()+" status"); + if(Regex.Matches(strSatus," ON ").Count>0) + { + return true; + } + if(Regex.Matches(strSatus," OFF").Count>0) + { + return false; + } + Console.WriteLine(this.Get_Name()+" don't use status this service should be fixed"); return false; } - Console.WriteLine(this.Get_Name()+" don't use status this service should be fixed"); - return false; - - + catch{return false;} + } private bool _findRunlevel(int runlevel) { diff --git a/frugal-mono-tools/Services.cs b/frugal-mono-tools/Services.cs index 8ea5494..3f3aa63 100644 --- a/frugal-mono-tools/Services.cs +++ b/frugal-mono-tools/Services.cs @@ -24,12 +24,15 @@ namespace frugalmonotools public static class ServicesRc { public static List<Service> Services = new List<Service>(); + private static bool _started=false; public static void CheckList(){ - - string rcFile="/etc/rc.d/"; - string[] files= Directory.GetFiles(rcFile,"rc.*"); + if (_started) return; + _started=false; Services.Clear(); + string rcFile="/etc/rc.d/"; + string[] files= Directory.GetFiles(rcFile,"rc.*",SearchOption.TopDirectoryOnly); + foreach(string file in files) { string rcName=file.Replace(rcFile+"rc.",""); @@ -64,12 +67,25 @@ namespace frugalmonotools (rcName!="mount")&& (rcName!="serial")&& (rcName!="single")&& + (rcName!="postgresql")&& //rc status crash should check it!! (rcName!="reboot")) { + try{ + if(Debug.ModeDebug) + Console.WriteLine(rcName); Service service = new Service(rcName); Services.Add(service); + } + catch(Exception exe) + { + Console.WriteLine(rcName+" is ignored"); + Console.WriteLine(exe.Message); + } } + } + Console.WriteLine("Service initialisation finish"); + _started=false; } } } diff --git a/frugal-mono-tools/gtk-gui/MainWindow.cs b/frugal-mono-tools/gtk-gui/MainWindow.cs index cbfb0aa..15ee99d 100644 --- a/frugal-mono-tools/gtk-gui/MainWindow.cs +++ b/frugal-mono-tools/gtk-gui/MainWindow.cs @@ -225,7 +225,7 @@ public partial class MainWindow this.ONG_principal = new global::Gtk.Notebook (); this.ONG_principal.CanFocus = true; this.ONG_principal.Name = "ONG_principal"; - this.ONG_principal.CurrentPage = 7; + this.ONG_principal.CurrentPage = 2; // Container child ONG_principal.Gtk.Notebook+NotebookChild this.vbox4 = new global::Gtk.VBox (); this.vbox4.Name = "vbox4"; diff --git a/frugal-mono-tools/gtk-gui/gui.stetic b/frugal-mono-tools/gtk-gui/gui.stetic index c49baec..a666bf4 100644 --- a/frugal-mono-tools/gtk-gui/gui.stetic +++ b/frugal-mono-tools/gtk-gui/gui.stetic @@ -9,7 +9,7 @@ <widget-library name="webkit-sharp, Version=1.1.15.0, Culture=neutral, PublicKeyToken=eaa1d335d2e19745" /> <widget-library name="notify-sharp, Version=0.4.0.0, Culture=neutral, PublicKeyToken=2df29c54e245917a" /> <widget-library name="vte-sharp, Version=0.16.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> - <widget-library name="../bin/Release/frugal-mono-tools.exe" internal="true" /> + <widget-library name="../bin/Debug/frugal-mono-tools.exe" internal="true" /> </import> <icon-factory> <icon-set id="iconeFwCC"> @@ -28,7 +28,7 @@ <widget class="Gtk.Notebook" id="ONG_principal"> <property name="MemberName" /> <property name="CanFocus">True</property> - <property name="CurrentPage">7</property> + <property name="CurrentPage">2</property> <child> <widget class="Gtk.VBox" id="vbox4"> <property name="MemberName" /> diff --git a/frugal-mono-tools/splash.cs b/frugal-mono-tools/splash.cs index 8f25484..364b091 100644 --- a/frugal-mono-tools/splash.cs +++ b/frugal-mono-tools/splash.cs @@ -15,7 +15,7 @@ namespace frugalmonotools MainWindow win = new MainWindow(); win.Show(); this.Hide(); - + Console.WriteLine("Start control center"); //now notifications if (MainClass.updatePkg) { _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git