about summary refs log tree commit diff stats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java2
-rw-r--r--client/trunk/src/com/fourisland/instadisc/InstaDiscApp.java3
-rw-r--r--client/trunk/src/com/fourisland/instadisc/InstaDiscView.java17
-rw-r--r--client/trunk/src/com/fourisland/instadisc/Item/Categories/Category.java3
-rw-r--r--client/trunk/src/com/fourisland/instadisc/Item/Categories/InstaDiscIcon.java6
-rw-r--r--client/trunk/src/com/fourisland/instadisc/Item/Item.java7
6 files changed, 37 insertions, 1 deletions
diff --git a/client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java b/client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java index 644217f..39c6445 100644 --- a/client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java +++ b/client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java
@@ -24,7 +24,7 @@ public class IDItemListCellRenderer extends JLabel implements ListCellRenderer {
24 Item item = (Item) arg1; 24 Item item = (Item) arg1;
25 25
26 this.setIcon(Category.iconFromCategory(Wrapper.getSubscription(item.getSubscription()).getCategory())); 26 this.setIcon(Category.iconFromCategory(Wrapper.getSubscription(item.getSubscription()).getCategory()));
27 this.setText("<HTML><I>" + Wrapper.getSubscription(item.getSubscription()).getTitle() + "</I><B>" + item.getTitle() + "</B> by " + item.getAuthor()); 27 this.setText("<HTML><I>" + Wrapper.getSubscription(item.getSubscription()).getTitle() + "</I>, <B>" + item.getTitle() + "</B> by " + item.getAuthor());
28 28
29 /*if (item.getUnread()) { 29 /*if (item.getUnread()) {
30 this.setBackground(Color.YELLOW); 30 this.setBackground(Color.YELLOW);
diff --git a/client/trunk/src/com/fourisland/instadisc/InstaDiscApp.java b/client/trunk/src/com/fourisland/instadisc/InstaDiscApp.java index cd3f1dd..dffb663 100644 --- a/client/trunk/src/com/fourisland/instadisc/InstaDiscApp.java +++ b/client/trunk/src/com/fourisland/instadisc/InstaDiscApp.java
@@ -5,6 +5,7 @@ package com.fourisland.instadisc;
5 5
6import com.fourisland.instadisc.Database.Wrapper; 6import com.fourisland.instadisc.Database.Wrapper;
7import com.fourisland.instadisc.FirstRun.FirstRunWizard; 7import com.fourisland.instadisc.FirstRun.FirstRunWizard;
8import java.awt.TrayIcon;
8import java.io.File; 9import java.io.File;
9import org.jdesktop.application.Application; 10import org.jdesktop.application.Application;
10import org.jdesktop.application.SingleFrameApplication; 11import org.jdesktop.application.SingleFrameApplication;
@@ -14,6 +15,8 @@ import org.jdesktop.application.SingleFrameApplication;
14 */ 15 */
15public class InstaDiscApp extends SingleFrameApplication { 16public class InstaDiscApp extends SingleFrameApplication {
16 17
18 public static TrayIcon ti;
19
17 /** 20 /**
18 * At startup create and show the main frame of the application. 21 * At startup create and show the main frame of the application.
19 */ 22 */
diff --git a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java index 70be2c1..d9a6c8a 100644 --- a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java +++ b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java
@@ -5,6 +5,11 @@ package com.fourisland.instadisc;
5 5
6import com.fourisland.instadisc.Database.Item; 6import com.fourisland.instadisc.Database.Item;
7import com.fourisland.instadisc.Database.Wrapper; 7import com.fourisland.instadisc.Database.Wrapper;
8import com.fourisland.instadisc.Item.Categories.InstaDiscIcon;
9import java.awt.AWTException;
10import java.awt.Image;
11import java.awt.SystemTray;
12import java.awt.TrayIcon;
8import org.jdesktop.application.Action; 13import org.jdesktop.application.Action;
9import org.jdesktop.application.ResourceMap; 14import org.jdesktop.application.ResourceMap;
10import org.jdesktop.application.SingleFrameApplication; 15import org.jdesktop.application.SingleFrameApplication;
@@ -20,6 +25,7 @@ import java.util.logging.Logger;
20import javax.swing.DefaultListModel; 25import javax.swing.DefaultListModel;
21import javax.swing.Timer; 26import javax.swing.Timer;
22import javax.swing.Icon; 27import javax.swing.Icon;
28import javax.swing.ImageIcon;
23import javax.swing.JDialog; 29import javax.swing.JDialog;
24import javax.swing.JFrame; 30import javax.swing.JFrame;
25 31
@@ -89,6 +95,17 @@ public class InstaDiscView extends FrameView {
89 } 95 }
90 } 96 }
91 }); 97 });
98
99 if (SystemTray.isSupported())
100 {
101 try {
102 TrayIcon ti = new TrayIcon(new ImageIcon(InstaDiscIcon.instadiscicon).getImage(), "InstaDisc");
103 SystemTray.getSystemTray().add(ti);
104 InstaDiscApp.ti = ti;
105 } catch (AWTException ex) {
106 Logger.getLogger(InstaDiscView.class.getName()).log(Level.SEVERE, null, ex);
107 }
108 }
92 109
93 jList1.setCellRenderer(new IDItemListCellRenderer()); 110 jList1.setCellRenderer(new IDItemListCellRenderer());
94 jList1.setModel(lm); 111 jList1.setModel(lm);
diff --git a/client/trunk/src/com/fourisland/instadisc/Item/Categories/Category.java b/client/trunk/src/com/fourisland/instadisc/Item/Categories/Category.java index 497d323..29914b9 100644 --- a/client/trunk/src/com/fourisland/instadisc/Item/Categories/Category.java +++ b/client/trunk/src/com/fourisland/instadisc/Item/Categories/Category.java
@@ -21,6 +21,9 @@ public class Category {
21 if (category.equals("blog-post")) 21 if (category.equals("blog-post"))
22 { 22 {
23 return new ImageIcon(Blogpost.blogpost); 23 return new ImageIcon(Blogpost.blogpost);
24 } else if (category.equals("instadisc"))
25 {
26 return new ImageIcon(InstaDiscIcon.instadiscicon);
24 } 27 }
25 return null; 28 return null;
26 } 29 }
diff --git a/client/trunk/src/com/fourisland/instadisc/Item/Categories/InstaDiscIcon.java b/client/trunk/src/com/fourisland/instadisc/Item/Categories/InstaDiscIcon.java new file mode 100644 index 0000000..3405a3e --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/Item/Categories/InstaDiscIcon.java
@@ -0,0 +1,6 @@
1package com.fourisland.instadisc.Item.Categories;
2
3public class InstaDiscIcon
4{
5 public static byte[] instadiscicon = new byte[] {-119,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,-13,-1,97,0,0,0,1,115,82,71,66,0,-82,-50,28,-23,0,0,0,6,98,75,71,68,0,-1,0,-1,0,-1,-96,-67,-89,-109,0,0,0,9,112,72,89,115,0,0,11,19,0,0,11,19,1,0,-102,-100,24,0,0,0,7,116,73,77,69,7,-40,7,30,11,31,50,57,-121,120,-95,0,0,0,25,116,69,88,116,67,111,109,109,101,110,116,0,67,114,101,97,116,101,100,32,119,105,116,104,32,71,73,77,80,87,-127,14,23,0,0,0,93,73,68,65,84,56,-53,-27,-111,49,14,-64,32,12,3,125,81,-1,-1,-27,116,75,35,74,84,104,-70,-43,3,-125,37,-50,-40,72,73,-18,114,109,-118,-39,101,-72,124,-87,-124,18,-57,44,57,65,60,7,13,80,-84,122,-10,67,-99,0,-102,-102,-78,-95,-81,-118,29,106,-64,-53,10,-70,85,0,1,-21,-55,-107,124,-47,11,-65,63,-30,127,1,49,-20,-47,-8,29,-12,-123,78,107,58,29,23,-107,-38,-46,31,0,0,0,0,73,69,78,68,-82,66,96,-126,-1};
6}
diff --git a/client/trunk/src/com/fourisland/instadisc/Item/Item.java b/client/trunk/src/com/fourisland/instadisc/Item/Item.java index e67b1ec..71e6f06 100644 --- a/client/trunk/src/com/fourisland/instadisc/Item/Item.java +++ b/client/trunk/src/com/fourisland/instadisc/Item/Item.java
@@ -8,6 +8,8 @@ import com.fourisland.instadisc.Database.Wrapper;
8import com.fourisland.instadisc.InstaDiscApp; 8import com.fourisland.instadisc.InstaDiscApp;
9import com.fourisland.instadisc.InstaDiscView; 9import com.fourisland.instadisc.InstaDiscView;
10import com.fourisland.instadisc.XmlRpc; 10import com.fourisland.instadisc.XmlRpc;
11import java.awt.SystemTray;
12import java.awt.TrayIcon.MessageType;
11import java.net.MalformedURLException; 13import java.net.MalformedURLException;
12import java.net.URL; 14import java.net.URL;
13import java.util.HashMap; 15import java.util.HashMap;
@@ -60,6 +62,11 @@ public class Item {
60 } catch (MalformedURLException ex) { 62 } catch (MalformedURLException ex) {
61 Logger.getLogger(Item.class.getName()).log(Level.SEVERE, null, ex); 63 Logger.getLogger(Item.class.getName()).log(Level.SEVERE, null, ex);
62 } 64 }
65
66 if (SystemTray.isSupported())
67 {
68 InstaDiscApp.ti.displayMessage("New item recieved!", Wrapper.getSubscription(headerMap.get("Subscription")).getTitle() + ", " + headerMap.get("Title") + " by " + headerMap.get("Author"), MessageType.INFO);
69 }
63 70
64 ((InstaDiscView)InstaDiscApp.getApplication().getMainView()).refreshItemPane(); 71 ((InstaDiscView)InstaDiscApp.getApplication().getMainView()).refreshItemPane();
65 } 72 }