Changeset 1402 for trunk/dll/mainwnd.c
- Timestamp:
- Mar 14, 2009, 6:17:59 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/mainwnd.c
r1400 r1402 81 81 07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error 82 82 08 Mar 09 GKY Renamed commafmt.h i18nutil.h 83 08 Mar 09 GKY Additional strings move to PCSZs in init.c83 08 Mar 09 GKY Additional strings move to PCSZs & String Table 84 84 08 Mar 09 GKY Add WriteDetailsSwitches and use LoadDetailsSwitches to replace in line code 85 85 … … 207 207 #pragma data_seg(GLOBAL2) 208 208 HMODULE FM3ModHandle; 209 CHAR *FM3Str;209 PCSZ FM3Str = "FM/3"; 210 210 RGB2 RGBGREY; 211 211 … … 427 427 henum = WinBeginEnumWindows(hwndMain); 428 428 while ((hwndC = WinGetNextWindow(henum)) != NULLHANDLE) { 429 //saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Tree = %lu\rExclude = %lu\rFound = %lu",hwndTree,exclude,hwndC); 430 if (hwndC != exclude && hwndC != hwndTree) { 429 if (hwndC != exclude && hwndC != hwndTree) { 431 430 id = WinQueryWindowUShort(hwndC, QWS_ID); 432 431 if (id) { … … 446 445 UM_CONTAINERDIR, MPFROMP(ret), MPVOID)) { 447 446 MakeValidDir(ret); 448 //saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Tree = %lu\rExclude = %lu\rFound = %lu\r\"%s\"",hwndTree,exclude,hwndC,ret);449 447 WinEndEnumWindows(henum); 450 448 return hwndC; … … 698 696 if (haccelSaved == NULLHANDLE) 699 697 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__, "WinQueryAccelTable"); 700 // else701 // DbgMsg(pszSrcFile, __LINE__, "WinQueryAccelTable SAVED %x", haccelSaved);702 698 } 703 699 if (haccelSaved != NULLHANDLE) { … … 712 708 if (!WinSetAccelTable(hab, haccelDriveList, hwndFrame)) 713 709 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, PCSZ_WINSETACCELTABLE); 714 // else715 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_DRIVELIST %x %x", hwndFrame, haccelDriveList);716 710 } 717 711 break; … … 725 719 if (!WinSetAccelTable(hab, haccelSetupList, hwndFrame)) 726 720 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, PCSZ_WINSETACCELTABLE); 727 // else728 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_SETUPLIST %x %x", hwndFrame, haccelSetupList);729 721 } 730 722 break; … … 738 730 if (!WinSetAccelTable(hab, haccelCmdList, hwndFrame)) 739 731 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, PCSZ_WINSETACCELTABLE); 740 // else741 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_CMDLIST %x %x", hwndFrame, haccelCmdList);742 732 } 743 733 break; … … 751 741 if (!WinSetAccelTable(hab, haccelUserList, hwndFrame)) 752 742 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, PCSZ_WINSETACCELTABLE); 753 // else754 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_USERLIST %x %x", hwndFrame, haccelUserList);755 743 } 756 744 break; … … 764 752 if (!WinSetAccelTable(hab, haccelButtonList, hwndFrame)) 765 753 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, PCSZ_WINSETACCELTABLE); 766 // else767 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable MAIN_BUTTONLIST %x %x", hwndFrame, haccelButtonList);768 754 } 769 755 break; … … 782 768 if (!WinSetAccelTable(hab, haccelSaved, hwndFrame)) 783 769 Win_Error(hwndFrame, HWND_DESKTOP, pszSrcFile, __LINE__, PCSZ_WINSETACCELTABLE); 784 // else785 // DbgMsg(pszSrcFile, __LINE__, "WinSetAccelTable SAVED %x %x", hwndFrame, haccelSaved);786 770 } 787 771 break; … … 865 849 case WM_BEGINDRAG: 866 850 id = WinQueryWindowUShort(hwnd, QWS_ID); 867 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"%u %s %u",id,(id == CBID_EDIT) ? "TRUE" : "FALSE",WinQueryWindowUShort(WinQueryWindow(hwnd,QW_PARENT),QWS_ID) == MAIN_USERLIST);868 851 if (id == CBID_EDIT && 869 852 WinQueryWindowUShort(WinQueryWindow(hwnd, QW_PARENT), QWS_ID) == 870 853 MAIN_USERLIST) { 871 854 … … 875 858 WinQueryWindowText(hwnd, CCHMAXPATH, path); 876 859 bstrip(path); 877 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"Dragging: %s",path);878 860 if (*path && !IsRoot(path)) 879 861 DragOne(hwnd, (HWND) 0, path, FALSE); … … 2097 2079 if (li->type == DID_ERROR) 2098 2080 Win_Error(DND_FRAME, HWND_DESKTOP, pszSrcFile, __LINE__, 2099 "Drag & Drop Dialog");2081 GetPString(IDS_DRAGDROPDIALOGTEXT)); 2100 2082 if (!li->type) { 2101 2083 FreeListInfo(li); … … 2952 2934 } 2953 2935 2954 fIsShutDownState = strcmp(pszStateName, GetPString(IDS_SHUTDOWNSTATE)) == 0;2936 fIsShutDownState = strcmp(pszStateName, PCSZ_SHUTDOWNSTATE) == 0; 2955 2937 sprintf(szPrefix, "%s.", pszStateName); 2956 2938 … … 3131 3113 3132 3114 // If restoring shutdown state bypass no-prescan drives 3133 fIsShutDownState = strcmp(pszStateName, GetPString(IDS_SHUTDOWNSTATE)) == 0;3115 fIsShutDownState = strcmp(pszStateName, PCSZ_SHUTDOWNSTATE) == 0; 3134 3116 // Delete saved state if internally saved state 3135 fDeleteState = strcmp(pszStateName, GetPString(IDS_FM2TEMPTEXT)) == 0;3117 fDeleteState = strcmp(pszStateName, PCSZ_FM2TEMPTEXT) == 0; 3136 3118 3137 3119 //size = (ULONG)0; … … 3223 3205 if (fIsShutDownState && 3224 3206 driveflags[toupper(*szDir) - 'A'] & DRIVE_NOPRESCAN) { 3225 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3207 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3208 sprintf(szKey, "%sDirCnr.%lu", szPrefix, x); 3209 WriteDetailsSwitches(szKey, NULL); 3226 3210 continue; 3227 3211 } 3228 3212 if (fDeleteState) 3229 3213 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); 3230 localdcd.ds.detailslongname = dsDirCnrDefault.detailslongname; // Set default3231 sprintf(szKey, "%sDirCnr.%lu.DetailsLongname", szPrefix, x);3232 size = sizeof(BOOL);3233 if (PrfQueryProfileData(fmprof,3234 FM3Str,3235 szKey,3236 (PVOID) &localdcd.ds.detailslongname,3237 &size))3238 {3239 if (fDeleteState)3240 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);3241 }3242 3243 3214 sprintf(szKey, "%sDirCnr.%lu", szPrefix, x); 3244 3215 LoadDetailsSwitches(szKey, &localdcd.ds); … … 3267 3238 RestorePresParams(hwndPPSave, PCSZ_DIRCNR); 3268 3239 } 3269 sprintf(szKey, "%sDirCnr.%lu", szPrefix, x);3240 //sprintf(szKey, "%sDirCnr.%lu", szPrefix, x); 3270 3241 RestorePresParams(hwndCnr, szKey); 3271 3242 dcd = WinQueryWindowPtr(hwndCnr, QWL_USER); … … 4605 4576 // Complain if attempting to use reserved name 4606 4577 if (stricmp(szStateName, GetPString(IDS_STATETEXT)) == 0 || 4607 stricmp(szStateName, GetPString(IDS_FM2TEMPTEXT)) == 0)4578 stricmp(szStateName, PCSZ_FM2TEMPTEXT) == 0) 4608 4579 { 4609 4580 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 4610 4581 GetPString(IDS_WARNINGTEXT), 4611 "\"%s\" is a reserved state name", szStateName);4582 GetPString(IDS_STATERESERVENAMETEXT), szStateName); 4612 4583 } 4613 4584 // Ignore request if blank 4614 4585 else if (*szStateName) { 4615 4586 BOOL fAbortOperation = FALSE; 4616 if (!fNoSaveState && fSaveState && stricmp(szStateName, GetPString(IDS_SHUTDOWNSTATE)) == 0)4587 if (!fNoSaveState && fSaveState && stricmp(szStateName, PCSZ_SHUTDOWNSTATE) == 0) 4617 4588 { 4618 4589 if (saymsg(MB_YESNO | MB_DEFBUTTON2 | MB_ICONASTERISK, hwnd, … … 4635 4606 saymsg(MB_ENTER | MB_ICONASTERISK, hwnd, 4636 4607 GetPString(IDS_WARNINGTEXT), 4637 "\"%s\" state name add failed", szStateName); // 15 Apr 07 SHL failed4608 GetPString(IDS_STATEADDFAILEDTEXT), szStateName); // 15 Apr 07 SHL failed 4638 4609 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); 4639 4610 } … … 4643 4614 hwnd, 4644 4615 GetPString(IDS_WARNINGTEXT), 4645 "State data save failed");4616 GetPString(IDS_STATEDATASAVEFAILED)); 4646 4617 WinSetWindowText(hwndStatelist, GetPString(IDS_STATETEXT)); 4647 4618 } … … 5732 5703 /* start remaining child windows */ 5733 5704 if (!fNoSaveState && fSaveState) { 5734 PCSZ pszStatename = GetPString(IDS_SHUTDOWNSTATE);5705 PCSZ pszStatename = PCSZ_SHUTDOWNSTATE; 5735 5706 PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(pszStatename), MPVOID); 5736 5707 if (!add_setup(pszStatename)) … … 5887 5858 "MainWindowPos", WinQueryWindow(hwnd, QW_PARENT)); 5888 5859 if (!fNoSaveState && fSaveState) 5889 SaveDirCnrState(hwnd, GetPString(IDS_SHUTDOWNSTATE));5860 SaveDirCnrState(hwnd, PCSZ_SHUTDOWNSTATE); 5890 5861 } 5891 5862 } … … 6344 6315 { 6345 6316 // Try to restore saved shutdown state 6346 char *pszDefaultStateName = xstrdup(GetPString(IDS_SHUTDOWNSTATE), 6347 pszSrcFile, __LINE__); 6317 char *pszDefaultStateName = xstrdup(PCSZ_SHUTDOWNSTATE, pszSrcFile, __LINE__); 6348 6318 if (pszDefaultStateName) { 6349 6319 if (!PostMsg(MainObjectHwnd, UM_RESTORE, MPFROMP(pszDefaultStateName), MPVOID))
Note:
See TracChangeset
for help on using the changeset viewer.