Index: src/cz/vity/freerapid/gui/managers/ProcessManager.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/cz/vity/freerapid/gui/managers/ProcessManager.java	(revision 3771)
+++ src/cz/vity/freerapid/gui/managers/ProcessManager.java	(revision )
@@ -74,7 +74,13 @@
             public void preferenceChange(PreferenceChangeEvent evt) {
                 if (UserProp.MAX_DOWNLOADS_AT_A_TIME.equals(evt.getKey()))
                     queueUpdated();
+                if (UserProp.STOP_AUTO_QUEUE.equals(evt.getKey())) {
+                    if (!AppPrefs.getProperty(UserProp.STOP_AUTO_QUEUE, UserProp.STOP_AUTO_QUEUE_DEFAULT))
+                        queueUpdated();
+                    else
+                        dataManager.stopDownloading();
-            }
+                }
+            }
         });
     }
 
@@ -135,14 +141,14 @@
     private boolean canCreateAnotherConnection(final boolean forceDownload) {
         synchronized (downloadingLock) {
             final int downloading = getDownloading();
-            if (downloading == ClientManager.MAX_DOWNLOADING) {
+            if (downloading == ClientManager.MAX_DOWNLOADING) 
                 return false;
-            } else {
-                if (forceDownload)
-                    return true;
+            if (forceDownload)
+                return true;
+            if (AppPrefs.getProperty(UserProp.STOP_AUTO_QUEUE, UserProp.STOP_AUTO_QUEUE_DEFAULT))
+                return false;
-                final int maxDownloads = Math.min(AppPrefs.getProperty(UserProp.MAX_DOWNLOADS_AT_A_TIME, UserProp.MAX_DOWNLOADS_AT_A_TIME_DEFAULT), ClientManager.MAX_DOWNLOADING);
-                return maxDownloads > downloading;
+            final int maxDownloads = Math.min(AppPrefs.getProperty(UserProp.MAX_DOWNLOADS_AT_A_TIME, UserProp.MAX_DOWNLOADS_AT_A_TIME_DEFAULT), ClientManager.MAX_DOWNLOADING);
+            return maxDownloads > downloading;
-            }
         }
     }
 
Index: src/cz/vity/freerapid/gui/managers/SchedulerManager.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/cz/vity/freerapid/gui/managers/SchedulerManager.java	(revision )
+++ src/cz/vity/freerapid/gui/managers/SchedulerManager.java	(revision )
@@ -0,0 +1,99 @@
+package cz.vity.freerapid.gui.managers;
+
+import cz.vity.freerapid.core.AppPrefs;
+import cz.vity.freerapid.core.UserProp;
+
+import java.util.Calendar;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.logging.Logger;
+
+
+/**
+ * @author birchie
+ */
+public final class SchedulerManager {
+    private final static Logger logger = Logger.getLogger(SchedulerManager.class.getName());
+    private Timer timer;
+
+    final long interval = 15;//seconds
+
+
+    public SchedulerManager() {
+    }
+    public void initManager(){
+        initSchedulerTimer();
+    }
+    public void initSchedulerTimer() {
+        Calendar scheduleTime = Calendar.getInstance();
+        if (timer != null) {
+            timer.cancel();
+        }
+        timer = new Timer("ScheduleTimer");
+        timer.scheduleAtFixedRate(new TimerTask() {
+            @Override
+            public void run() {
+                if (isEnabled())
+                    checkAndExecute();
+            }
+        }, scheduleTime.getTime(), interval * 1000);
+    }
+
+    public boolean isEnabled() {
+        return AppPrefs.getProperty(UserProp.SCHEDULER_ENABLED, UserProp.SCHEDULER_ENABLED_DEFAULT);
+    }
+
+    public void setEnabled(final boolean enabled) {
+        AppPrefs.storeProperty(UserProp.SCHEDULER_ENABLED, enabled);
+    }
+
+    public void checkAndExecute() {
+        if (this.isEnabled()) {
+            final String schedule = AppPrefs.getProperty(UserProp.SCHEDULER_TIMES, UserProp.SCHEDULER_TIMES_DEFAULT);
+
+            final String nextActionTime = schedule.split(",",2)[0];
+            final String restActionTime = schedule.split(",",2)[1];
+            if (nextActionTime.trim().equalsIgnoreCase("X")) {   // disable the scheduler
+                AppPrefs.storeProperty(UserProp.SCHEDULER_TIMES ,restActionTime+","+nextActionTime);
+                logger.info("Scheduler state = DISABLE");
+                setEnabled(false);
+            } else {
+                 try {
+                    final int currentTime[] = this.getCurrentTimeHMS();
+                    final String nextHourMin[] = nextActionTime.trim().split("\\D+");
+                    final int nextMin = Integer.parseInt(nextHourMin[nextHourMin.length-1]);
+                    final int nextHour = Integer.parseInt(nextHourMin[nextHourMin.length-2]);
+                    final String nextAction = nextActionTime.trim().split("\\d+")[0];
+                    logger.info("Scheduler current time = "+currentTime[0]+":"+currentTime[1]+"; next scheduled time = "+nextHour+":"+nextMin);
+                    if ((currentTime[0]==nextHour) && (currentTime[1]==nextMin)) {
+                        AppPrefs.storeProperty(UserProp.SCHEDULER_TIMES ,restActionTime+","+nextActionTime);
+                        if (nextAction.equals("-")) {
+                            logger.info("Scheduler action = STOP");
+                            AppPrefs.storeProperty(UserProp.STOP_AUTO_QUEUE, true);
+                        } else if (nextAction.equals("+")) {
+                            logger.info("Scheduler action = START");
+                            AppPrefs.storeProperty(UserProp.STOP_AUTO_QUEUE, false);
+                        } else {
+                            logger.info("Scheduler action = TOGGLE");
+                            AppPrefs.negateProperty(UserProp.STOP_AUTO_QUEUE,UserProp.STOP_AUTO_QUEUE_DEFAULT);
+                        }
+                    }
+                } catch (Exception err) {   // invalid time
+                    logger.info("Scheduler ignoring ERROR");
+                    AppPrefs.storeProperty(UserProp.SCHEDULER_TIMES ,restActionTime);
+                }
+            }
+
+        }
+    }
+    public int[] getCurrentTimeHMS() {
+        final int currentTimeSec = (int) System.currentTimeMillis() / 1000;
+        final int currentTimeMin = (currentTimeSec / 60) + AppPrefs.getProperty(UserProp.SCHEDULER_TIMEZONE_CORRECTION, UserProp.SCHEDULER_TIMEZONE_CORRECTION_DEFAULT);
+        final int currentTimeHour = currentTimeMin / 60;
+        int output[] = new int[3];
+        output[0] = currentTimeHour - (currentTimeHour/24)*24;
+        output[1] = currentTimeMin - (currentTimeMin/60)*60;
+        output[2] = currentTimeSec - (currentTimeSec/60)*60;
+        return output;
+    }
+}
\ No newline at end of file
Index: src/cz/vity/freerapid/gui/managers/DataManager.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/cz/vity/freerapid/gui/managers/DataManager.java	(revision 3771)
+++ src/cz/vity/freerapid/gui/managers/DataManager.java	(revision )
@@ -123,6 +123,32 @@
         }
     }
 
+    public void stopDownloading() {
+        if (AppPrefs.getProperty(UserProp.STOP_DOWNLOADS_WITH_QUEUE, UserProp.STOP_DOWNLOADS_WITH_QUEUE_DEFAULT)) {
+            final List<DownloadFile> toResumeList = new LinkedList<DownloadFile>();
+            synchronized (lock) {
+                for (DownloadFile file : downloadFiles) {
+                    final boolean resumeCheck = AppPrefs.getProperty(UserProp.STOP_ONLY_RESUMABLE_DOWNLOADS_WITH_QUEUE, UserProp.STOP_ONLY_RESUMABLE_DOWNLOADS_WITH_QUEUE_DEFAULT);
+                    if (!resumeCheck || file.isResumeSupported()) {
+                        final DownloadTask task = file.getTask();
+                        if (task != null && !task.isTerminated()) {
+                            file.resetErrorAttempts();
+                            toResumeList.add(file);
+                            file.setState(PAUSED);
+                            task.cancel(true);
+                        }
+                    }
+                }
+            }
+            try {
+                Thread.sleep(700);//time to cancel DownloadTask properly
+            } catch (InterruptedException e) {
+                //ignore
+            }
+            addToQueue(toResumeList);
+        }
+    }
+
     public void addFileStateChangedListener(FileStateChangeListener listener) {
         listenerList.add(FileStateChangeListener.class, listener);
     }
Index: src/cz/vity/freerapid/model/PluginMetaData.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/cz/vity/freerapid/model/PluginMetaData.java	(revision 3771)
+++ src/cz/vity/freerapid/model/PluginMetaData.java	(revision )
@@ -93,7 +93,7 @@
         if (maxAllowedDownloads > 1) {
             maxAllowedDownloads = Math.min(maxParallelDownloads, maxAllowedDownloads);
         } else {
-            if (maxAllowedDownloads == -1) maxAllowedDownloads = maxParallelDownloads;
+            if (maxAllowedDownloads == -1) maxAllowedDownloads = DescriptorUtils.getAttribute("defaultDownloads", maxParallelDownloads, descriptor);
         }
 
 
Index: src/cz/vity/freerapid/gui/actions/OptionsActions.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/cz/vity/freerapid/gui/actions/OptionsActions.java	(revision 3771)
+++ src/cz/vity/freerapid/gui/actions/OptionsActions.java	(revision )
@@ -68,6 +68,11 @@
     }
 
     @Action
+    public void stopAutoQueueAction() {
+        AppPrefs.negateProperty(UserProp.STOP_AUTO_QUEUE, UserProp.STOP_AUTO_QUEUE_DEFAULT);
+    }
+
+    @Action
     public void globalSpeedLimitAction() {
         AppPrefs.negateProperty(UserProp.SPEED_LIMIT_ENABLED, UserProp.SPEED_LIMIT_ENABLED_DEFAULT);
     }
Index: src/cz/vity/freerapid/gui/managers/MenuManager.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/cz/vity/freerapid/gui/managers/MenuManager.java	(revision 3771)
+++ src/cz/vity/freerapid/gui/managers/MenuManager.java	(revision )
@@ -126,6 +126,8 @@
                 MENU_SEPARATOR,
                 CHECKED + "monitorClipboardAction",
                 MENU_SEPARATOR,
+                CHECKED + "stopAutoQueueAction",
+                MENU_SEPARATOR,
                 CHECKED + "quietModeAction",
                 MENU_SEPARATOR,
                 CHECKED + "globalSpeedLimitAction",
@@ -224,6 +226,7 @@
         PropertyConnector.connectAndUpdate(BindUtils.getPrefsValueModel(UserProp.SHOW_COMPLETED, UserProp.SHOW_COMPLETED_DEFAULT), map.get("showCompletedAction"), "selected");
         PropertyConnector.connectAndUpdate(BindUtils.getPrefsValueModel(UserProp.SPEED_LIMIT_ENABLED, UserProp.SPEED_LIMIT_ENABLED_DEFAULT), map.get("globalLimitSpeedAction"), "selected");
         PropertyConnector.connectAndUpdate(BindUtils.getPrefsValueModel(UserProp.CLIPBOARD_MONITORING, UserProp.CLIPBOARD_MONITORING_DEFAULT), map.get("monitorClipboardAction"), "selected");
+        PropertyConnector.connectAndUpdate(BindUtils.getPrefsValueModel(UserProp.STOP_AUTO_QUEUE, UserProp.STOP_AUTO_QUEUE_DEFAULT), map.get("stopAutoQueueAction"), "selected");
         PropertyConnector.connectAndUpdate(BindUtils.getPrefsValueModel(UserProp.QUIET_MODE_ENABLED, UserProp.QUIET_MODE_ENABLED_DEFAULT), map.get("quietModeAction"), "selected");
 
         final JRootPane rootPane = director.getMainFrame().getRootPane();
Index: src/cz/vity/freerapid/core/UserProp.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/cz/vity/freerapid/core/UserProp.java	(revision 3771)
+++ src/cz/vity/freerapid/core/UserProp.java	(revision )
@@ -37,6 +37,31 @@
     public static final String LAST_COMBO_PATH = "lastComboPath";
 
 
+    public static final String STOP_AUTO_QUEUE = "stopAutoQueue";
+    public static final boolean STOP_AUTO_QUEUE_DEFAULT = false;
+
+    public static final String STOP_DOWNLOADS_WITH_QUEUE = "stopDownloadsWithQueue";
+    public static final boolean STOP_DOWNLOADS_WITH_QUEUE_DEFAULT = true;
+
+    public static final String STOP_ONLY_RESUMABLE_DOWNLOADS_WITH_QUEUE = "stopOnlyResumableDownloadsWithQueue";
+    public static final boolean STOP_ONLY_RESUMABLE_DOWNLOADS_WITH_QUEUE_DEFAULT = true;
+
+    public static final String STOP_QUEUE_ERROR_MAX_COUNT = "stopQueueErrorMaxCount";
+    public static final int STOP_QUEUE_ERROR_MAX_COUNT_DEFAULT = 3;
+
+    public static final String STOP_QUEUE_ERROR_TIME_FRAME = "stopQueueErrorTimeFrame";
+    public static final int STOP_QUEUE_ERROR_TIME_FRAME_DEFAULT = 30;
+
+    public static final String SCHEDULER_ENABLED = "schedulerEnabled";
+    public static final boolean SCHEDULER_ENABLED_DEFAULT = false;
+
+    public static final String SCHEDULER_TIMES = "schedulerTimes";
+    public static final String SCHEDULER_TIMES_DEFAULT = "+1:00,-5:00,+13:00,x,-17:00";
+
+    public static final String SCHEDULER_TIMEZONE_CORRECTION = "schedulerTimezoneCorrection";
+    public static final int SCHEDULER_TIMEZONE_CORRECTION_DEFAULT = 0;
+
+
     public static final String MAX_DOWNLOADS_AT_A_TIME = "maxDownloadsAtATime";
     public static final int MAX_DOWNLOADS_AT_A_TIME_DEFAULT = 5;
 
Index: src/cz/vity/freerapid/gui/dialogs/userprefs/ConnectionsTab.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/cz/vity/freerapid/gui/dialogs/userprefs/ConnectionsTab.java	(revision 3771)
+++ src/cz/vity/freerapid/gui/dialogs/userprefs/ConnectionsTab.java	(revision )
@@ -44,6 +44,13 @@
         final ValueModel useProxyList = bind(checkUseProxyList, UserProp.USE_PROXY_LIST, UserProp.USE_PROXY_LIST_DEFAULT);
         PropertyConnector.connectAndUpdate(useProxyList, fieldProxyListPath, "enabled");
         PropertyConnector.connectAndUpdate(useProxyList, actionMap.get("btnSelectProxyListAction"), "enabled");
+        final ValueModel stopDownloads = bind(checkStopDownloads, UserProp.STOP_DOWNLOADS_WITH_QUEUE, UserProp.STOP_DOWNLOADS_WITH_QUEUE_DEFAULT);
+        PropertyConnector.connectAndUpdate(stopDownloads, checkStopResumableDownloads, "enabled");
+        bind(checkStopResumableDownloads, UserProp.STOP_ONLY_RESUMABLE_DOWNLOADS_WITH_QUEUE, UserProp.STOP_ONLY_RESUMABLE_DOWNLOADS_WITH_QUEUE_DEFAULT);
+        bind(spinnerStopErrorMax, UserProp.STOP_QUEUE_ERROR_MAX_COUNT, UserProp.STOP_QUEUE_ERROR_MAX_COUNT_DEFAULT, 1, 50, 1);
+        bind(spinnerStopErrorTimeFrame, UserProp.STOP_QUEUE_ERROR_TIME_FRAME, UserProp.STOP_QUEUE_ERROR_TIME_FRAME_DEFAULT, 10, 300, 10);
+        bind(checkUseScheduler, UserProp.SCHEDULER_ENABLED, UserProp.SCHEDULER_ENABLED_DEFAULT);
+        bind(spinnerSchedulerTimezoneCorrection, UserProp.SCHEDULER_TIMEZONE_CORRECTION, UserProp.SCHEDULER_TIMEZONE_CORRECTION_DEFAULT, -1440, 1440, 30);
 
         String property = AppPrefs.getProperty(UserProp.PROXY_LIST_PATH, "");
         if (!property.isEmpty()) {
@@ -111,6 +118,15 @@
                 }
             }
         });
+        spinnerSchedulerTimezoneCorrection.addChangeListener(new ChangeListener() {
+            @Override
+            public void stateChanged(ChangeEvent e) {
+                AppPrefs.storeProperty(UserProp.SCHEDULER_TIMEZONE_CORRECTION, (Integer) spinnerSchedulerTimezoneCorrection.getValue());
+                final int currentTime[] = managerDirector.getSchedulerManager().getCurrentTimeHMS();
+                final String spacer = currentTime[1] < 10 ? "0" : "";
+                labelCurrentTime.setText(currentTime[0]+":"+spacer+currentTime[1]);
+            }
+        });
 
         fieldFileSpeedLimiterValues.setText(AppPrefs.getProperty(UserProp.SPEED_LIMIT_SPEEDS, UserProp.SPEED_LIMIT_SPEEDS_DEFAULT));
         fieldFileSpeedLimiterValues.getDocument().addDocumentListener(new DocumentListener() {
@@ -130,6 +146,24 @@
             }
         });
 
+        fieldSchedulerValues.setText(AppPrefs.getProperty(UserProp.SCHEDULER_TIMES, UserProp.SCHEDULER_TIMES_DEFAULT));
+        fieldSchedulerValues.getDocument().addDocumentListener(new DocumentListener() {
+            @Override
+            public void insertUpdate(DocumentEvent e) {
+                changedUpdate(e);
+            }
+
+            @Override
+            public void removeUpdate(DocumentEvent e) {
+                changedUpdate(e);
+            }
+
+            @Override
+            public void changedUpdate(DocumentEvent e) {
+                dialog.getModel().setBuffering(true);
+            }
+        });
+
         setAction(btnSelectConnectionProxy, "btnSelectConnectionProxy");
         setAction(btnProxyListPathSelect, "btnSelectProxyListAction");
     }
@@ -159,6 +193,7 @@
         updateDefaultConnection = updateDefaultConnection || isBuffering(UserProp.USE_DEFAULT_CONNECTION);
 
         AppPrefs.storeProperty(UserProp.SPEED_LIMIT_SPEEDS, fieldFileSpeedLimiterValues.getText());
+        AppPrefs.storeProperty(UserProp.SCHEDULER_TIMES, fieldSchedulerValues.getText());
 
         String property = fieldProxyListPath.getText();
         if (!property.isEmpty()) {
@@ -183,6 +218,8 @@
         JPanel panelErrorHandling = new JPanel();
         JPanel panelGlobalSpeedLimiter = new JPanel();
         JPanel panelFileSpeedLimiter = new JPanel();
+        JPanel panelStopDownloads = new JPanel();
+        JPanel panelScheduler = new JPanel();
 
         JLabel labelMaxConcurrentDownloads = new JLabel();
         labelMaxConcurrentDownloads.setName("labelMaxConcurrentDownloads");
@@ -240,6 +277,46 @@
         JLabel labelFileSpeedLimiterValuesDesc = new JLabel();
         labelFileSpeedLimiterValuesDesc.setName("labelFileSpeedLimiterValuesDesc");
 
+        checkStopDownloads = new JCheckBox();
+        checkStopDownloads.setName("checkStopDownloads");
+        checkStopResumableDownloads = new JCheckBox();
+        checkStopResumableDownloads.setName("checkStopResumableDownloads");
+        JLabel labelStopErrorDesc = new JLabel();
+        labelStopErrorDesc.setName("labelStopErrorDesc");
+        spinnerStopErrorMax = new JSpinner();
+        spinnerStopErrorMax.setModel(new SpinnerNumberModel(1, 1, 50, 1));
+        spinnerStopErrorMax.setName("spinnerStopErrorMax");
+        JLabel labelStopErrorMax = new JLabel();
+        labelStopErrorMax.setName("labelStopErrorMax");
+        spinnerStopErrorTimeFrame = new JSpinner();
+        spinnerStopErrorTimeFrame.setModel(new SpinnerNumberModel(10, 10, 300, 10));
+        spinnerStopErrorTimeFrame.setName("spinnerStopErrorTimeFrame");
+        JLabel labelStopErrorTimeFrame = new JLabel();
+        labelStopErrorTimeFrame.setName("labelStopErrorTimeFrame");
+
+        checkUseScheduler = new JCheckBox();
+        checkUseScheduler.setName("checkUseScheduler");
+        JLabel labelSchedulerValues = new JLabel();
+        labelSchedulerValues.setName("labelSchedulerValues");
+        fieldSchedulerValues = new JTextField();
+        fieldSchedulerValues.setName("fieldSchedulerValues");
+        JLabel labelSchedulerValuesDesc = new JLabel();
+        labelSchedulerValuesDesc.setName("labelSchedulerValuesDesc");
+        JLabel labelCurrentTimeDesc = new JLabel();
+        labelCurrentTimeDesc.setName("labelCurrentTimeDesc");
+        labelCurrentTime = new JLabel();
+        final int currentTime[] = managerDirector.getSchedulerManager().getCurrentTimeHMS();
+        final String spacer = currentTime[1] < 10 ? "0" : "";
+        labelCurrentTime.setText(currentTime[0]+":"+spacer+currentTime[1]);
+        labelCurrentTime.setName("labelCurrentTime");
+        JLabel labelSchedulerTimezoneCorrectionValue = new JLabel();
+        labelSchedulerTimezoneCorrectionValue.setName("labelSchedulerTimezoneCorrectionValue");
+        spinnerSchedulerTimezoneCorrection = new JSpinner();
+        spinnerSchedulerTimezoneCorrection.setModel(new SpinnerNumberModel(0, -1440, 1440, 30));
+        spinnerSchedulerTimezoneCorrection.setName("spinnerSchedulerTimezoneCorrection");
+        JLabel labelSchedulerTimezoneCorrectionDesc = new JLabel();
+        labelSchedulerTimezoneCorrectionDesc.setName("labelSchedulerTimezoneCorrectionDesc");
+
         JLabel labelRequiresRestart = new JLabel();
         labelRequiresRestart.setName("labelRequiresRestart");
         labelRequiresRestart.setVisible(false);
@@ -395,6 +472,87 @@
             panelFileSpeedLimiterBuilder.add(labelFileSpeedLimiterValuesDesc, cc.xy(3, 5));
         }
 
+        //======== panelStopDownloads ========
+        {
+            panelStopDownloads.setBorder(new TitledBorder(null, resourceMap.getString("panelStopDownloads.border"), TitledBorder.LEADING, TitledBorder.TOP));
+
+            PanelBuilder panelStopDownloadsBuilder = new PanelBuilder(new FormLayout(
+                    new ColumnSpec[]{
+                            new ColumnSpec(ColumnSpec.LEFT, Sizes.dluX(0), FormSpec.NO_GROW),
+                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
+                            FormFactory.DEFAULT_COLSPEC,
+                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
+                            FormFactory.DEFAULT_COLSPEC,
+                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
+                            FormFactory.DEFAULT_COLSPEC,
+                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
+                            FormFactory.DEFAULT_COLSPEC,
+                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
+                            new ColumnSpec(ColumnSpec.LEFT, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
+                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
+                            FormFactory.DEFAULT_COLSPEC
+                    },
+                    new RowSpec[]{
+                            FormFactory.DEFAULT_ROWSPEC,
+                            FormFactory.LINE_GAP_ROWSPEC,
+                            FormFactory.DEFAULT_ROWSPEC,
+                            FormFactory.LINE_GAP_ROWSPEC,
+                            FormFactory.NARROW_LINE_GAP_ROWSPEC
+                    }), panelStopDownloads);
+
+            panelStopDownloadsBuilder.add(checkStopDownloads, cc.xyw(3, 1, 5));
+            panelStopDownloadsBuilder.add(checkStopResumableDownloads, cc.xyw(9, 1, 5));
+            panelStopDownloadsBuilder.add(labelStopErrorDesc, cc.xy(3, 3));
+            panelStopDownloadsBuilder.add(spinnerStopErrorMax, cc.xy(5, 3));
+            panelStopDownloadsBuilder.add(labelStopErrorMax, cc.xy(7, 3));
+            panelStopDownloadsBuilder.add(spinnerStopErrorTimeFrame, cc.xy(9, 3));
+            panelStopDownloadsBuilder.add(labelStopErrorTimeFrame, cc.xy(11, 3));
+        }
+
+        //======== panelScheduler ========
+        {
+            panelScheduler.setBorder(new TitledBorder(null, resourceMap.getString("panelScheduler.border"), TitledBorder.LEADING, TitledBorder.TOP));
+
+            PanelBuilder panelSchedulerBuilder = new PanelBuilder(new FormLayout(
+                    new ColumnSpec[]{
+                            new ColumnSpec(ColumnSpec.LEFT, Sizes.dluX(0), FormSpec.NO_GROW),
+                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
+                            FormFactory.DEFAULT_COLSPEC,
+                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
+                            FormFactory.DEFAULT_COLSPEC,
+                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
+                            new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
+                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
+                            FormFactory.DEFAULT_COLSPEC
+                    },
+                    new RowSpec[]{
+                            FormFactory.DEFAULT_ROWSPEC,
+                            FormFactory.LINE_GAP_ROWSPEC,
+                            FormFactory.DEFAULT_ROWSPEC,
+                            FormFactory.LINE_GAP_ROWSPEC,
+                            FormFactory.DEFAULT_ROWSPEC,
+                            FormFactory.LINE_GAP_ROWSPEC,
+                            FormFactory.DEFAULT_ROWSPEC,
+                            FormFactory.LINE_GAP_ROWSPEC,
+                            FormFactory.DEFAULT_ROWSPEC,
+                            FormFactory.LINE_GAP_ROWSPEC,
+                            FormFactory.DEFAULT_ROWSPEC,
+                            FormFactory.LINE_GAP_ROWSPEC,
+                            FormFactory.NARROW_LINE_GAP_ROWSPEC
+                    }), panelScheduler);
+
+            panelSchedulerBuilder.add(checkUseScheduler, cc.xyw(3, 1, 7));
+            panelSchedulerBuilder.add(labelSchedulerValues, cc.xyw(3, 3, 7));
+            panelSchedulerBuilder.add(fieldSchedulerValues, cc.xyw(3, 5, 7));
+            panelSchedulerBuilder.add(labelSchedulerValuesDesc, cc.xyw(3, 7, 7));
+
+            panelSchedulerBuilder.add(labelCurrentTimeDesc, cc.xy(3, 9));
+            panelSchedulerBuilder.add(labelCurrentTime, cc.xy(5, 9));
+            panelSchedulerBuilder.add(labelSchedulerTimezoneCorrectionValue, cc.xy(3, 11));
+            panelSchedulerBuilder.add(spinnerSchedulerTimezoneCorrection, cc.xy(5, 11));
+            panelSchedulerBuilder.add(labelSchedulerTimezoneCorrectionDesc, cc.xy(7, 11));
+        }
+
         PanelBuilder thisBuilder = new PanelBuilder(new FormLayout(
                 new ColumnSpec[]{
                         new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
@@ -410,6 +568,10 @@
                         FormFactory.LINE_GAP_ROWSPEC,
                         FormFactory.DEFAULT_ROWSPEC,
                         FormFactory.LINE_GAP_ROWSPEC,
+                        FormFactory.DEFAULT_ROWSPEC,
+                        FormFactory.LINE_GAP_ROWSPEC,
+                        FormFactory.DEFAULT_ROWSPEC,
+                        FormFactory.LINE_GAP_ROWSPEC,
                         FormFactory.DEFAULT_ROWSPEC
                 }), this);
 
@@ -418,7 +580,9 @@
         thisBuilder.add(panelErrorHandling, cc.xyw(1, 5, 3));
         thisBuilder.add(panelGlobalSpeedLimiter, cc.xyw(1, 7, 1));
         thisBuilder.add(panelFileSpeedLimiter, cc.xyw(3, 7, 1));
-        thisBuilder.add(labelRequiresRestart, cc.xyw(1, 9, 3));
+        thisBuilder.add(panelStopDownloads, cc.xyw(1, 9, 3));
+        thisBuilder.add(panelScheduler, cc.xyw(1, 11, 3));
+        thisBuilder.add(labelRequiresRestart, cc.xyw(1, 13, 3));
     }
 
     private JSpinner spinnerMaxConcurrentDownloads;
@@ -433,5 +597,12 @@
     private JSpinner spinnerGlobalSpeedSliderMax;
     private JSpinner spinnerGlobalSpeedSliderStep;
     private JTextField fieldFileSpeedLimiterValues;
-
+    private JCheckBox checkStopDownloads;
+    private JCheckBox checkStopResumableDownloads;
+    private JSpinner spinnerStopErrorMax;
+    private JSpinner spinnerStopErrorTimeFrame;
+    private JCheckBox checkUseScheduler;
+    private JTextField fieldSchedulerValues;
+    private JLabel labelCurrentTime;
+    private JSpinner spinnerSchedulerTimezoneCorrection;
 }
Index: src/cz/vity/freerapid/gui/managers/ManagerDirector.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/cz/vity/freerapid/gui/managers/ManagerDirector.java	(revision 3771)
+++ src/cz/vity/freerapid/gui/managers/ManagerDirector.java	(revision )
@@ -67,6 +67,7 @@
     private ClipboardMonitorManager clipboardMonitorManager;
     private TaskServiceManager taskServiceManager;
     private UpdateManager updateManager;
+    private SchedulerManager schedulerManager;
     private SpeedRegulator speedRegulator;
     private LinkStoreManager linkStoreManager;
 
@@ -118,6 +119,8 @@
 
         this.updateManager = new UpdateManager(ManagerDirector.this, context);
 
+        this.schedulerManager = new SchedulerManager();
+
         this.fileTypeIconProvider = new FileTypeIconProvider(context);
 
         this.inputDataManager = new DataManager(this, context);
@@ -164,6 +167,7 @@
         toolbarManager.initManager();
         clipboardMonitorManager.initManager();
         updateManager.initManager();
+        schedulerManager.initManager();
         Toolkit.getDefaultToolkit().addAWTEventListener(new TextComponentContextMenuListener(), AWTEvent.MOUSE_EVENT_MASK);
     }
 
@@ -237,6 +241,10 @@
 
     public UpdateManager getUpdateManager() {
         return updateManager;
+    }
+
+    public SchedulerManager getSchedulerManager() {
+        return schedulerManager;
     }
 
     public SpeedRegulator getSpeedRegulator() {
Index: src/cz/vity/freerapid/core/tasks/DownloadTask.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/cz/vity/freerapid/core/tasks/DownloadTask.java	(revision 3771)
+++ src/cz/vity/freerapid/core/tasks/DownloadTask.java	(revision )
@@ -57,6 +57,11 @@
     private boolean useRelativeStoreFileIfPossible = true;
     private boolean skipped = false;
 
+    private static final int connectErrorMaxCount = AppPrefs.getProperty(UserProp.STOP_QUEUE_ERROR_MAX_COUNT, UserProp.STOP_QUEUE_ERROR_MAX_COUNT_DEFAULT);
+    private static final int connectErrorTimeFrame = AppPrefs.getProperty(UserProp.STOP_QUEUE_ERROR_TIME_FRAME, UserProp.STOP_QUEUE_ERROR_TIME_FRAME_DEFAULT);;
+    private static int connectErrorCount = 0;
+    private static long[] lastConnectErrorTime = new long[connectErrorMaxCount];
+
     public DownloadTask(Application application) {
         super(application);
         init();
@@ -371,6 +376,32 @@
             setServiceError(DownloadTaskError.YOU_HAVE_TO_WAIT_ERROR);
         }
         final boolean connectError = cause instanceof NoRouteToHostException || cause instanceof ConnectException || cause instanceof UnknownHostException;
+
+        if (connectError) {    // stop the que if more than MaxCount errors within TimeFrame seconds
+            final long nowSec = System.currentTimeMillis() / 1000;
+            for (int iPos=0; (iPos<connectErrorMaxCount) && (lastConnectErrorTime[iPos] > 0); iPos++) {
+                if ((nowSec - lastConnectErrorTime[iPos]) > connectErrorTimeFrame) {  // too long between errors
+                    for (int jPos=iPos; jPos<connectErrorMaxCount-1; jPos++)
+                       lastConnectErrorTime[jPos] = lastConnectErrorTime[jPos+1];
+                    iPos--;
+                    lastConnectErrorTime[connectErrorMaxCount-1] = 0;
+                    connectErrorCount--;
+                }
+           }
+            if (connectErrorCount == connectErrorMaxCount) {
+              for (int jPos=0; jPos<connectErrorMaxCount-1; jPos++)
+                  lastConnectErrorTime[jPos] = lastConnectErrorTime[jPos+1];
+                connectErrorCount--;
+            }
+            lastConnectErrorTime[connectErrorCount] = nowSec;
+            connectErrorCount++;
+            if (connectErrorCount >= connectErrorMaxCount) {
+                AppPrefs.storeProperty(UserProp.STOP_AUTO_QUEUE, true);
+            }
+        } else {
+            connectErrorCount = 0;
+            lastConnectErrorTime = new long[connectErrorMaxCount];
+        }
 
         if (AppPrefs.getProperty(UserProp.TEST_FILE, UserProp.TEST_FILE_DEFAULT))
             updateFileState(cause, connectError);
Index: src/cz/vity/freerapid/core/resources/MainApp.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
===================================================================
--- src/cz/vity/freerapid/core/resources/MainApp.properties	(revision 3771)
+++ src/cz/vity/freerapid/core/resources/MainApp.properties	(revision )
@@ -236,6 +236,10 @@
 monitorClipboardAction.Action.accelerator=F7
 monitorClipboardAction.Action.smallIcon=${iconsPath}clipboard_small.gif
 
+stopAutoQueueAction.Action.text=&Stop Auto-Downloading
+stopAutoQueueAction.Action.shortDescription=Toggle Auto-Downloading
+stopAutoQueueAction.Action.smallIcon=${iconsPath}stopsign.png
+
 quietModeAction.Action.text=&Quiet Mode
 quietModeAction.Action.shortDescription=Toggle Quiet Mode
 quietModeAction.Action.accelerator=F8
@@ -356,6 +360,9 @@
 
 labelClipboardMonitoring.icon=${iconsPath}clipboard_small.gif
 labelClipboardMonitoring.toolTipText=Clipboard Monitoring
+
+labelStopAutoQueue.icon=${iconsPath}stopsign.png
+labelStopAutoQueue.toolTipText=Stop Auto-Downloading
 
 labelQuietMode.icon=${iconsPath}loudspeaker.png
 labelQuietMode.toolTipText=Quiet Mode
\ No newline at end of file
Index: src/cz/vity/freerapid/swing/TrayIconSupport.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/cz/vity/freerapid/swing/TrayIconSupport.java	(revision 3771)
+++ src/cz/vity/freerapid/swing/TrayIconSupport.java	(revision )
@@ -145,6 +145,15 @@
             }
         });
 
+        final CheckboxMenuItem stopAutoQueue = new CheckboxMenuItem(map.getString("stopAutoQueueActionTray"));
+        stopAutoQueue.setState(AppPrefs.getProperty(UserProp.STOP_AUTO_QUEUE, UserProp.STOP_AUTO_QUEUE_DEFAULT));
+        stopAutoQueue.addItemListener(new ItemListener() {
+            public void itemStateChanged(ItemEvent e) {
+                final boolean b = stopAutoQueue.getState();
+                AppPrefs.storeProperty(UserProp.STOP_AUTO_QUEUE, b);
+            }
+        });
+
         final CheckboxMenuItem quietMode = new CheckboxMenuItem(map.getString("quietModeActionTray"));
         quietMode.setState(QuietMode.getInstance().isEnabled());
         quietMode.addItemListener(new ItemListener() {
@@ -163,6 +172,8 @@
                     hideWhenMinimizedItem.setState(AppPrefs.getProperty(FWProp.MINIMIZE_TO_TRAY, false));
                 } else if (UserProp.CLIPBOARD_MONITORING.equals(evt.getKey())) {
                     clipboardMonitoring.setState(AppPrefs.getProperty(UserProp.CLIPBOARD_MONITORING, UserProp.CLIPBOARD_MONITORING_DEFAULT));
+                } else if (UserProp.STOP_AUTO_QUEUE.equals(evt.getKey())) {
+                    stopAutoQueue.setState(AppPrefs.getProperty(UserProp.STOP_AUTO_QUEUE, UserProp.STOP_AUTO_QUEUE_DEFAULT));
                 } else if (UserProp.QUIET_MODE_ENABLED.equals(evt.getKey())) {
                     quietMode.setState(QuietMode.getInstance().isEnabled());
                 }
@@ -195,6 +206,7 @@
         popup.add(restoreItem);
         popup.addSeparator();
         popup.add(clipboardMonitoring);
+        popup.add(stopAutoQueue);
         popup.add(quietMode);
         popup.addSeparator();
         popup.add(hideWhenMinimizedItem);
Index: src/cz/vity/freerapid/gui/dialogs/userprefs/resources/UserPreferencesDialog.properties
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>windows-1252
===================================================================
--- src/cz/vity/freerapid/gui/dialogs/userprefs/resources/UserPreferencesDialog.properties	(revision 3771)
+++ src/cz/vity/freerapid/gui/dialogs/userprefs/resources/UserPreferencesDialog.properties	(revision )
@@ -102,6 +102,25 @@
 labelFileSpeedLimiterValues.text=Values for file speed limiter (kB/s)
 fieldFileSpeedLimiterValues.toolTipText=Separate values with commas. Two commas indicate a menu separator. 0 means unlimited.
 labelFileSpeedLimiterValuesDesc.text=<html><small>Separate values with commas.<br/>Two commas indicate a menu separator. 0 means unlimited.</small></html>
+panelStopDownloads.border=Stop auto-downloading
+checkStopDownloads.text=Stop files currently downloading
+checkStopResumableDownloads.text=Stop only the files that can be resumed
+labelStopErrorDesc.text=Stop auto-downloading if
+labelStopErrorMax.text=Connection errors occur within
+labelStopErrorTimeFrame.text=Seconds
+panelScheduler.border=Download scheduler
+checkUseScheduler.text=Enable download scheduler
+labelSchedulerValues.text=Values for download scheduler ([+/-]HH:MM)
+fieldSchedulerValues.toolTipText=Separate values with commas.  Scheduler processes from left to right (First value is the next scheduled event).
+labelSchedulerValuesDesc.text=<html><small>Separate values with commas.  Scheduler processes from left to right (First value is the next scheduled event).<br/>'+HH:MM' Starts downloads at the given time.  '-HH:MM' Stops downloads at the given time.  'x' Disables the scheduler  </small></html>
+labelCurrentTimeDesc.text=Java's current time
+labelSchedulerTimezoneCorrectionValue.text=Timezone correction
+labelSchedulerTimezoneCorrectionDesc.text=minutes(+/-). Correct Java's time to your local time.
+labelCurrentTimeDesc.toolTipText=Java does not always correctly read the operating system's timezone
+labelCurrentTime.toolTipText=Java does not always correctly read the operating system's timezone
+labelSchedulerTimezoneCorrectionValue.toolTipText=Java does not always correctly read the operating system's timezone
+labelSchedulerTimezoneCorrectionDesc.toolTipText=Java does not always correctly read the operating system's timezone
+spinnerSchedulerTimezoneCorrection.toolTipText=Java does not always correctly read the operating system's timezone
 
 labelRemoveCompleted.text=Remove completed downloads
 
Index: src/cz/vity/freerapid/gui/managers/StatusBarManager.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/cz/vity/freerapid/gui/managers/StatusBarManager.java	(revision 3771)
+++ src/cz/vity/freerapid/gui/managers/StatusBarManager.java	(revision )
@@ -100,6 +100,13 @@
                     AppPrefs.negateProperty(UserProp.CLIPBOARD_MONITORING, UserProp.CLIPBOARD_MONITORING_DEFAULT);
                 }
             });
+            JLabel stopAutoQueue = new JLabel();
+            stopAutoQueue.addMouseListener(new MouseAdapter() {
+                @Override
+                public void mouseClicked(MouseEvent e) {
+                    AppPrefs.negateProperty(UserProp.STOP_AUTO_QUEUE, UserProp.STOP_AUTO_QUEUE_DEFAULT);
+                }
+            });
             JLabel quietMode = new JLabel();
             quietMode.addMouseListener(new MouseAdapter() {
                 @Override
@@ -126,6 +133,8 @@
 
             clipboardMonitoring.setName("labelClipboardMonitoring");
             resourceMap.injectComponent(clipboardMonitoring);
+            stopAutoQueue.setName("labelStopAutoQueue");
+            resourceMap.injectComponent(stopAutoQueue);
             quietMode.setName("labelQuietMode");
             resourceMap.injectComponent(quietMode);
 
@@ -139,6 +148,7 @@
             //indicator.setPreferredSize(new Dimension(100, BAR_HEIGHT));
             infoLabel.setPreferredSize(new Dimension(360, BAR_HEIGHT));
             clipboardMonitoring.setPreferredSize(new Dimension(17, BAR_HEIGHT));
+            stopAutoQueue.setPreferredSize(new Dimension(17, BAR_HEIGHT));
             quietMode.setPreferredSize(new Dimension(17, BAR_HEIGHT));
             progress.setPreferredSize(new Dimension(progress.getPreferredSize().width + 35, BAR_HEIGHT));
             progress.setVisible(false);
@@ -151,9 +161,11 @@
             initSpeedBar(speedBarPanel, resourceMap);
 
             PropertyConnector.connectAndUpdate(BindUtils.getPrefsValueModel(UserProp.CLIPBOARD_MONITORING, UserProp.CLIPBOARD_MONITORING_DEFAULT), clipboardMonitoring, "enabled");
+            PropertyConnector.connectAndUpdate(BindUtils.getPrefsValueModel(UserProp.STOP_AUTO_QUEUE, UserProp.STOP_AUTO_QUEUE_DEFAULT), stopAutoQueue, "enabled");
             PropertyConnector.connectAndUpdate(BindUtils.getPrefsValueModel(UserProp.QUIET_MODE_ENABLED, UserProp.QUIET_MODE_ENABLED_DEFAULT), quietMode, "enabled");
 
             statusbar.add(clipboardMonitoring, JXStatusBar.Constraint.ResizeBehavior.FIXED);
+            statusbar.add(stopAutoQueue, JXStatusBar.Constraint.ResizeBehavior.FIXED);
             statusbar.add(quietMode, JXStatusBar.Constraint.ResizeBehavior.FIXED);
             statusbar.add(speedBarPanel, JXStatusBar.Constraint.ResizeBehavior.FIXED);
             statusbar.add(progress, JXStatusBar.Constraint.ResizeBehavior.FIXED);
