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

commit 6cee6812eb5e0c78b074fdbac344cc5f8e2cdc34
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Fri Dec 31 15:08:08 2010 +0100

*added popup notification

diff --git a/frugal-tweak-vala/Makefile b/frugal-tweak-vala/Makefile
index 9ad95c6..c602aa9 100644
--- a/frugal-tweak-vala/Makefile
+++ b/frugal-tweak-vala/Makefile
@@ -9,14 +9,14 @@ BROWSERSOURCES = $(SOURCEDIR)/browser.vala
PACMANUPDATESOURCES = $(SOURCEDIR)/Tree.vala $(SOURCEDIR)/Pacman-update.vala 
$(SOURCEDIR)/pacman.vala $(SOURCEDIR)/tools.vala

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

all: daemon terminal browser frugalwaretweak pacmanupdate

frugalwaretweak:
-       #gtk-builder-convert DATA/MainGUI.glade DATA/MainGUI.ui
-       $(VALAC) --define=$(VALAFLAG) --pkg gio-2.0 --pkg gtk+-2.0 --pkg 
gmodule-2.0 --pkg pacman  --pkg unique-1.0 \
+       $(VALAC) --define=$(VALAFLAG) --pkg gio-2.0 --pkg gtk+-2.0 --pkg 
gmodule-2.0 --pkg pacman  --pkg unique-1.0 --pkg libnotify \
$(FRUGALTWEAKSOURCES) -o frugalware-tweak

pacmanupdate:
@@ -32,7 +32,6 @@ browser:
$(VALAC) --define=$(VALAFLAG) --pkg gtk+-2.0 --pkg webkit-1.0 $(BROWSERSOURCES) 
-o frugalware-tweak-browser

clean:
-       @rm DATA/*.ui
@rm frugalware-tweak-terminal
@rm frugalware-tweak-daemon
@rm frugalware-tweak-browser
diff --git a/frugal-tweak-vala/src/MainClient.vala 
b/frugal-tweak-vala/src/MainClient.vala
index 21ed339..78548c4 100644
--- a/frugal-tweak-vala/src/MainClient.vala
+++ b/frugal-tweak-vala/src/MainClient.vala
@@ -19,9 +19,11 @@

using Gtk;
using Unique;
+using Popup;
using Tree;

int main (string[] args) {
+
Unique.App app;
Gtk.init (ref args);
app = new Unique.App("org.fwtweak.unique", null);
@@ -45,19 +47,16 @@ int main (string[] args) {
window.position = WindowPosition.CENTER;
window.destroy.connect (Gtk.main_quit);

-/*
-       var button = new Button.with_label ("Click me!");
-       button.clicked.connect (() => {
-       button.label = "Thank you";
-       });
-
-       window.add (button);
-*/
//added treeview for modules
var view = new TreeView ();
Tree.setup_treeviewModule (view);
window.add(view);

+       #if DEBUG==1
+               //for tested notification
+               Popup.PopupShow("titre test","test");
+       #endif
+
window.show_all ();

Gtk.main ();
diff --git a/frugal-tweak-vala/src/popup.vala b/frugal-tweak-vala/src/popup.vala
new file mode 100644
index 0000000..3703d12
--- /dev/null
+++ b/frugal-tweak-vala/src/popup.vala
@@ -0,0 +1,41 @@
+/*
+ *
+ * (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
+ */
+
+using Notify;
+using Tools;
+
+public static class Popup  {
+
+       public static void PopupShow(string title,string text) {
+               Notify.init("Frugalware-tweak");
+               var notification = new Notification (title,text, "icon_name", 
null);
+                       notification.set_timeout(5000);
+               notification.set_urgency(Notify.Urgency.LOW);
+               try
+               {
+                       notification.show();
+                       ConsoleDebug(text);
+               }
+               catch
+               {
+                       ConsoleDebug("Unable to show low notification");
+               }
+       }
+}
+
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to