* lots of misc. changes/refactoring
* removed create panel (merged into list panel) * stuff for future subtitle support * lots of flag icons
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<project name="FileBot" basedir="." default="fatjar">
|
||||
|
||||
<property name="title" value="${ant.project.name}" />
|
||||
|
@ -76,6 +76,7 @@
|
|||
<fileset dir="${source}">
|
||||
<include name="**/*.png" />
|
||||
<include name="**/*.gif" />
|
||||
<include name="**/*.xml" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
@ -90,5 +91,5 @@
|
|||
<target name="run" depends="fatjar">
|
||||
<java jar="${executable}" fork="true" />
|
||||
</target>
|
||||
|
||||
</project>
|
||||
|
||||
</project>
|
||||
|
|
BIN
fw/panel.sfv.png
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 53 KiB |
|
@ -28,5 +28,4 @@ public class Main {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public class FileFormat {
|
|||
else if (size >= KILO)
|
||||
return nf.format((double) size / KILO) + " KB";
|
||||
else
|
||||
return nf.format((double) size) + " Byte";
|
||||
return nf.format(size + " Byte");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import java.util.Collection;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.prefs.BackingStoreException;
|
||||
|
@ -17,9 +18,12 @@ public class Settings {
|
|||
|
||||
private static Settings settings = new Settings();
|
||||
|
||||
private static final String ROOT = "filebot";
|
||||
|
||||
public static final String SELECTED_PANEL = "panel";
|
||||
public static final String SEARCH_HISTORY = "history/search";
|
||||
public static final String SUBTITLE_HISTORY = "history/subtitle";
|
||||
public static final String LANGUAGE_HISTORY = "history/language";
|
||||
|
||||
|
||||
public static Settings getSettings() {
|
||||
|
@ -30,7 +34,7 @@ public class Settings {
|
|||
|
||||
|
||||
private Settings() {
|
||||
this.prefs = Preferences.userRoot().node("filebot");
|
||||
this.prefs = Preferences.userRoot().node(ROOT);
|
||||
}
|
||||
|
||||
|
||||
|
@ -117,4 +121,42 @@ public class Settings {
|
|||
mapNode.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Integer> getIntegerMap(String key) {
|
||||
Map<String, String> entries = getStringMap(key);
|
||||
|
||||
Map<String, Integer> map = new HashMap<String, Integer>(entries.size());
|
||||
|
||||
for (Entry<String, String> entry : entries.entrySet()) {
|
||||
try {
|
||||
map.put(entry.getKey(), new Integer(entry.getValue()));
|
||||
} catch (NumberFormatException e) {
|
||||
Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.SEVERE, e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
public void putIntegerMap(String key, Map<String, Integer> map) {
|
||||
Map<String, String> entries = new HashMap<String, String>();
|
||||
|
||||
for (Entry<String, Integer> entry : map.entrySet()) {
|
||||
entries.put(entry.getKey(), entry.getValue().toString());
|
||||
}
|
||||
|
||||
putStringMap(key, entries);
|
||||
}
|
||||
|
||||
|
||||
public void clear() {
|
||||
try {
|
||||
prefs.removeNode();
|
||||
prefs = Preferences.userRoot().node(ROOT);
|
||||
} catch (BackingStoreException e) {
|
||||
Logger.getLogger(Logger.GLOBAL_LOGGER_NAME).log(Level.SEVERE, e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,22 @@ public class ResourceManager {
|
|||
|
||||
|
||||
public static ImageIcon getFlagIcon(String countryCode) {
|
||||
return new ImageIcon(ResourceManager.class.getResource(String.format("flags/%s.gif", countryCode)));
|
||||
URL url = ResourceManager.class.getResource(String.format("flags/%s.gif", countryCode));
|
||||
|
||||
if (url == null)
|
||||
url = ResourceManager.class.getResource(String.format("flags/default.gif", countryCode));
|
||||
|
||||
return new ImageIcon(url);
|
||||
}
|
||||
|
||||
|
||||
public static ImageIcon getArchiveIcon(String type) {
|
||||
URL url = ResourceManager.class.getResource(String.format("archive/%s.png", type.toLowerCase()));
|
||||
|
||||
if (url == null)
|
||||
url = ResourceManager.class.getResource(String.format("archive/default.png"));
|
||||
|
||||
return new ImageIcon(url);
|
||||
}
|
||||
|
||||
|
||||
|
|
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 352 B |
After Width: | Height: | Size: 320 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 341 B |
After Width: | Height: | Size: 544 B |
After Width: | Height: | Size: 1005 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 366 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 601 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 556 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1005 B |
After Width: | Height: | Size: 1003 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 998 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1005 B |
After Width: | Height: | Size: 1000 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1004 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 337 B |
After Width: | Height: | Size: 999 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 119 B |
After Width: | Height: | Size: 308 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1001 B |
After Width: | Height: | Size: 998 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 327 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 579 B |
After Width: | Height: | Size: 999 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1005 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1001 B |
After Width: | Height: | Size: 1003 B |
After Width: | Height: | Size: 59 B |
After Width: | Height: | Size: 323 B |
After Width: | Height: | Size: 1001 B |
After Width: | Height: | Size: 574 B |
After Width: | Height: | Size: 334 B |
After Width: | Height: | Size: 1001 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 900 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1004 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 569 B |
After Width: | Height: | Size: 221 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 368 B |
After Width: | Height: | Size: 581 B |
After Width: | Height: | Size: 313 B |
After Width: | Height: | Size: 1004 B |
After Width: | Height: | Size: 1003 B |
After Width: | Height: | Size: 196 B |
After Width: | Height: | Size: 213 B |
After Width: | Height: | Size: 997 B |
After Width: | Height: | Size: 339 B |
After Width: | Height: | Size: 1006 B |
After Width: | Height: | Size: 1006 B |