[jkota commit] r143 - GTK+ arayüzüne bildirimler eklendi.

0 views
Skip to first unread message

codesite...@google.com

unread,
Apr 4, 2009, 1:18:48 AM4/4/09
to jkota-...@googlegroups.com
Author: serkankaba
Date: Fri Apr 3 22:07:27 2009
New Revision: 143

Modified:
branches/GTK/src/com/googlecode/jkota/gtk/GtkKota.java

Log:
GTK+ arayüzüne bildirimler eklendi.

Modified: branches/GTK/src/com/googlecode/jkota/gtk/GtkKota.java
==============================================================================
--- branches/GTK/src/com/googlecode/jkota/gtk/GtkKota.java (original)
+++ branches/GTK/src/com/googlecode/jkota/gtk/GtkKota.java Fri Apr 3
22:07:27 2009
@@ -11,11 +11,16 @@
import org.gnome.gtk.Menu;
import org.gnome.gtk.MenuItem;
import org.gnome.gtk.StatusIcon;
+import org.gnome.notify.Notification;
+import org.gnome.notify.Notify;

import com.googlecode.jkota.BaseKota;
+import com.googlecode.jkota.DownloadNotificationEvent;
+import com.googlecode.jkota.DownloadNotificationListener;
+import com.googlecode.jkota.DownloadNotificationType;
import com.googlecode.jkota.LogManager;

-public class GtkKota extends BaseKota {
+public class GtkKota extends BaseKota implements
DownloadNotificationListener {

private MenuItem quit,settings,about,logfile,clipboard,statistics;
private StatusIcon icon;
@@ -28,6 +33,16 @@
}

@Override
+ public void notification(DownloadNotificationEvent e) {
+ Notification notification=null;
+ if(e.getType()==DownloadNotificationType.WARNING)
+ notification=new
Notification("UYARI",e.getMessage(),"messagebox_warning",icon);
+ if(e.getType()==DownloadNotificationType.INFO)
+ notification=new
Notification("BİLGİ",e.getMessage(),"messagebox_info",icon);
+ notification.show();
+ }
+
+ @Override
public void initUI() {
icon= new StatusIcon("favicon.png");
icon.connect(
@@ -79,6 +94,7 @@

public static void main(String[] args) {
Gtk.init(args);
+ Notify.init("jkota");
new GtkKota();
Gtk.main();
}
@@ -88,6 +104,7 @@
public void onActivate(MenuItem source) {
if(source==quit) {
preQuit();
+ Notify.uninit();
Gtk.mainQuit();
}
if(source==logfile) {
Reply all
Reply to author
Forward
0 new messages