[Frugalware-git] frugal-tweak: *can save login/password note
bouleetbil
bouleetbil at frogdev.info
Thu Nov 18 21:38:07 CET 2010
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=a4f5b8670751e0236e69a2fac4b2f9070e05b53b
commit a4f5b8670751e0236e69a2fac4b2f9070e05b53b
Author: bouleetbil <bouleetbil at frogdev.info>
Date: Thu Nov 18 21:34:28 2010 +0100
*can save login/password note
diff --git a/frugal-mono-tools/Configuration.cs b/frugal-mono-tools/Configuration.cs
index 55b9b70..459b67e 100644
--- a/frugal-mono-tools/Configuration.cs
+++ b/frugal-mono-tools/Configuration.cs
@@ -97,6 +97,8 @@ namespace frugalmonotools
private bool _startWithX = true;
private bool _showNotif = true;
private bool _showSplash = true;
+ private string _noteLogin ="Login";
+ private string _notePass="";
public string GetConfFile(){
if(File.Exists(oldconfFile))
@@ -135,6 +137,22 @@ namespace frugalmonotools
{
return _showSplash;
}
+ public void Set_NoteLogin(string login)
+ {
+ _noteLogin=login;
+ }
+ public string Get_NoteLogin()
+ {
+ return _noteLogin;
+ }
+ public void Set_NotePass(string pass)
+ {
+ _notePass=pass;
+ }
+ public string Get_NotePass()
+ {
+ return _notePass;
+ }
public Configuration ()
{
@@ -161,6 +179,14 @@ namespace frugalmonotools
{
Set_ShowSplash(false);
}
+ if (Regex.Matches(line, "notelogin=").Count>0)
+ {
+ Set_NoteLogin(line.Split('=')[1]);
+ }
+ if (Regex.Matches(line, "notepass=").Count>0)
+ {
+ Set_NotePass(line.Split('=')[1]);
+ }
}
}
catch
@@ -179,6 +205,8 @@ namespace frugalmonotools
if (!Get_StartWithX()) FileConf.WriteLine("dontstartwithx");
if (!Get_ShowNotif()) FileConf.WriteLine("dontshownotif");
if (!Get_ShowSplash()) FileConf.WriteLine("dontshowsplash");
+ FileConf.WriteLine("notelogin="+this.Get_NoteLogin());
+ FileConf.WriteLine("notepass="+this.Get_NotePass());
FileConf.Close();
}
catch(Exception exe)
diff --git a/frugal-mono-tools/WID_Notes.cs b/frugal-mono-tools/WID_Notes.cs
index 5323053..5fe5ec9 100644
--- a/frugal-mono-tools/WID_Notes.cs
+++ b/frugal-mono-tools/WID_Notes.cs
@@ -30,6 +30,8 @@ namespace frugalmonotools
public void InitNotes()
{
TXT_Note.Buffer.Text=Outils.ReadFile( DirTweak.GetDirFrugalTweak()+cch_FileNote);
+ SAI_Login.Text=MainClass.configuration.Get_NoteLogin();
+ SAI_Pass.Text=MainClass.configuration.Get_NotePass();
}
protected virtual void OnBTNSaveClicked (object sender, System.EventArgs e)
{
@@ -38,6 +40,14 @@ namespace frugalmonotools
FileNotes.Close();
}
+ protected virtual void OnBTNSaveOptionsClicked (object sender, System.EventArgs e)
+ {
+ MainClass.configuration.Set_NoteLogin(SAI_Login.Text);
+ MainClass.configuration.Set_NotePass(SAI_Pass.Text);
+ MainClass.configuration.ConfSave();
+ }
+
+
}
}
diff --git a/frugal-mono-tools/gtk-gui/frugalmonotools.WID_Notes.cs b/frugal-mono-tools/gtk-gui/frugalmonotools.WID_Notes.cs
index 2b2d9ba..988a693 100644
--- a/frugal-mono-tools/gtk-gui/frugalmonotools.WID_Notes.cs
+++ b/frugal-mono-tools/gtk-gui/frugalmonotools.WID_Notes.cs
@@ -46,7 +46,7 @@ namespace frugalmonotools
this.notebook2 = new global::Gtk.Notebook ();
this.notebook2.CanFocus = true;
this.notebook2.Name = "notebook2";
- this.notebook2.CurrentPage = 0;
+ this.notebook2.CurrentPage = 1;
// Container child notebook2.Gtk.Notebook+NotebookChild
this.vbox1 = new global::Gtk.VBox ();
this.vbox1.Name = "vbox1";
@@ -188,6 +188,7 @@ namespace frugalmonotools
this.SAI_Pass.Name = "SAI_Pass";
this.SAI_Pass.Text = global::Mono.Unix.Catalog.GetString ("password");
this.SAI_Pass.IsEditable = true;
+ this.SAI_Pass.Visibility = false;
this.SAI_Pass.InvisibleChar = 'â¢';
this.vbox2.Add (this.SAI_Pass);
global::Gtk.Box.BoxChild w34 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.SAI_Pass]));
@@ -245,6 +246,7 @@ namespace frugalmonotools
this.Hide ();
this.BTN_Download.Clicked += new global::System.EventHandler (this.OnBTNSaveClicked);
this.BTN_Save.Clicked += new global::System.EventHandler (this.OnBTNSaveClicked);
+ this.BTN_SaveOptions.Clicked += new global::System.EventHandler (this.OnBTNSaveOptionsClicked);
}
}
}
diff --git a/frugal-mono-tools/gtk-gui/gui.stetic b/frugal-mono-tools/gtk-gui/gui.stetic
index 3e8eab9..1947975 100644
--- a/frugal-mono-tools/gtk-gui/gui.stetic
+++ b/frugal-mono-tools/gtk-gui/gui.stetic
@@ -3972,7 +3972,7 @@ Public License instead of this License.
<widget class="Gtk.Notebook" id="notebook2">
<property name="MemberName" />
<property name="CanFocus">True</property>
- <property name="CurrentPage">0</property>
+ <property name="CurrentPage">1</property>
<child>
<widget class="Gtk.VBox" id="vbox1">
<property name="MemberName" />
@@ -4106,6 +4106,7 @@ Inscription is free.</property>
<property name="CanFocus">True</property>
<property name="Text" translatable="yes">password</property>
<property name="IsEditable">True</property>
+ <property name="Visibility">False</property>
<property name="InvisibleChar">â¢</property>
</widget>
<packing>
@@ -4136,6 +4137,7 @@ Inscription is free.</property>
<property name="Icon">stock:gtk-save Menu</property>
<property name="Label" translatable="yes">Save</property>
<property name="UseUnderline">True</property>
+ <signal name="Clicked" handler="OnBTNSaveOptionsClicked" />
</widget>
<packing>
<property name="Position">2</property>
More information about the Frugalware-git
mailing list