Author: jflesch
Date: 2006-07-30 12:11:15 +0000 (Sun, 30 Jul 2006)
New Revision: 9819
Modified:
trunk/apps/Thaw/src/thaw/core/MainWindow.java
trunk/apps/Thaw/src/thaw/i18n/thaw.properties
trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
Log:
Add a dialog "about" and an entry in the "file" menu to allow user to reconnect
Modified: trunk/apps/Thaw/src/thaw/core/MainWindow.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/MainWindow.java 2006-07-30 09:54:53 UTC
(rev 9818)
+++ trunk/apps/Thaw/src/thaw/core/MainWindow.java 2006-07-30 12:11:15 UTC
(rev 9819)
@@ -10,8 +10,9 @@
import javax.swing.JMenuItem;
import java.awt.event.ActionEvent;
import java.awt.event.WindowEvent;
-//import javax.swing.Icon;
import javax.swing.ImageIcon;
+import javax.swing.JOptionPane;
+import java.awt.Font;
import thaw.i18n.I18n;
@@ -41,10 +42,14 @@
private JMenuBar menuBar = null;
private JMenu fileMenu = null;
-
+
+ private JMenuItem reconnectionFileMenuItem = null;
private JMenuItem optionsFileMenuItem = null;
private JMenuItem quitFileMenuItem = null;
+ private JMenu helpMenu = null;
+ private JMenuItem aboutHelpMenuItem = null;
+
private JTabbedPane tabbedPane = null;
private JLabel statusBar = null;
@@ -71,16 +76,27 @@
menuBar = new JMenuBar();
fileMenu = new JMenu(I18n.getMessage("thaw.menu.file"));
+ reconnectionFileMenuItem = new
JMenuItem(I18n.getMessage("thaw.menu.item.reconnect"));
optionsFileMenuItem = new
JMenuItem(I18n.getMessage("thaw.menu.item.options"));
quitFileMenuItem = new
JMenuItem(I18n.getMessage("thaw.menu.item.quit"));
+ reconnectionFileMenuItem.addActionListener(this);
optionsFileMenuItem.addActionListener(this);
quitFileMenuItem.addActionListener(this);
+ fileMenu.add(reconnectionFileMenuItem);
fileMenu.add(optionsFileMenuItem);
fileMenu.add(quitFileMenuItem);
menuBar.add(fileMenu);
+ helpMenu = new JMenu(I18n.getMessage("thaw.menu.help"));
+
+ aboutHelpMenuItem = new
JMenuItem(I18n.getMessage("thaw.menu.item.about"));
+ aboutHelpMenuItem.addActionListener(this);
+
+ helpMenu.add(aboutHelpMenuItem);
+ menuBar.add(helpMenu);
+
tabbedPane = new JTabbedPane();
statusBar = new JLabel();
@@ -156,6 +172,17 @@
* Called when an element from the menu is called.
*/
public void actionPerformed(ActionEvent e) {
+ if(e.getSource() == reconnectionFileMenuItem) {
+
+ core.getPluginManager().stopPlugins();
+
+ core.initNodeConnection();
+
+ core.getPluginManager().loadPlugins();
+ core.getPluginManager().runPlugins();
+
+ }
+
if(e.getSource() == optionsFileMenuItem) {
core.getConfigWindow().setVisible(true);
}
@@ -165,6 +192,9 @@
endOfTheWorld();
}
+ if(e.getSource() == aboutHelpMenuItem) {
+ showDialogAbout();
+ }
}
/**
@@ -196,6 +226,23 @@
return statusBar.getText();
}
+
+ public void showDialogAbout() {
+ JLabel[] labels = new JLabel[] {
+ new JLabel(I18n.getMessage("thaw.about.l1")),
+ new JLabel(I18n.getMessage("thaw.about.l2")),
+ new JLabel(I18n.getMessage("thaw.about.l3")),
+ new JLabel(I18n.getMessage("thaw.about.l4"))
+ //new JLabel(I18n.getMessage("thaw.about.l3")),
+ };
+
+ labels[0].setFont(new Font("Dialog", Font.BOLD, 30));
+
+ JOptionPane.showMessageDialog(null, labels,
I18n.getMessage("thaw.about.title"),
+ JOptionPane.INFORMATION_MESSAGE);
+
+ }
+
public void windowActivated(WindowEvent e) {
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2006-07-30 09:54:53 UTC
(rev 9818)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2006-07-30 12:11:15 UTC
(rev 9819)
@@ -60,9 +60,13 @@
## Menus
thaw.menu.file=File
+thaw.menu.item.reconnect=Force reconnection
thaw.menu.item.options=Options
thaw.menu.item.quit=Quit
+thaw.menu.help=Help
+thaw.menu.item.about=About
+
## Status bar
thaw.statusBar.initPlugins=Loading plugins ...
thaw.statusBar.ready=Ready
@@ -142,4 +146,11 @@
thaw.warning.isWritingSoApplyLater=Warning ! Thaw is exchanging data with the
node,\nand settings changes makes Thaw disconnect/reconnect.\nAre you sure that
you want to change them now ?
thaw.warning.disconnected=Thaw has been disconnected. Do you want to try to
reconnect ?
thaw.warning.unableToConnectTo=Unable to connect to
-thaw.warning.autoreconnecting=Disconnected. Thaw is trying to automatically
reconnect
+thaw.warning.autoreconnecting=Disconnected. Thaw is trying to automatically
reconnect ...
+
+## About
+thaw.about.title=About
+thaw.about.l1=Thaw
+thaw.about.l2=by Jerome Flesch
+thaw.about.l3=2006(c) Freenet Project Incorporated
+thaw.about.l4=under GPLv2
Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2006-07-30 09:54:53 UTC
(rev 9818)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2006-07-30 12:11:15 UTC
(rev 9819)
@@ -60,9 +60,13 @@
## Menus
thaw.menu.file=Fichier
+thaw.menu.item.reconnect=Forcer la reconnection
thaw.menu.item.options=Options
thaw.menu.item.quit=Quitter
+thaw.menu.help=Aide
+thaw.menu.item.about=? propos
+
## Status bar
thaw.statusBar.initPlugins=Loading plugins ...
thaw.statusBar.ready=Pr?t
@@ -142,3 +146,10 @@
thaw.warning.disconnected=Thaw a ?t? d?connect?, voulez-vous essayer de vous
reconnecter ?
thaw.warning.unableToConnectTo=Impossible de se connecter ?
thaw.warning.autoreconnecting=D?connect?. Thaw est entrain d'essayer de se
reconnecter ...
+
+## About
+thaw.about.title=? propos
+thaw.about.l1=Thaw
+thaw.about.l2=par J?r?me Flesch
+thaw.about.l3=2006(c) Freenet Project Incorporated
+thaw.about.l4=sous GPLv2