This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository lima. See https://gitlab.nuiton.org/chorem/lima.git commit a55ff1beca70f02ad63d0d446a950745e587ff1a Author: David Cossé <cosse@codelutin.com> Date: Fri Dec 16 16:21:18 2016 +0100 refs #686 pas de redémarrage de automatique de lima mais un dialogue demandant à l'utilisateur de redémmarrer --- .../java/org/chorem/lima/ui/MainViewHandler.java | 54 ++++++---------------- .../resources/i18n/lima-swing_en_GB.properties | 1 + .../resources/i18n/lima-swing_fr_FR.properties | 1 + 3 files changed, 17 insertions(+), 39 deletions(-) diff --git a/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java b/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java index 9dbdc02..2cb7dd0 100644 --- a/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java +++ b/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java @@ -62,7 +62,6 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; -import java.io.IOException; import java.net.URI; import java.net.URL; import java.util.Locale; @@ -118,14 +117,23 @@ public class MainViewHandler { public void changeLanguage(MainView mainUI, Locale newLocale) { LimaSwingConfig config = mainUI.getConfig(); - // sauvegarde de la nouvelle locale - config.setLocale(newLocale); + int response = JOptionPane.showConfirmDialog(mainUI,t("lima.restart")); - // rechargement i18n - LimaSwingApplicationContext.get().initI18n(config); + if (response == JOptionPane.YES_OPTION) { + // sauvegarde de la nouvelle locale + config.setLocale(newLocale); - // on recharge l'ui - reloadUI(LimaSwingApplicationContext.get()); + // rechargement i18n + LimaSwingApplicationContext.get().initI18n(config); + + LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.removeContextValue(LimaSwingApplicationContext.get()); + + mainUI.dispose(); + + mainUI.setVisible(false); + + System.exit(0); + } } /** @@ -309,38 +317,6 @@ public class MainViewHandler { } /** - * Permet de recharger l'ui principale et de changer de le mode d'affichage. - * - * @param rootContext le contexte applicatif - */ - protected void reloadUI(LimaSwingApplicationContext rootContext) { - - String version = LimaSwingApplicationContext.getContext().getConfig().getVersion(); - - // must remove all properties listener on config - LimaSwingApplicationContext.CONFIG_DEF.getContextValue(rootContext).removeJaxxPropertyChangeListener(); - - // scan main ui - MainView ui = getUI(rootContext); - - if (ui != null) { - LimaSwingApplicationContext.MAIN_UI_ENTRY_DEF.removeContextValue(rootContext); - - ui.dispose(); - - ui.setVisible(false); - } - - System.out.println("Lima-" + version + " restart !"); - try { - Runtime.getRuntime().exec("java -jar lima.jar"); - } catch (IOException e) { - e.printStackTrace(); - } - System.exit(0); - } - - /** * Test if there is some modification on screen, * * @param rootContext the context diff --git a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties index 218ae28..225ac47 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties @@ -481,6 +481,7 @@ lima.refresh=Refresh lima.refresh.shortcut=Refresh (F5) lima.remove=Remove lima.remove.shortcut=Edit (Ctrl+M) +lima.restart=Please restart the interface lima.retainedEarnings.wait= lima.search=Search lima.structure=Structure diff --git a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties index efea358..e85dc99 100644 --- a/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties +++ b/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties @@ -486,6 +486,7 @@ lima.quit=Quitter lima.refresh=Actualiser lima.refresh.shortcut=Actualiser (F5) lima.remove.shortcut= +lima.restart=Veuillez redémarrer l'interface lima.retainedEarnings.wait=Report à nouveau en cours lima.structure=Structure lima.table.account=Compte -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.