Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=571157626eb681aca8bb1bbd98a55655d46c2212
commit 571157626eb681aca8bb1bbd98a55655d46c2212 Author: bouleetbil <bouleet...@frogdev.info> Date: Tue Sep 21 13:01:59 2010 +0000 *added icons for buttons service *a user can configure services (gksu/ksu) diff --git a/frugal-mono-tools/Service.cs b/frugal-mono-tools/Service.cs index 7d2a861..25469a2 100644 --- a/frugal-mono-tools/Service.cs +++ b/frugal-mono-tools/Service.cs @@ -100,18 +100,31 @@ namespace frugalmonotools } public void Start() { - Outils.Excecute("/sbin/service",this.Get_Name()+" start",true); + if(MainClass.boRoot) + Outils.Excecute("/sbin/service",this.Get_Name()+" start",true); + else + Outils.ExcecuteAsRoot("/sbin/service "+this.Get_Name()+" start",true); } public void Stop() { - Outils.Excecute("/sbin/service",this.Get_Name()+" stop",true); + if(MainClass.boRoot) + Outils.Excecute("/sbin/service",this.Get_Name()+" stop",true); + else + Outils.ExcecuteAsRoot("/sbin/service "+this.Get_Name()+" stop",true); } public void EnableDisableOnBoot(bool enableit) { if(enableit) - Outils.Excecute("/sbin/service",this.Get_Name()+" add",true); + if(MainClass.boRoot) + Outils.Excecute("/sbin/service",this.Get_Name()+" add",true); + else + Outils.ExcecuteAsRoot("/sbin/service "+this.Get_Name()+" add",true); else - Outils.Excecute("/sbin/service",this.Get_Name()+" del",true); + if(MainClass.boRoot) + Outils.Excecute("/sbin/service",this.Get_Name()+" del",true); + else + Outils.ExcecuteAsRoot("/sbin/service "+this.Get_Name()+" del",true); + } } } diff --git a/frugal-mono-tools/WID_Services.cs b/frugal-mono-tools/WID_Services.cs index d1b2a6f..035a9d8 100644 --- a/frugal-mono-tools/WID_Services.cs +++ b/frugal-mono-tools/WID_Services.cs @@ -33,13 +33,12 @@ namespace frugalmonotools public void InitService() { ServicesRc.CheckList(); - if(!MainClass.boRoot) - { - BTN_ServiceStop.Visible=false; - BTN_ServiceStart.Visible=false; - BTN_ServiceDelBoot.Visible=false; - BTN_ServiceAddBoot.Visible=false; - } + + BTN_ServiceStop.Visible=false; + BTN_ServiceStart.Visible=false; + BTN_ServiceDelBoot.Visible=false; + BTN_ServiceAddBoot.Visible=false; + // services Gtk.TreeViewColumn ColumnServiceName = new Gtk.TreeViewColumn (); ColumnServiceName.Title = "Services"; @@ -97,23 +96,22 @@ namespace frugalmonotools { string T =(string)model.GetValue (iter, 0); ServiceSelected=T; - if(MainClass.boRoot) - { - BTN_ServiceStop.Visible=false; - BTN_ServiceStart.Visible=false; - BTN_ServiceDelBoot.Visible=false; - BTN_ServiceAddBoot.Visible=false; - Service service = new Service(T); - if (service.IsStarted()) - BTN_ServiceStop.Visible=true; - else - BTN_ServiceStart.Visible=true; - if(service.IsStartedOnBoot()) - BTN_ServiceDelBoot.Visible=true; - else - BTN_ServiceAddBoot.Visible=true; + + BTN_ServiceStop.Visible=false; + BTN_ServiceStart.Visible=false; + BTN_ServiceDelBoot.Visible=false; + BTN_ServiceAddBoot.Visible=false; + Service service = new Service(T); + if (service.IsStarted()) + BTN_ServiceStop.Visible=true; + else + BTN_ServiceStart.Visible=true; + if(service.IsStartedOnBoot()) + BTN_ServiceDelBoot.Visible=true; + else + BTN_ServiceAddBoot.Visible=true; - } + } } catch{} diff --git a/frugal-mono-tools/gtk-gui/frugalmonotools.WID_Services.cs b/frugal-mono-tools/gtk-gui/frugalmonotools.WID_Services.cs index e547ac7..9a7781b 100644 --- a/frugal-mono-tools/gtk-gui/frugalmonotools.WID_Services.cs +++ b/frugal-mono-tools/gtk-gui/frugalmonotools.WID_Services.cs @@ -51,50 +51,110 @@ namespace frugalmonotools this.BTN_ServiceStart.CanFocus = true; this.BTN_ServiceStart.Name = "BTN_ServiceStart"; this.BTN_ServiceStart.UseUnderline = true; - this.BTN_ServiceStart.Label = global::Mono.Unix.Catalog.GetString ("Start"); + // Container child BTN_ServiceStart.Gtk.Container+ContainerChild + global::Gtk.Alignment w3 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f); + // Container child GtkAlignment.Gtk.Container+ContainerChild + global::Gtk.HBox w4 = new global::Gtk.HBox (); + w4.Spacing = 2; + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Image w5 = new global::Gtk.Image (); + w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-play", global::Gtk.IconSize.Menu); + w4.Add (w5); + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Label w7 = new global::Gtk.Label (); + w7.LabelProp = global::Mono.Unix.Catalog.GetString ("Start"); + w7.UseUnderline = true; + w4.Add (w7); + w3.Add (w4); + this.BTN_ServiceStart.Add (w3); this.hbox20.Add (this.BTN_ServiceStart); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox20[this.BTN_ServiceStart])); - w3.Position = 0; - w3.Expand = false; - w3.Fill = false; + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox20[this.BTN_ServiceStart])); + w11.Position = 0; + w11.Expand = false; + w11.Fill = false; // Container child hbox20.Gtk.Box+BoxChild this.BTN_ServiceStop = new global::Gtk.Button (); this.BTN_ServiceStop.CanFocus = true; this.BTN_ServiceStop.Name = "BTN_ServiceStop"; this.BTN_ServiceStop.UseUnderline = true; - this.BTN_ServiceStop.Label = global::Mono.Unix.Catalog.GetString ("Stop"); + // Container child BTN_ServiceStop.Gtk.Container+ContainerChild + global::Gtk.Alignment w12 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f); + // Container child GtkAlignment.Gtk.Container+ContainerChild + global::Gtk.HBox w13 = new global::Gtk.HBox (); + w13.Spacing = 2; + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Image w14 = new global::Gtk.Image (); + w14.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-stop", global::Gtk.IconSize.Menu); + w13.Add (w14); + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Label w16 = new global::Gtk.Label (); + w16.LabelProp = global::Mono.Unix.Catalog.GetString ("Stop"); + w16.UseUnderline = true; + w13.Add (w16); + w12.Add (w13); + this.BTN_ServiceStop.Add (w12); this.hbox20.Add (this.BTN_ServiceStop); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox20[this.BTN_ServiceStop])); - w4.Position = 1; - w4.Expand = false; - w4.Fill = false; + global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox20[this.BTN_ServiceStop])); + w20.Position = 1; + w20.Expand = false; + w20.Fill = false; // Container child hbox20.Gtk.Box+BoxChild this.BTN_ServiceDelBoot = new global::Gtk.Button (); this.BTN_ServiceDelBoot.CanFocus = true; this.BTN_ServiceDelBoot.Name = "BTN_ServiceDelBoot"; this.BTN_ServiceDelBoot.UseUnderline = true; - this.BTN_ServiceDelBoot.Label = global::Mono.Unix.Catalog.GetString ("Don't start it on boot"); + // Container child BTN_ServiceDelBoot.Gtk.Container+ContainerChild + global::Gtk.Alignment w21 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f); + // Container child GtkAlignment.Gtk.Container+ContainerChild + global::Gtk.HBox w22 = new global::Gtk.HBox (); + w22.Spacing = 2; + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Image w23 = new global::Gtk.Image (); + w23.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-delete", global::Gtk.IconSize.Menu); + w22.Add (w23); + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Label w25 = new global::Gtk.Label (); + w25.LabelProp = global::Mono.Unix.Catalog.GetString ("Don't start it on boot"); + w25.UseUnderline = true; + w22.Add (w25); + w21.Add (w22); + this.BTN_ServiceDelBoot.Add (w21); this.hbox20.Add (this.BTN_ServiceDelBoot); - global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox20[this.BTN_ServiceDelBoot])); - w5.Position = 2; - w5.Expand = false; - w5.Fill = false; + global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.hbox20[this.BTN_ServiceDelBoot])); + w29.Position = 2; + w29.Expand = false; + w29.Fill = false; // Container child hbox20.Gtk.Box+BoxChild this.BTN_ServiceAddBoot = new global::Gtk.Button (); this.BTN_ServiceAddBoot.CanFocus = true; this.BTN_ServiceAddBoot.Name = "BTN_ServiceAddBoot"; this.BTN_ServiceAddBoot.UseUnderline = true; - this.BTN_ServiceAddBoot.Label = global::Mono.Unix.Catalog.GetString ("Start it on boot"); + // Container child BTN_ServiceAddBoot.Gtk.Container+ContainerChild + global::Gtk.Alignment w30 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f); + // Container child GtkAlignment.Gtk.Container+ContainerChild + global::Gtk.HBox w31 = new global::Gtk.HBox (); + w31.Spacing = 2; + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Image w32 = new global::Gtk.Image (); + w32.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Menu); + w31.Add (w32); + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Label w34 = new global::Gtk.Label (); + w34.LabelProp = global::Mono.Unix.Catalog.GetString ("Start it on boot"); + w34.UseUnderline = true; + w31.Add (w34); + w30.Add (w31); + this.BTN_ServiceAddBoot.Add (w30); this.hbox20.Add (this.BTN_ServiceAddBoot); - global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox20[this.BTN_ServiceAddBoot])); - w6.Position = 3; - w6.Expand = false; - w6.Fill = false; + global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.hbox20[this.BTN_ServiceAddBoot])); + w38.Position = 3; + w38.Expand = false; + w38.Fill = false; this.vbox7.Add (this.hbox20); - global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox7[this.hbox20])); - w7.Position = 1; - w7.Expand = false; - w7.Fill = false; + global::Gtk.Box.BoxChild w39 = ((global::Gtk.Box.BoxChild)(this.vbox7[this.hbox20])); + w39.Position = 1; + w39.Expand = false; + w39.Fill = false; this.Add (this.vbox7); if ((this.Child != null)) { this.Child.ShowAll (); diff --git a/frugal-mono-tools/gtk-gui/gui.stetic b/frugal-mono-tools/gtk-gui/gui.stetic index 5cc6e0b..e575a1c 100644 --- a/frugal-mono-tools/gtk-gui/gui.stetic +++ b/frugal-mono-tools/gtk-gui/gui.stetic @@ -1253,7 +1253,7 @@ </widget> </child> </widget> - <widget class="Gtk.Bin" id="frugalmonotools.WID_Services" design-size="320 300"> + <widget class="Gtk.Bin" id="frugalmonotools.WID_Services" design-size="600 300"> <property name="MemberName" /> <property name="Visible">False</property> <child> @@ -1286,7 +1286,8 @@ <property name="MemberName" /> <property name="Visible">False</property> <property name="CanFocus">True</property> - <property name="Type">TextOnly</property> + <property name="Type">TextAndIcon</property> + <property name="Icon">stock:gtk-media-play Menu</property> <property name="Label" translatable="yes">Start</property> <property name="UseUnderline">True</property> <signal name="Clicked" handler="OnBTNServiceStartClicked" /> @@ -1303,7 +1304,8 @@ <property name="MemberName" /> <property name="Visible">False</property> <property name="CanFocus">True</property> - <property name="Type">TextOnly</property> + <property name="Type">TextAndIcon</property> + <property name="Icon">stock:gtk-media-stop Menu</property> <property name="Label" translatable="yes">Stop</property> <property name="UseUnderline">True</property> <signal name="Clicked" handler="OnBTNServiceStopClicked" /> @@ -1320,7 +1322,8 @@ <property name="MemberName" /> <property name="Visible">False</property> <property name="CanFocus">True</property> - <property name="Type">TextOnly</property> + <property name="Type">TextAndIcon</property> + <property name="Icon">stock:gtk-delete Menu</property> <property name="Label" translatable="yes">Don't start it on boot</property> <property name="UseUnderline">True</property> <signal name="Clicked" handler="OnBTNServiceDelBootClicked" /> @@ -1337,7 +1340,8 @@ <property name="MemberName" /> <property name="Visible">False</property> <property name="CanFocus">True</property> - <property name="Type">TextOnly</property> + <property name="Type">TextAndIcon</property> + <property name="Icon">stock:gtk-add Menu</property> <property name="Label" translatable="yes">Start it on boot</property> <property name="UseUnderline">True</property> <signal name="Clicked" handler="OnBTNServiceAddBootClicked" /> _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git