OSDN Git Service

出力動画に拡張子がつかない問題に対処
[coroid/inqubus.git] / frontend / src / yukihane / inqubus / gui / MainFrame.java
index 51e19c2..1d4030b 100644 (file)
@@ -10,8 +10,6 @@ import java.awt.Image;
 import java.awt.ItemSelectable;
 import java.awt.Point;
 import java.awt.Toolkit;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.ItemEvent;
@@ -34,7 +32,6 @@ import java.util.Set;
 import java.util.SortedSet;
 import java.util.logging.Level;
 import java.util.logging.Logger;
-import java.util.regex.Pattern;
 import javax.swing.BorderFactory;
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.DropMode;
@@ -57,7 +54,6 @@ import javax.swing.JTextField;
 import javax.swing.KeyStroke;
 import javax.swing.LayoutStyle.ComponentPlacement;
 import javax.swing.SwingUtilities;
-import javax.swing.TransferHandler;
 import javax.swing.WindowConstants;
 import javax.swing.border.BevelBorder;
 import org.apache.commons.configuration.ConfigurationException;
@@ -65,7 +61,6 @@ import org.apache.commons.lang.builder.ToStringBuilder;
 import saccubus.MainFrame_AboutBox;
 import saccubus.util.WayBackTimeParser;
 import saccubus.worker.profile.CommentProfile;
-import saccubus.worker.profile.ConvertProfile;
 import saccubus.worker.profile.DownloadProfile;
 import saccubus.worker.profile.FfmpegProfile;
 import saccubus.worker.profile.GeneralProfile;
@@ -174,6 +169,7 @@ public class MainFrame extends JFrame {
         cmbVideo.setToolTipText(FILE_INPUTFIELD_TOOLTIP);
         btnVideo.addActionListener(
                 new FileChooseActionListener(MainFrame.this, JFileChooser.FILES_ONLY, fldVideo));
+        fldVideo.setTransferHandler(new ContentTransferHandler(fldVideo.getTransferHandler(), cbVideoLocal));
         final JLabel lblComment = new JLabel();
 
         fldBackLog.setToolTipText("YYYY/MM/DD hh:mm:ss形式、あるいは1970/01/01からの経過秒を入力します。");
@@ -210,6 +206,7 @@ public class MainFrame extends JFrame {
         cmbComment.setToolTipText(FILE_INPUTFIELD_TOOLTIP);
         btnComment.addActionListener(
                 new FileChooseActionListener(MainFrame.this, JFileChooser.FILES_ONLY, fldComment));
+        fldComment.setTransferHandler(new ContentTransferHandler(fldComment.getTransferHandler(), cbCommentLocal));
         final JLabel lblOutput = new JLabel();
         cbOutputEnable = new JCheckBox();
         fldOutput = new JTextField();
@@ -689,7 +686,9 @@ public class MainFrame extends JFrame {
         cmbId.setText("");
         cbBackLogReduce.setSelected(p.getCommentMinDisabled());
         cbBackLog.setEnabled(true);
+        cbBackLog.setSelected(false);
         fldBackLog.setEnabled(false);
+        fldBackLog.setText("");
 
         final boolean videoLocal = p.getVideoUseLocal();
         cbVideoLocal.setSelected(videoLocal);
@@ -1063,7 +1062,11 @@ public class MainFrame extends JFrame {
         private final boolean adjustRatio;
 
         private InqubusFfmpegProfile() throws IOException {
-            this.extOption = pnlInputFfmpeg.fldFfmpegOptionExtension.getText();
+            String ext = pnlInputFfmpeg.fldFfmpegOptionExtension.getText();
+            if (!ext.startsWith(".")) {
+                ext = "." + ext;
+            }
+            this.extOption = ext;
             this.inOption = pnlInputFfmpeg.fldFfmpegOptionIn.getText();
             this.mainOption = pnlInputFfmpeg.fldFfmpegOptionMain.getText();
             this.outOption = pnlInputFfmpeg.fldFfmpegOptionOut.getText();