* 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 |
BIN
fw/panel.subtitle.png
Normal file
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);
|
||||
}
|
||||
|
||||
|
||||
|
BIN
source/net/sourceforge/filebot/resources/archive/default.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
source/net/sourceforge/filebot/resources/archive/rar.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
source/net/sourceforge/filebot/resources/archive/zip.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
source/net/sourceforge/filebot/resources/flags/ad.gif
Normal file
After Width: | Height: | Size: 352 B |
BIN
source/net/sourceforge/filebot/resources/flags/ae.gif
Normal file
After Width: | Height: | Size: 320 B |
BIN
source/net/sourceforge/filebot/resources/flags/af.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/ag.gif
Normal file
After Width: | Height: | Size: 341 B |
BIN
source/net/sourceforge/filebot/resources/flags/ai.gif
Normal file
After Width: | Height: | Size: 544 B |
BIN
source/net/sourceforge/filebot/resources/flags/al.gif
Normal file
After Width: | Height: | Size: 1005 B |
BIN
source/net/sourceforge/filebot/resources/flags/am.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/an.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/ao.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/aq.gif
Normal file
After Width: | Height: | Size: 366 B |
BIN
source/net/sourceforge/filebot/resources/flags/ar.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/as.gif
Normal file
After Width: | Height: | Size: 601 B |
BIN
source/net/sourceforge/filebot/resources/flags/at.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/au.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/aw.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/ay.gif
Normal file
After Width: | Height: | Size: 556 B |
BIN
source/net/sourceforge/filebot/resources/flags/az.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/ba.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/bb.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/bd.gif
Normal file
After Width: | Height: | Size: 1005 B |
BIN
source/net/sourceforge/filebot/resources/flags/be.gif
Normal file
After Width: | Height: | Size: 1003 B |
BIN
source/net/sourceforge/filebot/resources/flags/bf.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/bg.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/bh.gif
Normal file
After Width: | Height: | Size: 998 B |
BIN
source/net/sourceforge/filebot/resources/flags/bi.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/bj.gif
Normal file
After Width: | Height: | Size: 1005 B |
BIN
source/net/sourceforge/filebot/resources/flags/bm.gif
Normal file
After Width: | Height: | Size: 1000 B |
BIN
source/net/sourceforge/filebot/resources/flags/bn.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/bo.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/br.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/bs.gif
Normal file
After Width: | Height: | Size: 1004 B |
BIN
source/net/sourceforge/filebot/resources/flags/bt.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/bv.gif
Normal file
After Width: | Height: | Size: 337 B |
BIN
source/net/sourceforge/filebot/resources/flags/bw.gif
Normal file
After Width: | Height: | Size: 999 B |
BIN
source/net/sourceforge/filebot/resources/flags/by.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/bz.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/ca.gif
Normal file
After Width: | Height: | Size: 119 B |
BIN
source/net/sourceforge/filebot/resources/flags/cd.gif
Normal file
After Width: | Height: | Size: 308 B |
BIN
source/net/sourceforge/filebot/resources/flags/cf.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/cg.gif
Normal file
After Width: | Height: | Size: 1001 B |
BIN
source/net/sourceforge/filebot/resources/flags/ch.gif
Normal file
After Width: | Height: | Size: 998 B |
BIN
source/net/sourceforge/filebot/resources/flags/ci.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/ck.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/cl.gif
Normal file
After Width: | Height: | Size: 327 B |
BIN
source/net/sourceforge/filebot/resources/flags/cm.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/cn.gif
Normal file
After Width: | Height: | Size: 579 B |
BIN
source/net/sourceforge/filebot/resources/flags/co.gif
Normal file
After Width: | Height: | Size: 999 B |
BIN
source/net/sourceforge/filebot/resources/flags/cr.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/cs.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/cu.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/cv.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/cy.gif
Normal file
After Width: | Height: | Size: 1005 B |
BIN
source/net/sourceforge/filebot/resources/flags/cz.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/da.gif
Normal file
After Width: | Height: | Size: 1001 B |
BIN
source/net/sourceforge/filebot/resources/flags/de.gif
Normal file
After Width: | Height: | Size: 1003 B |
BIN
source/net/sourceforge/filebot/resources/flags/default.gif
Normal file
After Width: | Height: | Size: 59 B |
BIN
source/net/sourceforge/filebot/resources/flags/dj.gif
Normal file
After Width: | Height: | Size: 323 B |
BIN
source/net/sourceforge/filebot/resources/flags/dk.gif
Normal file
After Width: | Height: | Size: 1001 B |
BIN
source/net/sourceforge/filebot/resources/flags/dm.gif
Normal file
After Width: | Height: | Size: 574 B |
BIN
source/net/sourceforge/filebot/resources/flags/do.gif
Normal file
After Width: | Height: | Size: 334 B |
BIN
source/net/sourceforge/filebot/resources/flags/dz.gif
Normal file
After Width: | Height: | Size: 1001 B |
BIN
source/net/sourceforge/filebot/resources/flags/ec.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/ee.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/eg.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/el.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/en.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/er.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/es.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/et.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/eu.gif
Normal file
After Width: | Height: | Size: 900 B |
BIN
source/net/sourceforge/filebot/resources/flags/fa.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/fi.gif
Normal file
After Width: | Height: | Size: 1004 B |
BIN
source/net/sourceforge/filebot/resources/flags/fj.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/fk.gif
Normal file
After Width: | Height: | Size: 569 B |
BIN
source/net/sourceforge/filebot/resources/flags/fm.gif
Normal file
After Width: | Height: | Size: 221 B |
BIN
source/net/sourceforge/filebot/resources/flags/fo.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/fr.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/ga.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/gb.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/gd.gif
Normal file
After Width: | Height: | Size: 368 B |
BIN
source/net/sourceforge/filebot/resources/flags/ge.gif
Normal file
After Width: | Height: | Size: 581 B |
BIN
source/net/sourceforge/filebot/resources/flags/gh.gif
Normal file
After Width: | Height: | Size: 313 B |
BIN
source/net/sourceforge/filebot/resources/flags/gi.gif
Normal file
After Width: | Height: | Size: 1004 B |
BIN
source/net/sourceforge/filebot/resources/flags/gl.gif
Normal file
After Width: | Height: | Size: 1003 B |
BIN
source/net/sourceforge/filebot/resources/flags/gm.gif
Normal file
After Width: | Height: | Size: 196 B |
BIN
source/net/sourceforge/filebot/resources/flags/gn.gif
Normal file
After Width: | Height: | Size: 213 B |
BIN
source/net/sourceforge/filebot/resources/flags/gp.gif
Normal file
After Width: | Height: | Size: 997 B |
BIN
source/net/sourceforge/filebot/resources/flags/gq.gif
Normal file
After Width: | Height: | Size: 339 B |
BIN
source/net/sourceforge/filebot/resources/flags/gr.gif
Normal file
After Width: | Height: | Size: 1006 B |
BIN
source/net/sourceforge/filebot/resources/flags/gt.gif
Normal file
After Width: | Height: | Size: 1006 B |