Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=246e4c6986ba178ee9231ae0ab06b1c870b6cbb2
commit 246e4c6986ba178ee9231ae0ab06b1c870b6cbb2 Author: bouleetbil <[email protected]> Date: Thu Nov 11 13:59:06 2010 +0100 *added module Date Time diff --git a/frugal-mono-tools/Fen_Menu.cs b/frugal-mono-tools/Fen_Menu.cs index 88d4a72..181b6f7 100644 --- a/frugal-mono-tools/Fen_Menu.cs +++ b/frugal-mono-tools/Fen_Menu.cs @@ -39,6 +39,7 @@ namespace frugalmonotools private const string cch_news="News"; private const string cch_configuration="Configuration"; private const string cch_about="About"; + private const string cch_datetime="Date Time"; //widget WID_Network fen_network ; @@ -56,7 +57,7 @@ namespace frugalmonotools WID_LoginManager fen_loginManager; WID_Logs fen_logs; WID_Grub fen_grub; - + WID_DateTime fen_dateTime; protected Gtk.TreeIter iter; public Fen_Menu () : base(Gtk.WindowType.Toplevel) @@ -90,6 +91,8 @@ namespace frugalmonotools Pixbuf icoSys = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.system.png"); iter = ListMenu.AppendValues(icoSys.ScaleSimple(20,20, Gdk.InterpType.Nearest),cch_system); this.TREE_Menu.SetCursor(ListMenu.GetPath(iter),TREE_Menu.GetColumn(1),false); + Pixbuf icoDate = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.datetime.png"); + ListMenu.AppendValues(icoDate.ScaleSimple(20,20, Gdk.InterpType.Nearest), cch_datetime); Pixbuf icoX = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.xorg.png"); ListMenu.AppendValues(icoX.ScaleSimple(20,20, Gdk.InterpType.Nearest), cch_xorg); Pixbuf icoupdate = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.update.png"); @@ -158,6 +161,13 @@ namespace frugalmonotools switch (module){ + case cch_datetime: + this.fen_dateTime = new WID_DateTime(); + this.HBOX_Details.PackStart(fen_dateTime); + this.HBOX_Details.ShowAll(); + this.fen_dateTime.InitDateTime(); + break; + case cch_packages: this.fen_pkg = new WID_Pkg(); this.HBOX_Details.PackStart(fen_pkg); diff --git a/frugal-mono-tools/Pictures/icons/datetime.png b/frugal-mono-tools/Pictures/icons/datetime.png new file mode 100644 index 0000000..48abfeb Binary files /dev/null and b/frugal-mono-tools/Pictures/icons/datetime.png differ diff --git a/frugal-mono-tools/WID_DateTime.cs b/frugal-mono-tools/WID_DateTime.cs new file mode 100644 index 0000000..e6bbd14 --- /dev/null +++ b/frugal-mono-tools/WID_DateTime.cs @@ -0,0 +1,53 @@ +// /* +// * Copyright (C) 2010 by Gaetan Gourdin <[email protected]> +// * +// * This program is free software; you can redistribute it and/or modify +// * it under the terms of the GNU General Public License as published by +// * the Free Software Foundation; either version 2 of the License, or +// * (at your option) any later version. +// * +// * This program is distributed in the hope that it will be useful, +// * but WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// * GNU General Public License for more details. +// * +// * You should have received a copy of the GNU General Public License +// * along with this program; if not, write to the Free Software +// * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// */ +using System; +namespace frugalmonotools +{ + [System.ComponentModel.ToolboxItem(true)] + public partial class WID_DateTime : Gtk.Bin + { + public WID_DateTime () + { + this.Build (); + } + public void InitDateTime() + { + if(!MainClass.boRoot) + { + BTN_Apply.Visible=false; + LIB_Root.Visible=true; + } + else + { + BTN_Apply.Visible=true; + LIB_Root.Visible=false; + } + SAI_Date.Text=Outils.getoutput("date +%Y%m%d"); + SAI_Hours.Text=Outils.getoutput("date +%T "); + } + protected virtual void OnBTNApplyClicked (object sender, System.EventArgs e) + { + //date +%Y%m%d+%T -s "20101111 13:09:17" + Outils.Excecute("date"," +%Y%m%d+%T -s '" +SAI_Date.Text+" "+SAI_Hours.Text+"'",false); + + } + + + } +} + diff --git a/frugal-mono-tools/frugal-mono-tools.csproj b/frugal-mono-tools/frugal-mono-tools.csproj index 12bc88a..23af25c 100644 --- a/frugal-mono-tools/frugal-mono-tools.csproj +++ b/frugal-mono-tools/frugal-mono-tools.csproj @@ -85,6 +85,7 @@ <EmbeddedResource Include="Pictures\Mono-powered.png" /> <EmbeddedResource Include="Pictures\icons\logs.png" /> <EmbeddedResource Include="Pictures\icons\grub.png" /> + <EmbeddedResource Include="Pictures\icons\datetime.png" /> </ItemGroup> <ItemGroup> <Compile Include="gtk-gui\generated.cs" /> @@ -140,6 +141,8 @@ <Compile Include="Grub.cs" /> <Compile Include="DiagGrub.cs" /> <Compile Include="gtk-gui\frugalmonotools.DiagGrub.cs" /> + <Compile Include="WID_DateTime.cs" /> + <Compile Include="gtk-gui\frugalmonotools.WID_DateTime.cs" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> diff --git a/frugal-mono-tools/gtk-gui/frugalmonotools.WID_DateTime.cs b/frugal-mono-tools/gtk-gui/frugalmonotools.WID_DateTime.cs new file mode 100644 index 0000000..0f9c718 --- /dev/null +++ b/frugal-mono-tools/gtk-gui/frugalmonotools.WID_DateTime.cs @@ -0,0 +1,166 @@ + +// This file has been generated by the GUI designer. Do not modify. +namespace frugalmonotools +{ + public partial class WID_DateTime + { + private global::Gtk.VBox vbox2; + + private global::Gtk.HBox hbox2; + + private global::Gtk.Image image40; + + private global::Gtk.HBox hbox3; + + private global::Gtk.Label label1; + + private global::Gtk.Entry SAI_Date; + + private global::Gtk.HBox hbox4; + + private global::Gtk.Label label2; + + private global::Gtk.Entry SAI_Hours; + + private global::Gtk.HBox hbox1; + + private global::Gtk.Label LIB_Root; + + private global::Gtk.Button BTN_Apply; + + protected virtual void Build () + { + global::Stetic.Gui.Initialize (this); + // Widget frugalmonotools.WID_DateTime + global::Stetic.BinContainer.Attach (this); + this.Name = "frugalmonotools.WID_DateTime"; + // Container child frugalmonotools.WID_DateTime.Gtk.Container+ContainerChild + this.vbox2 = new global::Gtk.VBox (); + this.vbox2.Name = "vbox2"; + this.vbox2.Spacing = 6; + // Container child vbox2.Gtk.Box+BoxChild + this.hbox2 = new global::Gtk.HBox (); + this.hbox2.Name = "hbox2"; + this.hbox2.Spacing = 6; + // Container child hbox2.Gtk.Box+BoxChild + this.image40 = new global::Gtk.Image (); + this.image40.Name = "image40"; + this.image40.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("frugalmonotools.Pictures.icons.datetime.png"); + this.hbox2.Add (this.image40); + global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.image40])); + w1.Position = 2; + w1.Expand = false; + w1.Fill = false; + this.vbox2.Add (this.hbox2); + global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox2])); + w2.Position = 0; + w2.Expand = false; + w2.Fill = false; + // Container child vbox2.Gtk.Box+BoxChild + this.hbox3 = new global::Gtk.HBox (); + this.hbox3.Name = "hbox3"; + this.hbox3.Spacing = 6; + // Container child hbox3.Gtk.Box+BoxChild + this.label1 = new global::Gtk.Label (); + this.label1.Name = "label1"; + this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("Date"); + this.hbox3.Add (this.label1); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.label1])); + w3.Position = 0; + w3.Expand = false; + w3.Fill = false; + // Container child hbox3.Gtk.Box+BoxChild + this.SAI_Date = new global::Gtk.Entry (); + this.SAI_Date.CanFocus = true; + this.SAI_Date.Name = "SAI_Date"; + this.SAI_Date.IsEditable = true; + this.SAI_Date.InvisibleChar = 'â¢'; + this.hbox3.Add (this.SAI_Date); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.SAI_Date])); + w4.Position = 1; + this.vbox2.Add (this.hbox3); + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox3])); + w5.Position = 1; + w5.Expand = false; + w5.Fill = false; + // Container child vbox2.Gtk.Box+BoxChild + this.hbox4 = new global::Gtk.HBox (); + this.hbox4.Name = "hbox4"; + this.hbox4.Spacing = 6; + // Container child hbox4.Gtk.Box+BoxChild + this.label2 = new global::Gtk.Label (); + this.label2.Name = "label2"; + this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Hours"); + this.hbox4.Add (this.label2); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox4[this.label2])); + w6.Position = 0; + w6.Expand = false; + w6.Fill = false; + // Container child hbox4.Gtk.Box+BoxChild + this.SAI_Hours = new global::Gtk.Entry (); + this.SAI_Hours.CanFocus = true; + this.SAI_Hours.Name = "SAI_Hours"; + this.SAI_Hours.IsEditable = true; + this.SAI_Hours.InvisibleChar = 'â¢'; + this.hbox4.Add (this.SAI_Hours); + global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox4[this.SAI_Hours])); + w7.Position = 1; + this.vbox2.Add (this.hbox4); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox4])); + w8.Position = 2; + w8.Expand = false; + w8.Fill = false; + // Container child vbox2.Gtk.Box+BoxChild + this.hbox1 = new global::Gtk.HBox (); + this.hbox1.Name = "hbox1"; + this.hbox1.Spacing = 6; + // Container child hbox1.Gtk.Box+BoxChild + this.LIB_Root = new global::Gtk.Label (); + this.LIB_Root.Name = "LIB_Root"; + this.LIB_Root.LabelProp = global::Mono.Unix.Catalog.GetString ("Can't save, should be started as root"); + this.hbox1.Add (this.LIB_Root); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.LIB_Root])); + w9.Position = 0; + w9.Expand = false; + w9.Fill = false; + // Container child hbox1.Gtk.Box+BoxChild + this.BTN_Apply = new global::Gtk.Button (); + this.BTN_Apply.CanFocus = true; + this.BTN_Apply.Name = "BTN_Apply"; + this.BTN_Apply.UseUnderline = true; + // Container child BTN_Apply.Gtk.Container+ContainerChild + global::Gtk.Alignment w10 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f); + // Container child GtkAlignment.Gtk.Container+ContainerChild + global::Gtk.HBox w11 = new global::Gtk.HBox (); + w11.Spacing = 2; + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Image w12 = new global::Gtk.Image (); + w12.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-apply", global::Gtk.IconSize.Menu); + w11.Add (w12); + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Label w14 = new global::Gtk.Label (); + w14.LabelProp = global::Mono.Unix.Catalog.GetString ("Apply"); + w14.UseUnderline = true; + w11.Add (w14); + w10.Add (w11); + this.BTN_Apply.Add (w10); + this.hbox1.Add (this.BTN_Apply); + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.BTN_Apply])); + w18.Position = 2; + w18.Expand = false; + w18.Fill = false; + this.vbox2.Add (this.hbox1); + global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1])); + w19.Position = 4; + w19.Expand = false; + w19.Fill = false; + this.Add (this.vbox2); + if ((this.Child != null)) { + this.Child.ShowAll (); + } + this.LIB_Root.Hide (); + this.Hide (); + this.BTN_Apply.Clicked += new global::System.EventHandler (this.OnBTNApplyClicked); + } + } +} diff --git a/frugal-mono-tools/gtk-gui/gui.stetic b/frugal-mono-tools/gtk-gui/gui.stetic index 837783d..4c0a7b0 100644 --- a/frugal-mono-tools/gtk-gui/gui.stetic +++ b/frugal-mono-tools/gtk-gui/gui.stetic @@ -3311,4 +3311,164 @@ Public License instead of this License. </widget> </child> </widget> + <widget class="Gtk.Bin" id="frugalmonotools.WID_DateTime" design-size="300 300"> + <property name="MemberName" /> + <property name="Visible">False</property> + <child> + <widget class="Gtk.VBox" id="vbox2"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.HBox" id="hbox2"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <placeholder /> + </child> + <child> + <placeholder /> + </child> + <child> + <widget class="Gtk.Image" id="image40"> + <property name="MemberName" /> + <property name="Pixbuf">resource:frugalmonotools.Pictures.icons.datetime.png</property> + </widget> + <packing> + <property name="Position">2</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.HBox" id="hbox3"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Label" id="label1"> + <property name="MemberName" /> + <property name="LabelProp" translatable="yes">Date</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Entry" id="SAI_Date"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="IsEditable">True</property> + <property name="InvisibleChar">â¢</property> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.HBox" id="hbox4"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Label" id="label2"> + <property name="MemberName" /> + <property name="LabelProp" translatable="yes">Hours</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <widget class="Gtk.Entry" id="SAI_Hours"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="IsEditable">True</property> + <property name="InvisibleChar">â¢</property> + </widget> + <packing> + <property name="Position">1</property> + <property name="AutoSize">True</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">2</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <placeholder /> + </child> + <child> + <widget class="Gtk.HBox" id="hbox1"> + <property name="MemberName" /> + <property name="Spacing">6</property> + <child> + <widget class="Gtk.Label" id="LIB_Root"> + <property name="MemberName" /> + <property name="Visible">False</property> + <property name="LabelProp" translatable="yes">Can't save, should be started as root</property> + </widget> + <packing> + <property name="Position">0</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + <child> + <placeholder /> + </child> + <child> + <widget class="Gtk.Button" id="BTN_Apply"> + <property name="MemberName" /> + <property name="CanFocus">True</property> + <property name="Type">TextAndIcon</property> + <property name="Icon">stock:gtk-apply Menu</property> + <property name="Label" translatable="yes">Apply</property> + <property name="UseUnderline">True</property> + <signal name="Clicked" handler="OnBTNApplyClicked" /> + </widget> + <packing> + <property name="Position">2</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="Position">4</property> + <property name="AutoSize">True</property> + <property name="Expand">False</property> + <property name="Fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> </stetic-interface> \ No newline at end of file
_______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
