Changeset 1685
- Timestamp:
- Mar 10, 2013, 5:51:30 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/comp.c
r1684 r1685 173 173 HDIR hdir = HDIR_CREATE; 174 174 ULONG ulFindCnt; 175 CHAR szDate[DATE_BUF_BYTES];175 //CHAR szDate[DATE_BUF_BYTES]; 176 176 177 177 // 13 Aug 07 SHL fixme to use FileToGet … … 194 194 strcpy(enddir, pffb->achName); 195 195 if (!(pffb->attrFile & FILE_DIRECTORY)) { 196 FDateFormat(szDate, pffb->fdateLastWrite);196 //FDateFormat(szDate, pffb->fdateLastWrite); 197 197 fprintf(fp, 198 "\"%s\",%u,%llu,%s,%02u%s%02u%s%02u,%lu,%lu,N\n",198 "\"%s\",%u,%llu,%lu/%lu/%lu,%02u:%02u:%02u,%lu,%lu,N\n", 199 199 mask, 200 200 enddir - mask, 201 pffb->cbFile, 202 szDate, 201 pffb->cbFile, 202 pffb->fdateLastWrite.year + 1980, 203 pffb->fdateLastWrite.month, 204 pffb->fdateLastWrite.day, 203 205 pffb->ftimeLastWrite.hours, 204 TimeSeparator,205 206 pffb->ftimeLastWrite.minutes, 206 TimeSeparator,207 207 pffb->ftimeLastWrite.twosecs, 208 208 pffb->attrFile, … … 495 495 } 496 496 497 #define NUM_BUT 4498 497 /** 499 498 * Action Thread … … 593 592 case IDM_DELETE: 594 593 595 if (fConfirmAction && !dontask) { 596 ULONG i; 597 CHAR s[CCHMAXPATH + 20]; 598 MB2INFO *pmbInfo; 599 MB2D mb2dBut[NUM_BUT] = //fixme to use GetPString 600 { 601 { "Yes", 1, 0}, 602 { "Yes don't ask again", 2, 1}, 603 { "No", 3, 2}, 604 { "Cancel delete operation", 4, 3} 605 }; 606 ULONG ulInfoSize = (sizeof(MB2INFO) + (sizeof(MB2D) * (NUM_BUT-1))); 607 pmbInfo = malloc (ulInfoSize); 608 if (pmbInfo) { 609 pmbInfo->cb = ulInfoSize; 610 pmbInfo->hIcon = 0; 611 pmbInfo->cButtons = NUM_BUT; 612 pmbInfo->flStyle = MB_MOVEABLE; 613 pmbInfo->hwndNotify = NULLHANDLE; 614 for (i = 0; i < NUM_BUT; i++) { 615 memcpy( pmbInfo->mb2d+i , mb2dBut+i , sizeof(MB2D)); 616 } //fixme to use GetPString 617 sprintf(s, "Do you wish to delete %s", pciS->pszFileName); 618 rc = WinMessageBox2(HWND_DESKTOP, cmp->hwnd, 619 s, "Confirm Delete", 1234, 620 pmbInfo); 621 free(pmbInfo); 622 if (rc == 2 || rc == 3) { 623 if (rc == 3) 624 enddelete = TRUE; 625 break; 626 } 627 else if (rc == 1) 628 dontask = TRUE; 629 } 630 } 594 if (fConfirmAction && !dontask) { 595 rc = saymsg2(NULL, 0, cmp->hwnd, GetPString(IDS_CONFIRMDELETE), GetPString(IDS_DOYOUWISHTODELETE), 596 pciS->pszFileName); 597 if (rc == 3 || rc == 4) { 598 if (rc == 4) 599 enddelete = TRUE; 600 break; 601 } 602 else if (rc == 2) 603 dontask = TRUE; 604 } 631 605 if (!unlinkf(pciS->pszFileName)) { 632 606 WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciS), … … 650 624 pciS->flags = 0; // Just on one side 651 625 WinSendMsg(hwndCnrS, CM_INVALIDATERECORD, MPFROMP(&pciS), 652 653 654 655 656 657 658 626 MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED)); 627 pciD->flags = 0; // Just on one side 628 if (pciD->pszSubject != NullStr) { 629 xfree(pciD->pszSubject, pszSrcFile, __LINE__); 630 pciD->pszSubject = NullStr; 631 } 632 } 659 633 if (hwndCnrS == WinWindowFromID(cmp->hwnd, COMP_LEFTDIR)) 660 634 cmp->cmp->totalleft--; … … 1701 1675 CHAR str[CCHMAXPATH * 2], *p; 1702 1676 CHAR *moder = "r"; 1677 BOOL fFixedSnap = TRUE; 1703 1678 1704 1679 memset(&fb4, 0, sizeof(fb4)); … … 1767 1742 p = strchr(p, ','); 1768 1743 if (p) { 1769 p++; 1770 fb4.cbFile = atoll(p); 1771 p = strchr(p, ','); 1772 if (p) { 1773 p++; 1774 if (ulDateFmt == 2 || ulDateFmt == 3) 1775 fb4.fdateLastWrite.year = atol(p) - 1980; 1776 else if (ulDateFmt == 1) 1777 fb4.fdateLastWrite.day = atol(p); 1778 else 1779 fb4.fdateLastWrite.month = atol(p); 1780 p = strchr(p, DateSeparator[0]); 1781 if (p) { 1782 p++; 1783 if (ulDateFmt == 2 || ulDateFmt == 3) 1784 fb4.fdateLastWrite.month = atol(p); 1785 else 1786 fb4.fdateLastWrite.day = atol(p); 1787 p = strchr(p, DateSeparator[0]); 1788 if (p) { 1789 p++; 1790 if (ulDateFmt == 2) 1791 fb4.fdateLastWrite.day = atol(p); 1792 else if (ulDateFmt == 3) 1793 fb4.fdateLastWrite.month = atol(p); 1794 else 1795 fb4.fdateLastWrite.year = atol(p) - 1980; 1744 p++; 1745 //DbgMsg(pszSrcFile, __LINE__, "DS %ul comma %ul", strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0]), strchr(p, ',')); 1746 if (((strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0])) - strchr(p, ',')) > 5) { 1747 CHAR szTemp[30]; 1748 CHAR *q; 1749 int i; 1750 1751 memset(szTemp, 0, sizeof(szTemp)); 1752 i = (strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0])) - 3 - p; 1753 strncpy(&szTemp, p, i); 1754 for (q = szTemp; q = strchr(szTemp, ',');) { 1755 strcpy(q, q + 1); 1756 } 1757 fb4.cbFile = atoll(szTemp); 1758 fFixedSnap = FALSE; 1759 1760 } 1761 else 1762 fb4.cbFile = atoll(p); 1763 if (!strchr(p, '/')) 1764 fFixedSnap = FALSE; 1765 p = (strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0])) - 6; 1766 p = strchr(p, ','); 1767 if (p) { 1768 p++; 1769 if (ulDateFmt == 2 || ulDateFmt == 3 || fFixedSnap) 1770 fb4.fdateLastWrite.year = atol(p) - 1980; 1771 else if (ulDateFmt == 1) 1772 fb4.fdateLastWrite.day = atol(p); 1773 else 1774 fb4.fdateLastWrite.month = atol(p); 1775 p = strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0]); 1776 if (p) { 1777 p++; 1778 if (ulDateFmt == 2 || ulDateFmt == 1 || fFixedSnap) 1779 fb4.fdateLastWrite.month = atol(p); 1780 else 1781 fb4.fdateLastWrite.day = atol(p); 1782 p = strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0]); 1783 if (p) { 1784 p++; 1785 if (ulDateFmt == 2 || fFixedSnap) 1786 fb4.fdateLastWrite.day = atol(p); 1787 else if (ulDateFmt == 3) 1788 fb4.fdateLastWrite.month = atol(p); 1789 else 1790 fb4.fdateLastWrite.year = atol(p) - 1980; 1796 1791 p = strchr(p, ','); 1797 1792 if (p) { 1798 1793 p++; 1799 1794 fb4.ftimeLastWrite.hours = atol(p); 1800 p =strchr(p, TimeSeparator[0]);1801 1795 p = strchr(p, ':') ? strchr(p, ':') : strchr(p, TimeSeparator[0]); 1796 if (p) { 1802 1797 p++; 1803 1798 fb4.ftimeLastWrite.minutes = atol(p); 1804 p =strchr(p, TimeSeparator[0]);1799 p = strchr(p, ':') ? strchr(p, ':') : strchr(p, TimeSeparator[0]); 1805 1800 if (p) { 1806 1801 p++; … … 1839 1834 } // while 1840 1835 } // if have rightdir 1841 fclose(fp); 1842 } 1836 fclose(fp); 1837 if (!filesr) 1838 saymsg(MB_OK | MB_ICONASTERISK, HWND_DESKTOP, 1839 GetPString(IDS_WARNINGTEXT), 1840 GetPString(IDS_SNAPSHOTFILEBADFORMAT)); 1841 } 1842 else 1843 saymsg(MB_OK | MB_ICONASTERISK, HWND_DESKTOP, 1844 GetPString(IDS_WARNINGTEXT), 1845 GetPString(IDS_SNAPSHOTFILELOADFAILED), cmp->rightlist); 1843 1846 } // if snapshot file 1844 1847
Note:
See TracChangeset
for help on using the changeset viewer.