Author: jflesch
Date: 2007-08-13 09:59:40 +0000 (Mon, 13 Aug 2007)
New Revision: 14639
Added:
trunk/apps/Thaw/images/mail.png
trunk/apps/Thaw/images/min-mail.png
Modified:
trunk/apps/Thaw/src/thaw/core/Main.java
trunk/apps/Thaw/src/thaw/gui/IconBox.java
trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
trunk/apps/Thaw/src/thaw/i18n/thaw.properties
trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
trunk/apps/Thaw/src/thaw/plugins/MiniFrost.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/BoardManagementHelper.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoard.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoardFactory.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/SSKBoardFactory.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Board.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/BoardFactory.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Message.java
Log:
Changing the version from 0.7.1 to 0.7.9 (pre-0.8)
Added: trunk/apps/Thaw/images/mail.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/mail.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/apps/Thaw/images/min-mail.png
===================================================================
(Binary files differ)
Property changes on: trunk/apps/Thaw/images/min-mail.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/apps/Thaw/src/thaw/core/Main.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/Main.java 2007-08-12 12:29:05 UTC (rev
14638)
+++ trunk/apps/Thaw/src/thaw/core/Main.java 2007-08-13 09:59:40 UTC (rev
14639)
@@ -29,7 +29,7 @@
public final static int
_major = 0,
_minor = 7,
- _update = 1;
+ _update = 9;
public final static String
_svnBuildNumber = "@custom@";
Modified: trunk/apps/Thaw/src/thaw/gui/IconBox.java
===================================================================
--- trunk/apps/Thaw/src/thaw/gui/IconBox.java 2007-08-12 12:29:05 UTC (rev
14638)
+++ trunk/apps/Thaw/src/thaw/gui/IconBox.java 2007-08-13 09:59:40 UTC (rev
14639)
@@ -168,7 +168,10 @@
public static ImageIcon markAsRead;
public static ImageIcon minMarkAsRead;
+ public static ImageIcon mail;
+ public static ImageIcon minMail;
+
/**
* Not really used
*/
@@ -308,6 +311,8 @@
IconBox.minAttachment =
IconBox.loadIcon("images/min-mail-attachment.png");
IconBox.windowNew =
IconBox.loadIcon("images/window-new.png");
IconBox.minWindowNew =
IconBox.loadIcon("images/min-window-new.png");
+ IconBox.mail =
IconBox.loadIcon("images/mail.png");
+ IconBox.minMail =
IconBox.loadIcon("images/min-mail.png");
}
}
Modified: trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-08-12
12:29:05 UTC (rev 14638)
+++ trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-08-13
09:59:40 UTC (rev 14639)
@@ -631,3 +631,5 @@
thaw.plugin.miniFrost.collision=Collision au moment de l'insertion d'un
message sur la board 'X'.\n Nouvel essai sur un nouveau slot.
+thaw.plugin.miniFrost.outBox=[en cours d'envoi]
+thaw.plugin.miniFrost.sentBox=[envoy?s]
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-08-12 12:29:05 UTC
(rev 14638)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-08-13 09:59:40 UTC
(rev 14639)
@@ -645,3 +645,6 @@
thaw.plugin.miniFrost.actions=[ACTIONS]
thaw.plugin.miniFrost.collision=Collision while inserting a message for the
board 'X'.\n Will try with another slot.
+
+thaw.plugin.miniFrost.outBox=[outbox]
+thaw.plugin.miniFrost.sentBox=[sent]
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2007-08-12 12:29:05 UTC
(rev 14638)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2007-08-13 09:59:40 UTC
(rev 14639)
@@ -631,3 +631,5 @@
thaw.plugin.miniFrost.collision=Collision au moment de l'insertion d'un
message sur la board 'X'.\n Nouvel essai sur un nouveau slot.
+thaw.plugin.miniFrost.outBox=[en cours d'envoi]
+thaw.plugin.miniFrost.sentBox=[envoy\u00e9s]
Modified: trunk/apps/Thaw/src/thaw/plugins/MiniFrost.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/MiniFrost.java 2007-08-12 12:29:05 UTC
(rev 14638)
+++ trunk/apps/Thaw/src/thaw/plugins/MiniFrost.java 2007-08-13 09:59:40 UTC
(rev 14639)
@@ -32,7 +32,8 @@
public final static BoardFactory[] factories =
new BoardFactory[] {
new thaw.plugins.miniFrost.frostKSK.KSKBoardFactory(),
- new thaw.plugins.miniFrost.frostKSK.SSKBoardFactory()
+ new thaw.plugins.miniFrost.frostKSK.SSKBoardFactory(),
+ new thaw.plugins.miniFrost.SpecialBoardFactory()
};
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/BoardManagementHelper.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/BoardManagementHelper.java
2007-08-12 12:29:05 UTC (rev 14638)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/BoardManagementHelper.java
2007-08-13 09:59:40 UTC (rev 14639)
@@ -60,13 +60,32 @@
private BoardFactory selection;
public BoardTypeAsker(MiniFrostPanel mainPanel) {
+ BoardFactory[] fs =
mainPanel.getPluginCore().getFactories();
+
+ int toremove = 0;
+
+ for (int i = 0 ; i < fs.length ; i++)
+ if (fs[i].toString() == null)
+ toremove++;
+
+ BoardFactory[] factories = new BoardFactory[fs.length -
toremove];
+
+ int removed = 0;
+
+ for (int i = 0 ; i < fs.length ; i++) {
+ if (fs[i].toString() != null)
+ factories[i-removed] = fs[i];
+ else
+ removed++;
+ }
+
selection =
(BoardFactory)JOptionPane.showInputDialog(mainPanel.getPluginCore().getCore().getMainWindow().getMainFrame(),
I18n.getMessage("thaw.plugin.miniFrost.selectType"),
I18n.getMessage("thaw.plugin.miniFrost.selectType"),
JOptionPane.QUESTION_MESSAGE,
null, /* icon */
-
mainPanel.getPluginCore().getFactories(),
-
mainPanel.getPluginCore().getFactories()[0]);
+
factories,
+
factories[0]);
}
public BoardFactory getSelection() {
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
2007-08-12 12:29:05 UTC (rev 14638)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
2007-08-13 09:59:40 UTC (rev 14639)
@@ -81,7 +81,7 @@
insidePanel = null;
- panel = new JPanel(new BorderLayout(5, 5));
+ panel = new JPanel(new BorderLayout(15, 15));
/* messages Panel */
@@ -115,6 +115,8 @@
buttonPanel.add(reply);
subject = new JLabel("");
+ subject.setIcon(IconBox.minMail);
+ subject.setIconTextGap(15);
JPanel northPanel = new JPanel(new BorderLayout(5, 5));
JPanel northNorthPanel = new JPanel(new BorderLayout(5,5));
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoard.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoard.java
2007-08-12 12:29:05 UTC (rev 14638)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoard.java
2007-08-13 09:59:40 UTC (rev 14639)
@@ -832,4 +832,10 @@
public int compareTo(Object o) {
return toString().compareToIgnoreCase(o.toString());
}
+
+ public boolean equals(Object o) {
+ if (!(o instanceof KSKBoard))
+ return false;
+ return ( ((KSKBoard)o).getId() == getId() );
+ }
}
Modified:
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoardFactory.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoardFactory.java
2007-08-12 12:29:05 UTC (rev 14638)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoardFactory.java
2007-08-13 09:59:40 UTC (rev 14639)
@@ -15,7 +15,9 @@
import thaw.plugins.Hsqldb;
import thaw.plugins.MiniFrost;
+import thaw.plugins.signatures.Identity;
+import thaw.plugins.miniFrost.interfaces.Board;
public class KSKBoardFactory
@@ -48,7 +50,8 @@
private Core core;
private MiniFrost plugin;
- private HashMap boards;
+ private HashMap boardsHashMap;
+ private Vector boards;
public KSKBoardFactory() {
@@ -69,7 +72,7 @@
if (firstStart)
addDefaultBoards();
- boards = new HashMap();
+ boardsHashMap = new HashMap();
return true;
}
@@ -323,8 +326,8 @@
String name = set.getString("name");
Date lastUpdate =
set.getDate("lastUpdate");
- if (boards.get(name) != null)
- v.add(boards.get(name));
+ if (boardsHashMap.get(name) != null)
+ v.add(boardsHashMap.get(name));
else {
int count =
countNewMessages(id);
@@ -333,7 +336,7 @@
count);
v.add(board);
- boards.put(name, board);
+ boardsHashMap.put(name, board);
}
}
}
@@ -341,13 +344,18 @@
Logger.error(this, "Can't get the board list because :
"+e.toString());
}
+ boards = v;
+
return v;
}
+ /**
+ * A little bit inefficient function ...
+ */
protected KSKBoard getBoard(int id) {
- for (Iterator it = boards.values().iterator();
+ for (Iterator it = boards.iterator();
it.hasNext();) {
KSKBoard board = (KSKBoard)it.next();
@@ -369,7 +377,68 @@
}
+ public Vector getSentMessages() {
+ Vector v = new Vector();
+ try {
+ synchronized(db.dbLock) {
+ Vector identities =
Identity.getYourIdentities(db);
+
+ PreparedStatement st;
+
+ st =
db.getConnection().prepareStatement("SELECT "+
+ " id,
"+
+ "
subject, "+
+ "
nick, "+
+ "
keyDate, "+
+ "
date, "+
+ "
msgId, "+
+ " rev,
"+
+ "
read, "+
+ "
archived, "+
+ "
encryptedFor, "+
+ "
boardId "+
+ "FROM
frostKSKMessages "+
+ "WHERE
sigId = ? ORDER by DATE DESC");
+
+ for (Iterator it = identities.iterator();
+ it.hasNext() ; ) {
+ Identity identity = (Identity)it.next();
+
+ st.setInt(1, identity.getId());
+
+ ResultSet set = st.executeQuery();
+
+ while (set.next()) {
+ KSKBoard board =
getBoard(set.getInt("boardId"));
+ v.add(new
KSKMessage(set.getInt("id"),
+
set.getString("msgId"),
+ null, /*
in reply to => We don't want a tree to be built */
+
set.getString("subject"),
+
identity.toString(),
+
identity.getId(),
+ identity,
+
set.getDate("date"),
+
set.getInt("rev"),
+
set.getBoolean("read"),
+
set.getBoolean("archived"),
+ null, /*
TODO : encryptedFor */
+ board));
+ }
+
+ }
+
+ }
+ } catch(SQLException e) {
+ Logger.error(this, "Can't get the sent messages because
: "+
+ e.toString());
+ }
+
+
+ return v;
+ }
+
+
public void createBoard(thaw.core.MainWindow mainWindow) {
String name =
JOptionPane.showInputDialog(mainWindow.getMainFrame(),
I18n.getMessage("thaw.plugin.miniFrost.boardName"),
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java
2007-08-12 12:29:05 UTC (rev 14638)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java
2007-08-13 09:59:40 UTC (rev 14639)
@@ -18,15 +18,14 @@
import thaw.plugins.Hsqldb;
import thaw.plugins.signatures.Identity;
+import thaw.plugins.miniFrost.interfaces.Message;
-
/**
* only notify when the message has been fully parsed
*/
public class KSKMessage
extends Observable
- implements thaw.plugins.miniFrost.interfaces.Message,
- Observer {
+ implements Message, Observer {
public final static int FCP_PRIORITY = 2; /* below 2, the node
doesn't react ?! */
@@ -212,7 +211,22 @@
return date;
}
+ public int compareTo(Object o) {
+ if (getDate() == null && ((Message)o).getDate() != null)
+ return -1;
+ if (getDate() != null && ((Message)o).getDate() == null)
+ return 1;
+
+ if (getDate() == null && ((Message)o).getDate() == null)
+ return 0;
+
+ int c = getDate().compareTo( ((Message)o).getDate());
+
+ return c;
+ }
+
+
public int getRev() {
return rev;
}
Modified:
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/SSKBoardFactory.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/SSKBoardFactory.java
2007-08-12 12:29:05 UTC (rev 14638)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/SSKBoardFactory.java
2007-08-13 09:59:40 UTC (rev 14639)
@@ -137,7 +137,14 @@
}
+ /**
+ * Already answered by KSKBoardFactory
+ */
+ public Vector getSentMessages() {
+ return new Vector();
+ }
+
private class NewBoardDialog implements Observer, ActionListener {
private JDialog dialog;
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Board.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Board.java
2007-08-12 12:29:05 UTC (rev 14638)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Board.java
2007-08-13 09:59:40 UTC (rev 14639)
@@ -7,28 +7,6 @@
public interface Board extends Comparable {
- /**
- * @return folder db id
- */
- //public int getParentId();
-
- /**
- * Called when the tree is being built.
- * This function must NOT modify/update the db !
- * It's just for the tree.
- * <br/>
- * setParent() must update the bdd
- */
- //public void setParentFolder(BoardFolder b);
-
-
- /**
- * just return what was given to setParentFolder().
- * getParent() must return the same thing !
- */
- //public BoardFolder getParentFolder();
-
-
public final static int ORDER_SUBJECT = 0;
public final static int ORDER_SENDER = 1;
public final static int ORDER_DATE = 2;
@@ -76,4 +54,6 @@
* without anything more
*/
public String toString();
+
+ public boolean equals(Object o);
}
Modified:
trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/BoardFactory.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/BoardFactory.java
2007-08-12 12:29:05 UTC (rev 14638)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/BoardFactory.java
2007-08-13 09:59:40 UTC (rev 14639)
@@ -33,6 +33,8 @@
boolean desc, boolean archived,
boolean unsigned, int minTrustLevel);
+ public Vector getSentMessages();
+
/**
* display the dialog asking for a name, etc.
* the tree will be reloaded after that
@@ -42,6 +44,7 @@
/**
* For example 'frost boards' ; Use I18n ...
+ * @return null if the user can't create any board with this factory
*/
public String toString();
}
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Message.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Message.java
2007-08-12 12:29:05 UTC (rev 14638)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Message.java
2007-08-13 09:59:40 UTC (rev 14639)
@@ -6,7 +6,7 @@
import thaw.plugins.signatures.Identity;
-public interface Message /* extends TreeNode */ {
+public interface Message extends Comparable {
public String getMsgId();
public String getInReplyToId();