Changeset 1394 for trunk/dll/comp.c
- Timestamp:
- Feb 5, 2009, 5:17:25 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/comp.c
r1391 r1394 7 7 8 8 Copyright (c) 1993-02 M. Kimes 9 Copyright (c) 2003, 200 8Steven H. Levine9 Copyright (c) 2003, 2009 Steven H. Levine 10 10 11 11 16 Oct 02 MK Baseline … … 553 553 break; 554 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 555 case IDM_MOVE: 556 { 557 BOOL fResetVerify = FALSE; 558 559 if (hwndCnrS == WinWindowFromID(cmp->hwnd, COMP_RIGHTDIR)) 560 BldFullPathName(szNewName, cmp->leftdir, pciS->pszDisplayName); 561 else 562 BldFullPathName(szNewName, cmp->rightdir, pciS->pszDisplayName); 563 // Make directory if required 564 strcpy(szDirName, szNewName); 565 p = strrchr(szDirName, '\\'); 566 if (fVerify && (driveflags[toupper(*szNewName) - 'A'] & DRIVE_WRITEVERIFYOFF || 567 driveflags[toupper(*pciS->pszFileName) - 'A'] & DRIVE_WRITEVERIFYOFF)) { 568 DosSetVerify(FALSE); 569 fResetVerify = TRUE; 570 } 571 if (p) { 572 if (p > szDirName + 2) 573 p++; 574 *p = 0; 575 if (IsFile(szDirName) == -1) 576 MassMkdir(hwndMain, szDirName); 577 } 578 rc = docopyf(MOVE, pciS->pszFileName, "%s", szNewName); 579 if (fResetVerify) { 580 DosSetVerify(fVerify); 581 fResetVerify = FALSE; 582 } 583 if (!rc && stricmp(pciS->pszFileName, szNewName)) { 584 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciS), 585 MPFROM2SHORT(FALSE, CRA_SELECTED)); 586 if (pciD->rc.flRecordAttr & CRA_SELECTED) 587 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciD), 588 MPFROM2SHORT(FALSE, CRA_SELECTED)); 589 FreeCnrItemData(pciD); 590 pciD->pszFileName = xstrdup(szNewName, pszSrcFile, __LINE__); 591 if (hwndCnrS == WinWindowFromID(cmp->hwnd, COMP_RIGHTDIR)) { 592 pciD->pszDisplayName = pciD->pszFileName + strlen(cmp->leftdir); 593 if (cmp->leftdir[strlen(cmp->leftdir) - 1] != '\\') 594 pciD->pszDisplayName++; 595 } 596 else { 597 pciD->pszDisplayName = pciD->pszFileName + strlen(cmp->rightdir); 598 if (cmp->rightdir[strlen(cmp->rightdir) - 1] != '\\') 599 pciD->pszDisplayName++; 600 } 601 pciD->pszLongName = pciS->pszLongName; 602 pciS->pszLongName = NullStr; // 07 Sep 08 SHL avoid aliased pointer 603 if (pciD->pszSubject != NullStr) { 604 xfree(pciD->pszSubject, pszSrcFile, __LINE__); 605 pciD->pszSubject = NullStr; 606 } 607 pciD->attrFile = pciS->attrFile; 608 pciD->pszDispAttr = pciS->pszDispAttr; 609 pciD->flags = 0; // Just on one side 610 pciD->date = pciS->date; 611 pciD->time = pciS->time; 612 pciD->ladate = pciS->ladate; 613 pciD->latime = pciS->latime; 614 pciD->crdate = pciS->crdate; 615 pciD->crtime = pciS->crtime; 616 pciD->cbFile = pciS->cbFile; 617 pciD->easize = pciS->easize; 618 619 if (pciS->pszFileName != NullStr) { 620 xfree(pciS->pszFileName, pszSrcFile, __LINE__); 621 pciS->pszFileName = NullStr; 622 pciS->pszDisplayName = pciS->pszFileName; 623 pciS->rc.pszIcon = pciS->pszFileName; 624 } 625 if (pciS->pszSubject != NullStr) { 626 xfree(pciS->pszSubject, pszSrcFile, __LINE__); 627 pciS->pszSubject = NullStr; 628 } 629 pciS->flags = 0; // Just on one side 630 631 WinSendMsg(hwndCnrS, CM_INVALIDATERECORD, MPFROMP(&pciS), 632 MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED)); 633 634 WinSendMsg(hwndCnrD, CM_INVALIDATERECORD, MPFROMP(&pciD), 635 MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED)); 636 637 if (hwndCnrS == WinWindowFromID(cmp->hwnd, COMP_LEFTDIR)) 638 cmp->cmp->totalleft--; 639 else 640 cmp->cmp->totalright--; 641 } 642 else if (rc) { 643 rc = Dos_Error(MB_ENTERCANCEL, 644 rc, 645 HWND_DESKTOP, 646 pszSrcFile, 647 __LINE__, 648 GetPString(IDS_COMPMOVEFAILEDTEXT), 649 pciS->pszFileName, szNewName); 650 if (rc == MBID_CANCEL) // Cause loop to break 651 pciNextS = NULL; 652 } 653 break; 654 } 655 656 case IDM_COPY: 657 { 658 BOOL fResetVerify = FALSE; 659 660 if (hwndCnrS == WinWindowFromID(cmp->hwnd, COMP_RIGHTDIR)) 661 BldFullPathName(szNewName, cmp->leftdir, pciS->pszDisplayName); 662 else 663 BldFullPathName(szNewName, cmp->rightdir, pciS->pszDisplayName); 664 // Make directory if required 665 strcpy(szDirName, szNewName); 666 p = strrchr(szDirName, '\\'); 667 if (fVerify && (driveflags[toupper(*szNewName) - 'A'] & DRIVE_WRITEVERIFYOFF || 668 driveflags[toupper(*pciS->pszFileName) - 'A'] & DRIVE_WRITEVERIFYOFF)) { 669 DosSetVerify(FALSE); 670 fResetVerify = TRUE; 671 } 672 if (p) { 673 if (p > szDirName + 2) 674 p++; 675 *p = 0; 676 if (IsFile(szDirName) == -1) 677 MassMkdir(hwndMain, szDirName); 678 } 679 rc = docopyf(COPY, pciS->pszFileName, "%s", szNewName); 680 if (fResetVerify) { 681 DosSetVerify(fVerify); 682 fResetVerify = FALSE; 683 } 684 if (rc) { 685 rc = Dos_Error(MB_ENTERCANCEL, 686 rc, 687 HWND_DESKTOP, 688 pszSrcFile, 689 __LINE__, 690 GetPString(IDS_COMPCOPYFAILEDTEXT), 691 pciS->pszFileName, szNewName); 692 if (rc == MBID_CANCEL) 693 pciNextS = NULL; // Cause loop to break 694 } 695 else { 696 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciS), 697 MPFROM2SHORT(FALSE, CRA_SELECTED)); 698 if (pciD->rc.flRecordAttr & CRA_SELECTED) 699 WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciD), 700 MPFROM2SHORT(FALSE, CRA_SELECTED)); 701 // 12 Jan 08 SHL 702 if (pciD->pszFileName == NullStr) { 703 if (hwndCnrD == WinWindowFromID(cmp->hwnd, COMP_LEFTDIR)) 704 cmp->totalleft++; 705 else 706 cmp->totalright++; 707 } 708 FreeCnrItemData(pciD); 709 pciD->pszFileName = xstrdup(szNewName, pszSrcFile, __LINE__); 710 if (hwndCnrS == WinWindowFromID(cmp->hwnd, COMP_RIGHTDIR)) { 711 pciD->pszDisplayName = pciD->pszFileName + strlen(cmp->leftdir); 712 if (cmp->leftdir[strlen(cmp->leftdir) - 1] != '\\') 713 pciD->pszDisplayName++; 714 } 715 else { 716 pciD->pszDisplayName = pciD->pszFileName + strlen(cmp->rightdir); 717 if (cmp->rightdir[strlen(cmp->rightdir) - 1] != '\\') 718 pciD->pszDisplayName++; 719 } 720 pciD->attrFile = pciS->attrFile; 721 pciD->pszDispAttr = pciS->pszDispAttr; 722 pciD->flags = CNRITEM_EXISTS; // Now on both sides 723 pciD->date = pciS->date; 724 pciD->time = pciS->time; 725 pciD->ladate = pciS->ladate; 726 pciD->latime = pciS->latime; 727 pciD->crdate = pciS->crdate; 728 pciD->crtime = pciS->crtime; 729 pciD->cbFile = pciS->cbFile; 730 pciD->easize = pciS->easize; 731 732 // Forget status until we regenerate it 733 if (pciS->pszSubject != NullStr) { 734 xfree(pciS->pszSubject, pszSrcFile, __LINE__); 735 pciS->pszSubject = NullStr; 736 } 737 pciS->flags = CNRITEM_EXISTS; // Now on both sides 738 739 WinSendMsg(hwndCnrS, CM_INVALIDATERECORD, MPFROMP(&pciS), 740 MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED)); 741 WinSendMsg(hwndCnrD, CM_INVALIDATERECORD, MPFROMP(&pciD), 742 MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED)); 743 } 744 break; 745 } 746 746 747 747 default: … … 2211 2211 2212 2212 PrfQueryProfileData(fmprof, FM3Str, "CompDir.Position", (PVOID) &swp, &size); 2213 swp.fl &= ~SWP_SIZE; // 04 Feb 09 SHL ignore saved size 2213 2214 WinSetWindowPos(hwnd, 2214 2215 HWND_TOP, … … 2230 2231 }; 2231 2232 UINT x; 2232 2233 2233 for (x = 0; ids[x]; x++) { 2234 //fixme to allow user to change presparams 1-10-09 GKY 2234 2235 SetPresParams(WinWindowFromID(hwnd, ids[x]), 2235 2236 &RGBGREY,
Note:
See TracChangeset
for help on using the changeset viewer.