Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-mono-tools.git;a=commitdiff;h=fbdee7b49de2967a181fd55574d37507429ac98e
commit fbdee7b49de2967a181fd55574d37507429ac98e Author: bouleetbil <bouleet...@frogdev.info> Date: Fri Aug 20 12:07:30 2010 +0000 network/login manager notebook finished diff --git a/frugal-mono-tools/MainWindow.cs b/frugal-mono-tools/MainWindow.cs index 0c571a2..a4cadf8 100644 --- a/frugal-mono-tools/MainWindow.cs +++ b/frugal-mono-tools/MainWindow.cs @@ -35,11 +35,25 @@ public partial class MainWindow : Gtk.Window ONG_principal.RemovePage(cen_OngXORG); ONG_principal.RemovePage(cen_OngHW); ONG_principal.RemovePage(cen_OngPKG); - //root option + //root options if (Mono.Unix.Native.Syscall.getuid()!=0) { BTN_Network.Visible=false; BTN_LoginManager.Visible=false; + + } + //network init + INT_NM.Active=Outils.ServiceOnStartUp("S99rc.networkmanager"); + EnableDisable(INT_NM,"/usr/sbin/NetworkManager",LIB_NMNotInstalled); + INT_WICD.Active=Outils.ServiceOnStartUp("S99rc.wicd"); + EnableDisable(INT_WICD,"/usr/sbin/wicd",LIB_WICDNotInstalled); + if((!INT_NM.Active) && (!INT_WICD.Active)) + { + INT_FW.Active=true; + } + else + { + INT_FW.Active=false; } //Login Manager init EnableDisable(INT_XDM,"/usr/bin/xdm",LIB_XDM); @@ -173,6 +187,7 @@ public partial class MainWindow : Gtk.Window protected virtual void usenm (object sender, System.EventArgs e) { + if (INT_NM.Inconsistent) return; if (this.INT_NM.Active) { this.INT_FW.Active=false; @@ -186,6 +201,7 @@ public partial class MainWindow : Gtk.Window protected virtual void usewicd (object sender, System.EventArgs e) { + if (INT_NM.Inconsistent) return; if (this.INT_WICD.Active) { this.INT_FW.Active=false; diff --git a/frugal-mono-tools/OUTILS/Outils.cs b/frugal-mono-tools/OUTILS/Outils.cs index d9b1806..2d1da7f 100644 --- a/frugal-mono-tools/OUTILS/Outils.cs +++ b/frugal-mono-tools/OUTILS/Outils.cs @@ -38,6 +38,28 @@ namespace frugalmonotools Outils.Excecute("service "+servicename+" stop",""); } } + /// <summary> + /// return true if service is enable on startup + /// verify on each runlevel + /// </summary> + /// <param name="servicename"> + /// A <see cref="System.String"/> + /// </param> + /// <returns> + /// A <see cref="System.Boolean"/> + /// </returns> + public static bool ServiceOnStartUp(string servicename) + { + string ch_DirRC="/etc/rc.d/"; + + if (System.IO.File.Exists(ch_DirRC+"rc0.d/"+servicename)) return true; + if (System.IO.File.Exists(ch_DirRC+"rc1.d/"+servicename)) return true; + if (System.IO.File.Exists(ch_DirRC+"rc2.d/"+servicename)) return true; + if (System.IO.File.Exists(ch_DirRC+"rc3.d/"+servicename)) return true; + if (System.IO.File.Exists(ch_DirRC+"rc4.d/"+servicename)) return true; + if (System.IO.File.Exists(ch_DirRC+"rc5.d/"+servicename)) return true; + return false; + } /* public static String ResultExcecute(String Commande,string Arguments) { _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git