add more events to core listener
[jSite2.git] / src / net / pterodactylus / jsite / gui / SwingInterface.java
index b5d651b..2f6f965 100644 (file)
@@ -311,6 +311,9 @@ public class SwingInterface implements CoreListener {
                if (configProperties.containsKey("userFont")) {
                        userFont = configProperties.getProperty("userFont");
                }
+               if (configProperties.containsKey("language")) {
+                       I18n.setLocale(new Locale(configProperties.getProperty("language")));
+               }
        }
 
        /**
@@ -337,6 +340,7 @@ public class SwingInterface implements CoreListener {
                if (userFont != null) {
                        configProperties.setProperty("userFont", userFont);
                }
+               configProperties.setProperty("language", I18n.getLocale().getLanguage());
                FileOutputStream configOutputStream = null;
                try {
                        configOutputStream = new FileOutputStream(configFile);
@@ -500,6 +504,7 @@ public class SwingInterface implements CoreListener {
         * Imports old jSite configuration.
         */
        private void importConfig() {
+               /* TODO */
        }
 
        /**
@@ -523,12 +528,14 @@ public class SwingInterface implements CoreListener {
         * Connects to the node.
         */
        private void nodeConnect() {
+               /* TODO */
        }
 
        /**
         * Disconnects from the node.
         */
        private void nodeDisconnect() {
+               /* TODO */
        }
 
        /**
@@ -567,12 +574,14 @@ public class SwingInterface implements CoreListener {
         * Clones a project.
         */
        private void cloneProject() {
+               /* TODO */
        }
 
        /**
         * Deletes a project.
         */
        private void deleteProject() {
+               /* TODO */
        }
 
        //
@@ -582,36 +591,60 @@ public class SwingInterface implements CoreListener {
        /**
         * {@inheritDoc}
         */
-       public void loadingProjectsFailed(String directory) {
+       public void loadingProjectsFailed(String directory, Throwable throwable) {
                JOptionPane.showMessageDialog(mainWindow, I18n.get("mainWindow.error.projectLoadingFailed.message", directory), I18n.get("mainWindow.error.projectLoadingFailed.title"), JOptionPane.ERROR_MESSAGE);
        }
 
        /**
         * {@inheritDoc}
         */
+       public void savingProjectsDone(String directory) {
+               mainWindow.setStatusBarText(I18n.get("mainWindow.statusBar.projectSavingDone"));
+       }
+
+       /**
+        * {@inheritDoc}
+        */
+       public void savingProjectsFailed(String directory, Throwable throwabled) {
+               /* TODO */
+       }
+
+       /**
+        * {@inheritDoc}
+        */
        public void coreLoaded() {
                this.nodeList = core.getNodes();
                manageNodesDialog.setNodeList(nodeList);
                mainWindow.setVisible(true);
-               mainWindow.setStatusBarText("Core loaded.");
+               mainWindow.setStatusBarText(I18n.get("mainWindow.statusBar.coreLoaded"));
+       }
+
+       /**
+        * {@inheritDoc}
+        */
+       public void coreStopped() {
+               mainWindow.setStatusBarText(I18n.get("mainWindow.statusBar.coreStopped"));
        }
 
        /**
         * {@inheritDoc}
         */
        public void nodeConnected(Node node) {
+               /* TODO */
        }
 
        /**
         * {@inheritDoc}
         */
        public void nodeConnecting(Node node) {
+               /* TODO */
        }
 
        /**
         * {@inheritDoc}
         */
        public void nodeDisconnected(Node node) {
+               /* TODO */
        }
 
 }