Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-mono-tools.git;a=commitdiff;h=cd2a422a30abda52544780e780ec3881ccc21715

commit cd2a422a30abda52544780e780ec3881ccc21715
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Wed Sep 1 12:01:40 2010 +0000

*can disable notification popup

diff --git a/frugal-mono-tools/Configuration.cs 
b/frugal-mono-tools/Configuration.cs
index 24208af..c62fe00 100644
--- a/frugal-mono-tools/Configuration.cs
+++ b/frugal-mono-tools/Configuration.cs
@@ -26,6 +26,7 @@ namespace frugalmonotools
private const string confFile=@"/.config/FrugalTools.conf";
private bool _checkUpdate = false;
private bool _startWithX = true;
+               private bool _showNotif = true;
public string GetConfFile(){
return Environment.GetFolderPath(System.Environment.SpecialFolder
.Personal)+confFile;
@@ -46,6 +47,15 @@ namespace frugalmonotools
{
_startWithX=valeur;
}
+               public void Set_ShowNotif(bool valeur)
+               {
+                       _showNotif=valeur;
+               }
+               public bool Get_ShowNotif()
+               {
+                       return _showNotif;
+               }
+
public Configuration ()
{
//read value
@@ -63,6 +73,10 @@ namespace frugalmonotools
{
Set_StartWithX(false);
}
+                                       if (Regex.Matches(line, 
"dontshownotif").Count>0)
+                                               {
+                                                       Set_ShowNotif(false);
+                                               }
}
}
catch
@@ -79,6 +93,7 @@ namespace frugalmonotools
StreamWriter FileConf = new StreamWriter(GetConfFile());
if (Get_CheckUpdate()) FileConf.WriteLine("checkupdate");
if (!Get_StartWithX()) FileConf.WriteLine("dontstartwithx");
+                               if (!Get_ShowNotif()) 
FileConf.WriteLine("dontshownotif");
FileConf.Close();
}
catch(Exception exe)
diff --git a/frugal-mono-tools/Main.cs b/frugal-mono-tools/Main.cs
index 44613e4..856ea37 100644
--- a/frugal-mono-tools/Main.cs
+++ b/frugal-mono-tools/Main.cs
@@ -62,7 +62,7 @@ namespace frugalmonotools
Console.WriteLine(pkg.packagename+" can be updated to "+pkg.packageversion);
}
}
-                               notif.ShowMessage("Frugalware","Some update are 
available.");
+                               if(configuration.Get_ShowNotif()) 
notif.ShowMessage("Frugalware","Some update are available.");
Console.WriteLine("Some packages can be updated.");
}
}
diff --git a/frugal-mono-tools/MainWindow.cs b/frugal-mono-tools/MainWindow.cs
index 8d7c5dd..6575866 100644
--- a/frugal-mono-tools/MainWindow.cs
+++ b/frugal-mono-tools/MainWindow.cs
@@ -275,6 +275,7 @@ public partial class MainWindow : Gtk.Window
//configuration
INT_CheckStartup.Active=MainClass.configuration.Get_CheckUpdate();
INT_StartWithXSession.Active=MainClass.configuration.Get_StartWithX();
+               INT_ShowNotif.Active=MainClass.configuration.Get_ShowNotif();
}

protected void OnDeleteEvent (object sender, DeleteEventArgs a)
@@ -722,6 +723,7 @@ public partial class MainWindow : Gtk.Window
{
MainClass.configuration.Set_CheckUpdate(INT_CheckStartup.Active);
MainClass.configuration.Set_StartWithX(INT_StartWithXSession.Active);
+               MainClass.configuration.Set_ShowNotif(INT_ShowNotif.Active);
MainClass.configuration.ConfSave();
}

diff --git a/frugal-mono-tools/gtk-gui/MainWindow.cs 
b/frugal-mono-tools/gtk-gui/MainWindow.cs
index d6af576..a10da0e 100644
--- a/frugal-mono-tools/gtk-gui/MainWindow.cs
+++ b/frugal-mono-tools/gtk-gui/MainWindow.cs
@@ -183,6 +183,8 @@ public partial class MainWindow

private global::Gtk.CheckButton INT_StartWithXSession;

+       private global::Gtk.CheckButton INT_ShowNotif;
+
private global::Gtk.HBox hbox21;

private global::Gtk.Button BTN_SaveConf;
@@ -207,7 +209,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 = 1;
+               this.ONG_principal.CurrentPage = 7;
// Container child ONG_principal.Gtk.Notebook+NotebookChild
this.vbox4 = new global::Gtk.VBox ();
this.vbox4.Name = "vbox4";
@@ -1049,6 +1051,19 @@ public partial class MainWindow
w81.Expand = false;
w81.Fill = false;
// Container child vbox8.Gtk.Box+BoxChild
+               this.INT_ShowNotif = new global::Gtk.CheckButton ();
+               this.INT_ShowNotif.CanFocus = true;
+               this.INT_ShowNotif.Name = "INT_ShowNotif";
+               this.INT_ShowNotif.Label = global::Mono.Unix.Catalog.GetString 
("Show notification");
+               this.INT_ShowNotif.Active = true;
+               this.INT_ShowNotif.DrawIndicator = true;
+               this.INT_ShowNotif.UseUnderline = true;
+               this.vbox8.Add (this.INT_ShowNotif);
+               global::Gtk.Box.BoxChild w82 = 
((global::Gtk.Box.BoxChild)(this.vbox8[this.INT_ShowNotif]));
+               w82.Position = 2;
+               w82.Expand = false;
+               w82.Fill = false;
+               // Container child vbox8.Gtk.Box+BoxChild
this.hbox21 = new global::Gtk.HBox ();
this.hbox21.Name = "hbox21";
this.hbox21.Spacing = 6;
@@ -1059,18 +1074,18 @@ public partial class MainWindow
this.BTN_SaveConf.UseUnderline = true;
this.BTN_SaveConf.Label = global::Mono.Unix.Catalog.GetString ("Apply");
this.hbox21.Add (this.BTN_SaveConf);
-               global::Gtk.Box.BoxChild w82 = 
((global::Gtk.Box.BoxChild)(this.hbox21[this.BTN_SaveConf]));
-               w82.Position = 2;
-               w82.Expand = false;
-               w82.Fill = false;
-               this.vbox8.Add (this.hbox21);
-               global::Gtk.Box.BoxChild w83 = 
((global::Gtk.Box.BoxChild)(this.vbox8[this.hbox21]));
-               w83.Position = 3;
+               global::Gtk.Box.BoxChild w83 = 
((global::Gtk.Box.BoxChild)(this.hbox21[this.BTN_SaveConf]));
+               w83.Position = 2;
w83.Expand = false;
w83.Fill = false;
+               this.vbox8.Add (this.hbox21);
+               global::Gtk.Box.BoxChild w84 = 
((global::Gtk.Box.BoxChild)(this.vbox8[this.hbox21]));
+               w84.Position = 4;
+               w84.Expand = false;
+               w84.Fill = false;
this.ONG_principal.Add (this.vbox8);
-               global::Gtk.Notebook.NotebookChild w84 = 
((global::Gtk.Notebook.NotebookChild)(this.ONG_principal[this.vbox8]));
-               w84.Position = 7;
+               global::Gtk.Notebook.NotebookChild w85 = 
((global::Gtk.Notebook.NotebookChild)(this.ONG_principal[this.vbox8]));
+               w85.Position = 7;
// Notebook tab
this.Configuration = new global::Gtk.Label ();
this.Configuration.Name = "Configuration";
@@ -1088,8 +1103,8 @@ public partial class MainWindow
this.textview2.Name = "textview2";
this.GtkScrolledWindow2.Add (this.textview2);
this.ONG_principal.Add (this.GtkScrolledWindow2);
-               global::Gtk.Notebook.NotebookChild w86 = 
((global::Gtk.Notebook.NotebookChild)(this.ONG_principal[this.GtkScrolledWindow2]));
-               w86.Position = 8;
+               global::Gtk.Notebook.NotebookChild w87 = 
((global::Gtk.Notebook.NotebookChild)(this.ONG_principal[this.GtkScrolledWindow2]));
+               w87.Position = 8;
// Notebook tab
this.label6 = new global::Gtk.Label ();
this.label6.Name = "label6";
diff --git a/frugal-mono-tools/gtk-gui/gui.stetic 
b/frugal-mono-tools/gtk-gui/gui.stetic
index 8043883..61264fc 100644
--- a/frugal-mono-tools/gtk-gui/gui.stetic
+++ b/frugal-mono-tools/gtk-gui/gui.stetic
@@ -9,7 +9,7 @@
<widget-library name="webkit-sharp, Version=1.1.15.0, Culture=neutral, 
PublicKeyToken=eaa1d335d2e19745" />
<widget-library name="notify-sharp, Version=0.4.0.0, Culture=neutral, 
PublicKeyToken=2df29c54e245917a" />
<widget-library name="vte-sharp, Version=0.16.0.0, Culture=neutral, 
PublicKeyToken=35e10195dab3c99f" />
-    <widget-library name="../bin/Release/frugal-mono-tools.exe" 
internal="true" />
+    <widget-library name="../bin/Debug/frugal-mono-tools.exe" internal="true" 
/>
</import>
<icon-factory>
<icon-set id="iconeFwCC">
@@ -28,7 +28,7 @@
<widget class="Gtk.Notebook" id="ONG_principal">
<property name="MemberName" />
<property name="CanFocus">True</property>
-        <property name="CurrentPage">1</property>
+        <property name="CurrentPage">7</property>
<child>
<widget class="Gtk.VBox" id="vbox4">
<property name="MemberName" />
@@ -1225,6 +1225,23 @@ ztv</property>
</packing>
</child>
<child>
+              <widget class="Gtk.CheckButton" id="INT_ShowNotif">
+                <property name="MemberName" />
+                <property name="CanFocus">True</property>
+                <property name="Label" translatable="yes">Show 
notification</property>
+                <property name="Active">True</property>
+                <property name="DrawIndicator">True</property>
+                <property name="HasLabel">True</property>
+                <property name="UseUnderline">True</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>
+            <child>
<placeholder />
</child>
<child>
@@ -1255,7 +1272,7 @@ ztv</property>
</child>
</widget>
<packing>
-                <property name="Position">3</property>
+                <property name="Position">4</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
diff --git a/frugal-mono-tools/splash.cs b/frugal-mono-tools/splash.cs
index ec235f7..8f25484 100644
--- a/frugal-mono-tools/splash.cs
+++ b/frugal-mono-tools/splash.cs
@@ -28,7 +28,7 @@ namespace frugalmonotools
}
try{
IconSummaryBody notif= new IconSummaryBody();
-                               notif.ShowMessage("Frugalware","Some update are 
available.");
+                               if(MainClass.configuration.Get_ShowNotif()) 
notif.ShowMessage("Frugalware","Some update are available.");
}
catch{}
Console.WriteLine("Some packages can be updated.");
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to