Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=1c9f4211902a5f3f911abaef8f3a1687eef0555f

commit 1c9f4211902a5f3f911abaef8f3a1687eef0555f
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Fri Dec 31 16:24:24 2010 +0100

*use backend glib for configuration

diff --git a/frugal-tweak-vala/DATA/org.frugalware.frugaltweak.gschema.xml 
b/frugal-tweak-vala/DATA/org.frugalware.frugaltweak.gschema.xml
new file mode 100644
index 0000000..4236ab9
--- /dev/null
+++ b/frugal-tweak-vala/DATA/org.frugalware.frugaltweak.gschema.xml
@@ -0,0 +1,13 @@
+<schemalist>
+  <schema id="org.frugalware.frugaltweak" path="/org/frugalware/frugaltweak/" 
gettext-domain="frugaltweak">
+
+    <key name="shownotif" type="b">
+      <summary>Show Notification</summary>
+      <default>true</default>
+      <description>
+        Show the notifications into frugalware tweak
+      </description>
+    </key>
+
+  </schema>
+</schemalist>
diff --git a/frugal-tweak-vala/Makefile b/frugal-tweak-vala/Makefile
index c602aa9..f9f4dfa 100644
--- a/frugal-tweak-vala/Makefile
+++ b/frugal-tweak-vala/Makefile
@@ -10,7 +10,7 @@ PACMANUPDATESOURCES = $(SOURCEDIR)/Tree.vala 
$(SOURCEDIR)/Pacman-update.vala $(S

#for start modules
FRUGALTWEAKSOURCES = $(SOURCEDIR)/MainClient.vala $(SOURCEDIR)/Tree.vala 
$(SOURCEDIR)/pacman.vala $(SOURCEDIR)/tools.vala \
-                                               $(SOURCEDIR)/popup.vala
+                                               $(SOURCEDIR)/popup.vala 
$(SOURCEDIR)/configuration.vala
VALAC = valac

all: daemon terminal browser frugalwaretweak pacmanupdate
diff --git a/frugal-tweak-vala/src/configuration.vala 
b/frugal-tweak-vala/src/configuration.vala
new file mode 100644
index 0000000..058af94
--- /dev/null
+++ b/frugal-tweak-vala/src/configuration.vala
@@ -0,0 +1,33 @@
+/*
+ *
+ * (C) 2010 bouleetbil <bouleet...@frogdev.info>
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  
USA
+ */
+
+
+public static class Configuration  {
+
+       public static bool GetShowNotif()
+       {
+               var settings = new Settings ("org.frugalware.frugaltweak");
+               return settings.get_boolean ("shownotif");
+       }
+       public static void SetShowNotif(bool enable)
+       {
+               var settings = new Settings ("org.frugalware.frugaltweak");
+               settings.set_boolean ("shownotif", enable);
+       }
+}
diff --git a/frugal-tweak-vala/src/popup.vala b/frugal-tweak-vala/src/popup.vala
index 3703d12..712b3a9 100644
--- a/frugal-tweak-vala/src/popup.vala
+++ b/frugal-tweak-vala/src/popup.vala
@@ -19,13 +19,16 @@

using Notify;
using Tools;
+using Configuration;

public static class Popup  {

public static void PopupShow(string title,string text) {
+               if(!GetShowNotif()) return ;
+
Notify.init("Frugalware-tweak");
var notification = new Notification (title,text, "icon_name", null);
-                       notification.set_timeout(5000);
+               notification.set_timeout(5000);
notification.set_urgency(Notify.Urgency.LOW);
try
{
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to