X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fgui%2FSwingInterface.java;h=cf6f4e1ed8fdd4b391ab508a92e4ff6d3ba8b666;hb=f42b615dcbe440d9908385754948d6448a3b67ff;hp=be9b22d48eb27f5fe917bd83be01859bbe21e98c;hpb=6343df567ec832112927bfd218afe6fa98fa89a6;p=jSite2.git
diff --git a/src/net/pterodactylus/jsite/gui/SwingInterface.java b/src/net/pterodactylus/jsite/gui/SwingInterface.java
index be9b22d..cf6f4e1 100644
--- a/src/net/pterodactylus/jsite/gui/SwingInterface.java
+++ b/src/net/pterodactylus/jsite/gui/SwingInterface.java
@@ -59,7 +59,7 @@ import net.pterodactylus.util.logging.LoggingListener;
/**
* The Swing user interface.
- *
+ *
* @author David âBombeâ Roden <bombe@freenetproject.org>
*/
public class SwingInterface implements CoreListener, LoggingListener, PropertyChangeListener {
@@ -169,7 +169,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Creates a new swing interface.
- *
+ *
* @param core
* The core to operate on
* @param configDirectory
@@ -219,7 +219,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the core that is controlled by the Swing interface.
- *
+ *
* @return The core
*/
Core getCore() {
@@ -228,7 +228,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the main window of the Swing interface.
- *
+ *
* @return The main window
*/
MainWindow getMainWindow() {
@@ -237,7 +237,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns whether the advanced mode is activated.
- *
+ *
* @return true
if the advanced mode is activated,
* false
if the simple mode is activated
*/
@@ -247,7 +247,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the âconfigureâ action.
- *
+ *
* @return The âconfigureâ action
*/
I18nAction getConfigureAction() {
@@ -256,7 +256,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the âimport configâ action.
- *
+ *
* @return The âimport configâ action
*/
I18nAction getImportConfigAction() {
@@ -265,7 +265,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the âquitâ action.
- *
+ *
* @return The âquitâ action
*/
I18nAction getQuitAction() {
@@ -274,7 +274,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the âadd nodeâ action.
- *
+ *
* @return The âadd nodeâ action
*/
I18nAction getAddNodeAction() {
@@ -283,7 +283,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the âconnect to nodeâ action for the given node.
- *
+ *
* @param node
* The node go get the âconnectâ action for
* @return The âconnect to nodeâ action
@@ -294,7 +294,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the âdisconnect from nodeâ action for the given node.
- *
+ *
* @param node
* The node go get the âdisconnectâ action for
* @return The âdisconnect from nodeâ action
@@ -305,7 +305,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the âedit nodeâ action for the given node.
- *
+ *
* @param node
* The node to edit
* @return The âedit nodeâ action
@@ -316,7 +316,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the âdelete nodeâ action for the given node.
- *
+ *
* @param node
* The node to delete
* @return The âdelete nodeâ action
@@ -327,7 +327,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns all language actions.
- *
+ *
* @return All language actions
*/
List getLanguageActions() {
@@ -336,7 +336,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the âaboutâ action.
- *
+ *
* @return The âaboutâ action
*/
I18nAction getHelpAboutAction() {
@@ -345,7 +345,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the âadd projectâ action.
- *
+ *
* @return The âadd projectâ action
*/
I18nAction getAddProjectAction() {
@@ -354,7 +354,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the âclone projectâ action for the given project.
- *
+ *
* @param project
* The project to get the âclone projectâ action for
* @return The âclone projectâ action
@@ -365,7 +365,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the âdelete projectâ action for the given project.
- *
+ *
* @param project
* The project to get the âdelete projectâ action for
* @return The âdelete projectâ action
@@ -376,7 +376,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns all currently configured nodes.
- *
+ *
* @return All configured nodes
*/
List getNodes() {
@@ -385,7 +385,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns a list of all projects.
- *
+ *
* @return All projects
*/
List getProjects() {
@@ -394,7 +394,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Returns the thread pool used for off-thread processes.
- *
+ *
* @return The thread pool
*/
Executor getThreadPool() {
@@ -547,7 +547,8 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
};
List availableLanguages = I18n.findAvailableLanguages();
for (final Locale locale: availableLanguages) {
- I18nAction languageAction = new I18nAction("general.language." + locale.getLanguage()) {
+ String language = locale.getLanguage();
+ I18nAction languageAction = new I18nAction("general.language." + language, IconLoader.loadIcon("/flag-" + language + ".png")) {
@SuppressWarnings("synthetic-access")
public void actionPerformed(ActionEvent e) {
@@ -555,7 +556,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
}
};
- if (I18n.getLocale().getLanguage().equals(locale.getLanguage())) {
+ if (I18n.getLocale().getLanguage().equals(language)) {
languageAction.setEnabled(false);
}
languageActions.add(languageAction);
@@ -673,7 +674,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Edits the given node.
- *
+ *
* @param node
* The node to edit
*/
@@ -691,7 +692,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Deletes the given node.
- *
+ *
* @param node
* The node to delete
*/
@@ -704,7 +705,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Connects to the node.
- *
+ *
* @param node
* The node to connect to
*/
@@ -724,7 +725,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Disconnects from the node.
- *
+ *
* @param node
* The node to disconnect from
*/
@@ -736,7 +737,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Changes the language of the interface. This method also disables the
* action for the newly set language and enables all others.
- *
+ *
* @param newLocale
* The new language
* @param languageAction
@@ -762,9 +763,8 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
private void addProject() {
try {
core.createProject();
- } catch (JSiteException nne1) {
- /* TODO - add i18n */
- JOptionPane.showMessageDialog(mainWindow, I18n.get(""), I18n.get(""), JOptionPane.ERROR_MESSAGE);
+ } catch (JSiteException jse1) {
+ JOptionPane.showMessageDialog(mainWindow, I18n.get("mainWindow.error.notConnected.message"), I18n.get("mainWindow.error.notConnected.title"), JOptionPane.ERROR_MESSAGE);
} catch (IOException e) {
/* TODO - add i18n */
JOptionPane.showMessageDialog(mainWindow, I18n.get(""), I18n.get(""), JOptionPane.ERROR_MESSAGE);
@@ -773,7 +773,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Clones a project.
- *
+ *
* @param project
* The project to clone
*/
@@ -783,7 +783,7 @@ public class SwingInterface implements CoreListener, LoggingListener, PropertyCh
/**
* Deletes a project.
- *
+ *
* @param project
* The project to delete
*/