Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/extract.c
r1223 r1300 15 15 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 16 16 19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory 17 29 Nov 08 GKY Add the option of creating a subdirectory from the arcname 18 for the extract path. 17 19 18 20 ***********************************************************************/ … … 98 100 { 99 101 EXTRDATA *arcdata = NULL; 102 ULONG size = sizeof(BOOL); 103 BOOL fFileNameExtPath; 100 104 101 105 switch (msg) { … … 104 108 arcdata = (EXTRDATA *) mp2; 105 109 { 106 ULONG size = sizeof(BOOL);110 ULONG sizet; 107 111 BOOL fRemember = FALSE; 108 112 BOOL fDirectory = FALSE; 109 113 PFNWP oldproc; 110 114 115 fFileNameExtPath = FALSE; 111 116 oldproc = WinSubclassWindow(WinWindowFromID(hwnd, EXT_DIRECTORY), 112 117 (PFNWP) ExtractTextProc); … … 117 122 (PVOID) & fRemember, &size); 118 123 PrfQueryProfileData(fmprof, FM3Str, "DirectoryExt", 119 (PVOID) & fDirectory, &size); 124 (PVOID) & fDirectory, &size); 125 PrfQueryProfileData(fmprof, FM3Str, "FileNamePathExt", 126 (PVOID) & fFileNameExtPath, &size); 120 127 WinCheckButton(hwnd, EXT_REMEMBER, fRemember); 121 128 WinCheckButton(hwnd, EXT_AWDIRS, fDirectory); 129 WinCheckButton(hwnd, EXT_FILENAMEEXT, fFileNameExtPath); 122 130 WinSendDlgItemMsg(hwnd, EXT_DIRECTORY, EM_SETTEXTLIMIT, 123 131 MPFROM2SHORT(CCHMAXPATH, 0), MPVOID); … … 131 139 WinSetDlgItemText(hwnd, EXT_FILENAME, arcdata->arcname); 132 140 else 133 WinSetDlgItemText(hwnd, EXT_FILENAME, GetPString(IDS_EXTVARIOUSTEXT)); 141 WinSetDlgItemText(hwnd, EXT_FILENAME, GetPString(IDS_EXTVARIOUSTEXT)); 142 143 if (fFileNameExtPath && arcdata->arcname) { 144 145 CHAR FileName[CCHMAXPATH]; 146 PSZ p; 147 148 strcpy(FileName, arcdata->arcname); 149 p = strrchr(FileName, '.'); 150 if (p) 151 *p = 0; 152 else { 153 p = FileName + strlen(arcdata->arcname); 154 p--; 155 *p = 0; 156 } 157 strcpy(arcdata->extractdir, FileName); 158 WinSetDlgItemText(hwnd, EXT_DIRECTORY, arcdata->extractdir); 159 } 134 160 if (fDirectory) { 135 161 WinSendDlgItemMsg(hwnd, EXT_WDIRS, BM_SETCHECK, … … 147 173 CHAR textdir[CCHMAXPATH]; 148 174 149 size = sizeof(textdir);175 sizet = sizeof(textdir); 150 176 *textdir = 0; 151 177 PrfQueryProfileData(fmprof, FM3Str, "Ext_ExtractDir", … … 153 179 if (*textdir && !IsFile(textdir)) 154 180 strcpy(arcdata->extractdir, textdir); 155 size = sizeof(textdir);181 sizet = sizeof(textdir); 156 182 *textdir = 0; 157 183 PrfQueryProfileData(fmprof, FM3Str, "Ext_Mask", (PVOID) textdir, … … 198 224 WinEnableWindow(WinWindowFromID(hwnd, EXT_WDIRS), FALSE); 199 225 else if (fRemember) { 200 size = sizeof(BOOL);226 //size = sizeof(BOOL); 201 227 fRemember = FALSE; 202 228 PrfQueryProfileData(fmprof, FM3Str, "Ext_WDirs", 203 (PVOID) & fRemember, &size);229 (PVOID) &fRemember, &size); 204 230 if (fRemember) 205 231 PostMsg(WinWindowFromID(hwnd, EXT_WDIRS), BM_CLICK, MPVOID, MPVOID); … … 227 253 228 254 PrfWriteProfileData(fmprof, FM3Str, "RememberExt", 229 (PVOID) & fRemember, sizeof(BOOL));255 (PVOID) &fRemember, size); 230 256 } 231 257 break; … … 236 262 237 263 PrfWriteProfileData(fmprof, FM3Str, "DirectoryExt", 238 (PVOID) & fDirectory, sizeof(BOOL));264 (PVOID) &fDirectory, size); 239 265 240 266 if (fDirectory) { … … 248 274 WinSetDlgItemText(hwnd, EXT_COMMAND, arcdata->info->extract); 249 275 } 276 } 277 break; 278 279 case EXT_FILENAMEEXT: 280 { 281 BOOL fFileNameExtPath = WinQueryButtonCheckstate(hwnd, EXT_FILENAMEEXT); 282 283 PrfWriteProfileData(fmprof, FM3Str, "FileNamePathExt", 284 (PVOID) &fFileNameExtPath, size); 285 if (fFileNameExtPath && arcdata->arcname) { 286 CHAR FileName[CCHMAXPATH]; 287 PSZ p; 288 289 strcpy(FileName, arcdata->arcname); 290 p = strrchr(FileName, '.'); 291 if (p) 292 *p = 0; 293 else { 294 p = FileName + strlen(arcdata->arcname); 295 p--; 296 *p = 0; 297 } 298 strcpy(arcdata->extractdir, FileName); 299 WinSetDlgItemText(hwnd, EXT_DIRECTORY, arcdata->extractdir); 300 } 301 else { 302 *arcdata->extractdir = 0; 303 if (*extractpath) { 304 if (arcdata->arcname && *arcdata->arcname && 305 !strcmp(extractpath, "*")) { 306 307 CHAR *p; 308 309 strcpy(arcdata->extractdir, arcdata->arcname); 310 p = strrchr(arcdata->extractdir, '\\'); 311 if (p) { 312 if (p < arcdata->extractdir + 3) 313 p++; 314 *p = 0; 315 } 316 } 317 else 318 strcpy(arcdata->extractdir, extractpath); 319 } 320 if (!*arcdata->extractdir) { 321 if (*lastextractpath) 322 strcpy(arcdata->extractdir, lastextractpath); 323 else if (arcdata->arcname && *arcdata->arcname) { 324 325 CHAR *p; 326 327 strcpy(arcdata->extractdir, arcdata->arcname); 328 p = strrchr(arcdata->extractdir, '\\'); 329 if (p) { 330 if (p < arcdata->extractdir + 3) 331 p++; 332 *p = 0; 333 } 334 } 335 if (!*arcdata->extractdir) 336 strcpy(arcdata->extractdir, pFM2SaveDirectory); 337 } 338 WinSetDlgItemText(hwnd, EXT_DIRECTORY, arcdata->extractdir); 339 } 250 340 } 251 341 break; … … 325 415 if (*s) { 326 416 if (!SetDir(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT), 327 QW_OWNER), hwnd, s,0)) {417 QW_OWNER), hwnd, s, fFileNameExtPath ? 1:0)) { 328 418 strcpy(arcdata->extractdir, s); 329 419 WinSetDlgItemText(hwnd, EXT_DIRECTORY, s); … … 340 430 fRemember = WinQueryButtonCheckstate(hwnd, EXT_WDIRS); 341 431 PrfWriteProfileData(fmprof, FM3Str, "Ext_WDirs", 342 (PVOID) & fRemember, sizeof(BOOL));432 (PVOID) &fRemember, size); 343 433 fRemember = TRUE; 344 434 } -
trunk/dll/fm3dlg.h
r1086 r1300 21 21 29 Feb 08 GKY Changes to enable user settable command line length 22 22 20 Jul 08 JBS Ticket 114: Support user-selectable env. strings in Tree container. 23 29 Nov 08 GKY Add the option of creating a subdirectory from the arcname 24 for the extract path. 23 25 24 26 ***********************************************************************/ … … 138 140 #define EXT_REMEMBER 20511 139 141 #define EXT_AWDIRS 20512 142 #define EXT_FILENAMEEXT 20513 140 143 141 144 #define ARCH_FRAME 20600 -
trunk/dll/fm3res.dlg
r1289 r1300 38 38 01 Sep 08 GKY Change User-defined BMP text to better match what it actually does. 39 39 21 Nov 08 JBS Ticket 297: Added use of COPYRIGHT_YEAR in About dialog 40 29 Nov 08 GKY Add the option of creating a subdirectory from the arcname 41 for the extract path to extract dialog. 40 42 41 43 ***********************************************************************/ … … 1264 1266 LTEXT "Command Line:", -1, 4, 74, 72, 8, NOT WS_GROUP 1265 1267 LTEXT "Filename:", -1, 4, 53, 56, 8, NOT WS_GROUP 1266 LTEXT "Extract Directory:", -1, 4, 31, 93, 8, NOT WS_GROUP1268 LTEXT "Extract Directory:", -1, 4, 31, 50, 8, NOT WS_GROUP 1267 1269 ENTRYFIELD "", EXT_MASK, 36, 109, 144, 8, ES_MARGIN | WS_GROUP 1268 1270 AUTORADIOBUTTON "~Normal", EXT_NORMAL, 5, 88, 43, 10, … … 1272 1274 BS_NOPOINTERFOCUS | WS_TABSTOP 1273 1275 // PRESPARAMS PP_FONTNAMESIZE, "8.Helvetica.Bold" 1274 AUTOCHECKBOX "~Always Paths", EXT_AWDIRS, 115, 88, 65, 10, 1275 BS_NOPOINTERFOCUS | WS_TABSTOP 1276 // PRESPARAMS PP_FONTNAMESIZE, "8.Helvetica.Bold" 1276 AUTOCHECKBOX "~Always Paths", EXT_AWDIRS, 115, 88, 65, 10, 1277 BS_NOPOINTERFOCUS | WS_TABSTOP 1278 // PRESPARAMS PP_FONTNAMESIZE, "8.Helvetica.Bold" 1279 AUTOCHECKBOX "~Filename as extract path", EXT_FILENAMEEXT, 55, 31, 85, 10, 1280 BS_NOPOINTERFOCUS 1277 1281 ENTRYFIELD "", EXT_COMMAND, 6, 63, 174, 8, ES_MARGIN | WS_GROUP 1278 1282 PUSHBUTTON "~See", EXT_SEE, 148, 73, 34, 11
Note:
See TracChangeset
for help on using the changeset viewer.
