OSDN Git Service

置換文字設定を削除
authoryukihane <yukihane.feather@gmail.com>
Wed, 21 Mar 2012 15:04:45 +0000 (00:04 +0900)
committeryukihane <yukihane.feather@gmail.com>
Wed, 21 Mar 2012 15:04:45 +0000 (00:04 +0900)
frontend/src/saccubus/worker/impl/convert/Convert.java
frontend/src/saccubus/worker/impl/download/Download.java
frontend/src/saccubus/worker/profile/GeneralProfile.java
frontend/src/yukihane/inqubus/config/Config.java
frontend/src/yukihane/inqubus/config/ConfigGeneralProfile.java
frontend/src/yukihane/inqubus/gui/ConfigDialog.java

index a02524e..87b289d 100644 (file)
@@ -84,8 +84,6 @@ public class Convert extends Worker<ConvertResult, ConvertProgress> {
         outputPattern.setTitle(isNotEmpty(title) ? title : "");
         final String fileName = getBaseName(videoFile.getPath());
         outputPattern.setFileName(fileName);
-        outputPattern.setReplaceFrom(gene.getReplaceFrom());
-        outputPattern.setReplaceFrom(gene.getReplaceTo());
         final File outputFile = new File(outprof.getDir(),
                 outputPattern.createFileName() + profile.getFfmpegOption().getExtOption());
 
index a41d2b2..c33e46d 100644 (file)
@@ -78,9 +78,7 @@ public class Download extends Worker<DownloadResult, DownloadProgress> {
             vi = client.getVideoInfo(videoId);
 
             final String name = profile.getVideoProfile().getFileName();
-            final String replaceFrom = profile.getGeneralProfile().getReplaceFrom();
-            final String replaceTo = profile.getGeneralProfile().getReplaceTo();
-            videoNamePattern = new NamePattern(name, replaceFrom, replaceTo, vi.getTitleInWatchPage());
+            videoNamePattern = new NamePattern(name, vi.getTitleInWatchPage());
 
             if (needsBackLog()) {
                 final String key = client.getWayBackKey(vi);
@@ -95,8 +93,7 @@ public class Download extends Worker<DownloadResult, DownloadProgress> {
             final CommentProfile prof = profile.getCommentProfile();
             final GeneralProfile gene = profile.getGeneralProfile();
 
-            final NamePattern pattern = new NamePattern(prof.getFileName(), gene.getReplaceFrom(), gene.getReplaceTo(),
-                    vi.getTitleInWatchPage());
+            final NamePattern pattern = new NamePattern(prof.getFileName(), vi.getTitleInWatchPage());
             // TODO コメントファイルに{low}は使えないことをどこかに書くべきか
             final String name = pattern.createFileName(videoId, true);
             final File file = new File(profile.getCommentProfile().getDir(), name);
index f7136ee..3a1d919 100644 (file)
@@ -7,14 +7,4 @@ import java.io.File;
  * @author yuki
  */
 public interface GeneralProfile {
-
-    /** @return 置換する禁則文字を取得します. */
-    String getReplaceFrom();
-
-    /**
-     * 禁則文字をこの文字に変換します.
-     * @return 置換後文字.
-     */
-    String getReplaceTo();
-
 }
index a11a1fd..902b86f 100644 (file)
@@ -249,27 +249,7 @@ public enum Config {
     public void setOutputDisplayProgress(boolean s) {
         config.setProperty(FILE_OUTPUT_DISPLAY_PROGRESS, s);
     }
-    /*
-     * ファイル - 禁則文字
-     */
-    private static final String FILE_REPLACE_FROM = "file.prohibit.replace_from";
 
-    public String getReplaceFrom() {
-        return config.getString(FILE_REPLACE_FROM, "/\\:*?\"<>|.");
-    }
-
-    public void setReplaceFrom(String s) {
-        config.setProperty(FILE_REPLACE_FROM, s);
-    }
-    private static final String FILE_REPLACE_TO = "file.prohibit.replace_to";
-
-    public String getReplaceTo() {
-        return config.getString(FILE_REPLACE_TO, "_");
-    }
-
-    public void setReplaceTo(String s) {
-        config.setProperty(FILE_REPLACE_TO, s);
-    }
     /*
      * コメント
      */
index 74b6414..08515ec 100644 (file)
@@ -9,25 +9,6 @@ import saccubus.worker.profile.GeneralProfile;
  */
 public class ConfigGeneralProfile implements GeneralProfile {
 
-    private final String replaceFrom;
-    private final String replaceTo;
-
-    public ConfigGeneralProfile() {
-        final Config p = Config.INSTANCE;
-        this.replaceFrom = p.getReplaceFrom();
-        this.replaceTo = p.getReplaceTo();
-    }
-
-    @Override
-    public String getReplaceFrom() {
-        return this.replaceFrom;
-    }
-
-    @Override
-    public String getReplaceTo() {
-        return this.replaceTo;
-    }
-
     @Override
     public String toString() {
         return ToStringBuilder.reflectionToString(this);
index 720a1f9..87f8d2b 100644 (file)
@@ -334,38 +334,6 @@ public class ConfigDialog extends JDialog {
                 .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
         );
 
-        final JPanel pnlFileProhibit = new JPanel();
-        pnlFileProhibit.setBorder(BorderFactory.createTitledBorder("禁則文字"));
-        final JLabel lblReplaceFrom = new JLabel("置換対象文字");
-        final JLabel lblReplaceTo = new JLabel("置換後文字");
-
-        final GroupLayout glProhibit = new GroupLayout(pnlFileProhibit);
-        glProhibit.setAutoCreateContainerGaps(true);
-        glProhibit.setAutoCreateGaps(true);
-        pnlFileProhibit.setLayout(glProhibit);
-
-        glProhibit.setHorizontalGroup(glProhibit.createSequentialGroup()
-            .addGroup(glProhibit.createParallelGroup()
-                .addComponent(lblReplaceFrom)
-                .addComponent(lblReplaceTo)
-            )
-            .addGroup(glProhibit.createParallelGroup()
-                .addComponent(fldReplaceFrom)
-                .addComponent(fldReplaceTo)
-            )
-        );
-
-        glProhibit.setVerticalGroup(glProhibit.createSequentialGroup()
-            .addGroup(glProhibit.createParallelGroup(Alignment.BASELINE)
-                .addComponent(lblReplaceFrom)
-                .addComponent(fldReplaceFrom)
-            )
-            .addGroup(glProhibit.createParallelGroup(Alignment.BASELINE)
-                .addComponent(lblReplaceTo)
-                .addComponent(fldReplaceTo)
-            )
-        );
-
         GroupLayout gl_pnlFile = new GroupLayout(pnlFile);
         pnlFile.setLayout(gl_pnlFile);
         gl_pnlFile.setHorizontalGroup(
@@ -376,7 +344,6 @@ public class ConfigDialog extends JDialog {
                     .addComponent(pnlFileOutput, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                     .addComponent(pnlFileVideo, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                     .addComponent(pnlFileComment, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                    .addComponent(pnlFileProhibit, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                 )
                 .addContainerGap())
         );
@@ -390,7 +357,6 @@ public class ConfigDialog extends JDialog {
                 .addPreferredGap(ComponentPlacement.RELATED)
                 .addComponent(pnlFileOutput, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(ComponentPlacement.RELATED)
-                .addComponent(pnlFileProhibit, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                 .addContainerGap())
         );
 
@@ -855,9 +821,6 @@ public class ConfigDialog extends JDialog {
     private final JCheckBox cbOutputEnable;
     private final JCheckBox cbOutputCommentOverlay;
     private final JCheckBox cbOutputDisplayProgress;
-    // ファイル - 禁則文字
-    private final JTextField fldReplaceFrom = new JTextField();
-    private final JTextField fldReplaceTo = new JTextField();
     // コメント
     // コメント
     private final JCheckBox cbCommentSizeAuto = new JCheckBox("自動調整");
@@ -973,12 +936,6 @@ public class ConfigDialog extends JDialog {
         cbOutputCommentOverlay.setSelected(p.getOutputCommentOverlay());
         cbOutputDisplayProgress.setSelected(p.getOutputDisplayProgress());
 
-        /*
-         * ファイル - 禁則文字
-         */
-        fldReplaceFrom.setText(p.getReplaceFrom());
-        fldReplaceTo.setText(p.getReplaceTo());
-
         /**
          * コメント
          */
@@ -1103,12 +1060,6 @@ public class ConfigDialog extends JDialog {
         p.setOutputDisplayProgress(cbOutputDisplayProgress.isSelected());
 
         /*
-         * ファイル - 禁則文字
-         */
-        p.setReplaceFrom(fldReplaceFrom.getText());
-        p.setReplaceTo(fldReplaceTo.getText());
-
-        /*
          * コメント
          */
         p.setCommentSizeAutosize(cbCommentSizeAuto.isSelected());