Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-mono-tools.git;a=commitdiff;h=54ca3e22c341815509e4b3604abda338418e17ab
commit 54ca3e22c341815509e4b3604abda338418e17ab Author: bouleetbil <bouleet...@frogdev.info> Date: Fri Aug 20 09:54:41 2010 +0000 Enable/disable some options if package don't installed diff --git a/frugal-mono-tools/MainWindow.cs b/frugal-mono-tools/MainWindow.cs index d55e56c..32b3c45 100644 --- a/frugal-mono-tools/MainWindow.cs +++ b/frugal-mono-tools/MainWindow.cs @@ -36,6 +36,11 @@ public partial class MainWindow : Gtk.Window ONG_principal.RemovePage(cen_OngHW); ONG_principal.RemovePage(cen_OngPKG); //Login Manager init + EnableDisable(INT_XDM,"/usr/bin/xdm",LIB_XDM); + EnableDisable(INT_LXDM,"/usr/sbin/lxdm",LIB_LXDM); + EnableDisable(INT_Slim,"/usr/bin/slim",LIB_SLIM); + EnableDisable(INT_GDM,"/usr/sbin/gdm",LIB_GDM); + EnableDisable(INT_KDM,"/usr/bin/kdm",LIB_KDM); try { System.IO.StreamReader textFile = new System.IO.StreamReader(cch_FileLoginManager); @@ -301,6 +306,32 @@ public partial class MainWindow : Gtk.Window } catch{} } + /// <summary> + ///Enable / Disable some options if package is installed + /// </summary> + /// <param name="INT_Option"> + /// A <see cref="CheckButton"/> + /// </param> + /// <param name="FileToTest"> + /// A <see cref="System.String"/> + /// </param> + /// <param name="text"> + /// A <see cref="Label"/> + /// </param> + public void EnableDisable(CheckButton INT_Option,string FileToTest, Label text) + { + //check if file existe for works more quickly + if(!File.Exists(FileToTest)) + { + INT_Option.Active=false; + INT_Option.Inconsistent=true; + text.Visible=true; + } + else + { + text.Visible=false; + } + } diff --git a/frugal-mono-tools/gtk-gui/MainWindow.cs b/frugal-mono-tools/gtk-gui/MainWindow.cs index 3eca82e..8517a62 100644 --- a/frugal-mono-tools/gtk-gui/MainWindow.cs +++ b/frugal-mono-tools/gtk-gui/MainWindow.cs @@ -79,7 +79,7 @@ public partial class MainWindow private global::Gtk.CheckButton INT_XDM; - private global::Gtk.Label LIB_NMNotInstalled2; + private global::Gtk.Label LIB_XDM; private global::Gtk.HBox hbox6; @@ -87,7 +87,7 @@ public partial class MainWindow private global::Gtk.CheckButton INT_LXDM; - private global::Gtk.Label LIB_NMNotInstalled1; + private global::Gtk.Label LIB_LXDM; private global::Gtk.HBox hbox7; @@ -95,7 +95,7 @@ public partial class MainWindow private global::Gtk.CheckButton INT_Slim; - private global::Gtk.Label LIB_WICDNotInstalled1; + private global::Gtk.Label LIB_SLIM; private global::Gtk.HBox hbox9; @@ -103,7 +103,7 @@ public partial class MainWindow private global::Gtk.CheckButton INT_GDM; - private global::Gtk.Label LIB_WICDNotInstalled2; + private global::Gtk.Label LIB_GDM; private global::Gtk.HBox hbox10; @@ -111,7 +111,7 @@ public partial class MainWindow private global::Gtk.CheckButton INT_KDM; - private global::Gtk.Label LIB_WICDNotInstalled3; + private global::Gtk.Label LIB_KDM; private global::Gtk.HBox hbox8; @@ -151,7 +151,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 = 6; + this.ONG_principal.CurrentPage = 4; // Container child ONG_principal.Gtk.Notebook+NotebookChild this.vbox4 = new global::Gtk.VBox (); this.vbox4.Name = "vbox4"; @@ -462,11 +462,11 @@ public partial class MainWindow global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(this.hbox5[this.INT_XDM])); w31.Position = 1; // Container child hbox5.Gtk.Box+BoxChild - this.LIB_NMNotInstalled2 = new global::Gtk.Label (); - this.LIB_NMNotInstalled2.Name = "LIB_NMNotInstalled2"; - this.LIB_NMNotInstalled2.LabelProp = global::Mono.Unix.Catalog.GetString ("Not installed"); - this.hbox5.Add (this.LIB_NMNotInstalled2); - global::Gtk.Box.BoxChild w32 = ((global::Gtk.Box.BoxChild)(this.hbox5[this.LIB_NMNotInstalled2])); + this.LIB_XDM = new global::Gtk.Label (); + this.LIB_XDM.Name = "LIB_XDM"; + this.LIB_XDM.LabelProp = global::Mono.Unix.Catalog.GetString ("Not installed"); + this.hbox5.Add (this.LIB_XDM); + global::Gtk.Box.BoxChild w32 = ((global::Gtk.Box.BoxChild)(this.hbox5[this.LIB_XDM])); w32.Position = 2; w32.Expand = false; w32.Fill = false; @@ -499,11 +499,11 @@ public partial class MainWindow global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.hbox6[this.INT_LXDM])); w35.Position = 1; // Container child hbox6.Gtk.Box+BoxChild - this.LIB_NMNotInstalled1 = new global::Gtk.Label (); - this.LIB_NMNotInstalled1.Name = "LIB_NMNotInstalled1"; - this.LIB_NMNotInstalled1.LabelProp = global::Mono.Unix.Catalog.GetString ("Not installed"); - this.hbox6.Add (this.LIB_NMNotInstalled1); - global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.hbox6[this.LIB_NMNotInstalled1])); + this.LIB_LXDM = new global::Gtk.Label (); + this.LIB_LXDM.Name = "LIB_LXDM"; + this.LIB_LXDM.LabelProp = global::Mono.Unix.Catalog.GetString ("Not installed"); + this.hbox6.Add (this.LIB_LXDM); + global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.hbox6[this.LIB_LXDM])); w36.Position = 2; w36.Expand = false; w36.Fill = false; @@ -536,11 +536,11 @@ public partial class MainWindow global::Gtk.Box.BoxChild w39 = ((global::Gtk.Box.BoxChild)(this.hbox7[this.INT_Slim])); w39.Position = 1; // Container child hbox7.Gtk.Box+BoxChild - this.LIB_WICDNotInstalled1 = new global::Gtk.Label (); - this.LIB_WICDNotInstalled1.Name = "LIB_WICDNotInstalled1"; - this.LIB_WICDNotInstalled1.LabelProp = global::Mono.Unix.Catalog.GetString ("Not installed"); - this.hbox7.Add (this.LIB_WICDNotInstalled1); - global::Gtk.Box.BoxChild w40 = ((global::Gtk.Box.BoxChild)(this.hbox7[this.LIB_WICDNotInstalled1])); + this.LIB_SLIM = new global::Gtk.Label (); + this.LIB_SLIM.Name = "LIB_SLIM"; + this.LIB_SLIM.LabelProp = global::Mono.Unix.Catalog.GetString ("Not installed"); + this.hbox7.Add (this.LIB_SLIM); + global::Gtk.Box.BoxChild w40 = ((global::Gtk.Box.BoxChild)(this.hbox7[this.LIB_SLIM])); w40.Position = 2; w40.Expand = false; w40.Fill = false; @@ -573,11 +573,11 @@ public partial class MainWindow global::Gtk.Box.BoxChild w43 = ((global::Gtk.Box.BoxChild)(this.hbox9[this.INT_GDM])); w43.Position = 1; // Container child hbox9.Gtk.Box+BoxChild - this.LIB_WICDNotInstalled2 = new global::Gtk.Label (); - this.LIB_WICDNotInstalled2.Name = "LIB_WICDNotInstalled2"; - this.LIB_WICDNotInstalled2.LabelProp = global::Mono.Unix.Catalog.GetString ("Not installed"); - this.hbox9.Add (this.LIB_WICDNotInstalled2); - global::Gtk.Box.BoxChild w44 = ((global::Gtk.Box.BoxChild)(this.hbox9[this.LIB_WICDNotInstalled2])); + this.LIB_GDM = new global::Gtk.Label (); + this.LIB_GDM.Name = "LIB_GDM"; + this.LIB_GDM.LabelProp = global::Mono.Unix.Catalog.GetString ("Not installed"); + this.hbox9.Add (this.LIB_GDM); + global::Gtk.Box.BoxChild w44 = ((global::Gtk.Box.BoxChild)(this.hbox9[this.LIB_GDM])); w44.Position = 2; w44.Expand = false; w44.Fill = false; @@ -610,11 +610,11 @@ public partial class MainWindow global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(this.hbox10[this.INT_KDM])); w47.Position = 1; // Container child hbox10.Gtk.Box+BoxChild - this.LIB_WICDNotInstalled3 = new global::Gtk.Label (); - this.LIB_WICDNotInstalled3.Name = "LIB_WICDNotInstalled3"; - this.LIB_WICDNotInstalled3.LabelProp = global::Mono.Unix.Catalog.GetString ("Not installed"); - this.hbox10.Add (this.LIB_WICDNotInstalled3); - global::Gtk.Box.BoxChild w48 = ((global::Gtk.Box.BoxChild)(this.hbox10[this.LIB_WICDNotInstalled3])); + this.LIB_KDM = new global::Gtk.Label (); + this.LIB_KDM.Name = "LIB_KDM"; + this.LIB_KDM.LabelProp = global::Mono.Unix.Catalog.GetString ("Not installed"); + this.hbox10.Add (this.LIB_KDM); + global::Gtk.Box.BoxChild w48 = ((global::Gtk.Box.BoxChild)(this.hbox10[this.LIB_KDM])); w48.Position = 2; w48.Expand = false; w48.Fill = false; diff --git a/frugal-mono-tools/gtk-gui/gui.stetic b/frugal-mono-tools/gtk-gui/gui.stetic index 7a03120..adc0f68 100644 --- a/frugal-mono-tools/gtk-gui/gui.stetic +++ b/frugal-mono-tools/gtk-gui/gui.stetic @@ -18,7 +18,7 @@ <widget class="Gtk.Notebook" id="ONG_principal"> <property name="MemberName" /> <property name="CanFocus">True</property> - <property name="CurrentPage">6</property> + <property name="CurrentPage">4</property> <child> <widget class="Gtk.VBox" id="vbox4"> <property name="MemberName" /> @@ -479,7 +479,7 @@ </packing> </child> <child> - <widget class="Gtk.Label" id="LIB_NMNotInstalled2"> + <widget class="Gtk.Label" id="LIB_XDM"> <property name="MemberName" /> <property name="LabelProp" translatable="yes">Not installed</property> </widget> @@ -530,7 +530,7 @@ </packing> </child> <child> - <widget class="Gtk.Label" id="LIB_NMNotInstalled1"> + <widget class="Gtk.Label" id="LIB_LXDM"> <property name="MemberName" /> <property name="LabelProp" translatable="yes">Not installed</property> </widget> @@ -581,7 +581,7 @@ </packing> </child> <child> - <widget class="Gtk.Label" id="LIB_WICDNotInstalled1"> + <widget class="Gtk.Label" id="LIB_SLIM"> <property name="MemberName" /> <property name="LabelProp" translatable="yes">Not installed</property> </widget> @@ -632,7 +632,7 @@ </packing> </child> <child> - <widget class="Gtk.Label" id="LIB_WICDNotInstalled2"> + <widget class="Gtk.Label" id="LIB_GDM"> <property name="MemberName" /> <property name="LabelProp" translatable="yes">Not installed</property> </widget> @@ -683,7 +683,7 @@ </packing> </child> <child> - <widget class="Gtk.Label" id="LIB_WICDNotInstalled3"> + <widget class="Gtk.Label" id="LIB_KDM"> <property name="MemberName" /> <property name="LabelProp" translatable="yes">Not installed</property> </widget> _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git