X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fmain%2FMain.java;h=edbf5e4f841eea7d3c9bedc904081bcb36aae42c;hb=74679a4d987b65413a48b5ed22d7b33e96ee1bc8;hp=ad61c5b1201f729a5ef49edce649ac84664f6abb;hpb=e47e15fdbb7515f5a3757c3f5df8c1d0950aee8e;p=jSite.git diff --git a/src/de/todesbaum/jsite/main/Main.java b/src/de/todesbaum/jsite/main/Main.java index ad61c5b..edbf5e4 100644 --- a/src/de/todesbaum/jsite/main/Main.java +++ b/src/de/todesbaum/jsite/main/Main.java @@ -79,7 +79,7 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen private static final Logger logger = Logger.getLogger(Main.class.getName()); /** The version. */ - private static final Version VERSION = new Version(0, 9, 2); + private static final Version VERSION = new Version(0, 10); /** The configuration. */ private Configuration configuration; @@ -147,6 +147,9 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen /** Mapping from page type to page. */ private final Map pages = new HashMap(); + /** The original location of the configuration file. */ + private ConfigurationLocation originalLocation; + /** * Creates a new core with the default configuration file. */ @@ -167,9 +170,9 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen configurationLocator.setCustomLocation(configFilename); } - ConfigurationLocation preferredLocation = configurationLocator.findPreferredLocation(); - logger.log(Level.CONFIG, "Using configuration from " + preferredLocation + "."); - configuration = new Configuration(configurationLocator, preferredLocation); + originalLocation = configurationLocator.findPreferredLocation(); + logger.log(Level.CONFIG, "Using configuration from " + originalLocation + "."); + configuration = new Configuration(configurationLocator, originalLocation); Locale.setDefault(configuration.getLocale()); I18n.setLocale(configuration.getLocale()); @@ -458,6 +461,9 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setConfigurationLocation(configuration.getConfigurationDirectory()); ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setHasNextToJarConfiguration(configuration.getConfigurationLocator().isValidLocation(ConfigurationLocation.NEXT_TO_JAR_FILE)); ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setHasCustomConfiguration(configuration.getConfigurationLocator().isValidLocation(ConfigurationLocation.CUSTOM)); + ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setUseEarlyEncode(configuration.useEarlyEncode()); + ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setPriority(configuration.getPriority()); + ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setManifestPutter(configuration.getManifestPutter()); showPage(PageType.PAGE_PREFERENCES); optionsPreferencesAction.setEnabled(false); wizard.setNextEnabled(true); @@ -550,6 +556,9 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen ProjectInsertPage projectInsertPage = (ProjectInsertPage) pages.get(PageType.PAGE_INSERT_PROJECT); String tempDirectory = ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).getTempDirectory(); projectInsertPage.setTempDirectory(tempDirectory); + projectInsertPage.setUseEarlyEncode(configuration.useEarlyEncode()); + projectInsertPage.setPriority(configuration.getPriority()); + projectInsertPage.setManifestPutter(configuration.getManifestPutter()); projectInsertPage.startInsert(); nodeMenu.setEnabled(false); optionsPreferencesAction.setEnabled(false); @@ -566,6 +575,9 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen PreferencesPage preferencesPage = (PreferencesPage) pages.get(PageType.PAGE_PREFERENCES); showPage(PageType.PAGE_PROJECTS); optionsPreferencesAction.setEnabled(true); + configuration.setUseEarlyEncode(preferencesPage.useEarlyEncode()); + configuration.setPriority(preferencesPage.getPriority()); + configuration.setManifestPutter(preferencesPage.getManifestPutter()); configuration.setConfigurationLocation(preferencesPage.getConfigurationLocation()); } } @@ -593,7 +605,7 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.project.warning.use-clipboard-now")); } if (JOptionPane.showConfirmDialog(wizard, I18n.getMessage("jsite.quit.question"), I18n.getMessage("jsite.quit.question.title"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION) { - if (isOverwritingConfiguration()) { + if (isOverwritingConfiguration() && !originalLocation.equals(configuration.getConfigurationDirectory())) { int overwriteConfigurationAnswer = JOptionPane.showConfirmDialog(wizard, MessageFormat.format(I18n.getMessage("jsite.quit.overwrite-configuration"), configuration.getConfigurationLocator().getFile(configuration.getConfigurationDirectory())), I18n.getMessage("jsite.quit.overwrite-configuration.title"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if (overwriteConfigurationAnswer == JOptionPane.YES_OPTION) { if (saveConfiguration()) {