diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java index 260d37d76..90a93254a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -262,6 +262,7 @@ public class Configuration { public static final ConfigurationItem> swfSpecificConfigs = null; + @ConfigurationDefaultCalendar(0) public static final ConfigurationItem lastUpdatesCheckDate = null; @ConfigurationDefaultInt(1000) @@ -741,12 +742,6 @@ public class Configuration { } //limit paralel threads? //int processorCount = Runtime.getRuntime().availableProcessors(); - - if (lastUpdatesCheckDate.get() == null) { - GregorianCalendar mingc = new GregorianCalendar(); - mingc.setTime(new Date(Long.MIN_VALUE)); - lastUpdatesCheckDate.set(mingc); - } } @SuppressWarnings("unchecked") @@ -817,6 +812,12 @@ public class Configuration { if (aDouble != null) { defaultValue = aDouble.value(); } + ConfigurationDefaultCalendar aCalendar = field.getAnnotation(ConfigurationDefaultCalendar.class); + if (aCalendar != null) { + GregorianCalendar mingc = new GregorianCalendar(); + mingc.setTime(new Date(aCalendar.value())); + defaultValue = mingc; + } return defaultValue; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/ConfigurationDefaultCalendar.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/ConfigurationDefaultCalendar.java new file mode 100644 index 000000000..5edc52472 --- /dev/null +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/ConfigurationDefaultCalendar.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2010-2015 JPEXS, All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. + */ +package com.jpexs.decompiler.flash.configuration; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * + * @author JPEXS + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface ConfigurationDefaultCalendar { + + long value(); +} diff --git a/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java b/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java index af5fc0a93..e78d23043 100644 --- a/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java +++ b/src/com/jpexs/decompiler/flash/gui/AdvancedSettingsDialog.java @@ -34,7 +34,6 @@ import java.awt.Graphics2D; import java.awt.Insets; import java.awt.RenderingHints; import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.io.File; import java.lang.reflect.Field; import java.lang.reflect.ParameterizedType; @@ -94,6 +93,8 @@ public class AdvancedSettingsDialog extends AppDialog { /** * Creates new form AdvancedSettingsDialog + * + * @param selectedCategory */ public AdvancedSettingsDialog(String selectedCategory) { initComponents(selectedCategory); @@ -387,7 +388,7 @@ public class AdvancedSettingsDialog extends AppDialog { val = ""; } if (itemType == Calendar.class) { - tf.setText(new SimpleDateFormat().format(((Calendar) item.get()).getTime())); + tf.setText(new SimpleDateFormat().format(((Calendar) val).getTime())); } else { tf.setText(val.toString()); }