| |
445 |
445 |
{ |
| |
446 |
446 |
|
| |
447 |
447 |
m_tasks.ResumeWaitingTasks((size_t)GetPropValue<PP_CMLIMITMAXOPERATIONS>(GetConfig())); |
| |
448 |
448 |
break; |
| |
449 |
449 |
} |
| |
450 |
450 |
} |
| |
451 |
451 |
|
| |
452 |
452 |
CWnd::OnTimer(nIDEvent); |
| |
453 |
453 |
} |
| |
454 |
454 |
|
| |
455 |
455 |
void CMainWnd::OnPopupShowOptions() |
| |
456 |
456 |
{ |
| |
457 |
457 |
COptionsDlg *pDlg=new COptionsDlg(this); |
| |
458 |
458 |
pDlg->m_bAutoDelete=true; |
| |
459 |
459 |
pDlg->m_bLockInstance=true; |
| |
460 |
460 |
pDlg->Create(); |
| |
461 |
461 |
} |
| |
462 |
462 |
|
| |
463 |
463 |
BOOL CMainWnd::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct) |
| |
464 |
464 |
{ |
| |
|
465 |
if(!pCopyDataStruct) |
| |
|
466 |
return CWnd::OnCopyData(pWnd, pCopyDataStruct); |
| |
|
467 |
|
| |
|
468 |
switch(pCopyDataStruct->dwData) |
| |
|
469 |
{ |
| |
|
470 |
case eCDType_TaskDefinitionContentSpecial: |
| |
|
471 |
case eCDType_TaskDefinitionContent: |
| |
|
472 |
{ |
| |
465 |
473 |
|
| |
466 |
474 |
wchar_t* pszBuffer = static_cast<wchar_t*>(pCopyDataStruct->lpData); |
| |
467 |
475 |
unsigned long ulLen = pCopyDataStruct->cbData / sizeof(wchar_t); |
| |
468 |
476 |
|
| |
469 |
477 |
|
| |
470 |
478 |
if(!pszBuffer || ulLen == 0 || pszBuffer[ulLen - 1] != L'\0') |
| |
471 |
479 |
return FALSE; |
| |
472 |
480 |
|
| |
473 |
481 |
chcore::TWStringData wstrData(pszBuffer); |
| |
474 |
482 |
|
| |
475 |
483 |
|
| |
476 |
484 |
chcore::TTaskDefinition tTaskDefinition; |
| |
477 |
485 |
tTaskDefinition.LoadFromString(wstrData); |
| |
478 |
486 |
|
| |
479 |
487 |
|
| |
480 |
488 |
chcore::TConfig& rConfig = GetConfig(); |
| |
481 |
489 |
rConfig.ExtractSubConfig(BRANCH_TASK_SETTINGS, tTaskDefinition.GetConfiguration()); |
| |
482 |
490 |
|
| |
483 |
491 |
|
| |
484 |
|
switch(pCopyDataStruct->dwData & CSharedConfigStruct::OPERATION_MASK) |
| |
|
492 |
if(pCopyDataStruct->dwData == eCDType_TaskDefinitionContentSpecial) |
| |
485 |
493 |
{ |
| |
486 |
|
case CSharedConfigStruct::DD_COPYMOVESPECIAL_FLAG: |
| |
487 |
|
case CSharedConfigStruct::EC_PASTESPECIAL_FLAG: |
| |
488 |
|
case CSharedConfigStruct::EC_COPYMOVETOSPECIAL_FLAG: |
| |
489 |
494 |
CCustomCopyDlg dlg(tTaskDefinition); |
| |
490 |
495 |
|
| |
491 |
496 |
GetPropValue<PP_RECENTPATHS>(rConfig, dlg.m_vRecent); |
| |
492 |
497 |
|
| |
493 |
498 |
INT_PTR iModalResult; |
| |
494 |
499 |
if((iModalResult = dlg.DoModal()) == IDCANCEL) |
| |
495 |
500 |
return CWnd::OnCopyData(pWnd, pCopyDataStruct); |
| |
496 |
501 |
else if(iModalResult == -1) |
| |
497 |
502 |
return TRUE; |
| |
498 |
503 |
|
| |
499 |
504 |
dlg.m_vRecent.push_back(dlg.m_tTaskDefinition.GetDestinationPath().ToString()); |
| |
500 |
505 |
|
| |
501 |
506 |
SetPropValue<PP_RECENTPATHS>(rConfig, dlg.m_vRecent); |
| |
502 |
507 |
|
| |
503 |
508 |
tTaskDefinition = dlg.m_tTaskDefinition; |
| |
504 |
509 |
} |
| |
505 |
510 |
|
| |
506 |
511 |
|
| |
507 |
512 |
SetTaskPropValue<eTO_AlternateFilenameFormatString_First>(tTaskDefinition.GetConfiguration(), GetResManager().LoadString(IDS_FIRSTCOPY_STRING)); |
| |
508 |
513 |
SetTaskPropValue<eTO_AlternateFilenameFormatString_AfterFirst>(tTaskDefinition.GetConfiguration(), GetResManager().LoadString(IDS_NEXTCOPY_STRING)); |
| |
509 |
514 |
|
| |
510 |
515 |
|
| |
511 |
516 |
CTaskPtr spTask = m_tasks.CreateTask(tTaskDefinition); |
| |
512 |
517 |
|
| |
513 |
518 |
|
| |
514 |
519 |
spTask->BeginProcessing(); |
| |
|
520 |
} |
| |
|
521 |
} |
| |
515 |
522 |
|
| |
516 |
523 |
return CWnd::OnCopyData(pWnd, pCopyDataStruct); |
| |
517 |
524 |
} |
| |
518 |
525 |
|
| |
519 |
526 |
void CMainWnd::OnShowMiniView() |
| |
520 |
527 |
{ |
| |
521 |
528 |
m_pdlgMiniView=new CMiniViewDlg(&m_tasks, &CStatusDlg::m_bLock, this); |
| |
522 |
529 |
m_pdlgMiniView->m_bAutoDelete=true; |
| |
523 |
530 |
m_pdlgMiniView->m_bLockInstance=true; |
| |
524 |
531 |
m_pdlgMiniView->Create(); |
| |
525 |
532 |
} |
| |
526 |
533 |
|
| |
527 |
534 |
void CMainWnd::OnPopupCustomCopy() |
| |
528 |
535 |
{ |
| |
529 |
536 |
chcore::TConfig& rConfig = GetConfig(); |
| |
530 |
537 |
|
| |
531 |
538 |
CCustomCopyDlg dlg; |
| |
532 |
539 |
|
| |
533 |
540 |
GetPropValue<PP_RECENTPATHS>(rConfig, dlg.m_vRecent); |
| |
534 |
541 |
|