diff --git a/apps/i2psnark/java/src/org/klomp/snark/Snark.java b/apps/i2psnark/java/src/org/klomp/snark/Snark.java index 4f3992c42c2d027e0ed5a0328b2e1d1c1ed78810..900165876c46dec023fcc1560401df8d9886d4fd 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/Snark.java +++ b/apps/i2psnark/java/src/org/klomp/snark/Snark.java @@ -552,6 +552,8 @@ public class Snark * @throws RuntimeException via fatal() */ public synchronized void startTorrent() { + if (!stopped) + return; starting = true; try { x_startTorrent(); diff --git a/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java b/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java index fd5aa4f537a3677029df8eef5bff2f9fd6a7d934..ec3241a7640f162bfa213d4eb8c7cda7c994dfe1 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java +++ b/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java @@ -1590,7 +1590,7 @@ public class SnarkManager implements CompleteListener, ClientApp { fis = new FileInputStream(sfile); } catch (IOException ioe) { // catch this here so we don't try do delete it below - addMessage(_t("Cannot open \"{0}\"", sfile.getName()) + ": " + ioe.getMessage()); + addMessage(_t("Cannot open \"{0}\"", sfile.getName()) + ": " + ioe.getLocalizedMessage()); return false; } @@ -1654,13 +1654,13 @@ public class SnarkManager implements CompleteListener, ClientApp { } catch (IOException ioe) { // close before rename/delete for windows if (fis != null) try { fis.close(); fis = null; } catch (IOException ioe2) {} - String err = _t("Torrent in \"{0}\" is invalid", sfile.toString()) + ": " + ioe.getMessage(); + String err = _t("Torrent in \"{0}\" is invalid", sfile.toString()) + ": " + ioe.getLocalizedMessage(); addMessage(err); _log.error(err, ioe); disableTorrentFile(filename); return false; } catch (OutOfMemoryError oom) { - addMessage(_t("ERROR - Out of memory, cannot create torrent from {0}", sfile.getName()) + ": " + oom.getMessage()); + addMessage(_t("ERROR - Out of memory, cannot create torrent from {0}", sfile.getName()) + ": " + oom.getLocalizedMessage()); return false; } finally { if (fis != null) try { fis.close(); } catch (IOException ioe) {} @@ -2232,13 +2232,17 @@ public class SnarkManager implements CompleteListener, ClientApp { */ private void locked_saveTorrentStatus(byte[] ih, Properties config) { File conf = configFile(_configDir, ih); + if (shouldAutoStart() && !conf.exists()) { + // force on for new torrents + config.setProperty(PROP_META_RUNNING, "true"); + } File subdir = conf.getParentFile(); if (!subdir.exists()) subdir.mkdirs(); try { DataHelper.storeProps(config, conf); if (_log.shouldInfo()) - _log.info("Saved config to " + conf); + _log.info("Saved config to " + conf /* , new Exception() */ ); } catch (IOException ioe) { _log.error("Unable to save the config to " + conf); } @@ -2391,12 +2395,13 @@ public class SnarkManager implements CompleteListener, ClientApp { } else if (info.getTotalLength() <= 0) { return _t("Torrent \"{0}\" has no data!", info.getName()); } else if (info.getTotalLength() > Storage.MAX_TOTAL_SIZE) { +/* System.out.println("torrent info: " + info.toString()); List<Long> lengths = info.getLengths(); if (lengths != null) for (int i = 0; i < lengths.size(); i++) System.out.println("File " + i + " is " + lengths.get(i) + " long."); - +*/ return _t("Torrents larger than {0}B are not supported yet \"{1}\"!", Storage.MAX_TOTAL_SIZE, info.getName()); } else { // ok @@ -2414,7 +2419,7 @@ public class SnarkManager implements CompleteListener, ClientApp { filename = sfile.getCanonicalPath(); } catch (IOException ioe) { _log.error("Unable to remove the torrent " + filename, ioe); - addMessage(_t("Error: Could not remove the torrent {0}", filename) + ": " + ioe.getMessage()); + addMessage(_t("Error: Could not remove the torrent {0}", filename) + ": " + ioe.getLocalizedMessage()); return null; } int remaining = 0; @@ -2709,8 +2714,8 @@ public class SnarkManager implements CompleteListener, ClientApp { } Set<String> existingNames = listTorrentFiles(); - if (_log.shouldLog(Log.DEBUG)) - _log.debug("DirMon found: " + DataHelper.toString(foundNames) + " existing: " + DataHelper.toString(existingNames)); + //if (_log.shouldLog(Log.DEBUG)) + // _log.debug("DirMon found: " + DataHelper.toString(foundNames) + " existing: " + DataHelper.toString(existingNames)); // lets find new ones first... boolean shouldStart = shouldAutoStart(); for (String name : foundNames) { @@ -3086,14 +3091,15 @@ public class SnarkManager implements CompleteListener, ClientApp { } } } - + /** * ignore case, current locale * @since 0.9 */ private static class IgnoreCaseComparator implements Comparator<Tracker>, Serializable { + private final Collator coll = Collator.getInstance(); public int compare(Tracker l, Tracker r) { - return l.name.toLowerCase().compareTo(r.name.toLowerCase()); + return coll.compare(l.name, r.name); } } } diff --git a/apps/i2psnark/java/src/org/klomp/snark/Storage.java b/apps/i2psnark/java/src/org/klomp/snark/Storage.java index 16d214f679e822abbd8a2075588d9f7e2fdfbd7c..d3fa8df10a29a3a0e241fd03ccd2c6d84fce967a 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/Storage.java +++ b/apps/i2psnark/java/src/org/klomp/snark/Storage.java @@ -85,7 +85,7 @@ public class Storage implements Closeable /** The default piece size. */ private static final int DEFAULT_PIECE_SIZE = 256*1024; /** bigger than this will be rejected */ - public static final int MAX_PIECE_SIZE = 16*1024*1024; + public static final int MAX_PIECE_SIZE = 32*1024*1024; /** The maximum number of pieces in a torrent. */ public static final int MAX_PIECES = 32*1024; public static final long MAX_TOTAL_SIZE = MAX_PIECE_SIZE * (long) MAX_PIECES; diff --git a/installer/resources/themes/snark/dark/snark.css b/installer/resources/themes/snark/dark/snark.css index 2525c6f791f05351d5292936deecea2e40d42de6..29e6addca0dd53d34f2a415205ef8762d4811430 100644 --- a/installer/resources/themes/snark/dark/snark.css +++ b/installer/resources/themes/snark/dark/snark.css @@ -728,7 +728,6 @@ td.subHeaderPriority, td.priority { td.subHeaderPriority { background: #020; font-weight: bold; - background: url(images/snarktopnav.png) repeat-x scroll center center #110011; background-image: linear-gradient(to bottom, #030 0%, #020 50%, #000 51%); text-align: center !important; padding: 0 1px !important; diff --git a/installer/resources/themes/snark/ubergine/images/snarktopnav.png b/installer/resources/themes/snark/ubergine/images/snarktopnav.png deleted file mode 100644 index 0d00c75c2ff77e1cbef02aaeb7faf2824ee5af40..0000000000000000000000000000000000000000 Binary files a/installer/resources/themes/snark/ubergine/images/snarktopnav.png and /dev/null differ diff --git a/installer/resources/themes/snark/ubergine/snark.css b/installer/resources/themes/snark/ubergine/snark.css index 7a3ba6620afff4488cdbb2d7c74115944f8b1a92..02dc7b21508f3717de1a17cc67554ef336b48527 100644 --- a/installer/resources/themes/snark/ubergine/snark.css +++ b/installer/resources/themes/snark/ubergine/snark.css @@ -80,12 +80,6 @@ body { .snarknavbar { margin: -10px 0 10px 0 !important; padding: 15px 10px 14px; - border: 1px solid #101; - border-radius: 0 0 4px 4px; - box-shadow: inset 0 0 0 1px #3f173f, inset 0 0 3px 1px #212; - filter: drop-shadow(0 1px 4px #101); - background: #101 url(images/snarktopnav.png) repeat-x scroll center center; - background: linear-gradient(to bottom, #522852, #4a2449 11%, #321831 33%, #281428 51%, #1c0e1c 52%, #101 54%); min-width: 600px; width: 70%; text-align: center;