From 7ec6d494753415162b5b8c845d2ef32f9c0ca93a Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 31 Jul 2009 00:27:07 +0000 Subject: [PATCH] * language favorites can now be restored after restart * stricter embedded checksum pattern * fixed weird selection behavior in subtitle files list --- build.xml | 18 +++++++++--------- .../sourceforge/filebot/FileBotUtilities.java | 3 ++- .../subtitle/SubtitleDownloadComponent.java | 5 +++++ .../ui/panel/subtitle/SubtitlePanel.java | 4 ++-- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/build.xml b/build.xml index 955ecf7b..227d6b91 100644 --- a/build.xml +++ b/build.xml @@ -21,14 +21,6 @@ - - - - - - - - @@ -44,9 +36,17 @@ + + + + + + + + - + diff --git a/source/net/sourceforge/filebot/FileBotUtilities.java b/source/net/sourceforge/filebot/FileBotUtilities.java index df75a7dd..80340609 100644 --- a/source/net/sourceforge/filebot/FileBotUtilities.java +++ b/source/net/sourceforge/filebot/FileBotUtilities.java @@ -38,7 +38,7 @@ public final class FileBotUtilities { * checksum string is a hex number with at least 8 digits. Capturing group 0 will contain * the matched checksum string. */ - public static final Pattern EMBEDDED_CHECKSUM_PATTERN = Pattern.compile("(?<=\\[|\\()(\\p{XDigit}{8,})(?=\\]|\\))"); + public static final Pattern EMBEDDED_CHECKSUM_PATTERN = Pattern.compile("(?<=\\[|\\()(\\p{XDigit}{8})(?=\\]|\\))"); public static String getEmbeddedChecksum(CharSequence string) { @@ -55,6 +55,7 @@ public final class FileBotUtilities { public static String removeEmbeddedChecksum(String string) { + // match embedded checksum and surrounding brackets return string.replaceAll("[\\(\\[]\\p{XDigit}{8}[\\]\\)]", ""); } diff --git a/source/net/sourceforge/filebot/ui/panel/subtitle/SubtitleDownloadComponent.java b/source/net/sourceforge/filebot/ui/panel/subtitle/SubtitleDownloadComponent.java index 67449d0f..5e1bca5f 100644 --- a/source/net/sourceforge/filebot/ui/panel/subtitle/SubtitleDownloadComponent.java +++ b/source/net/sourceforge/filebot/ui/panel/subtitle/SubtitleDownloadComponent.java @@ -101,6 +101,11 @@ class SubtitleDownloadComponent extends JComponent { } }; + // better selection behaviour + EventSelectionModel fileSelection = new EventSelectionModel(files); + fileSelection.setSelectionMode(ListSelection.MULTIPLE_INTERVAL_SELECTION_DEFENSIVE); + fileList.setSelectionModel(fileSelection); + // install dnd and clipboard export handler MemoryFileListExportHandler memoryFileExportHandler = new MemoryFileListExportHandler(); fileList.setTransferHandler(new DefaultTransferHandler(null, memoryFileExportHandler, memoryFileExportHandler)); diff --git a/source/net/sourceforge/filebot/ui/panel/subtitle/SubtitlePanel.java b/source/net/sourceforge/filebot/ui/panel/subtitle/SubtitlePanel.java index 7df2e098..d76a8e91 100644 --- a/source/net/sourceforge/filebot/ui/panel/subtitle/SubtitlePanel.java +++ b/source/net/sourceforge/filebot/ui/panel/subtitle/SubtitlePanel.java @@ -53,7 +53,7 @@ public class SubtitlePanel extends AbstractSearchPanel