From jflesch at freenetproject.org Sat Dec 1 18:41:30 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Sat, 1 Dec 2007 18:41:30 +0000 (UTC)
Subject: [Thaw-dev] r16193 - in trunk/apps/Thaw/src: com/birosoft/liquid
com/birosoft/liquid/skin com/birosoft/liquid/util
freenet/crypt/ciphers net/infonode/gui/laf thaw/fcp thaw/gui
thaw/plugins thaw/plugins/index
thaw/plugins/miniFrost/frostKSK thaw/plugins/queueWatcher
Message-ID: <20071201184130.EA74F4793D7@freenetproject.org>
Author: jflesch
Date: 2007-12-01 18:41:30 +0000 (Sat, 01 Dec 2007)
New Revision: 16193
Modified:
trunk/apps/Thaw/src/com/birosoft/liquid/FileChooserBasicUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidCheckBoxUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidComboBoxButton.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidComboBoxUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidDesktopIconUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidFrameBorder.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidInternalFrameBorder.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidInternalFrameTitlePane.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidInternalFrameUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidLookAndFeel.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidMenuItemUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidMenuUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidProgressBarUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidRootPaneUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidScrollBarUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidScrollButton.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidScrollPaneUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidSliderUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidSpinnerUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidSplitPaneDivider.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidTabbedPaneUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidTableHeaderUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidTitlePane.java
trunk/apps/Thaw/src/com/birosoft/liquid/LiquidToolBarUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/XTraScrollBarUI.java
trunk/apps/Thaw/src/com/birosoft/liquid/skin/SkinImageCache.java
trunk/apps/Thaw/src/com/birosoft/liquid/skin/SkinMenuItem.java
trunk/apps/Thaw/src/com/birosoft/liquid/util/Panel.java
trunk/apps/Thaw/src/freenet/crypt/ciphers/Rijndael_Algorithm.java
trunk/apps/Thaw/src/net/infonode/gui/laf/InfoNodeLookAndFeel.java
trunk/apps/Thaw/src/thaw/fcp/FCPGetNode.java
trunk/apps/Thaw/src/thaw/fcp/FCPListPeers.java
trunk/apps/Thaw/src/thaw/gui/JDragTree.java
trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java
trunk/apps/Thaw/src/thaw/plugins/index/IndexParser.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java
trunk/apps/Thaw/src/thaw/plugins/queueWatcher/DragAndDropManager.java
Log:
Fix all the eclipse warnings (Look'n'feels included)
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/FileChooserBasicUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/FileChooserBasicUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/FileChooserBasicUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -37,7 +37,6 @@
import java.beans.PropertyChangeListener;
import java.io.File;
-import java.io.IOException;
import java.text.DateFormat;
@@ -97,7 +96,6 @@
public class FileChooserBasicUI extends BasicFileChooserUI {
private static final Dimension hstrut5 = new Dimension(5, 1);
- private static final Dimension hstrut11 = new Dimension(11, 1);
private static final Dimension vstrut5 = new Dimension(1, 5);
private static final Insets shrinkwrap = new Insets(2, 2, 2, 2);
@@ -144,7 +142,6 @@
}
};
- private boolean useShellFolder;
private ListSelectionModel listSelectionModel;
private JList list;
private JTable detailsTable;
@@ -361,7 +358,6 @@
// FileSystemView.getRoots() returns one folder and that is
// the same as the first item in the ShellFolder combobox list.
{
- useShellFolder = false;
}
// ************************************** //
@@ -542,17 +538,16 @@
protected void installListeners(JFileChooser fc) {
super.installListeners(fc);
- ActionMap actionMap = getActionMap();
+ ActionMap actionMap = getActionMapSub();
SwingUtilities.replaceUIActionMap(fc, actionMap);
}
- protected ActionMap getActionMap() {
- return createActionMap();
+ protected ActionMap getActionMapSub() {
+ return createActionMapSub();
}
-
- protected ActionMap createActionMap() {
+ protected ActionMap createActionMapSub() {
AbstractAction escAction = new AbstractAction() {
- /**
+ /**
*
*/
private static final long serialVersionUID = -425601186607161693L;
@@ -965,7 +960,7 @@
editCell = new JTextField();
editCell.addActionListener(new EditActionListener());
editCell.addFocusListener(editorFocusListener);
- editCell.setNextFocusableComponent(list);
+ //editCell.setNextFocusableComponent(list);
}
list.add(editCell);
@@ -1917,23 +1912,12 @@
File[] baseFolders;
- baseFolders = fsv.getRoots();
+ baseFolders = fsv.getRoots();
directories.addAll(Arrays.asList(baseFolders));
- // Get the canonical (full) path. This has the side
- // benefit of removing extraneous chars from the path,
- // for example /foo/bar/ becomes /foo/bar
- File canonical = null;
- try {
- canonical = directory.getCanonicalFile();
- } catch (IOException e) {
- // Maybe drive is not ready. Can't abort here.
- canonical = directory;
- }
-
- calculateDepths();
+ calculateDepths();
}
private void calculateDepths() {
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidCheckBoxUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidCheckBoxUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidCheckBoxUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -94,9 +94,6 @@
textRect.x = textRect.y = textRect.width = textRect.height = 0;
Icon altIcon = b.getIcon();
- Icon selectedIcon = null;
- Icon disabledIcon = null;
-
String text = SwingUtilities.layoutCompoundLabel(c, fm, b.getText(),
(altIcon != null) ? altIcon : getDefaultIcon(),
b.getVerticalAlignment(), b.getHorizontalAlignment(),
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidComboBoxButton.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidComboBoxButton.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidComboBoxButton.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -153,7 +153,6 @@
Insets insets = new Insets(0, 12, 2, 2);
int width = getWidth() - (insets.left + insets.right);
- int widthFocus = width; //- (skin.getHsize()-skin.getOffset());
int height = getHeight() - (insets.top + insets.bottom);
if (height <= 0 || width <= 0)
@@ -163,12 +162,7 @@
int left = insets.left;
int top = insets.top;
- int right = left + (width - 1);
- int bottom = top + (height - 1);
-
int iconWidth = LiquidComboBoxUI.comboBoxButtonSize;
- int iconLeft = (leftToRight) ? right : left;
-
// Let the renderer paint
Component c = null;
boolean mustResetOpaque = false;
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidComboBoxUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidComboBoxUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidComboBoxUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -308,10 +308,6 @@
Insets margin = arrowButton.getMargin();
Insets insets = comboBox.getInsets();
- if (editor instanceof JComponent) {
- Insets editorInsets = ((JComponent) editor).getInsets();
- }
-
size.height += (margin.top + margin.bottom);
size.height += (insets.top + insets.bottom);
@@ -368,14 +364,10 @@
}
public Dimension preferredLayoutSize(Container parent) {
- JComboBox cb = (JComboBox) parent;
-
return parent.getPreferredSize();
}
public Dimension minimumLayoutSize(Container parent) {
- JComboBox cb = (JComboBox) parent;
-
return parent.getMinimumSize();
}
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidDesktopIconUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidDesktopIconUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidDesktopIconUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -241,11 +241,7 @@
public void mouseDragged(MouseEvent e) {
Point p;
- int newX, newY, newW, newH;
- int deltaX;
- int deltaY;
- Dimension min;
- Dimension max;
+ int newX, newY;
p = SwingUtilities.convertPoint((Component)e.getSource(),
e.getX(), e.getY(), null);
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidFrameBorder.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidFrameBorder.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidFrameBorder.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -30,11 +30,8 @@
private static LiquidFrameBorder onlyInstance;
// private static Robot robot;
// private static boolean robotsSupported = true;
- private static final Insets insets = new Insets(0, 4, 4, 4);
private boolean prevState = false;
private Window window;
- private int titleHeight;
-
/** indicates whether the internal frame is active */
private boolean isActive = true;
@@ -92,8 +89,6 @@
int frameTitleHeight = UIManager.getInt(
"InternalFrame.frameTitleHeight");
- int index = isActive ? 0 : 1;
-
drawLeftTop(g, isActive, 4, frameTitleHeight);
g.translate(0, frameTitleHeight);
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidInternalFrameBorder.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidInternalFrameBorder.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidInternalFrameBorder.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -51,8 +51,6 @@
{
int frameTitleHeight = isPalette ? UIManager.getInt("InternalFrame.paletteTitleHeight") : UIManager.getInt("InternalFrame.frameTitleHeight");
- int index=isActive ? 0 : 1;
-
drawLeftTop(g, isActive, 4, frameTitleHeight);
g.translate(0, frameTitleHeight);
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidInternalFrameTitlePane.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidInternalFrameTitlePane.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidInternalFrameTitlePane.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -76,12 +76,6 @@
protected int frameTitleHeight;
/**
- * The buttons width, calculated at runtime.
- */
- private int buttonsWidth;
-
-
- /**
* This constructor creates a title pane for the given internal frame
* instance.
*
@@ -143,8 +137,6 @@
int width = getWidth();
int height = getHeight();
- Color foreground = LiquidLookAndFeel.getWindowTitleInactiveForeground();
-
Graphics2D g2 = (Graphics2D) g;
Object oldAntiAliasingValue = g2.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
@@ -647,8 +639,6 @@
}
}
}
-
- buttonsWidth = leftToRight ? (w - x) : x;
}
public void activate() {
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidInternalFrameUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidInternalFrameUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidInternalFrameUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -34,7 +34,6 @@
public class LiquidInternalFrameUI extends BasicInternalFrameUI {
protected static String IS_PALETTE = "JInternalFrame.isPalette";
private static String FRAME_TYPE = "JInternalFrame.frameType";
- private static String NORMAL_FRAME = "normal";
private static String PALETTE_FRAME = "palette";
private static String OPTION_DIALOG = "optionDialog";
private static final PropertyChangeListener liquidPropertyChangeListener = new LiquidPropertyChangeHandler();
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidLookAndFeel.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidLookAndFeel.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidLookAndFeel.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -264,16 +264,11 @@
"reset-field-edit", "UP", "increment", "KP_UP", "increment",
"DOWN", "decrement", "KP_DOWN", "decrement",
});
- private boolean windowslfforfilechooser = false;
-
-
/**
* This constructor installs the Liquid Look and Feel with the default color
* theme.
*/
public LiquidLookAndFeel() {
- windowslfforfilechooser = false;
-
if (!isInstalled) {
isInstalled = true;
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidMenuItemUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidMenuItemUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidMenuItemUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -76,9 +76,6 @@
protected static int defaultTextIconGap;
protected static int defaultIconGap;
- /* diagnostic aids -- should be false for production builds. */
- private static final boolean TRACE = false; // trace creates and disposes
- private static final boolean VERBOSE = false; // show reuse hits/misses
private static final boolean DEBUG = false; // show bad params, misc.
/* Client Property keys for text and accelerator text widths */
@@ -492,27 +489,6 @@
menuItem.doClick(0);
}
- /**
- * This is to see if the menu item in question is part of the
- * system menu on an internal frame.
- * The Strings that are being checked can be found in
- * MetalInternalFrameTitlePaneUI.java,
- * WindowsInternalFrameTitlePaneUI.java, and
- * MotifInternalFrameTitlePaneUI.java.
- *
- * @since 1.4
- */
- private boolean isInternalFrameSystemMenu() {
- String actionCommand = menuItem.getActionCommand();
-
- if ((actionCommand == "Close") || (actionCommand == "Minimize") ||
- (actionCommand == "Restore") || (actionCommand == "Maximize")) {
- return true;
- } else {
- return false;
- }
- }
-
public static ComponentUI createUI(JComponent c) {
return new LiquidMenuItemUI();
}
@@ -734,8 +710,6 @@
JMenuItem b = (JMenuItem) c;
ButtonModel model = b.getModel();
- Icon bicon = b.getIcon();
-
JComponent p = (JComponent) b.getParent();
Integer maxValueInt = (Integer) p.getClientProperty(LiquidMenuItemUI.MAX_ICON_WIDTH);
int maxValue = (maxValueInt == null) ? 16 : maxValueInt.intValue();
@@ -787,7 +761,6 @@
// layout the text and icon
Icon ic = b.getIcon();
- Icon iCheck = checkIcon;
Icon paintIcon = ic;
if (useCheckAndArrow()) {
@@ -1227,7 +1200,6 @@
public void menuDragMouseReleased(MenuDragMouseEvent e) {
MenuSelectionManager manager = e.getMenuSelectionManager();
- MenuElement[] path = e.getPath();
Point p = e.getPoint();
if ((p.x >= 0) && (p.x < menuItem.getWidth()) && (p.y >= 0) &&
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidMenuUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidMenuUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidMenuUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -22,7 +22,6 @@
import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
import javax.swing.ActionMap;
-import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
@@ -65,12 +64,6 @@
private int lastMnemonic = 0;
- /** Uses as the parent of the windowInputMap when selected. */
- private InputMap selectedWindowInputMap;
-
- /* diagnostic aids -- should be false for production builds. */
- private static final boolean TRACE = false; // trace creates and disposes
- private static final boolean VERBOSE = false; // show reuse hits/misses
private static final boolean DEBUG = false; // show bad params, misc.
private static boolean crossMenuMnemonic = true;
@@ -83,7 +76,6 @@
public void installUI(JComponent c)
{
super.installUI(c);
- JMenu m=(JMenu)c;
}
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidProgressBarUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidProgressBarUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidProgressBarUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -135,8 +135,6 @@
if (!(g instanceof Graphics2D)) {
return;
}
- Graphics2D g2 = (Graphics2D) g;
-
int index = 0;//progressBar.isEnabled() ? 0 : 1;
Insets b = progressBar.getInsets(); // area for border
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidRootPaneUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidRootPaneUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidRootPaneUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -458,7 +458,6 @@
int mbWidth = 0;
int mbHeight = 0;
int tpWidth = 0;
- int tpHeight = 0;
Insets i = parent.getInsets();
JRootPane root = (JRootPane) parent;
@@ -491,7 +490,6 @@
if (tpd != null) {
tpWidth = tpd.width;
- tpHeight = tpd.height;
}
}
}
@@ -516,7 +514,6 @@
int mbWidth = 0;
int mbHeight = 0;
int tpWidth = 0;
- int tpHeight = 0;
Insets i = parent.getInsets();
JRootPane root = (JRootPane) parent;
@@ -549,7 +546,6 @@
if (tpd != null) {
tpWidth = tpd.width;
- tpHeight = tpd.height;
}
}
}
@@ -674,7 +670,6 @@
}
if (root.getContentPane() != null) {
- Dimension cpd = root.getContentPane().getPreferredSize();
root.getContentPane().setBounds(0, nextY, w,
(h < nextY) ? 0 : (h - nextY));
}
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidScrollBarUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidScrollBarUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidScrollBarUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -10,7 +10,6 @@
package com.birosoft.liquid;
-import java.awt.Color;
import java.awt.Insets;
import java.awt.Dimension;
import java.awt.Graphics;
@@ -33,30 +32,9 @@
public class LiquidScrollBarUI extends BasicScrollBarUI
{
private int orientation = -1;
- private int minExtent, minValue;
private final int MIN_THUMB_SIZE = 14;
public static final String FREE_STANDING_PROP = "JScrollBar.isFreeStanding";
- /**
- * The scrollbar's highlight color.
- */
- private static Color highlightColor;
-
- /**
- * The scrollbar's dark shadow color.
- */
- private static Color darkShadowColor;
-
- /**
- * The thumb's shadow color.
- */
- private static Color thumbShadow;
-
- /**
- * The thumb's highlight color.
- */
- private static Color thumbHighlightColor;
-
/** true if thumb is in rollover state */
protected boolean isRollover=false;
/** true if thumb was in rollover state */
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidScrollButton.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidScrollButton.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidScrollButton.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -30,8 +30,6 @@
*/
private static final long serialVersionUID = -7314095928302353987L;
private boolean isFreeStanding = false;
- private int buttonWidth;
-
/** one of the four skins for the button */
private static Skin skinUp= new Skin("scrollbuttonsup.png", 4, 0);
/** one of the four skins for the button */
@@ -53,7 +51,6 @@
public LiquidScrollButton(int orientation,int width, boolean freeStanding)
{
super(orientation);
- buttonWidth = width;
isFreeStanding = freeStanding;
this.putClientProperty(LiquidScrollBarUI.FREE_STANDING_PROP, isFreeStanding ? Boolean.TRUE : Boolean.FALSE);
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidScrollPaneUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidScrollPaneUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidScrollPaneUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -110,7 +110,7 @@
if (scrollpane.isWheelScrollingEnabled() &&
(e.getScrollAmount() != 0)) {
JScrollBar toScroll = scrollpane.getVerticalScrollBar();
- int direction = 0;
+
int length = toScroll.getHeight();
// find which scrollbar to scroll, or return if none
@@ -125,8 +125,6 @@
length = toScroll.getWidth();
}
- direction = (e.getWheelRotation() < 0) ? (-1) : 1;
-
if (e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
int newValue = toScroll.getValue() +
((e.getWheelRotation() * length) / (toScroll.getUnitIncrement() * 2));
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidSliderUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidSliderUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidSliderUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -104,14 +104,6 @@
public void paintTicks(Graphics g) {
Rectangle tickBounds = tickRect;
- int i;
- int maj;
- int min;
- int max;
- int w = tickBounds.width;
- int h = tickBounds.height;
- int centerEffect;
- int tickHeight;
boolean leftToRight = slider.getComponentOrientation().isLeftToRight();
g.setColor(new Color(0, 0, 0, 0));
@@ -119,9 +111,6 @@
tickBounds.height);
g.setColor(Color.black);
- maj = slider.getMajorTickSpacing();
- min = slider.getMinorTickSpacing();
-
if (slider.getOrientation() == JSlider.HORIZONTAL) {
g.translate(0, tickBounds.y);
@@ -195,8 +184,6 @@
}
public void paintTrack(Graphics g) {
- Color trackColor = Color.red;
-
boolean leftToRight = slider.getComponentOrientation().isLeftToRight();
g.translate(trackRect.x, trackRect.y);
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidSpinnerUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidSpinnerUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidSpinnerUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -56,7 +56,6 @@
true);
private static final ArrowButtonHandler previousButtonHandler = new ArrowButtonHandler("decrement",
false);
- private static final Dimension zeroSize = new Dimension(0, 0);
public static ComponentUI createUI(JComponent c) {
return new LiquidSpinnerUI();
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidSplitPaneDivider.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidSplitPaneDivider.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidSplitPaneDivider.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -51,9 +51,7 @@
*/
private static final long serialVersionUID = 4058298927908826880L;
- private int inset = 0;
-
- Skin skinVertSplitter = null;
+ Skin skinVertSplitter = null;
Skin skinHorzSplitter = null;
public LiquidSplitPaneDivider(BasicSplitPaneUI ui)
@@ -80,7 +78,6 @@
{
Dimension size = getSize();
Rectangle clip = new Rectangle(size.width, size.height);
- Insets insets = getInsets();
if (orientation == JSplitPane.HORIZONTAL_SPLIT)
{
int xOffset = (clip.width - 5) / 2;
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidTabbedPaneUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidTabbedPaneUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidTabbedPaneUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -537,17 +537,8 @@
}
public void paint(Graphics g, JComponent c) {
- int width = tabPane.getWidth();
- int height = tabPane.getHeight();
- Insets insets = tabPane.getInsets();
- int x = insets.left;
- int y = insets.top;
- int w = width - insets.right - insets.left;
- int h = height - insets.top - insets.bottom;
-
int tabPlacement = tabPane.getTabPlacement();
- Insets contentInsets = getContentBorderInsets(tabPlacement);
if (tabPlacement == BOTTOM) {
Color oldColor = g.getColor();
@@ -578,7 +569,6 @@
protected int getTabLabelShiftX(int tabPlacement, int tabIndex,
boolean isSelected) {
- Rectangle tabRect = rects[tabIndex];
int nudge = 0;
switch (tabPlacement) {
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidTableHeaderUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidTableHeaderUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidTableHeaderUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -273,7 +273,6 @@
}
private Dimension createHeaderSize(long width) {
- TableColumnModel columnModel = header.getColumnModel();
// None of the callers include the intercell spacing, do it here.
if (width > Integer.MAX_VALUE) {
@@ -433,7 +432,6 @@
}
Point p = e.getPoint();
- TableColumnModel columnModel = header.getColumnModel();
int index = header.columnAtPoint(p);
if (index != columnSelected) {
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidTitlePane.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidTitlePane.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidTitlePane.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -17,10 +17,7 @@
import java.beans.*;
-import java.util.Locale;
-
import javax.swing.*;
-import javax.swing.border.*;
import javax.swing.plaf.*;
@@ -53,7 +50,6 @@
*
*/
private static final long serialVersionUID = -1424746354108457746L;
- private static final Border handyEmptyBorder = new EmptyBorder(0, 0, 0, 0);
private static final int IMAGE_HEIGHT = 16;
private static final int IMAGE_WIDTH = 16;
private static LiquidWindowButtonUI iconButtonUI;
@@ -143,25 +139,13 @@
private JRootPane rootPane;
/**
- * Room remaining in title for bumps.
- */
- private int buttonsWidth;
-
- /**
* Buffered Frame.state property. As state isn't bound, this is kept
* to determine when to avoid updating widgets.
*/
private int state;
- /**
- * RootPaneUI that created us.
- */
- private LiquidRootPaneUI rootPaneUI;
-
public LiquidTitlePane(JRootPane root, LiquidRootPaneUI ui) {
rootPane = root;
- rootPaneUI = ui;
-
state = -1;
installSubcomponents();
@@ -171,15 +155,6 @@
}
/**
- * Uninstalls the necessary state.
- */
- private void uninstall() {
- uninstallListeners();
- window = null;
- removeAll();
- }
-
- /**
* Installs the necessary listeners.
*/
private void installListeners() {
@@ -324,12 +299,6 @@
}
/**
- * Uninstalls any previously installed UI values.
- */
- private void uninstallDefaults() {
- }
-
- /**
* Returns the JMenuBar displaying the appropriate
* system menu items.
*/
@@ -463,7 +432,6 @@
* Adds the necessary JMenuItems to the passed in menu.
*/
private void addMenuItems(JPopupMenu menu) {
- Locale locale = getRootPane().getLocale();
JMenuItem mi = menu.add(restoreAction);
mi.setMnemonic('r');
@@ -728,7 +696,6 @@
int width = getWidth();
int height = getHeight();
- Color foreground = LiquidLookAndFeel.getWindowTitleInactiveForeground();
Graphics2D g2 = (Graphics2D) g;
Object oldAntiAliasingValue = g2.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
@@ -1008,53 +975,6 @@
}
/**
- * Convenience method to clip the passed in text to the specified
- * size.
- */
- private String clippedText(String text, FontMetrics fm, int availTextWidth) {
- if ((text == null) || (text.equals(""))) {
- return "";
- }
-
- int textWidth = SwingUtilities.computeStringWidth(fm, text);
- String clipString = "...";
-
- if (textWidth > availTextWidth) {
- int totalWidth = SwingUtilities.computeStringWidth(fm, clipString);
- int nChars;
-
- for (nChars = 0; nChars < text.length(); nChars++) {
- totalWidth += fm.charWidth(text.charAt(nChars));
-
- if (totalWidth > availTextWidth) {
- break;
- }
- }
-
- text = text.substring(0, nChars) + clipString;
- }
-
- return text;
- }
-
- private int getInt(Object key, int defaultValue) {
- Object value = UIManager.get(key);
-
- if (value instanceof Integer) {
- return ((Integer) value).intValue();
- }
-
- if (value instanceof String) {
- try {
- return Integer.parseInt((String) value);
- } catch (NumberFormatException nfe) {
- }
- }
-
- return defaultValue;
- }
-
- /**
* Actions used to close the Window.
*/
private class CloseAction extends AbstractAction {
@@ -1268,8 +1188,6 @@
public void layoutContainer(Container c) {
if (getWindowDecorationStyle() == JRootPane.NONE) {
- buttonsWidth = 0;
-
return;
}
@@ -1368,8 +1286,6 @@
}
}
}
-
- buttonsWidth = leftToRight ? (w - x) : x;
}
}
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/LiquidToolBarUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/LiquidToolBarUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/LiquidToolBarUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -42,11 +42,6 @@
private Skin hbarHandler = new Skin("htoolbarhandler.png", 1, 3, 8, 3, 8);
/**
- * These insets are forced inner margin for the toolbar buttons.
- */
- private Insets insets = new Insets(2, 2, 2, 2);
-
- /**
* Creates the UI delegate for the given component.
*
* @param c The component to create its UI delegate.
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/XTraScrollBarUI.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/XTraScrollBarUI.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/XTraScrollBarUI.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -268,7 +268,6 @@
BoundedRangeModel model = XTraScrollBarUI.this.scrollbar().getModel();
Rectangle thumbR = XTraScrollBarUI.this.getThumbBounds();
- float trackLength;
int thumbMin, thumbMax, thumbPos;
if (XTraScrollBarUI.this.scrollbar().getOrientation() == JScrollBar.VERTICAL) {
@@ -276,14 +275,12 @@
thumbMax = XTraScrollBarUI.this.decrButton().getY() /*incrButton.getY()*/ - XTraScrollBarUI.this.getThumbBounds().height;
thumbPos = Math.min(thumbMax, Math.max(thumbMin, (e.getY() - offset)));
XTraScrollBarUI.this.setThumbBounds(thumbR.x, thumbPos, thumbR.width, thumbR.height);
- trackLength = XTraScrollBarUI.this.getTrackBounds().height;
}
else {
thumbMin = sbInsets.left; //decrButton.getX() + decrButton.getWidth();
thumbMax = XTraScrollBarUI.this.decrButton().getX() /*incrButton.getX()*/ - XTraScrollBarUI.this.getThumbBounds().width;
thumbPos = Math.min(thumbMax, Math.max(thumbMin, (e.getX() - offset)));
XTraScrollBarUI.this.setThumbBounds(thumbPos, thumbR.y, thumbR.width, thumbR.height);
- trackLength = XTraScrollBarUI.this.getTrackBounds().width;
}
/* Set the scrollbars value. If the thumb has reached the end of
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/skin/SkinImageCache.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/skin/SkinImageCache.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/skin/SkinImageCache.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -42,12 +42,10 @@
}
private HashMap map;
- private HashMap iconMap;
private HashMap bufferedMap;
protected SkinImageCache() {
map = new HashMap();
- iconMap = new HashMap();
bufferedMap = new HashMap();
}
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/skin/SkinMenuItem.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/skin/SkinMenuItem.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/skin/SkinMenuItem.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -23,8 +23,6 @@
private int hsize, vsize;
private int roundedSize;
- private boolean useDefaultButton = false;
- private boolean useSelectedButton = false;
private boolean doneAllCalculations = false;
public SkinMenuItem(String fileName, int leftOffset, int leftRolloverOffset, int rightOffset, int rightRolloverOffset, int roundedSize)
Modified: trunk/apps/Thaw/src/com/birosoft/liquid/util/Panel.java
===================================================================
--- trunk/apps/Thaw/src/com/birosoft/liquid/util/Panel.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/com/birosoft/liquid/util/Panel.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -7,8 +7,6 @@
package com.birosoft.liquid.util;
import java.awt.*;
-import java.awt.image.BufferedImage;
-import java.awt.geom.Rectangle2D;
/**
*
@@ -35,76 +33,4 @@
//drawIt(g, 10, 10, 48, 48, bg, bg);
}
- private void drawIt(Graphics g, int x, int y, int w, int h, Color c, Color bg) {
- //g.setColor(Color.white);
- //g.fillRect(0, 0, this.getWidth(), this.getHeight());
- int x2 = x+w-1;
- int y2 = y+h-1;
- // outer dark rect
- g.setColor(Colors.dark(c, 115));
- g.drawLine(x+2, y, x2-2, y); // t
- g.drawLine(x, y+2, x, y2-2); // l
- g.drawLine(x+1, y+1, x+1, y+1); // tl
- g.setColor(Colors.dark(c, 150));
- g.drawLine(x+2, y2, x2-2, y2); // b
- g.drawLine(x2, y+2, x2, y2-2); // r
- g.drawLine(x2-1, y2-1, x2-1, y2-1); // br
- g.setColor(Colors.dark(c, 132));
- g.drawLine(x2-1, y+1, x2-1, y+1); // tr
- g.drawLine(x+1, y2-1, x+1, y2-1); // bl
-
- // inner top light lines
- g.setColor(Colors.light(c, 105));
- g.drawLine(x+2, y+1, x2-2, y+1);
- g.drawLine(x+1, y+2, x2-1, y+2);
- g.drawLine(x+1, y+3, x+2, y+3);
- g.drawLine(x2-2, y+3, x2-1, y+3);
- g.drawLine(x+1, y+4, x+1, y+4);
- g.drawLine(x2-1, y+4, x2-1, y+4);
-
- // inner bottom light lines
- g.setColor(Colors.light(c, 110));
- g.drawLine(x+2, y2-1, x2-2, y2-1);
- g.drawLine(x+1, y2-2, x2-1, y2-2);
- g.drawLine(x+1, y2-3, x+2, y2-3);
- g.drawLine(x2-2, y2-3, x2-1, y2-3);
- g.drawLine(x+1, y2-4, x+1, y2-4);
- g.drawLine(x2-1, y2-4, x2-1, y2-4);
-
- // inner left mid lines
- g.setColor(c);
- g.drawLine(x+1, y+5, x+1, y2-5);
- g.drawLine(x+2, y+4, x+2, y2-4);
-
- // inner right mid lines
- g.drawLine(x2-1, y+5, x2-1, y2-5);
- g.drawLine(x2-2, y+4, x2-2, y2-4);
-
- Graphics2D g2 = (Graphics2D)g;
- BufferedImage img = Colors.getClearFill();
- TexturePaint tp = new TexturePaint(img, new Rectangle2D.Float(0.0f,0.0f,img.getWidth(),img.getHeight()));
- Paint p=g2.getPaint();
- g2.setPaint(tp);
- g2.fillRect(x+2, y+2, w-4, h-4);
- g2.setPaint(p);
- int red, green, blue;
- Color btnColor = Colors.dark(c, 130);
- red = (btnColor.getRed() >> 1) + (bg.getRed() >> 1);
- green = (btnColor.getGreen() >> 1) + (bg.getGreen() >> 1);
- blue = (btnColor.getBlue() >> 1) + (bg.getBlue() >> 1);
- btnColor = new Color(red, green, blue);
-
- g.setColor(btnColor);
- g.drawLine(x+1, y, x+1, y);
- g.drawLine(x, y+1, x, y+1);
- g.drawLine(x+1, y2, x+1, y2);
- g.drawLine(x, y2-1, x, y2-1);
-
- g.drawLine(x2-1, y, x2-1, y);
- g.drawLine(x2, y+1, x2, y+1);
- g.drawLine(x2-1, y2, x2-1, y2);
- g.drawLine(x2, y2-1, x2, y2-1);
-
- }
-
}
Modified: trunk/apps/Thaw/src/freenet/crypt/ciphers/Rijndael_Algorithm.java
===================================================================
--- trunk/apps/Thaw/src/freenet/crypt/ciphers/Rijndael_Algorithm.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/freenet/crypt/ciphers/Rijndael_Algorithm.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -293,17 +293,6 @@
// ...........................................................................
/**
- * Convenience method to expand a user-supplied key material into a
- * session key, assuming Rijndael's default block size (128-bit).
- *
- * @param k The 128/192/256-bit user-key to use.
- * @exception InvalidKeyException If the key is invalid.
- */
- private static final Object makeKey (byte[] k) throws InvalidKeyException {
- return makeKey(k, BLOCK_SIZE);
- }
-
- /**
* Convenience method to encrypt exactly one block of plaintext, assuming
* Rijndael's default block size (128-bit).
*
Modified: trunk/apps/Thaw/src/net/infonode/gui/laf/InfoNodeLookAndFeel.java
===================================================================
--- trunk/apps/Thaw/src/net/infonode/gui/laf/InfoNodeLookAndFeel.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/net/infonode/gui/laf/InfoNodeLookAndFeel.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -306,41 +306,31 @@
}
}
- private static class MyListCellRenderer extends DefaultListCellRenderer {
- /**
- *
- */
- private static final long serialVersionUID = -4686589215440055032L;
- private Border normalBorder;
- private Border focusBorder;
+ public static class MyListCellRendererUIResource extends DefaultListCellRenderer implements javax.swing.plaf.UIResource {
+ private static final long serialVersionUID = 5326463933712427348L;
+
+ private Border normalBorder;
+ private Border focusBorder;
- MyListCellRenderer(Border normalBorder, Border focusBorder) {
- this.normalBorder = normalBorder;
- this.focusBorder = focusBorder;
- }
- public Component getListCellRendererComponent(JList list, Object value, int index,
- boolean isSelected,
- boolean cellHasFocus) {
- JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- label.setBorder(cellHasFocus ? focusBorder : normalBorder);
- return label;
- }
+ public MyListCellRendererUIResource(Border normalBorder, Border focusBorder) {
+ this.normalBorder = normalBorder;
+ this.focusBorder = focusBorder;
+ }
- public static class UIResource extends MyListCellRenderer implements javax.swing.plaf.UIResource {
- /**
- *
- */
- private static final long serialVersionUID = 5326463933712427348L;
+ public Component getListCellRendererComponent(JList list, Object value, int index,
+ boolean isSelected,
+ boolean cellHasFocus) {
+ JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+ label.setBorder(cellHasFocus ? focusBorder : normalBorder);
+ return label;
+ }
- public UIResource(Border normalBorder, Border focusBorder) {
- super(normalBorder, focusBorder);
- }
+
}
- }
- protected void initComponentDefaults(UIDefaults table) {
- super.initComponentDefaults(table);
+ protected void initComponentDefaults(UIDefaults table) {
+ super.initComponentDefaults(table);
Class iconClass = MetalLookAndFeel.class;
UIResource menuItemBorder = new MetalBorders.MenuItemBorder() {
@@ -371,7 +361,7 @@
"List.cellRenderer", new UIDefaults.ActiveValue() {
public Object createValue(UIDefaults table) {
- return new MyListCellRenderer.UIResource(theme.getListItemBorder(), theme.getListFocusedItemBorder());
+ return new MyListCellRendererUIResource(theme.getListItemBorder(), theme.getListFocusedItemBorder());
}
},
Modified: trunk/apps/Thaw/src/thaw/fcp/FCPGetNode.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPGetNode.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPGetNode.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -33,9 +33,6 @@
public final static String usedMemElement = "volatile.usedJavaMemory";
private long usedMem = 0;
- public final static String netSizeSessionElement = "volatile.networkSizeEstimateSession";
- private int netSizeSession = 0;
-
public final static String nmbThreadsElement = "volatile.runningThreadCount";
private int nmbThreads = 0;
Modified: trunk/apps/Thaw/src/thaw/fcp/FCPListPeers.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPListPeers.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPListPeers.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -11,8 +11,6 @@
private boolean withMetadata;
private boolean withVolatile;
- private FCPQueueManager queueManager;
-
private Hashtable peers; /* key : peer name -> hashtable : key : parameter name -> parameter value */
private boolean endList;
Modified: trunk/apps/Thaw/src/thaw/gui/JDragTree.java
===================================================================
--- trunk/apps/Thaw/src/thaw/gui/JDragTree.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/thaw/gui/JDragTree.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -400,7 +400,6 @@
private DragSource dragSource = null;
private DragGestureRecognizer dgRecognizer = null;
- private DropTarget dropTarget = null;
/**
* @param root
@@ -426,7 +425,7 @@
this);
// don't act on right mouse button
dgRecognizer.setSourceActions(dgRecognizer.getSourceActions() & ~InputEvent.BUTTON3_MASK & ~InputEvent.BUTTON2_MASK);
- dropTarget = new DropTarget(this, new CDropTargetListener());
+ new DropTarget(this, new CDropTargetListener());
}
/**
Modified: trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/thaw/plugins/QueueWatcher.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -19,7 +19,6 @@
import thaw.core.MainWindow;
import thaw.fcp.FCPTransferQuery;
import thaw.plugins.queueWatcher.DetailPanel;
-import thaw.plugins.queueWatcher.DragAndDropManager;
import thaw.plugins.queueWatcher.QueuePanel;
public class QueueWatcher extends ToolbarModifier implements thaw.core.Plugin, PropertyChangeListener, ChangeListener, ActionListener {
Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexParser.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexParser.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexParser.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -337,7 +337,6 @@
private boolean ownerTag = false;
private boolean privateKeyTag = false;
private boolean dateTag = false;
- private boolean commentsTag = false;
private boolean categoryTag = false;
private boolean hasCommentTag = false;
private boolean clientTag = false;
@@ -400,7 +399,6 @@
if (pub != null) {
hasCommentTag = true;
- commentsTag = true;
Logger.debug(this, "Comment allowed in this index");
index.setCommentKeys(pub, priv);
}
@@ -464,7 +462,6 @@
if (categoryStr != null)
index.setCategory(categoryStr);
} else if ("comments".equals(rawName)) {
- commentsTag = false;
return;
} else if ("client".equals(rawName)) {
clientTag = false;
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessage.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -41,7 +41,6 @@
private String inReplyToStr;
private String subject;
private KSKAuthor author;
- private int sigId;
private java.util.Date date;
private int rev;
private boolean read;
@@ -200,7 +199,6 @@
this.author = new KSKAuthor(nick, identity);
- this.sigId = sigId;
this.date = date;
this.rev = rev;
this.read = read;
Modified: trunk/apps/Thaw/src/thaw/plugins/queueWatcher/DragAndDropManager.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/queueWatcher/DragAndDropManager.java 2007-12-01 17:29:52 UTC (rev 16192)
+++ trunk/apps/Thaw/src/thaw/plugins/queueWatcher/DragAndDropManager.java 2007-12-01 18:41:30 UTC (rev 16193)
@@ -16,25 +16,25 @@
import java.util.Iterator;
import java.util.Vector;
-import javax.swing.JComponent;
-import javax.swing.TransferHandler;
-
import thaw.core.Core;
import thaw.core.Logger;
import thaw.fcp.FCPTransferQuery;
-
+/**
+ * TODO : WIP !
+ * @author jflesch
+ */
public class DragAndDropManager implements DragGestureListener, DragSourceListener {
private QueuePanel[] queuePanels;
- private DragSource dragSource;
+ // private DragSource dragSource;
private final String tmpDir = System.getProperty("java.io.tmpdir");
public DragAndDropManager(final Core core, final QueuePanel[] queuePanels) {
this.queuePanels = queuePanels;
- dragSource = DragSource.getDefaultDragSource();
+ //dragSource = DragSource.getDefaultDragSource();
//for(int i = 0 ; i < queuePanels.length ; i++) {
//dragSource.createDefaultDragGestureRecognizer(queuePanels[i].getTable(),
@@ -48,7 +48,7 @@
//}
}
- private class FileTransferHandler extends TransferHandler {
+ /*private class FileTransferHandler extends TransferHandler {
private static final long serialVersionUID = 1L;
protected Transferable createTransferable(final JComponent c) {
@@ -65,7 +65,7 @@
return null;
}
- }
+ }*/
public void dragGestureRecognized(final DragGestureEvent dge) {
try {
From jflesch at freenetproject.org Sat Dec 1 18:48:12 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Sat, 1 Dec 2007 18:48:12 +0000 (UTC)
Subject: [Thaw-dev] r16195 - in trunk/apps/Thaw/src/thaw: i18n
plugins/miniFrost/frostKSK
Message-ID: <20071201184812.7DD924797CE@freenetproject.org>
Author: jflesch
Date: 2007-12-01 18:48:12 +0000 (Sat, 01 Dec 2007)
New Revision: 16195
Modified:
trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
trunk/apps/Thaw/src/thaw/i18n/thaw.properties
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoardFactory.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/SSKBoardFactory.java
Log:
MiniFrost : refuse to add signed boards with obsolete keys
Modified: trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-12-01 18:45:27 UTC (rev 16194)
+++ trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-12-01 18:48:12 UTC (rev 16195)
@@ -105,6 +105,7 @@
## Errors
thaw.error.idAlreadyUsed=Impossible de se connecter. Notre identifiant est d??j?? utilis?? par un autre client connect?? au noeud.
+thaw.error.obsolete=D?sol?, clef obsol?te.
## Menus
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-12-01 18:45:27 UTC (rev 16194)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-12-01 18:48:12 UTC (rev 16195)
@@ -105,6 +105,7 @@
## Errors
thaw.error.idAlreadyUsed=Unable to connect. Our Id is already used by another client connected to the node.
+thaw.error.obsolete=sorry, obsolete key.
## Menus
thaw.menu.file=File
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoardFactory.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoardFactory.java 2007-12-01 18:45:27 UTC (rev 16194)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKBoardFactory.java 2007-12-01 18:48:12 UTC (rev 16195)
@@ -500,12 +500,17 @@
* Put here to make my life simpler with the KSKBoardAttachment.
*/
protected void createBoard(String name, String publicKey, String privateKey,
- boolean warningIfExisting) {
+ boolean warningIfExisting) {
if (!thaw.fcp.FreenetURIHelper.isAKey(publicKey)) {
Logger.error(this, "Invalid publicKey");
return;
}
+
+ if (thaw.fcp.FreenetURIHelper.isObsolete(publicKey)) {
+ new thaw.gui.WarningWindow(core, I18n.getMessage("thaw.error.obsolete"));
+ return;
+ }
if (privateKey != null && "".equals(privateKey))
privateKey = null;
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/SSKBoardFactory.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/SSKBoardFactory.java 2007-12-01 18:45:27 UTC (rev 16194)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/SSKBoardFactory.java 2007-12-01 18:48:12 UTC (rev 16195)
@@ -196,8 +196,8 @@
return;
} else if (e.getSource() == ok) {
createBoard(name.getText(),
- publicKey.getText(),
- privateKey.getText());
+ publicKey.getText(),
+ privateKey.getText());
}
synchronized(this) {
From jflesch at freenetproject.org Mon Dec 3 01:08:37 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Mon, 3 Dec 2007 01:08:37 +0000 (UTC)
Subject: [Thaw-dev] r16210 - in trunk/apps/Thaw/src/thaw: core i18n
plugins/index
Message-ID: <20071203010837.AE1B047B311@freenetproject.org>
Author: jflesch
Date: 2007-12-03 01:08:37 +0000 (Mon, 03 Dec 2007)
New Revision: 16210
Modified:
trunk/apps/Thaw/src/thaw/core/ConfigWindow.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/index/IndexManagementHelper.java
trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java
Log:
Make it possible to add a whole index folder at once to the index blacklist
Modified: trunk/apps/Thaw/src/thaw/core/ConfigWindow.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/ConfigWindow.java 2007-12-02 22:44:19 UTC (rev 16209)
+++ trunk/apps/Thaw/src/thaw/core/ConfigWindow.java 2007-12-03 01:08:37 UTC (rev 16210)
@@ -243,7 +243,7 @@
dialog.getContentPane().add(new JLabel(I18n.getMessage("thaw.common.pleaseWait"),
JLabel.CENTER));
- dialog.setUndecorated(true);
+ //dialog.setUndecorated(true);
dialog.setResizable(false);
dialog.setSize(150, 30);
Modified: trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-12-02 22:44:19 UTC (rev 16209)
+++ trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-12-03 01:08:37 UTC (rev 16210)
@@ -105,7 +105,7 @@
## Errors
thaw.error.idAlreadyUsed=Impossible de se connecter. Notre identifiant est d??j?? utilis?? par un autre client connect?? au noeud.
-thaw.error.obsolete=D?sol?, clef obsol?te.
+thaw.error.obsolete=D???sol???, clef obsol???te.
## Menus
@@ -283,16 +283,16 @@
thaw.plugin.index.yourIndexes=Vos indexes
-thaw.plugin.index.addIndex=Ajouter un index de fichier
-thaw.plugin.index.addIndexesFromLink=Ajouter ces indexes ?? votre liste
-thaw.plugin.index.createIndex=Cr??er un nouvel index de fichiers
+thaw.plugin.index.addIndex=Ajouter un index
+thaw.plugin.index.addIndexesFromLink=Ajouter ces indexes
+thaw.plugin.index.createIndex=Cr??er un index
thaw.plugin.index.addCategory=Creer un dossier
thaw.plugin.index.rename=Renommer
thaw.plugin.index.delete=Effacer
-thaw.plugin.index.insertIndex=[R??]inserer cet index sur Freenet
-thaw.plugin.index.insertIndexes=[R??]inserer ces indexes sur Freenet
-thaw.plugin.index.downloadIndex=Mettre ?? jour cet index depuis Freenet
-thaw.plugin.index.downloadIndexes=Mettre ?? jour ces indexes depuis Freenet
+thaw.plugin.index.insertIndex=[R??]inserer cet index
+thaw.plugin.index.insertIndexes=[R??]inserer ces indexes
+thaw.plugin.index.downloadIndex=Rafra??chir
+thaw.plugin.index.downloadIndexes=Rafra??chir
thaw.plugin.index.copyKey=Copier la clef de l'index dans le presse-papier
thaw.plugin.index.copyKeys=Copier les clefs des indexes dans le presse-papier
thaw.plugin.index.copyPrivateKey=Copier la clef priv??e de cet index dans le presse-papier
@@ -305,7 +305,7 @@
thaw.plugin.index.newCategory=Nouveau dossier
thaw.plugin.index.newIndex=Nouvel index
-thaw.plugin.index.addAlreadyExistingIndex=Ajouter un index d??j?? existant
+thaw.plugin.index.addAlreadyExistingIndex=Ajouter un index
thaw.plugin.index.indexSettings=R??glages de l'index
@@ -315,9 +315,9 @@
thaw.plugin.index.search.label=Chercher dans le dossier ou l'index s??lectionn??:
thaw.plugin.index.search.apply=Chercher
-thaw.plugin.index.addFilesWithInserting=Inserer un ou plusieurs fichier(s) sur Freenet et les ajouter ?? cet index
-thaw.plugin.index.addFilesWithoutInserting=Ajouter un ou plusieurs fichier(s) ?? cet index
-thaw.plugin.index.addLink=Ajouter un lien vers un autre index
+thaw.plugin.index.addFilesWithInserting=Inserer et ajouter un ou plusieurs fichier(s)
+thaw.plugin.index.addFilesWithoutInserting=Ajouter un ou plusieurs fichier(s)
+thaw.plugin.index.addLink=Ajouter un lien
thaw.plugin.index.insert=Inserer
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-12-02 22:44:19 UTC (rev 16209)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-12-03 01:08:37 UTC (rev 16210)
@@ -290,9 +290,9 @@
thaw.plugin.index.yourIndexes=Your indexes
-thaw.plugin.index.addIndex=Add a file index
-thaw.plugin.index.addIndexesFromLink=Add these indexes to your list
-thaw.plugin.index.createIndex=Create a new file index
+thaw.plugin.index.addIndex=Add an index
+thaw.plugin.index.addIndexesFromLink=Add these indexes
+thaw.plugin.index.createIndex=Create an index
thaw.plugin.index.addCategory=Create a folder
thaw.plugin.index.rename=Rename
thaw.plugin.index.delete=Delete
@@ -312,7 +312,7 @@
thaw.plugin.index.newCategory=New folder
thaw.plugin.index.newIndex=New index
-thaw.plugin.index.addAlreadyExistingIndex=Add an already existing index
+thaw.plugin.index.addAlreadyExistingIndex=Add an index
thaw.plugin.index.indexSettings=Index settings
thaw.plugin.index.indexKey=Index key:
@@ -321,9 +321,9 @@
thaw.plugin.index.search.label=Search in the selected folder or index:
thaw.plugin.index.search.apply=Search
-thaw.plugin.index.addFilesWithInserting=Insert file(s) on Freenet and add them to this index
-thaw.plugin.index.addFilesWithoutInserting=Add file(s) to this index
-thaw.plugin.index.addLink=Add a link to another index
+thaw.plugin.index.addFilesWithInserting=Insert and add file(s)
+thaw.plugin.index.addFilesWithoutInserting=Add file(s)
+thaw.plugin.index.addLink=Add a link
thaw.plugin.index.insert=Insert
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2007-12-02 22:44:19 UTC (rev 16209)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2007-12-03 01:08:37 UTC (rev 16210)
@@ -105,6 +105,7 @@
## Errors
thaw.error.idAlreadyUsed=Impossible de se connecter. Notre identifiant est d\u00e9j\u00e0 utilis\u00e9 par un autre client connect\u00e9 au noeud.
+thaw.error.obsolete=D\ufffdsol\ufffd, clef obsol\ufffdte.
## Menus
@@ -282,16 +283,16 @@
thaw.plugin.index.yourIndexes=Vos indexes
-thaw.plugin.index.addIndex=Ajouter un index de fichier
-thaw.plugin.index.addIndexesFromLink=Ajouter ces indexes \u00e0 votre liste
-thaw.plugin.index.createIndex=Cr\u00e9er un nouvel index de fichiers
+thaw.plugin.index.addIndex=Ajouter un index
+thaw.plugin.index.addIndexesFromLink=Ajouter ces indexes
+thaw.plugin.index.createIndex=Cr\u00e9er un index
thaw.plugin.index.addCategory=Creer un dossier
thaw.plugin.index.rename=Renommer
thaw.plugin.index.delete=Effacer
-thaw.plugin.index.insertIndex=[R\u00e9]inserer cet index sur Freenet
-thaw.plugin.index.insertIndexes=[R\u00e9]inserer ces indexes sur Freenet
-thaw.plugin.index.downloadIndex=Mettre \u00e0 jour cet index depuis Freenet
-thaw.plugin.index.downloadIndexes=Mettre \u00e0 jour ces indexes depuis Freenet
+thaw.plugin.index.insertIndex=[R\u00e9]inserer cet index
+thaw.plugin.index.insertIndexes=[R\u00e9]inserer ces indexes
+thaw.plugin.index.downloadIndex=Rafra\u00eechir
+thaw.plugin.index.downloadIndexes=Rafra\u00eechir
thaw.plugin.index.copyKey=Copier la clef de l'index dans le presse-papier
thaw.plugin.index.copyKeys=Copier les clefs des indexes dans le presse-papier
thaw.plugin.index.copyPrivateKey=Copier la clef priv\u00e9e de cet index dans le presse-papier
@@ -304,7 +305,7 @@
thaw.plugin.index.newCategory=Nouveau dossier
thaw.plugin.index.newIndex=Nouvel index
-thaw.plugin.index.addAlreadyExistingIndex=Ajouter un index d\u00e9j\u00e0 existant
+thaw.plugin.index.addAlreadyExistingIndex=Ajouter un index
thaw.plugin.index.indexSettings=R\u00e9glages de l'index
@@ -314,9 +315,9 @@
thaw.plugin.index.search.label=Chercher dans le dossier ou l'index s\u00e9lectionn\u00e9:
thaw.plugin.index.search.apply=Chercher
-thaw.plugin.index.addFilesWithInserting=Inserer un ou plusieurs fichier(s) sur Freenet et les ajouter \u00e0 cet index
-thaw.plugin.index.addFilesWithoutInserting=Ajouter un ou plusieurs fichier(s) \u00e0 cet index
-thaw.plugin.index.addLink=Ajouter un lien vers un autre index
+thaw.plugin.index.addFilesWithInserting=Inserer et ajouter un ou plusieurs fichier(s)
+thaw.plugin.index.addFilesWithoutInserting=Ajouter un ou plusieurs fichier(s)
+thaw.plugin.index.addLink=Ajouter un lien
thaw.plugin.index.insert=Inserer
Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java 2007-12-02 22:44:19 UTC (rev 16209)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java 2007-12-03 01:08:37 UTC (rev 16210)
@@ -1100,14 +1100,36 @@
}
public void setTarget(final IndexTreeNode node) {
- if (node != null && node instanceof Index)
+ if (node != null)
super.setTarget(node);
else
super.setTarget(null);
}
+
+ private void blackListRecursivly(Hsqldb db, IndexFolder target) {
+ /* A nicer way would be to ask directly to the database the index who
+ * are children of this folder, but I'm a lazy bastard.
+ */
+ java.util.Enumeration targetChildren = target.children();
+
+ while (targetChildren.hasMoreElements()) {
+ Object o = targetChildren.nextElement();
+
+ if (o instanceof Index) {
+ BlackList.addToBlackList(db, ((Index)o).getPublicKey());
+ } else if (o instanceof IndexFolder) {
+ blackListRecursivly(db, (IndexFolder)o);
+ }
+ }
+ }
public void apply() {
- BlackList.addToBlackList(indexBrowser.getDb(), getTarget().getPublicKey());
+ if (getTarget() instanceof IndexFolder) {
+ blackListRecursivly(indexBrowser.getDb(), (IndexFolder)getTarget());
+ } else if (getTarget() instanceof Index) {
+ BlackList.addToBlackList(indexBrowser.getDb(), getTarget().getPublicKey());
+ }
+
super.apply();
indexBrowser.getBlackList().updateList();
}
Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java 2007-12-02 22:44:19 UTC (rev 16209)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java 2007-12-03 01:08:37 UTC (rev 16210)
@@ -193,7 +193,7 @@
item = new JMenuItem(I18n.getMessage("thaw.plugin.index.sortAlphabetically"));
indexFolderMenu.add(item);
indexFolderActions.add(new IndexManagementHelper.IndexFolderReorderer(indexBrowser, item));
-
+
item = new JMenuItem(I18n.getMessage("thaw.plugin.index.addAlreadyExistingIndex"),
IconBox.minIndexReadOnly);
indexFolderMenu.add(item);
@@ -212,6 +212,11 @@
indexFolderMenu.add(item);
indexFolderActions.add(new IndexManagementHelper.IndexRenamer(indexBrowser, item));
+ item = new JMenuItem(I18n.getMessage("thaw.plugin.index.addToBlackList"),
+ IconBox.minStop);
+ indexFolderMenu.add(item);
+ indexAndFileActions.add(new IndexManagementHelper.IndexBlackLister(indexBrowser, item));
+
item = new JMenuItem(I18n.getMessage("thaw.plugin.index.delete"), IconBox.minDelete);
indexFolderMenu.add(item);
indexFolderActions.add(new IndexManagementHelper.IndexDeleter(indexBrowser, item));
From jflesch at freenetproject.org Mon Dec 3 01:41:41 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Mon, 3 Dec 2007 01:41:41 +0000 (UTC)
Subject: [Thaw-dev] r16211 - in trunk/apps/Thaw/src/thaw: core fcp
plugins/index
Message-ID: <20071203014141.5CFD9479862@freenetproject.org>
Author: jflesch
Date: 2007-12-03 01:41:41 +0000 (Mon, 03 Dec 2007)
New Revision: 16211
Modified:
trunk/apps/Thaw/src/thaw/core/ConfigWindow.java
trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
trunk/apps/Thaw/src/thaw/plugins/index/DatabaseManager.java
trunk/apps/Thaw/src/thaw/plugins/index/Index.java
Log:
During an index tree importation : If an index is already in tree, then just check if the private key can be updated
Modified: trunk/apps/Thaw/src/thaw/core/ConfigWindow.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/ConfigWindow.java 2007-12-03 01:08:37 UTC (rev 16210)
+++ trunk/apps/Thaw/src/thaw/core/ConfigWindow.java 2007-12-03 01:41:41 UTC (rev 16211)
@@ -183,7 +183,7 @@
* Called when apply button is pressed.
*/
public void actionPerformed(final ActionEvent e) {
- if((e.getSource() == okButton) && !core.canDisconnect()) {
+ if((e.getSource() == okButton) && !core.canDisconnect() && needConnectionReset) {
final int ret = JOptionPane.showOptionDialog((java.awt.Component)null,
I18n.getMessage("thaw.warning.isWritingSoApplyLater"),
I18n.getMessage("thaw.warning.title"),
Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java 2007-12-03 01:08:37 UTC (rev 16210)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java 2007-12-03 01:41:41 UTC (rev 16211)
@@ -252,6 +252,12 @@
transferedBlocks = 0;
this.queueManager = queueManager;
+
+ /* TODO : seems to be true sometimes => find why */
+ if (queueManager == null
+ || queueManager.getQueryManager() == null
+ || queueManager.getQueryManager().getConnection() == null)
+ return false;
if (queueManager.getQueryManager().getConnection().isLocalSocket()
&& !noDDA
Modified: trunk/apps/Thaw/src/thaw/plugins/index/DatabaseManager.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/DatabaseManager.java 2007-12-03 01:08:37 UTC (rev 16210)
+++ trunk/apps/Thaw/src/thaw/plugins/index/DatabaseManager.java 2007-12-03 01:41:41 UTC (rev 16211)
@@ -267,7 +267,7 @@
+ "localPath VARCHAR(500) NULL,"
+ "mime VARCHAR(50) NULL,"
+ "size BIGINT NOT NULL,"
- + "category INTEGER NULL," // This field is a mistake.
+ + "category INTEGER NULL," // TODO : This field is unused, to remove ?
+ "indexParent INTEGER NOT NULL,"
+ "toDelete BOOLEAN DEFAULT FALSE NOT NULL,"
+ "dontDelete BOOLEAN DEFAULT FALSE NOT NULL,"
@@ -624,6 +624,23 @@
indexHandler = new IndexParser(index).getIndexHandler();
indexHandler.startDocument();
+ } else {
+ /* returned null because it already exists in the db ? */
+ /* if yes, we will just update the private key */
+
+ String publicKey = attrs.getValue("publicKey");
+ String privateKey = attrs.getValue("privateKey");
+
+ if (privateKey == null || "".equals(privateKey)) {
+ return;
+ }
+
+ int id = Index.isAlreadyKnown(db, publicKey, true);
+
+ if (id < 0)
+ return;
+ else
+ Index.setPrivateKey(db, id, privateKey);
}
return;
Modified: trunk/apps/Thaw/src/thaw/plugins/index/Index.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/Index.java 2007-12-03 01:08:37 UTC (rev 16210)
+++ trunk/apps/Thaw/src/thaw/plugins/index/Index.java 2007-12-03 01:41:41 UTC (rev 16211)
@@ -81,10 +81,7 @@
private boolean successful = true;
- /**
- * @deprecated Just don't use it !
- */
- public Index() {
+ private Index() {
db = null;
}
@@ -548,13 +545,15 @@
}
}
-
public void setPrivateKey(String privateKey) {
+ this.privateKey = privateKey;
+ setPrivateKey(db, id, privateKey);
+ }
+
+ public static void setPrivateKey(Hsqldb db, int indexId, String privateKey) {
if (privateKey != null && !FreenetURIHelper.isAKey(privateKey))
privateKey = null;
- this.privateKey = privateKey;
-
synchronized(db.dbLock) {
try {
PreparedStatement st;
@@ -566,11 +565,11 @@
st.setString(1, privateKey);
else
st.setNull(1, Types.VARCHAR);
- st.setInt(2, id);
+ st.setInt(2, indexId);
st.execute();
} catch(SQLException e) {
- Logger.error(this, "Unable to set private Key because: "+e.toString());
+ Logger.error(new Index(), "Unable to set private Key because: "+e.toString());
}
}
}
From jflesch at freenetproject.org Mon Dec 3 18:21:30 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Mon, 3 Dec 2007 18:21:30 +0000 (UTC)
Subject: [Thaw-dev] r16229 - trunk/apps/Thaw/src/thaw/plugins/index
Message-ID: <20071203182130.2D59D47AA4D@freenetproject.org>
Author: jflesch
Date: 2007-12-03 18:21:29 +0000 (Mon, 03 Dec 2007)
New Revision: 16229
Modified:
trunk/apps/Thaw/src/thaw/plugins/index/DatabaseManager.java
trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java
Log:
Fix index importation : Don't refresh immediatly imported indexes + sort correctly the indexes in the tree
Modified: trunk/apps/Thaw/src/thaw/plugins/index/DatabaseManager.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/DatabaseManager.java 2007-12-03 17:53:06 UTC (rev 16228)
+++ trunk/apps/Thaw/src/thaw/plugins/index/DatabaseManager.java 2007-12-03 18:21:29 UTC (rev 16229)
@@ -617,7 +617,7 @@
folders[folderLevel],
attrs.getValue("publicKey"),
attrs.getValue("privateKey"),
- false);
+ false, false);
if (index != null) {
index.rename(attrs.getValue("displayName"));
Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java 2007-12-03 17:53:06 UTC (rev 16228)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java 2007-12-03 18:21:29 UTC (rev 16229)
@@ -344,8 +344,14 @@
publicKey = dialog.getPublicKey();
privateKey = dialog.getPrivateKey();
+ /* https://bugs.freenetproject.org/view.php?id=1625:
+ * --- 0001625: Added index not in the correct category
+ * If you add an index from the link list instead of the unknown index list,
+ * it's added in the same folder than the index instead of "recently added".
+ * ==> Target == null
+ */
IndexManagementHelper.reuseIndex(getQueueManager(), getIndexBrowserPanel(),
- (IndexFolder)getTarget(), publicKey, privateKey,
+ null, publicKey, privateKey,
false /* autosort */);
}
}
@@ -416,17 +422,10 @@
IndexFolder parent;
- /* https://bugs.freenetproject.org/view.php?id=1625:
- * --- 0001625: Added index not in the correct category
- * If you add an index from the link list instead of the unknown index list,
- * it's added in the same folder than the index instead of "recently added".
- */
- /*
if (target != null)
parent = target;
else
- */
- parent = indexBrowser.getIndexTree().getRoot().getRecentlyAddedFolder();
+ parent = indexBrowser.getIndexTree().getRoot().getRecentlyAddedFolder();
int revision = FreenetURIHelper.getUSKRevision(publicKey);
Modified: trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java 2007-12-03 17:53:06 UTC (rev 16228)
+++ trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java 2007-12-03 18:21:29 UTC (rev 16229)
@@ -76,11 +76,17 @@
JMenuItem item;
JButton button;
+ /* https://bugs.freenetproject.org/view.php?id=1625:
+ * --- 0001625: Added index not in the correct category
+ * If you add an index from the link list instead of the unknown index list,
+ * it's added in the same folder than the index instead of "recently added".
+ * ==> addToParent == false
+ */
item = new JMenuItem(I18n.getMessage("thaw.plugin.index.addIndexesFromLink"), IconBox.minAdd);
button = new JButton(IconBox.indexReuse);
button.setToolTipText(I18n.getMessage("thaw.plugin.index.addIndexesFromLink"));
toolbarActions.add(new LinkManagementHelper.IndexAdder(button, queueManager,
- indexBrowser, true));
+ indexBrowser, false));
toolbarModifier.addButtonToTheToolbar(button);
rightClickMenu.add(item);
From jflesch at freenetproject.org Mon Dec 3 18:24:12 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Mon, 3 Dec 2007 18:24:12 +0000 (UTC)
Subject: [Thaw-dev] r16230 - trunk/apps/Thaw/src/thaw/plugins/index
Message-ID: <20071203182412.0693947AA9E@freenetproject.org>
Author: jflesch
Date: 2007-12-03 18:24:11 +0000 (Mon, 03 Dec 2007)
New Revision: 16230
Modified:
trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
Log:
Index browser : Add the new / imported indexes to the bottom of each folder instead of the top
Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java 2007-12-03 18:21:29 UTC (rev 16229)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java 2007-12-03 18:24:11 UTC (rev 16230)
@@ -432,6 +432,7 @@
Hsqldb db = indexBrowser.getDb();
Index index = null;
+ int pos = parent.getChildCount();
synchronized(db.dbLock) {
try {
@@ -457,7 +458,7 @@
st.setString(4, publicKey);
st.setString(5, privateKey);
st.setNull(6, Types.VARCHAR);
- st.setInt(7, 0 /* positionInTree */);
+ st.setInt(7, pos /* positionInTree */);
st.setInt(8, revision);
st.setBoolean(9, false);
@@ -483,7 +484,7 @@
index.setIsNewFlag();
- ((MutableTreeNode)parent).insert((index), 0);
+ ((MutableTreeNode)parent).insert((index), pos);
indexBrowser.getIndexTree().refresh(parent);
From jflesch at freenetproject.org Mon Dec 3 19:04:21 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Mon, 3 Dec 2007 19:04:21 +0000 (UTC)
Subject: [Thaw-dev] r16233 - trunk/apps/Thaw/src/thaw/core
Message-ID: <20071203190421.CA13E479F2E@freenetproject.org>
Author: jflesch
Date: 2007-12-03 19:04:21 +0000 (Mon, 03 Dec 2007)
New Revision: 16233
Modified:
trunk/apps/Thaw/src/thaw/core/ConfigWindow.java
trunk/apps/Thaw/src/thaw/core/Core.java
trunk/apps/Thaw/src/thaw/core/PluginManager.java
Log:
Plugin manager : Improvement of the synchronization ; should avoid that some plugins are loaded many times
Modified: trunk/apps/Thaw/src/thaw/core/ConfigWindow.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/ConfigWindow.java 2007-12-03 18:30:07 UTC (rev 16232)
+++ trunk/apps/Thaw/src/thaw/core/ConfigWindow.java 2007-12-03 19:04:21 UTC (rev 16233)
@@ -206,9 +206,11 @@
setChanged();
notifyObservers(okButton);
- Reloader reloader = new Reloader(needConnectionReset);
- Thread reload = new ThawThread(reloader, "Config reloader", this);
- reload.start();
+ synchronized(PluginManager.pluginLock) {
+ Reloader reloader = new Reloader(needConnectionReset);
+ Thread reload = new ThawThread(reloader, "Config reloader", this);
+ reload.start();
+ }
needConnectionReset = false;
}
@@ -232,7 +234,7 @@
this.running = true;
}
- public void run() {
+ public void apply() {
JDialog dialog = null;
if (resetConnection) {
@@ -303,6 +305,12 @@
if (resetConnection)
dialog.setVisible(false);
}
+
+ public void run() {
+ synchronized(PluginManager.pluginLock) {
+ apply();
+ }
+ }
public void stop() {
running = false;
Modified: trunk/apps/Thaw/src/thaw/core/Core.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/Core.java 2007-12-03 18:30:07 UTC (rev 16232)
+++ trunk/apps/Thaw/src/thaw/core/Core.java 2007-12-03 19:04:21 UTC (rev 16233)
@@ -610,43 +610,45 @@
}
public void run() {
- Logger.notice(this, "Starting reconnection process !");
-
- getMainWindow().setStatus(IconBox.blueBunny,
- I18n.getMessage("thaw.statusBar.connecting"), java.awt.Color.RED);
- getPluginManager().stopPlugins(); /* don't forget there is the status bar plugin */
- getMainWindow().setStatus(IconBox.blueBunny,
- I18n.getMessage("thaw.statusBar.connecting"), java.awt.Color.RED);
-
- subDisconnect();
-
- while(running) {
- try {
- Thread.sleep(Core.TIME_BETWEEN_EACH_TRY);
- } catch(final java.lang.InterruptedException e) {
- // brouzouf
+ synchronized(PluginManager.pluginLock) {
+ Logger.notice(this, "Starting reconnection process !");
+
+ getMainWindow().setStatus(IconBox.blueBunny,
+ I18n.getMessage("thaw.statusBar.connecting"), java.awt.Color.RED);
+ getPluginManager().stopPlugins(); /* don't forget there is the status bar plugin */
+ getMainWindow().setStatus(IconBox.blueBunny,
+ I18n.getMessage("thaw.statusBar.connecting"), java.awt.Color.RED);
+
+ subDisconnect();
+
+ while(running) {
+ try {
+ Thread.sleep(Core.TIME_BETWEEN_EACH_TRY);
+ } catch(final java.lang.InterruptedException e) {
+ // brouzouf
+ }
+
+ Logger.notice(this, "Trying to reconnect ...");
+ if(initConnection())
+ break;
}
-
- Logger.notice(this, "Trying to reconnect ...");
- if(initConnection())
- break;
+
+ if (running) {
+ getMainWindow().setStatus(IconBox.minConnectAction,
+ I18n.getMessage("thaw.statusBar.ready"));
+ } else {
+ getMainWindow().setStatus(IconBox.minDisconnectAction,
+ I18n.getMessage("thaw.statusBar.disconnected"), java.awt.Color.RED);
+ }
+
+ if (running) {
+ getPluginManager().loadAndRunPlugins();
+ }
+
+ reconnectionManager = null;
+
+ getMainWindow().connectionHasChanged();
}
-
- if (running) {
- getMainWindow().setStatus(IconBox.minConnectAction,
- I18n.getMessage("thaw.statusBar.ready"));
- } else {
- getMainWindow().setStatus(IconBox.minDisconnectAction,
- I18n.getMessage("thaw.statusBar.disconnected"), java.awt.Color.RED);
- }
-
- if (running) {
- getPluginManager().loadAndRunPlugins();
- }
-
- reconnectionManager = null;
-
- getMainWindow().connectionHasChanged();
}
public void stop() {
@@ -659,13 +661,15 @@
* use Thread => will also do all the work related to the plugins
*/
public void reconnect() {
- if (reconnectionManager == null) {
- reconnectionManager = new ReconnectionManager();
- final Thread th = new ThawThread(reconnectionManager,
- "Reconnection manager", this);
- th.start();
- } else {
- Logger.warning(this, "Already trying to reconnect !");
+ synchronized(this) {
+ if (reconnectionManager == null) {
+ reconnectionManager = new ReconnectionManager();
+ final Thread th = new ThawThread(reconnectionManager,
+ "Reconnection manager", this);
+ th.start();
+ } else {
+ Logger.warning(this, "Already trying to reconnect !");
+ }
}
}
Modified: trunk/apps/Thaw/src/thaw/core/PluginManager.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/PluginManager.java 2007-12-03 18:30:07 UTC (rev 16232)
+++ trunk/apps/Thaw/src/thaw/core/PluginManager.java 2007-12-03 19:04:21 UTC (rev 16233)
@@ -48,6 +48,7 @@
// LinkedHashMap because I want to keep a predictible plugin order.
private LinkedHashMap plugins = null; // String (pluginName) -> Plugin
+ public final static Object pluginLock = new Object();
/**
* Need a ref to the core to pass it to the plugins (and to access config)
@@ -75,38 +76,40 @@
* Load plugin from config or from default list.
* Reload if already loaded.
*/
- public synchronized boolean loadAndRunPlugins() {
- plugins = new LinkedHashMap();
+ public boolean loadAndRunPlugins() {
+ synchronized(pluginLock) {
+ plugins = new LinkedHashMap();
- Vector pluginNames;
+ Vector pluginNames;
- if(core.getConfig().getPluginNames().size() == 0) {
- Logger.notice(this, "Loading default plugin list");
- /* Then we load the config with the default plugins */
- for(int i = 0 ; i < PluginManager.defaultPlugins.length ; i++) {
- core.getConfig().addPlugin(PluginManager.defaultPlugins[i]);
+ if(core.getConfig().getPluginNames().size() == 0) {
+ Logger.notice(this, "Loading default plugin list");
+ /* Then we load the config with the default plugins */
+ for(int i = 0 ; i < PluginManager.defaultPlugins.length ; i++) {
+ core.getConfig().addPlugin(PluginManager.defaultPlugins[i]);
+ }
}
- }
- /* we duplicate the vector to avoid collisions */
- /* (remember : plugins can load other plugins */
- pluginNames = new Vector(core.getConfig().getPluginNames());
+ /* we duplicate the vector to avoid collisions */
+ /* (remember : plugins can load other plugins */
+ pluginNames = new Vector(core.getConfig().getPluginNames());
- final Iterator pluginIt = pluginNames.iterator();
+ final Iterator pluginIt = pluginNames.iterator();
- final int progressJump = (100-40) / pluginNames.size();
- core.getSplashScreen().setProgression(40);
+ final int progressJump = (100-40) / pluginNames.size();
+ core.getSplashScreen().setProgression(40);
- while(pluginIt.hasNext()) {
- final String pluginName = (String)pluginIt.next();
+ while(pluginIt.hasNext()) {
+ final String pluginName = (String)pluginIt.next();
- core.getSplashScreen().setProgressionAndStatus(core.getSplashScreen().getProgression()+progressJump,
- "Loading plugin '"+pluginName.replaceFirst("thaw.plugins.", "")+"' ...");
+ core.getSplashScreen().setProgressionAndStatus(core.getSplashScreen().getProgression()+progressJump,
+ "Loading plugin '"+pluginName.replaceFirst("thaw.plugins.", "")+"' ...");
- if (loadPlugin(pluginName) == null) {
- Logger.notice(this, "Plugin alread loaded");
- } else {
- runPlugin(pluginName);
+ if (loadPlugin(pluginName) == null) {
+ Logger.notice(this, "Plugin alread loaded");
+ } else {
+ runPlugin(pluginName);
+ }
}
}
@@ -117,136 +120,145 @@
/**
* Stop all plugins.
*/
- public synchronized boolean stopPlugins() {
- Iterator pluginIt;
+ public boolean stopPlugins() {
+ synchronized(pluginLock) {
+ Iterator pluginIt;
- if (plugins == null) {
- Logger.error(this, "No plugin to stop ?!");
- return false;
- }
+ if (plugins == null) {
+ Logger.error(this, "No plugin to stop ?!");
+ return false;
+ }
- pluginIt = plugins.values().iterator();
+ pluginIt = plugins.values().iterator();
- while(pluginIt.hasNext()) {
- final Plugin plugin = (Plugin)pluginIt.next();
+ while(pluginIt.hasNext()) {
+ final Plugin plugin = (Plugin)pluginIt.next();
- try {
- Logger.info(this, "Stopping plugin '"+plugin.getClass().getName()+"'");
+ try {
+ Logger.info(this, "Stopping plugin '"+plugin.getClass().getName()+"'");
- if (plugin != null)
- plugin.stop();
- else
- Logger.error(this, "Plugin == null !?");
- } catch(final Exception e) {
- Logger.error(this, "Unable to stop the plugin "+
- "'"+plugin.getClass().getName()+"'"+
- ", because: "+e.toString());
- e.printStackTrace();
+ if (plugin != null)
+ plugin.stop();
+ else
+ Logger.error(this, "Plugin == null !?");
+ } catch(final Exception e) {
+ Logger.error(this, "Unable to stop the plugin "+
+ "'"+plugin.getClass().getName()+"'"+
+ ", because: "+e.toString());
+ e.printStackTrace();
+ }
}
+
+ return true;
}
-
- return true;
}
-
/**
* Load a given plugin (without adding it to the config or running it).
*/
- public synchronized Plugin loadPlugin(final String className) {
- Plugin plugin = null;
-
- Logger.info(this, "Loading plugin: '"+className+"'");
-
- try {
- if ( plugins.get(className) != null) {
- Logger.debug(this, "loadPlugin(): Plugin '"+className+"' already loaded");
+ public Plugin loadPlugin(final String className) {
+ synchronized(pluginLock) {
+ Plugin plugin = null;
+
+ Logger.info(this, "Loading plugin: '"+className+"'");
+
+ try {
+ if ( plugins.get(className) != null) {
+ Logger.debug(this, "loadPlugin(): Plugin '"+className+"' already loaded");
+ return null;
+ }
+
+ //Logger.info(this, "Loading plugin '"+className+"'");
+
+ plugin = (Plugin)Class.forName(className).newInstance();
+
+ plugins.put(className, plugin);
+
+ } catch(final Exception e) {
+ Logger.error(this, "loadPlugin('"+className+"'): Exception: "+e);
+ e.printStackTrace();
return null;
}
-
- //Logger.info(this, "Loading plugin '"+className+"'");
-
- plugin = (Plugin)Class.forName(className).newInstance();
-
- plugins.put(className, plugin);
-
- } catch(final Exception e) {
- Logger.error(this, "loadPlugin('"+className+"'): Exception: "+e);
- e.printStackTrace();
- return null;
+
+ return plugin;
}
-
- return plugin;
}
/**
* Run a given plugin.
*/
- public synchronized boolean runPlugin(final String className) {
- Logger.info(this, "Starting plugin: '"+className+"'");
-
- try {
- Plugin plugin = (Plugin)plugins.get(className);
-
- javax.swing.ImageIcon icon;
-
- if ((icon = plugin.getIcon()) != null)
- core.getSplashScreen().addIcon(icon);
- else
- core.getSplashScreen().addIcon(thaw.gui.IconBox.add);
-
- plugin.run(core);
-
- } catch(final Exception e) {
- Logger.error(this, "runPlugin('"+className+"'): Exception: "+e);
- e.printStackTrace();
- return false;
+ public boolean runPlugin(final String className) {
+ synchronized(pluginLock) {
+ Logger.info(this, "Starting plugin: '"+className+"'");
+
+ try {
+ Plugin plugin = (Plugin)plugins.get(className);
+
+ javax.swing.ImageIcon icon;
+
+ if ((icon = plugin.getIcon()) != null)
+ core.getSplashScreen().addIcon(icon);
+ else
+ core.getSplashScreen().addIcon(thaw.gui.IconBox.add);
+
+ plugin.run(core);
+
+ } catch(final Exception e) {
+ Logger.error(this, "runPlugin('"+className+"'): Exception: "+e);
+ e.printStackTrace();
+ return false;
+ }
+
+ return true;
}
-
- return true;
}
/**
* Stop a given plugin.
*/
- public synchronized boolean stopPlugin(final String className) {
- Logger.info(this, "Stopping plugin: '"+className+"'");
-
- try {
- ((Plugin)plugins.get(className)).stop();
-
- } catch(final Exception e) {
- Logger.error(this, "stopPlugin('"+className+"'): Exception: "+e);
- e.printStackTrace();
- return false;
+ public boolean stopPlugin(final String className) {
+ synchronized(pluginLock) {
+ Logger.info(this, "Stopping plugin: '"+className+"'");
+
+ try {
+ ((Plugin)plugins.get(className)).stop();
+
+ } catch(final Exception e) {
+ Logger.error(this, "stopPlugin('"+className+"'): Exception: "+e);
+ e.printStackTrace();
+ return false;
+ }
+
+ return true;
}
-
- return true;
}
/**
* Unload a given plugin (without adding it to the config or running it).
*/
- public synchronized boolean unloadPlugin(final String className) {
- try {
- if(plugins.get(className) == null) {
- Logger.notice(this, "unloadPlugin(): Plugin '"+className+"' already unloaded");
+ public boolean unloadPlugin(final String className) {
+ synchronized(pluginLock) {
+ try {
+ if(plugins.get(className) == null) {
+ Logger.notice(this, "unloadPlugin(): Plugin '"+className+"' already unloaded");
+ return false;
+ }
+
+ plugins.remove(className);
+ core.getConfig().removePlugin(className);
+
+ } catch(final Exception e) {
+ Logger.error(this, "unloadPlugin('"+className+"'): Exception: "+e);
+ e.printStackTrace();
return false;
}
- plugins.remove(className);
- core.getConfig().removePlugin(className);
-
- } catch(final Exception e) {
- Logger.error(this, "unloadPlugin('"+className+"'): Exception: "+e);
- e.printStackTrace();
- return false;
+ return true;
}
-
- return true;
}
public Plugin getPlugin(final String className) {
From jflesch at freenetproject.org Mon Dec 3 23:13:05 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Mon, 3 Dec 2007 23:13:05 +0000 (UTC)
Subject: [Thaw-dev] r16247 - in trunk/apps/Thaw/src/thaw: i18n
plugins/miniFrost/frostKSK
Message-ID: <20071203231305.2391D47B2FB@freenetproject.org>
Author: jflesch
Date: 2007-12-03 23:13:04 +0000 (Mon, 03 Dec 2007)
New Revision: 16247
Modified:
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/frostKSK/KSKMessageParser.java
Log:
MiniFrost : If it can't parse a message, it will store an error messsage instead in the database to not download it again
Modified: trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-12-03 21:43:56 UTC (rev 16246)
+++ trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-12-03 23:13:04 UTC (rev 16247)
@@ -640,6 +640,7 @@
thaw.plugin.miniFrost.draft=Brouillon
thaw.plugin.miniFrost.encrypted=Crypt?
thaw.plugin.miniFrost.encryptedBody=Crypt? pour 'X'
+thaw.plugin.miniFrost.invalidMessage=Message invalide
thaw.plugin.miniFrost.regexpBlacklistLongDesc=Archiver imm?diatement les messages correspondant aux expressions suivantes (une par line):
thaw.plugin.miniFrost.seeSunManual=(Voir X)
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-12-03 21:43:56 UTC (rev 16246)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-12-03 23:13:04 UTC (rev 16247)
@@ -655,6 +655,7 @@
thaw.plugin.miniFrost.encrypted=Encrypted
thaw.plugin.miniFrost.encryptedFor=[Encrypted for 'X']
thaw.plugin.miniFrost.encryptedBody=Encrypted for 'X'
+thaw.plugin.miniFrost.invalidMessage=Invalid message
thaw.plugin.miniFrost.regexpBlacklistLongDesc=Archivate immediatly the messages matching the following expressions (one per line):
thaw.plugin.miniFrost.seeSunManual=(See X)
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2007-12-03 21:43:56 UTC (rev 16246)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2007-12-03 23:13:04 UTC (rev 16247)
@@ -640,6 +640,7 @@
thaw.plugin.miniFrost.draft=Brouillon
thaw.plugin.miniFrost.encrypted=Crypt\u00e9
thaw.plugin.miniFrost.encryptedBody=Crypt\u00e9 pour 'X'
+thaw.plugin.miniFrost.invalidMessage=Message invalide
thaw.plugin.miniFrost.regexpBlacklistLongDesc=Archiver imm\u00e9diatement les messages correspondant aux expressions suivantes (une par line):
thaw.plugin.miniFrost.seeSunManual=(Voir X)
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessageParser.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessageParser.java 2007-12-03 21:43:56 UTC (rev 16246)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessageParser.java 2007-12-03 23:13:04 UTC (rev 16247)
@@ -532,8 +532,47 @@
/* because we have date to store: */
return true;
}
+
+ private boolean invalidMessage(String reason) {
+ /* Invalid message -> Will use default value */
+ /* the goal is to not download this message again */
+
+ inReplyTo = null;
+ from = "["+I18n.getMessage("thaw.plugin.miniFrost.invalidMessage")+"]";
+ subject = "["+I18n.getMessage("thaw.plugin.miniFrost.invalidMessage")+"]";
+ String[] date = gmtFormat.format(new Date()).toString().split(" ");
+ this.date = date[0];
+ this.time = date[1];
+ /* not really used */
+ this.recipient = null;
+
+ /* will be ignored by the checks */
+ this.board = null;
+
+ this.body = I18n.getMessage("thaw.plugin.miniFrost.invalidMessage")+
+ ((reason != null) ? "\n"+reason : "");
+
+ this.publicKey = null;
+ this.signature = null;
+ this.idLinePos = "0";
+ this.idLineLen = "0";
+ attachments = null;
+
+ identity = null;
+
+ if (frostCrypt == null)
+ frostCrypt = new FrostCrypt();
+ this.messageId = frostCrypt.computeChecksumSHA256(date[0] + date[1]);
+
+ read = true;
+ archived = true;
+
+ return true;
+ }
+
+
/**
* This function has been imported from FROST.
* Parses the XML file and passes the FrostMessage element to XMLize load method.
@@ -546,14 +585,14 @@
doc = XMLTools.parseXmlFile(file, false);
} catch(Exception ex) { // xml format error
Logger.notice(this, "Invalid Xml");
- return false;
+ return invalidMessage("XML parser error:\n"+ex.toString());
}
if( doc == null ) {
Logger.notice(this,
"Error: couldn't parse XML Document - " +
"File name: '" + file.getName() + "'");
- return false;
+ return invalidMessage("Nothing parsed ?!");
}
Element rootNode = doc.getDocumentElement();
@@ -574,7 +613,7 @@
/* XMLTools throws runtime exception sometimes ... */
Logger.notice(this, "Unable to parse XML message because : "+e.toString());
e.printStackTrace();
- return false;
+ return invalidMessage("Unable to parse XML message because : "+e.toString());
}
}
From jflesch at freenetproject.org Sat Dec 15 00:30:15 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Sat, 15 Dec 2007 00:30:15 +0000 (UTC)
Subject: [Thaw-dev] r16556 - in trunk/apps/Thaw/src/thaw: i18n
plugins/miniFrost plugins/miniFrost/frostKSK
plugins/miniFrost/interfaces
Message-ID: <20071215003015.022C13C0771@freenetproject.org>
Author: jflesch
Date: 2007-12-15 00:30:14 +0000 (Sat, 15 Dec 2007)
New Revision: 16556
Added:
trunk/apps/Thaw/src/thaw/plugins/miniFrost/Outbox.java
Modified:
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/BoardTree.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/MiniFrostPanel.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/SentMessages.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/SpecialBoardFactory.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKDraft.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Draft.java
Log:
Add a new special board in minifrost displaying messages being sent
Modified: trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-12-15 00:16:43 UTC (rev 16555)
+++ trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-12-15 00:30:14 UTC (rev 16556)
@@ -658,7 +658,7 @@
thaw.plugin.miniFrost.actions=[ACTIONS]
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.outbox=[en cours d'envoi]
thaw.plugin.miniFrost.sentBox=[envoy?s]
thaw.plugin.miniFrost.attachBoards=Attacher des boards
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-12-15 00:16:43 UTC (rev 16555)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-12-15 00:30:14 UTC (rev 16556)
@@ -673,7 +673,7 @@
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.outbox=[outbox]
thaw.plugin.miniFrost.sentBox=[sent]
thaw.plugin.miniFrost.attachBoards=Attach board(s)
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2007-12-15 00:16:43 UTC (rev 16555)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2007-12-15 00:30:14 UTC (rev 16556)
@@ -658,7 +658,7 @@
thaw.plugin.miniFrost.actions=[ACTIONS]
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.outbox=[en cours d'envoi]
thaw.plugin.miniFrost.sentBox=[envoy\u00e9s]
thaw.plugin.miniFrost.attachBoards=Attacher des boards
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/BoardTree.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/BoardTree.java 2007-12-15 00:16:43 UTC (rev 16555)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/BoardTree.java 2007-12-15 00:30:14 UTC (rev 16556)
@@ -356,15 +356,15 @@
Board b = ((Board)list.getSelectedValue());
- if (b == currentlySelected)
- return;
-
- currentlySelected = b;
-
for (Iterator it = actions.iterator();
it.hasNext();) {
((BoardManagementHelper.BoardAction)it.next()).setTarget(b);
}
+
+ if (b == currentlySelected)
+ return;
+
+ currentlySelected = b;
setChanged();
notifyObservers(b);
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java 2007-12-15 00:16:43 UTC (rev 16555)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java 2007-12-15 00:30:14 UTC (rev 16556)
@@ -283,9 +283,14 @@
/* it's dirty, but it should work */
JPanel iPanel = null;
+
+ String rev = "";
+ if (msg.getRev() >= 0)
+ rev = " [r"+Integer.toString(msg.getRev())+"]";
+
subject.setText(I18n.getMessage("thaw.plugin.miniFrost.subject")+": "+msg.getSubject()+
- " [r"+Integer.toString(msg.getRev())+"]");
+ rev);
Logger.info(this, "Displaying "+Integer.toString(subMsgs.size())+" sub-msgs");
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/MiniFrostPanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/MiniFrostPanel.java 2007-12-15 00:16:43 UTC (rev 16555)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/MiniFrostPanel.java 2007-12-15 00:30:14 UTC (rev 16556)
@@ -276,6 +276,10 @@
boardTree.updateDraftValues(waitings, postings);
}
+
+ public Vector getDrafts() {
+ return drafts;
+ }
public boolean isInGmailView() {
return gmailView;
Added: trunk/apps/Thaw/src/thaw/plugins/miniFrost/Outbox.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/Outbox.java (rev 0)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/Outbox.java 2007-12-15 00:30:14 UTC (rev 16556)
@@ -0,0 +1,221 @@
+package thaw.plugins.miniFrost;
+
+import java.util.Vector;
+import java.util.Iterator;
+
+import thaw.plugins.MiniFrost;
+import thaw.plugins.miniFrost.interfaces.Author;
+import thaw.plugins.miniFrost.interfaces.Board;
+import thaw.plugins.miniFrost.interfaces.Draft;
+import thaw.plugins.miniFrost.interfaces.Message;
+import thaw.plugins.signatures.Identity;
+import thaw.core.I18n;
+
+
+public class Outbox implements Board {
+
+ private MiniFrost miniFrost;
+
+ public Outbox(MiniFrost miniFrost) {
+ this.miniFrost = miniFrost;
+ }
+
+ public boolean destroy() {
+ /* just can't */
+ return false;
+ }
+
+ public Draft getDraft(Message inReplyTo) {
+ /* just can't */
+ return null;
+ }
+
+ private static class DraftAuthorShell implements thaw.plugins.miniFrost.interfaces.Author {
+ private Draft draft;
+
+ public DraftAuthorShell(Draft draft) {
+ this.draft = draft;
+ }
+
+ public Identity getIdentity() {
+ return draft.getAuthorIdentity();
+ }
+
+ public String toString() {
+ return draft.getAuthorNick();
+ }
+
+ public String toString(boolean noDup) {
+ return toString();
+ }
+ }
+
+ private static class DraftSubMessageShell implements thaw.plugins.miniFrost.interfaces.SubMessage {
+ private Draft draft;
+
+ public DraftSubMessageShell(Draft draft) {
+ this.draft = draft;
+ }
+
+ public Author getAuthor() {
+ return new DraftAuthorShell(draft);
+ }
+
+ public java.util.Date getDate() {
+ return draft.getDate();
+ }
+
+ public String getMessage() {
+ return draft.getText();
+ }
+ }
+
+ private static class DraftShell implements thaw.plugins.miniFrost.interfaces.Message {
+ private Draft draft;
+
+ public DraftShell(Draft draft) {
+ this.draft = draft;
+ }
+
+ public String getMsgId() {
+ return "kwain.net";
+ }
+
+ public String getInReplyToId() {
+ return null;
+ }
+
+ public String getSubject() {
+ return draft.getSubject();
+ }
+
+ public Author getSender() {
+ return new DraftAuthorShell(draft);
+ }
+
+ public java.util.Date getDate() {
+ return draft.getDate();
+ }
+
+ /**
+ * @return < 0 if must not be displayed
+ */
+ public int getRev() {
+ return -1;
+ }
+
+ public boolean isArchived() {
+ return false;
+ }
+
+ public boolean isRead() {
+ return true;
+ }
+
+ public Identity encryptedFor() {
+ return null;
+ }
+
+ public void setRead(boolean read) {
+ /* ni ! */
+ }
+
+ public void setArchived(boolean archived) {
+ /* ni ! */
+ }
+
+ public Board getBoard() {
+ return draft.getBoard();
+ }
+
+ /**
+ * SubMessage vector. (Don't store / cache !)
+ */
+ public Vector getSubMessages() {
+ Vector v = new Vector();
+ v.add(new DraftSubMessageShell(draft));
+ return v;
+ }
+
+ /**
+ * @return null if none
+ */
+ public Vector getAttachments() {
+ return draft.getAttachments();
+ }
+
+ public boolean equals(Object o) {
+ return (o == this);
+ }
+
+ 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 -1 * c;
+ }
+ }
+
+ public Vector getMessages(String[] keywords, int orderBy, boolean desc,
+ boolean archived, boolean read, boolean unsigned, int minTrustLevel) {
+
+ Vector drafts = miniFrost.getPanel().getDrafts();
+ Vector msgs = new Vector();
+
+ if (drafts == null)
+ return msgs;
+
+ for (Iterator it = drafts.iterator();
+ it.hasNext();) {
+ Draft draft = (Draft)it.next();
+ msgs.add(new DraftShell(draft));
+ }
+
+ return msgs;
+ }
+
+ public String getName() {
+ return I18n.getMessage("thaw.plugin.miniFrost.outbox");
+ }
+
+ public int getNewMessageNumber(boolean unsigned, boolean archived, int minTrustLevel) {
+ Vector drafts = miniFrost.getPanel().getDrafts();
+
+ return ((drafts == null) ? 0 : drafts.size());
+ }
+
+ public Message getNextUnreadMessage(boolean unsigned, boolean archived,
+ int minTrustLevel) {
+ /* always */
+ return null;
+ }
+
+ public boolean isRefreshing() {
+ /* never refreshing */
+ return false;
+ }
+
+ public void refresh() {
+ /* can't */
+ }
+
+ public int compareTo(Object arg0) {
+ return -1;
+ }
+
+ public boolean equals(Object o) {
+ return false;
+ }
+
+ public String toString() {
+ return getName();
+ }
+}
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/SentMessages.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/SentMessages.java 2007-12-15 00:16:43 UTC (rev 16555)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/SentMessages.java 2007-12-15 00:30:14 UTC (rev 16556)
@@ -62,6 +62,7 @@
* @return null if none
*/
public Message getNextUnreadMessage(boolean unsigned, boolean archived, int minTrustLevel) {
+ /* always */
return null;
}
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/SpecialBoardFactory.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/SpecialBoardFactory.java 2007-12-15 00:16:43 UTC (rev 16555)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/SpecialBoardFactory.java 2007-12-15 00:30:14 UTC (rev 16556)
@@ -40,6 +40,7 @@
Vector v = new Vector();
v.add(new SentMessages(miniFrost));
+ v.add(new Outbox(miniFrost));
return v;
}
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKDraft.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKDraft.java 2007-12-15 00:16:43 UTC (rev 16555)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKDraft.java 2007-12-15 00:30:14 UTC (rev 16556)
@@ -104,6 +104,10 @@
public void setDate(Date date) {
this.date = date;
}
+
+ public Date getDate() {
+ return date;
+ }
private java.io.File fileToInsert;
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Draft.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Draft.java 2007-12-15 00:16:43 UTC (rev 16555)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Draft.java 2007-12-15 00:30:14 UTC (rev 16556)
@@ -40,6 +40,7 @@
* @param date the date provided is already GMT-ized
*/
public void setDate(java.util.Date date);
+ public java.util.Date getDate();
/**
* @param i specify the position of the id line in the text
From jflesch at freenetproject.org Sat Dec 15 01:29:35 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Sat, 15 Dec 2007 01:29:35 +0000 (UTC)
Subject: [Thaw-dev] r16560 - in trunk/apps/Thaw/src/thaw: fcp
plugins/signatures
Message-ID: <20071215012935.522503C0743@freenetproject.org>
Author: jflesch
Date: 2007-12-15 01:29:35 +0000 (Sat, 15 Dec 2007)
New Revision: 16560
Modified:
trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
trunk/apps/Thaw/src/thaw/fcp/FCPClientHello.java
trunk/apps/Thaw/src/thaw/plugins/signatures/Identity.java
Log:
Improve a little bit logs readability
Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java 2007-12-15 01:09:17 UTC (rev 16559)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java 2007-12-15 01:29:35 UTC (rev 16560)
@@ -510,7 +510,8 @@
return;
}
- Logger.notice(this, "GetFailed : "+message.getValue("CodeDescription"));
+ if (!"13".equals(message.getValue("Code"))) /* if != of Data Not Found */
+ Logger.notice(this, "GetFailed : "+message.getValue("CodeDescription"));
if(!isRunning()) { /* Must be a "GetFailed: cancelled by caller", so we simply ignore */
@@ -945,6 +946,7 @@
if(!isPersistent()) {
Logger.notice(this, "Can't remove non persistent request.");
+
return false;
}
@@ -992,7 +994,7 @@
public boolean stop(final FCPQueueManager queryManager) {
Logger.info(this, "Stop fetching of the key : "+getFileKey());
- if(!removeRequest())
+ if(isPersistent() && !removeRequest())
return false;
boolean wasFinished = isFinished();
Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientHello.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPClientHello.java 2007-12-15 01:09:17 UTC (rev 16559)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPClientHello.java 2007-12-15 01:29:35 UTC (rev 16560)
@@ -12,7 +12,7 @@
* and start() returns false.
*/
public class FCPClientHello implements FCPQuery, Observer {
- public final static int NODEHELLO_TIMEOUT = 30; /* in seconds */
+ public final static int NODEHELLO_TIMEOUT = 60; /* in seconds */
private final static String FCP_EXPECTED_VERSION = "2.0";
private String id;
Modified: trunk/apps/Thaw/src/thaw/plugins/signatures/Identity.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/signatures/Identity.java 2007-12-15 01:09:17 UTC (rev 16559)
+++ trunk/apps/Thaw/src/thaw/plugins/signatures/Identity.java 2007-12-15 01:29:35 UTC (rev 16560)
@@ -513,8 +513,8 @@
initFrostCrypt();
return frostCrypt.detachedVerify(text, publicKey, sig);
} catch(Exception e) {
- Logger.notice(this, "signature check failed because: "+e.toString());
- e.printStackTrace();
+ Logger.info(this, "Exception while checking signature: "+e.toString());
+ //e.printStackTrace();
return false;
}
}
From jflesch at freenetproject.org Sat Dec 15 01:38:56 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Sat, 15 Dec 2007 01:38:56 +0000 (UTC)
Subject: [Thaw-dev] r16561 - trunk/apps/Thaw/src/thaw/fcp
Message-ID: <20071215013856.4ED8147B340@freenetproject.org>
Author: jflesch
Date: 2007-12-15 01:38:56 +0000 (Sat, 15 Dec 2007)
New Revision: 16561
Modified:
trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
Log:
Should fix DDA (need testing)
Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java 2007-12-15 01:29:35 UTC (rev 16560)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java 2007-12-15 01:38:56 UTC (rev 16561)
@@ -259,18 +259,6 @@
|| queueManager.getQueryManager().getConnection() == null)
return false;
- if (queueManager.getQueryManager().getConnection().isLocalSocket()
- && !noDDA
- && (destinationDir != null || finalPath != null)) {
-
- if (destinationDir == null)
- destinationDir = new File(finalPath).getAbsoluteFile().getParent();
-
- testDDA = new FCPTestDDA(destinationDir, false, true);
- testDDA.addObserver(this);
- return testDDA.start(queueManager);
- }
-
return sendClientGet();
}
@@ -417,7 +405,21 @@
if("ProtocolError".equals( message.getMessageName() )) {
Logger.debug(this, "ProtocolError !");
+
+ if (queueManager.getQueryManager().getConnection().isLocalSocket()
+ && !noDDA
+ && (destinationDir != null || finalPath != null)) {
+ if (destinationDir == null)
+ destinationDir = new File(finalPath).getAbsoluteFile().getParent();
+
+ testDDA = new FCPTestDDA(destinationDir, false, true);
+ testDDA.addObserver(this);
+ testDDA.start(queueManager);
+
+ return;
+ }
+
if ("4".equals(message.getValue("Code"))) {
Logger.warning(this, "The node reported an invalid key. Please check the following key\n"+
key);
From jflesch at freenetproject.org Sat Dec 15 01:57:33 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Sat, 15 Dec 2007 01:57:33 +0000 (UTC)
Subject: [Thaw-dev] r16562 - trunk/apps/Thaw/src/thaw/plugins/index
Message-ID: <20071215015733.3E0A047B340@freenetproject.org>
Author: jflesch
Date: 2007-12-15 01:57:33 +0000 (Sat, 15 Dec 2007)
New Revision: 16562
Modified:
trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java
Log:
Fix index adding from links
Modified: trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java 2007-12-15 01:38:56 UTC (rev 16561)
+++ trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java 2007-12-15 01:57:33 UTC (rev 16562)
@@ -91,7 +91,7 @@
toolbarModifier.addButtonToTheToolbar(button);
rightClickMenu.add(item);
rightClickActions.add(new LinkManagementHelper.IndexAdder(item, queueManager,
- indexBrowser, true));
+ indexBrowser, false));
item = new JMenuItem(I18n.getMessage("thaw.plugin.index.copyKeys"), IconBox.minCopy);
rightClickMenu.add(item);
From jflesch at freenetproject.org Sat Dec 15 02:01:23 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Sat, 15 Dec 2007 02:01:23 +0000 (UTC)
Subject: [Thaw-dev] r16563 - trunk/apps/Thaw/src/thaw/plugins/index
Message-ID: <20071215020123.96AC847B758@freenetproject.org>
Author: jflesch
Date: 2007-12-15 02:01:22 +0000 (Sat, 15 Dec 2007)
New Revision: 16563
Modified:
trunk/apps/Thaw/src/thaw/plugins/index/LinkManagementHelper.java
Log:
re-Fix index adding from links
Modified: trunk/apps/Thaw/src/thaw/plugins/index/LinkManagementHelper.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/LinkManagementHelper.java 2007-12-15 01:57:33 UTC (rev 16562)
+++ trunk/apps/Thaw/src/thaw/plugins/index/LinkManagementHelper.java 2007-12-15 02:01:22 UTC (rev 16563)
@@ -109,7 +109,7 @@
private Vector t;
private boolean addToParent; /* (== add to the same parent folder) */
- private boolean autoSorting;
+ private boolean autoSorting = true;
/**
* @param addToParent Try to add the new index to the same folder than the
From jflesch at freenetproject.org Sun Dec 16 12:55:07 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Sun, 16 Dec 2007 12:55:07 +0000 (UTC)
Subject: [Thaw-dev] r16595 - trunk/apps/Thaw/src/thaw/plugins/signatures
Message-ID: <20071216125507.81E8948121E@freenetproject.org>
Author: jflesch
Date: 2007-12-16 12:55:07 +0000 (Sun, 16 Dec 2007)
New Revision: 16595
Modified:
trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
Log:
Fix bug #1901 : Identity config dialog : Don't allow multiple identity selection because the button 'export' doesn't support it
Modified: trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java 2007-12-16 00:13:23 UTC (rev 16594)
+++ trunk/apps/Thaw/src/thaw/plugins/signatures/SigConfigTab.java 2007-12-16 12:55:07 UTC (rev 16595)
@@ -9,6 +9,7 @@
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
import javax.swing.event.TableModelEvent;
import javax.swing.JComboBox;
@@ -183,6 +184,7 @@
BorderLayout.NORTH);
list = new JList();
+ list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
updateList();
From jflesch at freenetproject.org Sun Dec 16 13:22:37 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Sun, 16 Dec 2007 13:22:37 +0000 (UTC)
Subject: [Thaw-dev] r16596 - in trunk/apps/Thaw/src/thaw: core fcp i18n
plugins/index
Message-ID: <20071216132237.ABFF33C072C@freenetproject.org>
Author: jflesch
Date: 2007-12-16 13:22:37 +0000 (Sun, 16 Dec 2007)
New Revision: 16596
Modified:
trunk/apps/Thaw/src/thaw/core/Core.java
trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
trunk/apps/Thaw/src/thaw/fcp/FCPMessage.java
trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
trunk/apps/Thaw/src/thaw/plugins/index/IndexBrowserPanel.java
Log:
Fix DDA once for all
Modified: trunk/apps/Thaw/src/thaw/core/Core.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/Core.java 2007-12-16 12:55:07 UTC (rev 16595)
+++ trunk/apps/Thaw/src/thaw/core/Core.java 2007-12-16 13:22:37 UTC (rev 16596)
@@ -724,7 +724,6 @@
|| code == 13 /* Couldn't write file */
|| code == 14 /* Couldn't rename file */
|| code == 22 /* File parse error */
- || code == 25 /* DDA denied */
|| code == 26 /* Could not read file */) {
askToDisableDDA();
}
Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java 2007-12-16 12:55:07 UTC (rev 16595)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java 2007-12-16 13:22:37 UTC (rev 16596)
@@ -406,7 +406,8 @@
if("ProtocolError".equals( message.getMessageName() )) {
Logger.debug(this, "ProtocolError !");
- if (queueManager.getQueryManager().getConnection().isLocalSocket()
+ if ("25".equals(message.getValue("Code"))
+ && queueManager.getQueryManager().getConnection().isLocalSocket()
&& !noDDA
&& (destinationDir != null || finalPath != null)) {
Modified: trunk/apps/Thaw/src/thaw/fcp/FCPMessage.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPMessage.java 2007-12-16 12:55:07 UTC (rev 16595)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPMessage.java 2007-12-16 13:22:37 UTC (rev 16596)
@@ -62,7 +62,8 @@
}
- if("ProtocolError".equals( getMessageName() ))
+ if("ProtocolError".equals( getMessageName() )
+ && !"25".equals(getValue("Code")) ) /* code 25 == need to test DDA */
Logger.warning(this, "PROTOCOL ERROR:\n"+toString());
else if (Logger.getLogLevel() <= 3)
Logger.info(this, "Message (Node >> Thaw): "+getMessageName());
Modified: trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-12-16 12:55:07 UTC (rev 16595)
+++ trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-12-16 13:22:37 UTC (rev 16596)
@@ -239,6 +239,11 @@
thaw.warning.unableToConnectTo=Impossible de se connecter ?
thaw.warning.autoreconnecting=D?connect?. Thaw est entrain d'essayer de se reconnecter automagiquement ...
+thaw.warning.DDA.l0=Thaw a quelques probl?mes pour utiliser l'acc?s direct au disque.
+thaw.warning.DDA.l1=Voulez-vous d?sactiver cette option ?
+thaw.warning.DDA.l2=Cette option peut ?tre r?activ?e en s?lectionnant
+thaw.warning.DDA.l3='#' dans la configuration.
+thaw.warning.DDA.l4=Si vous la d?sactiver, vous pouvez avoir ? red?marrer certains transferts.
## Toolbar
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2007-12-16 12:55:07 UTC (rev 16595)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2007-12-16 13:22:37 UTC (rev 16596)
@@ -239,6 +239,11 @@
thaw.warning.unableToConnectTo=Impossible de se connecter \u00e0
thaw.warning.autoreconnecting=D\u00e9connect\u00e9. Thaw est entrain d'essayer de se reconnecter automagiquement ...
+thaw.warning.DDA.l0=Thaw a quelques probl\u00e8mes pour utiliser l'acc\u00e8s direct au disque.
+thaw.warning.DDA.l1=Voulez-vous d\u00e9sactiver cette option ?
+thaw.warning.DDA.l2=Cette option peut \u00eatre r\u00e9activ\u00e9e en s\u00e9lectionnant
+thaw.warning.DDA.l3='#' dans la configuration.
+thaw.warning.DDA.l4=Si vous la d\u00e9sactiver, vous pouvez avoir \u00e0 red\u00e9marrer certains transferts.
## Toolbar
Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexBrowserPanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexBrowserPanel.java 2007-12-16 12:55:07 UTC (rev 16595)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexBrowserPanel.java 2007-12-16 13:22:37 UTC (rev 16596)
@@ -88,7 +88,7 @@
if (config.getValue("indexBrowserPanelSplitPosition") != null)
split.setDividerLocation(Integer.parseInt(config.getValue("indexBrowserPanelSplitPosition")));
- leftSplit.setSize(150, MainWindow.DEFAULT_SIZE_Y - 150);
+ leftSplit.setSize(400, MainWindow.DEFAULT_SIZE_Y - 400);
leftSplit.setResizeWeight(0.5);
if (config.getValue("indexTreeUnknownListSplitLocation") == null) {
From jflesch at freenetproject.org Sun Dec 16 15:03:38 2007
From: jflesch at freenetproject.org (jflesch at freenetproject.org)
Date: Sun, 16 Dec 2007 15:03:38 +0000 (UTC)
Subject: [Thaw-dev] r16597 - in trunk/apps/Thaw/src/thaw: core i18n
plugins/miniFrost plugins/miniFrost/frostKSK
plugins/miniFrost/interfaces plugins/signatures
Message-ID: <20071216150338.C54AE3C072C@freenetproject.org>
Author: jflesch
Date: 2007-12-16 15:03:38 +0000 (Sun, 16 Dec 2007)
New Revision: 16597
Modified:
trunk/apps/Thaw/src/thaw/core/Core.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/DraftPanel.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKDraft.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKMessageParser.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/interfaces/Draft.java
trunk/apps/Thaw/src/thaw/plugins/signatures/Identity.java
Log:
MiniFrost : add support for crypted messages
Modified: trunk/apps/Thaw/src/thaw/core/Core.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/Core.java 2007-12-16 13:22:37 UTC (rev 16596)
+++ trunk/apps/Thaw/src/thaw/core/Core.java 2007-12-16 15:03:38 UTC (rev 16597)
@@ -717,14 +717,15 @@
if ("ProtocolError".equals(m.getMessageName())) {
int code = Integer.parseInt(m.getValue("Code"));
- if (code == 8 /* Invalid field (?!) */
- || code == 9 /* File not found */
- || code == 10 /* Disk target exists */
- || code == 12 /* Couldn't create file */
- || code == 13 /* Couldn't write file */
- || code == 14 /* Couldn't rename file */
- || code == 22 /* File parse error */
- || code == 26 /* Could not read file */) {
+ if (connection.isLocalSocket()
+ && (code == 8 /* Invalid field (?!) */
+ || code == 9 /* File not found */
+ || code == 10 /* Disk target exists */
+ || code == 12 /* Couldn't create file */
+ || code == 13 /* Couldn't write file */
+ || code == 14 /* Couldn't rename file */
+ || code == 22 /* File parse error */
+ || code == 26 /* Could not read file */)) {
askToDisableDDA();
}
Modified: trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-12-16 13:22:37 UTC (rev 16596)
+++ trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties 2007-12-16 15:03:38 UTC (rev 16597)
@@ -2,7 +2,7 @@
# 2006-2007(c)
## Commons
-# Note for devs and translators: These words must be/are always used alone.
+
thaw.common.queueWatcher=Transferts
thaw.common.node=Node
thaw.common.plugins=Plugins
@@ -596,6 +596,8 @@
thaw.plugin.miniFrost.subject=Sujet
thaw.plugin.miniFrost.author=De
+thaw.plugin.miniFrost.recipient=?
+thaw.plugin.miniFrost.recipient.all=[n'importe-qui]
thaw.plugin.miniFrost.status=Status
thaw.plugin.miniFrost.date=Date
thaw.plugin.miniFrost.read=Lire
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-12-16 13:22:37 UTC (rev 16596)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2007-12-16 15:03:38 UTC (rev 16597)
@@ -6,7 +6,6 @@
## Commons
-# Note for devs and translators: These words must be/are always used alone.
thaw.common.node=Node
thaw.common.plugins=Plugins
@@ -600,6 +599,8 @@
thaw.plugin.miniFrost.subject=Subject
thaw.plugin.miniFrost.author=From
+thaw.plugin.miniFrost.recipient=To
+thaw.plugin.miniFrost.recipient.all=[anybody]
thaw.plugin.miniFrost.status=Status
thaw.plugin.miniFrost.date=Date
thaw.plugin.miniFrost.read=Read
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2007-12-16 13:22:37 UTC (rev 16596)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2007-12-16 15:03:38 UTC (rev 16597)
@@ -2,7 +2,7 @@
# 2006-2007(c)
## Commons
-# Note for devs and translators: These words must be/are always used alone.
+
thaw.common.queueWatcher=Transferts
thaw.common.node=Node
thaw.common.plugins=Plugins
@@ -596,6 +596,8 @@
thaw.plugin.miniFrost.subject=Sujet
thaw.plugin.miniFrost.author=De
+thaw.plugin.miniFrost.recipient=\u00c0
+thaw.plugin.miniFrost.recipient.all=[n'importe-qui]
thaw.plugin.miniFrost.status=Status
thaw.plugin.miniFrost.date=Date
thaw.plugin.miniFrost.read=Lire
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/DraftPanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/DraftPanel.java 2007-12-16 13:22:37 UTC (rev 16596)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/DraftPanel.java 2007-12-16 15:03:38 UTC (rev 16597)
@@ -57,6 +57,8 @@
private JComboBox authorBox;
private JTextField subjectField;
private JTextArea textArea;
+ private JComboBox recipientBox;
+
private JButton cancelButton;
private JButton sendButton;
@@ -84,12 +86,22 @@
messageDateFormat = new SimpleDateFormat("yyyy.MM.dd - HH:mm:ss");
panel = new JPanel(new BorderLayout(5, 5));
+
+ /* author box */
authorBox = new JComboBox();
authorBox.setEditable(true);
-
+
subjectField = new JTextField("");
subjectField.setEditable(true);
+
+ /* recipient box */
+
+ recipientBox = new JComboBox();
+
+ /* content will be updated when setDraft() will be called
+ * to take into consideration people marked as GOOD recently
+ */
textArea = new JTextArea("");
textArea.setEditable(true);
@@ -104,12 +116,13 @@
JPanel northPanel = new JPanel(new BorderLayout(5, 5));
- JPanel headersPanel = new JPanel(new GridLayout(3, 1));
+ JPanel headersPanel = new JPanel(new GridLayout(4, 1));
headersPanel.add(new JLabel(I18n.getMessage("thaw.plugin.miniFrost.board")+": "));
headersPanel.add(new JLabel(I18n.getMessage("thaw.plugin.miniFrost.author")+": "));
- headersPanel.add(new JLabel(I18n.getMessage("thaw.plugin.miniFrost.subject")+": "));
+ headersPanel.add(new JLabel(I18n.getMessage("thaw.plugin.miniFrost.recipient")+": "));
+ headersPanel.add(new JLabel(I18n.getMessage("thaw.plugin.miniFrost.subject")+": "));
- JPanel valuesPanel = new JPanel(new GridLayout(3, 1));
+ JPanel valuesPanel = new JPanel(new GridLayout(4, 1));
JPanel topPanel = new JPanel(new BorderLayout(5, 5));
topPanel.add(boardLabel, BorderLayout.CENTER);
@@ -117,6 +130,7 @@
valuesPanel.add(topPanel);
valuesPanel.add(authorBox);
+ valuesPanel.add(recipientBox);
valuesPanel.add(subjectField);
northPanel.add(headersPanel, BorderLayout.WEST);
@@ -210,16 +224,43 @@
Vector ids = new Vector();
ids.add(I18n.getMessage("thaw.plugin.miniFrost.anonymous"));
ids.addAll(Identity.getYourIdentities(mainPanel.getDb()));
-
+
authorBox.removeAllItems();
for (Iterator it = ids.iterator(); it.hasNext();)
authorBox.addItem(it.next());
-
+
if (draft.getAuthorIdentity() != null)
authorBox.setSelectedItem(draft.getAuthorIdentity());
else if (draft.getAuthorNick() != null)
authorBox.setSelectedItem(draft.getAuthorNick());
+ else
+ authorBox.setSelectedIndex(0);
+
+ /* recipient */
+ Vector nicePeople = new Vector();
+ nicePeople.add(I18n.getMessage("thaw.plugin.miniFrost.recipient.all"));
+ nicePeople.addAll(Identity.getIdentities(mainPanel.getDb(),
+ "trustLevel >= "+Integer.toString(Identity.trustLevelInt[1])));
+
+ recipientBox.removeAllItems();
+
+ for (Iterator it = nicePeople.iterator(); it.hasNext(); ) {
+ recipientBox.addItem(it.next());
+ }
+
+ recipientBox.setSelectedIndex(0);
+
+ if (draft.getRecipient() != null) {
+ recipientBox.setSelectedItem(draft.getRecipient());
+
+ if (!recipientBox.getSelectedItem().equals(draft.getRecipient())) {
+ /* then it means that the recipient wasn't in the list */
+ recipientBox.addItem(draft.getRecipient());
+ recipientBox.setSelectedItem(draft.getRecipient());
+ }
+ }
+
/* subject */
subjectField.setText(draft.getSubject());
@@ -296,6 +337,13 @@
draft.setAuthor(nick, null);
}
+
+ /* recipient */
+
+