OSDN Git Service

行うべき処理が無い場合にはメッセージを出力し,キューには追加しない No.26342
authoryukihane <yukihane.feather@gmail.com>
Sat, 12 May 2012 11:40:48 +0000 (20:40 +0900)
committeryukihane <yukihane.feather@gmail.com>
Sat, 12 May 2012 14:29:06 +0000 (23:29 +0900)
frontend/src/yukihane/inqubus/gui/MainFrame.java

index 4f2f317..8e03253 100644 (file)
@@ -627,9 +627,13 @@ public class MainFrame extends JFrame {
                 thumbRepository.request(downProf.getProxyProfile(), tempDir, id);
 
                 final RequestProcess rp = new RequestProcess(downProf, id, convProf);
-                taskManager.add(rp);
-                targetModel.addTarget(new Target(rp));
-                initInputPanel();
+                final boolean res = taskManager.add(rp);
+                if (res) {
+                    targetModel.addTarget(new Target(rp));
+                    initInputPanel();
+                } else {
+                    fldInputMessage.setText("行うべき処理がありません");
+                }
             } catch (Throwable th) {
                 logger.error(null, th);
                 JOptionPane.showMessageDialog(MainFrame.this, th.getMessage(), "中断しました", JOptionPane.ERROR_MESSAGE);
@@ -711,6 +715,7 @@ public class MainFrame extends JFrame {
     // End of variables declaration//GEN-END:variables
 
     private void initInputPanel() {
+        fldInputMessage.setText("");
         initMainTab();
         initFfmpegTab();
         tbpInput.setSelectedIndex(0);