Changeset 1684
- Timestamp:
- Mar 9, 2013, 9:17:55 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/dll/comp.c ¶
r1683 r1684 87 87 06 Jan 13 GKY Added EA compare option to compare dir Ticket 80 88 88 06 Mar 13 SHL ActionCnrThread: need to strdup pszFmtFileSize to avoid aliased pointers 89 09 Mar 13 SHL SetButtonEnables: correct enable support for newish buttons 89 90 90 91 ***********************************************************************/ … … 480 481 strcpy(mv.target, NewName); 481 482 rc = WinDlgBox(HWND_DESKTOP, 482 483 484 483 hwnd, 484 RenameProc, 485 FM3ModHandle, REN_FRAME, (PVOID) & mv); 485 486 if (!rc) 486 487 return 1; … … 569 570 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 570 571 pciD = WinSendMsg(hwndCnrD, CM_QUERYRECORD, MPVOID, 571 572 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 572 573 fConfirmAction = WinQueryButtonCheckstate(cmp->hwnd, COMP_CONFIRMACTION); 573 574 InitITimer(&itdSleep, 500); // Sleep every 500 mSec … … 598 599 MB2D mb2dBut[NUM_BUT] = //fixme to use GetPString 599 600 { 600 601 602 603 601 { "Yes", 1, 0}, 602 { "Yes don't ask again", 2, 1}, 603 { "No", 3, 2}, 604 { "Cancel delete operation", 4, 3} 604 605 }; 605 606 ULONG ulInfoSize = (sizeof(MB2INFO) + (sizeof(MB2D) * (NUM_BUT-1))); 606 607 pmbInfo = malloc (ulInfoSize); 607 608 if (pmbInfo) { 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 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; 628 629 } 629 630 } … … 687 688 } 688 689 if (fConfirmAction && pciS->flags & CNRITEM_EXISTS && !dontask) { 689 690 691 692 693 690 rc = ConfirmAction(cmp->hwnd, pciS->pszFileName, szNewName); 691 if (rc == 1) 692 break; 693 else if (rc == 2) 694 dontask = TRUE; 694 695 } 695 696 rc = docopyf(MOVE, pciS->pszFileName, szNewName); … … 800 801 } 801 802 if (fConfirmAction && pciS->flags & CNRITEM_EXISTS && !dontask) { 802 803 804 805 806 803 rc = ConfirmAction(cmp->hwnd, pciS->pszFileName, szNewName); 804 if (rc == 1) 805 break; 806 else if (rc == 2) 807 dontask = TRUE; 807 808 } 808 809 rc = docopyf(COPY, pciS->pszFileName, szNewName); … … 854 855 pciD->latime = pciS->latime; 855 856 pciD->crdate = pciS->crdate; 856 857 pciD->crtime = pciS->crtime; 857 858 // 2013-03-06 SHL 858 859 if (pciS->pszFmtFileSize == NullStr) … … 1141 1142 ~pciS->flags & CNRITEM_LARGER && 1142 1143 ~pciS->flags & CNRITEM_NEWER && 1143 1144 1144 ~pciS->flags & CNRITEM_OLDER && 1145 ~pciS->flags & CNRITEM_EASDIFFER; 1145 1146 CompSelectSetSelects(pciS, pciDa[x], matched, matched, wantAnd); 1146 1147 } … … 1157 1158 ~pciS->flags & CNRITEM_SMALLER && 1158 1159 ~pciS->flags & CNRITEM_LARGER && 1159 1160 ~pciS->flags & CNRITEM_EASDIFFER; 1160 1161 CompSelectSetSelects(pciS, pciDa[x], matched, matched, wantAnd); 1161 1162 } … … 1333 1334 pciD = pciDa[x]; 1334 1335 CompSelectSetSelects(pciS, 1335 1336 1337 1338 1336 pciD, 1337 pciS->flags & CNRITEM_EASDIFFER, 1338 pciD->flags & CNRITEM_EASDIFFER, 1339 wantAnd); 1339 1340 } 1340 1341 SleepIfNeeded(&itdSleep, 0); … … 1692 1693 strupr(cmp->rightdir); 1693 1694 FillDirList(cmp->rightdir, lenr, cmp->includesubdirs, 1694 1695 &filesr, &cmp->cmp->totalright, &numallocr); 1695 1696 } 1696 1697 else { … … 1749 1750 while (!feof(fp)) { 1750 1751 if (!xfgets_bstripcr 1751 1752 1752 (str, sizeof(str), fp, pszSrcFile, __LINE__)) { 1753 break; 1753 1754 } 1754 1755 p = str; … … 1757 1758 if (*p && *p != '\"') { 1758 1759 p = strchr(p, '\"'); 1759 1760 if (p) { 1760 1761 *p = 0; 1761 1762 p++; 1762 1763 if (*p == ',') { 1763 1764 p++; 1764 1765 if (!cmp->includesubdirs && atol(p) > lenr) 1765 1766 continue; 1766 1767 p = strchr(p, ','); 1767 1768 if (p) { 1768 1769 p++; 1769 1770 fb4.cbFile = atoll(p); 1770 1771 p = strchr(p, ','); 1771 1772 1773 1774 1775 1776 1777 1778 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); 1779 1780 p = strchr(p, DateSeparator[0]); 1780 1781 1782 1783 1784 1785 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); 1786 1787 p = strchr(p, DateSeparator[0]); 1787 1788 1789 1790 1791 1792 1793 1794 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; 1795 1796 p = strchr(p, ','); 1796 1797 if (p) { 1797 1798 p++; 1798 1799 fb4.ftimeLastWrite.hours = atol(p); 1799 1800 1800 p = strchr(p, TimeSeparator[0]); 1801 if (p) { 1801 1802 p++; 1802 1803 fb4.ftimeLastWrite.minutes = atol(p); 1803 1804 p = strchr(p, TimeSeparator[0]); 1804 1805 if (p) { 1805 1806 p++; 1806 1807 fb4.ftimeLastWrite.twosecs = atol(p); 1807 1808 p = strchr(p, ','); 1808 1809 if (p) { 1809 1810 p++; 1810 1811 fb4.attrFile = atol(p); 1811 1812 p = strchr(p, ','); 1812 1813 if (p) { 1813 1814 p++; 1814 1815 fb4.cbList = atol(p) * 2; … … 1816 1817 strupr(str + 1); 1817 1818 else if (fForceLower) 1818 1819 strlwr(str + 1); 1819 1820 if (AddToFileList((str + 1) + lenr, 1820 1821 &fb4, … … 2307 2308 WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTONE), fEnable); 2308 2309 WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTNEWER), fEnable); 2310 WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTEAS), fEnable); // 2013-03-09 SHL 2309 2311 WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTOLDER), fEnable); 2310 2312 WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTBIGGER), fEnable); … … 2313 2315 WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTONE), fEnable); 2314 2316 WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTNEWER), fEnable); 2317 WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTEAS), fEnable); // 2013-03-09 SHL 2315 2318 WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTOLDER), fEnable); 2316 2319 WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTBIGGER), fEnable); … … 2333 2336 WinEnableWindow(WinWindowFromID(hwnd, COMP_INCLUDESUBDIRS), fEnable); 2334 2337 WinEnableWindow(WinWindowFromID(hwnd, COMP_HIDENOTSELECTED), fEnable); 2338 WinEnableWindow(WinWindowFromID(hwnd, COMP_CONFIRMACTION), fEnable); // 2013-03-09 SHL 2335 2339 } 2336 2340 … … 2390 2394 { 2391 2395 USHORT ids[] = {COMP_FRAME, COMP_LEFTDIR, COMP_RIGHTDIR, COMP_COLLECT, 2392 2393 2394 2395 2396 2397 2396 COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT, 2397 COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU, 2398 COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT, 2399 COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT, 2400 COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR, 2401 COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0}; 2398 2402 UINT x; 2399 2403 CHAR s[24]; … … 2859 2863 CA_DETAILSVIEWTITLES | CA_OWNERDRAW; 2860 2864 WinSendDlgItemMsg(hwnd, COMP_LEFTDIR, CM_SETCNRINFO, MPFROMP(&cnri), 2861 2865 MPFROMLONG(CMA_CNRTITLE | CMA_FLWINDOWATTR)); 2862 2866 WinSetDlgItemText(hwnd, COMP_LISTLOADED, ""); 2863 2867 cnri.pszCnrTitle = cmp->rightdir; … … 3247 3251 strcpy(fullname, PCSZ_STARDOTPMD); 3248 3252 if (insert_filename(HWND_DESKTOP, fullname, TRUE, FALSE) && 3249 3253 *fullname && !strchr(fullname, '*') && !strchr(fullname, '?')) 3250 3254 strcpy(cmp->rightlist, fullname); 3251 3255 } … … 3315 3319 ULONG size = sizeof(SWP); 3316 3320 USHORT ids[] = {COMP_FRAME, COMP_LEFTDIR, COMP_RIGHTDIR, COMP_COLLECT, 3317 3318 3319 3320 3321 3322 3321 COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT, 3322 COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU, 3323 COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT, 3324 COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT, 3325 COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR, 3326 COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0}; 3323 3327 UINT x; 3324 3328 CHAR s[24]; 3325 3329 WinQueryWindowPos(hwnd, &swp); 3326 3330 PrfWriteProfileData(fmprof, FM3Str, "CompDir.Position", (PVOID) &swp, 3327 3331 size); 3328 3332 for (x = 0; ids[x]; x++) { 3329 3333 sprintf(s, "CompDir%i", ids[x]);
Note:
See TracChangeset
for help on using the changeset viewer.