Ticket #8011: queue-scheduler.patch
File queue-scheduler.patch, 9.4 KB (added by , 13 years ago) |
---|
-
src/interface/settings/settingsdialog.cpp
23 23 #include "optionspage_edit_associations.h" 24 24 #include "optionspage_proxy.h" 25 25 #include "optionspage_filelists.h" 26 #include "optionspage_queue.h" 26 27 #include "../filezillaapp.h" 27 28 #include "../Mainfrm.h" 28 29 … … 51 52 page_updatecheck, 52 53 #endif 53 54 page_logging, 54 page_debug 55 page_debug, 56 page_queue 55 57 }; 56 58 57 59 // Helper macro to add pages in the most simplistic way … … 139 141 #endif //FZ_MANUALUPDATECHECK && FZ_AUTOUPDATECHECK 140 142 ADD_PAGE(_("Logging"), COptionsPageLogging, page_none); 141 143 ADD_PAGE(_("Debug"), COptionsPageDebug, page_none); 144 ADD_PAGE(_("Queue"), COptionsPageQueue, page_none); 142 145 143 146 treeCtrl->SetQuickBestSize(false); 144 147 treeCtrl->InvalidateBestSize(); -
src/interface/Mainfrm.cpp
283 283 m_pActivityLed[1] = 0; 284 284 } 285 285 286 // Start a 60 second timer for the queue scheduler 287 m_queueScheduleTimer.SetOwner(this); 288 m_queueScheduleTimerId = m_queueScheduleTimer.GetId(); 289 m_queueScheduleTimer.Start(6000); // trip timer every 60sec 290 286 291 m_transferStatusTimer.SetOwner(this); 287 292 m_closeEventTimer.SetOwner(this); 288 293 … … 1267 1272 1268 1273 m_transferStatusTimer.Stop(); 1269 1274 1275 m_queueScheduleTimer.Stop(); 1276 1270 1277 if (!m_pQueueView->Quit()) 1271 1278 { 1272 1279 event.Veto(); … … 1370 1377 evt.SetCanVeto(false); 1371 1378 AddPendingEvent(evt); 1372 1379 } 1380 1381 // Every 6 seconds or so we get the time and see if it equals our start or end time 1382 // for the Process Queue start or end schedule 1383 if (event.GetId() == m_queueScheduleTimer.GetId()) 1384 { 1385 // Is process queue scheduling turned on? 1386 if (COptions::Get()->GetOptionVal(OPTION_PROCESS_QUEUE_SCHEDULING) != 0) 1387 { 1388 wxDateTime now = wxDateTime::Now(); 1389 // Compare it against the start time and process the queue if necessary 1390 if (now.GetHour() == COptions::Get()->GetOptionVal(OPTION_PROCESS_QUEUE_START_HOUR) && 1391 now.GetMinute() == COptions::Get()->GetOptionVal(OPTION_PROCESS_QUEUE_START_MINUTE)) 1392 { 1393 if (m_pQueueView) 1394 m_pQueueView->SetActive(1); 1395 } 1396 // Compare it against the end time and stop process the queue if necessary 1397 if (now.GetHour() == COptions::Get()->GetOptionVal(OPTION_PROCESS_QUEUE_END_HOUR) && 1398 now.GetMinute() == COptions::Get()->GetOptionVal(OPTION_PROCESS_QUEUE_END_MINUTE)) 1399 { 1400 if (m_pQueueView) 1401 m_pQueueView->SetActive(0); 1402 } 1403 } 1404 } 1373 1405 } 1374 1406 1375 1407 void CMainFrame::OpenSiteManager(const CServer* pServer /*=0*/) … … 2682 2714 Show(); 2683 2715 OpenSiteManager(); 2684 2716 } 2717 2718 // See if there is anything in the queue to process, and if process queue on startup is set 2719 if (COptions::Get()->GetOptionVal(OPTION_PROCESS_QUEUE_ON_STARTUP) != 0) 2720 { 2721 // Set the queue to process 2722 if (m_pQueueView) 2723 m_pQueueView->SetActive(1); 2724 } 2685 2725 } 2686 2726 2687 2727 void CMainFrame::OnMenuNewTab(wxCommandEvent& event) -
src/interface/Options.h
83 83 OPTION_STRIP_VMS_REVISION, 84 84 OPTION_INTERFACE_SITEMANAGER_ON_STARTUP, 85 85 86 // Process Queue options 87 OPTION_PROCESS_QUEUE_ON_STARTUP, 88 OPTION_PROCESS_QUEUE_SCHEDULING, 89 OPTION_PROCESS_QUEUE_START_HOUR, 90 OPTION_PROCESS_QUEUE_START_MINUTE, 91 OPTION_PROCESS_QUEUE_END_HOUR, 92 OPTION_PROCESS_QUEUE_END_MINUTE, 93 86 94 // Default/internal options 87 95 OPTION_DEFAULT_SETTINGSDIR, 88 96 OPTION_DEFAULT_KIOSKMODE, -
src/interface/Makefile.am
72 72 settings/optionspage_connection_sftp.cpp \ 73 73 settings/optionspage_dateformatting.cpp \ 74 74 settings/optionspage_debug.cpp \ 75 settings/optionspage_queue.cpp \ 75 76 settings/optionspage_edit.cpp \ 76 77 settings/optionspage_edit_associations.cpp \ 77 78 settings/optionspage_fileexists.cpp \ … … 184 185 settings/optionspage_connection_sftp.h \ 185 186 settings/optionspage_dateformatting.h \ 186 187 settings/optionspage_debug.h \ 188 settings/optionspage_queue.h \ 187 189 settings/optionspage_edit.h \ 188 190 settings/optionspage_edit_associations.h \ 189 191 settings/optionspage_fileexists.h \ -
src/interface/resources/settings.xrc
2214 2214 </object> 2215 2215 </object> 2216 2216 </object> 2217 <object class="wxPanel" name="ID_SETTINGS_QUEUE"> 2218 <object class="wxBoxSizer"> 2219 <orient>wxVERTICAL</orient> 2220 <object class="sizeritem"> 2221 <object class="wxStaticBoxSizer"> 2222 <label>Queue settings</label> 2223 <orient>wxVERTICAL</orient> 2224 <object class="sizeritem"> 2225 <object class="wxBoxSizer"> 2226 <orient>wxVERTICAL</orient> 2227 <object class="sizeritem"> 2228 <object class="wxCheckBox" name="ID_PROCESS_QUEUE_ON_STARTUP"> 2229 <label>&Process Queue on Startup</label> 2230 </object> 2231 </object> 2232 </object> 2233 </object> 2234 <object class="sizeritem"> 2235 <object class="wxBoxSizer"> 2236 <orient>wxVERTICAL</orient> 2237 <object class="sizeritem"> 2238 <object class="wxCheckBox" name="ID_PROCESS_QUEUE_SCHEDULING"> 2239 <label>Enable &Scheduled Queue Processing</label> 2240 </object> 2241 </object> 2242 </object> 2243 </object> 2244 <object class="sizeritem"> 2245 <object class="wxBoxSizer"> 2246 <object class="sizeritem"> 2247 <object class="wxStaticText"> 2248 <label>Start Processing Queue at:</label> 2249 </object> 2250 <flag>wxALIGN_CENTRE_VERTICAL</flag> 2251 </object> 2252 <object class="sizeritem"> 2253 <object class="wxTextCtrl" name="ID_QUEUE_START_HOUR"> 2254 <size>30,-1</size> 2255 </object> 2256 <flag>wxALIGN_CENTRE_VERTICAL|wxGROW</flag> 2257 </object> 2258 <object class="sizeritem"> 2259 <object class="wxStaticText"> 2260 <label>:</label> 2261 </object> 2262 <flag>wxALIGN_CENTRE_VERTICAL</flag> 2263 </object> 2264 <object class="sizeritem"> 2265 <object class="wxTextCtrl" name="ID_QUEUE_START_MINUTE"> 2266 <size>30,-1</size> 2267 </object> 2268 <flag>wxALIGN_CENTRE_VERTICAL|wxGROW</flag> 2269 </object> 2270 </object> 2271 <flag>wxGROW</flag> 2272 </object> 2273 <object class="sizeritem"> 2274 <object class="wxBoxSizer"> 2275 <object class="sizeritem"> 2276 <object class="wxStaticText"> 2277 <label>End Processing Queue at:</label> 2278 </object> 2279 <flag>wxALIGN_CENTRE_VERTICAL</flag> 2280 </object> 2281 <object class="sizeritem"> 2282 <object class="wxTextCtrl" name="ID_QUEUE_END_HOUR"> 2283 <size>30,-1</size> 2284 </object> 2285 <flag>wxALIGN_CENTRE_VERTICAL|wxGROW</flag> 2286 </object> 2287 <object class="sizeritem"> 2288 <object class="wxStaticText"> 2289 <label>:</label> 2290 </object> 2291 <flag>wxALIGN_CENTRE_VERTICAL</flag> 2292 </object> 2293 <object class="sizeritem"> 2294 <object class="wxTextCtrl" name="ID_QUEUE_END_MINUTE"> 2295 <size>30,-1</size> 2296 </object> 2297 <flag>wxALIGN_CENTRE_VERTICAL|wxGROW</flag> 2298 </object> 2299 </object> 2300 <flag>wxGROW</flag> 2301 </object> 2302 </object> 2303 </object> 2304 </object> 2305 </object> 2217 2306 </resource> 2307 No newline at end of file -
src/interface/Options.cpp
178 178 { "Strip VMS revisions", number, _T("0"), normal }, 179 179 { "Show Site Manager on startup", number, _T("0"), normal }, 180 180 181 // Queue Processing features 182 { "Process Queue on startup", number, _T("0"), normal }, 183 { "Enable Queue Scheduling", number, _T("0"), normal }, 184 { "Process Queue start hour", number, _T("0"), normal }, 185 { "Process Queue start minute", number, _T("0"), normal }, 186 { "Process Queue end hour", number, _T("0"), normal }, 187 { "Process Queue end minute", number, _T("0"), normal }, 188 181 189 // Default/internal options 182 190 { "Config Location", string, _T(""), default_only }, 183 191 { "Kiosk mode", number, _T("0"), default_priority }, -
src/interface/Mainfrm.h
88 88 CQueueView* m_pQueueView; 89 89 CLed* m_pActivityLed[2]; 90 90 wxTimer m_transferStatusTimer; 91 92 wxTimer m_queueScheduleTimer; 93 int m_queueScheduleTimerId; 94 91 95 CThemeProvider* m_pThemeProvider; 92 96 #if FZ_MANUALUPDATECHECK && FZ_AUTOUPDATECHECK 93 97 CUpdateWizard* m_pUpdateWizard;