Changeset 909
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/assoc.c
r907 r909 630 630 { 631 631 ASSOC temp; 632 CHAR dummy[34] ;632 CHAR dummy[34], *psz[1002]; 633 633 634 634 replace = FALSE; … … 645 645 memset(&temp, 0, sizeof(ASSOC)); 646 646 WinQueryDlgItemText(hwnd, ASS_MASK, sizeof(temp.mask), temp.mask); 647 WinQueryDlgItemText(hwnd, ASS_CL, sizeof(temp.cl), temp.cl); 647 WinQueryDlgItemText(hwnd, ASS_CL, sizeof(temp.cl), temp.cl); 648 *psz = CheckApp_QuoteAddExe(temp.cl); 649 memcpy(temp.cl, *psz, strlen(*psz) + 1); 648 650 WinQueryDlgItemText(hwnd, ASS_SIG, sizeof(temp.sig), temp.sig); 649 651 rstrip(temp.sig); … … 669 671 temp.flags |= DIEAFTER; 670 672 if (WinQueryButtonCheckstate(hwnd, ASS_PROMPT)) 671 temp.flags |= PROMPT; 673 temp.flags |= PROMPT; 674 if (fCancelAction){ 675 fCancelAction = FALSE; 676 break; 677 } 678 else 672 679 info = add_association(&temp); 673 680 if (!info) … … 719 726 { 720 727 ASSOC temp; 721 CHAR dummy[34] ;728 CHAR dummy[34], *psz[1002]; 722 729 723 730 replace = FALSE; … … 725 732 memset(&temp, 0, sizeof(ASSOC)); 726 733 WinQueryDlgItemText(hwnd, ASS_MASK, sizeof(temp.mask), temp.mask); 727 WinQueryDlgItemText(hwnd, ASS_CL, sizeof(temp.cl), temp.cl); 734 WinQueryDlgItemText(hwnd, ASS_CL, sizeof(temp.cl), temp.cl); 735 *psz = CheckApp_QuoteAddExe(temp.cl); 736 memcpy(temp.cl, *psz, strlen(*psz) + 1); 728 737 WinQueryDlgItemText(hwnd, ASS_SIG, sizeof(temp.sig), temp.sig); 729 738 rstrip(temp.sig); … … 749 758 temp.flags |= DIEAFTER; 750 759 if (WinQueryButtonCheckstate(hwnd, ASS_PROMPT)) 751 temp.flags |= PROMPT; 752 info = add_association(&temp); 760 temp.flags |= PROMPT; 761 if (fCancelAction){ 762 fCancelAction = FALSE; 763 break; 764 } 765 else 766 info = add_association(&temp); 753 767 //Add will fail if mask is not changed 754 768 if (info) { … … 821 835 { 822 836 ASSOC temp; 823 CHAR dummy[34] ;837 CHAR dummy[34], *psz[1002]; 824 838 825 839 replace = TRUE; … … 831 845 memset(&temp, 0, sizeof(ASSOC)); 832 846 WinQueryDlgItemText(hwnd, ASS_MASK, sizeof(temp.mask), temp.mask); 833 WinQueryDlgItemText(hwnd, ASS_CL, sizeof(temp.cl), temp.cl); 847 WinQueryDlgItemText(hwnd, ASS_CL, sizeof(temp.cl), temp.cl); 848 *psz = CheckApp_QuoteAddExe(temp.cl); 849 memcpy(temp.cl, *psz, strlen(*psz) + 1); 834 850 WinQueryDlgItemText(hwnd, ASS_SIG, sizeof(temp.sig), temp.sig); 835 851 rstrip(temp.sig); … … 855 871 temp.flags |= DIEAFTER; 856 872 if (WinQueryButtonCheckstate(hwnd, ASS_PROMPT)) 857 temp.flags |= PROMPT; 858 info = add_association(&temp); 873 temp.flags |= PROMPT; 874 if (fCancelAction){ 875 fCancelAction = FALSE; 876 break; 877 } 878 else 879 info = add_association(&temp); 859 880 //Add will fail if mask is not changed 860 881 if (info) { -
trunk/dll/command.c
r907 r909 568 568 if (insert_filename(hwnd, filename, 2, FALSE) && *filename) { 569 569 BldQuotedFileName(szfilename, filename); 570 strcat(szfilename, " %a");571 570 WinSetDlgItemText(hwnd, CMD_CL, szfilename); 572 571 } … … 620 619 } 621 620 { 622 COMMAND temp; 621 COMMAND temp; 622 char *psz[1002]; 623 APIRET ret; 623 624 624 625 memset(&temp, 0, sizeof(COMMAND)); 625 626 WinQueryDlgItemText(hwnd, CMD_CL, sizeof(temp.cl), temp.cl); 626 bstrip(temp.cl); 627 *psz = CheckApp_QuoteAddExe(temp.cl); 628 memcpy(temp.cl, *psz, strlen(*psz) + 1); 629 if (!strchr(temp.cl, '%')){ 630 ret = saymsg(MB_YESNO, 631 HWND_DESKTOP, 632 NullStr, 633 GetPString(IDS_TOACTONSELECTEDTEXT)); 634 if (ret == MBID_YES) 635 strcat(temp.cl, " %a"); 636 } 627 637 WinQueryDlgItemText(hwnd, CMD_TITLE, sizeof(temp.title), temp.title); 628 638 if (WinQueryButtonCheckstate(hwnd, CMD_DEFAULT)) … … 641 651 temp.flags |= PROMPT; 642 652 if (WinQueryButtonCheckstate(hwnd, CMD_ONCE)) 643 temp.flags |= ONCE; 644 info = add_command(&temp); 645 if (!info) 653 temp.flags |= ONCE; 654 if (fCancelAction){ 655 fCancelAction = FALSE; 656 break; 657 } 658 else 659 info = add_command(&temp); 660 if (!info) 646 661 { 647 662 WinDismissDlg(hwnd, 0); … … 698 713 case CMD_ADD: 699 714 { 700 COMMAND temp; 715 COMMAND temp; 716 CHAR *psz[1002]; 717 APIRET ret; 701 718 702 719 memset(&temp, 0, sizeof(COMMAND)); 703 720 WinQueryDlgItemText(hwnd, CMD_CL, sizeof(temp.cl), temp.cl); 704 bstrip(temp.cl); 721 *psz = CheckApp_QuoteAddExe(temp.cl); 722 memcpy(temp.cl, *psz, strlen(*psz) + 1); 723 if (!strchr(temp.cl, '%')){ 724 ret = saymsg(MB_YESNO, 725 HWND_DESKTOP, 726 NullStr, 727 GetPString(IDS_TOACTONSELECTEDTEXT)); 728 if (ret == MBID_YES) 729 strcat(temp.cl, " %a"); 730 } 705 731 WinQueryDlgItemText(hwnd, CMD_TITLE, sizeof(temp.title), temp.title); 706 732 if (WinQueryButtonCheckstate(hwnd, CMD_DEFAULT)) … … 719 745 temp.flags |= PROMPT; 720 746 if (WinQueryButtonCheckstate(hwnd, CMD_ONCE)) 721 temp.flags |= ONCE; 722 info = add_command(&temp); 747 temp.flags |= ONCE; 748 if (fCancelAction){ 749 fCancelAction = FALSE; 750 break; 751 } 752 else 753 info = add_command(&temp); 723 754 if (!info) { 724 755 saymsg(MB_ENTER, hwnd, GetPString(IDS_ERRORTEXT), … … 781 812 break; 782 813 case CMD_REPLACE: 783 { 784 CHAR temp[34]; 814 { //Delete first 815 char *psz[1002]; 816 COMMAND temp; 817 APIRET ret; 818 819 memset(&temp, 0, sizeof(COMMAND)); 820 WinQueryDlgItemText(hwnd, CMD_CL, sizeof(temp.cl), temp.cl); 821 *psz = CheckApp_QuoteAddExe(temp.cl); 822 memcpy(temp.cl, *psz, strlen(*psz) + 1); 823 if (fCancelAction){ 824 fCancelAction = FALSE; 825 break; 826 } 827 if (!strchr(temp.cl, '%')){ 828 ret = saymsg(MB_YESNO, 829 HWND_DESKTOP, 830 NullStr, 831 GetPString(IDS_TOACTONSELECTEDTEXT)); 832 if (ret == MBID_YES) 833 strcat(temp.cl, " %a"); 834 } 835 //remember item location in the list 785 836 y = (SHORT) WinSendDlgItemMsg(hwnd, 786 CMD_LISTBOX, 787 LM_QUERYSELECTION, 788 MPFROMSHORT(LIT_CURSOR), MPVOID); 789 WinQueryDlgItemText(hwnd, CMD_TITLE, 34, temp); 790 bstrip(temp); 791 if (kill_command(temp)) 792 { 837 CMD_LISTBOX, 838 LM_QUERYSELECTION, 839 MPFROMSHORT(LIT_CURSOR), MPVOID); 840 WinQueryDlgItemText(hwnd, CMD_TITLE, sizeof(temp.title), temp.title); 841 bstrip(temp.title); 842 if (kill_command(temp.title)){ 793 843 x = (SHORT) WinSendDlgItemMsg(hwnd, 794 844 CMD_LISTBOX, … … 804 854 MPFROMSHORT(LIT_NONE), MPFROMSHORT(FALSE)); 805 855 } 806 save_commands(); 807 } 808 } 809 { 810 COMMAND temp; 811 812 memset(&temp, 0, sizeof(COMMAND)); 813 WinQueryDlgItemText(hwnd, CMD_CL, sizeof(temp.cl), temp.cl); 814 bstrip(temp.cl); 815 WinQueryDlgItemText(hwnd, CMD_TITLE, sizeof(temp.title), temp.title); 816 if (WinQueryButtonCheckstate(hwnd, CMD_DEFAULT)) 817 temp.flags = 0; 818 else if (WinQueryButtonCheckstate(hwnd, CMD_FULLSCREEN)) 819 temp.flags = FULLSCREEN; 820 else if (WinQueryButtonCheckstate(hwnd, CMD_MINIMIZED)) 821 temp.flags = MINIMIZED; 822 else if (WinQueryButtonCheckstate(hwnd, CMD_MAXIMIZED)) 823 temp.flags = MAXIMIZED; 824 else if (WinQueryButtonCheckstate(hwnd, CMD_INVISIBLE)) 825 temp.flags = INVISIBLE; 826 if (WinQueryButtonCheckstate(hwnd, CMD_KEEP)) 827 temp.flags |= KEEP; 828 if (WinQueryButtonCheckstate(hwnd, CMD_PROMPT)) 829 temp.flags |= PROMPT; 830 if (WinQueryButtonCheckstate(hwnd, CMD_ONCE)) 831 temp.flags |= ONCE; 832 info = add_command(&temp); 833 if (!info) { 856 } // then do an add 857 if (WinQueryButtonCheckstate(hwnd, CMD_DEFAULT)) 858 temp.flags = 0; 859 else if (WinQueryButtonCheckstate(hwnd, CMD_FULLSCREEN)) 860 temp.flags = FULLSCREEN; 861 else if (WinQueryButtonCheckstate(hwnd, CMD_MINIMIZED)) 862 temp.flags = MINIMIZED; 863 else if (WinQueryButtonCheckstate(hwnd, CMD_MAXIMIZED)) 864 temp.flags = MAXIMIZED; 865 else if (WinQueryButtonCheckstate(hwnd, CMD_INVISIBLE)) 866 temp.flags = INVISIBLE; 867 if (WinQueryButtonCheckstate(hwnd, CMD_KEEP)) 868 temp.flags |= KEEP; 869 if (WinQueryButtonCheckstate(hwnd, CMD_PROMPT)) 870 temp.flags |= PROMPT; 871 if (WinQueryButtonCheckstate(hwnd, CMD_ONCE)) 872 temp.flags |= ONCE; 873 info = add_command(&temp); 874 if (!info) { 834 875 saymsg(MB_ENTER, hwnd, GetPString(IDS_ERRORTEXT), 835 GetPString(IDS_CANTADDCOMMANDTEXT), 836 temp.title); 837 } 876 GetPString(IDS_CANTADDCOMMANDTEXT), 877 temp.title); 878 } 879 838 880 else { 839 881 CHAR env[1002]; … … 844 886 if (*env) { 845 887 PrfWriteProfileString(fmprof, FM3Str, temp.cl, env); 846 } 888 } //put item back in original place 847 889 x = (SHORT) WinSendDlgItemMsg(hwnd, 848 890 CMD_LISTBOX, … … 850 892 MPFROM2SHORT(y, 0), 851 893 MPFROMP(temp.title)); 852 if (x >= 0) { 894 if (x >= 0) { 895 LINKCMDS *temphead = NULL,*last = NULL, *temptail = NULL; 896 SHORT numitems, sSelect = 0; 897 853 898 WinSendDlgItemMsg(hwnd, 854 899 CMD_LISTBOX, … … 859 904 LM_SELECTITEM, 860 905 MPFROMSHORT(x), MPFROMSHORT(TRUE)); 861 { 862 LINKCMDS *temphead = NULL, *info, *last = NULL, *temptail = NULL; 863 SHORT sSelect, numitems; 864 865 sSelect = 0; 866 numitems = (SHORT) WinSendDlgItemMsg(hwnd, CMD_LISTBOX, 867 LM_QUERYITEMCOUNT, 868 MPVOID, MPVOID); 869 while (numitems) { 870 info = (LINKCMDS *) WinSendDlgItemMsg(hwnd, CMD_LISTBOX, 871 LM_QUERYITEMHANDLE, 872 MPFROMSHORT(sSelect++), 873 MPVOID); 874 if (info) { 875 if (!temphead) { 876 temphead = info; 877 info->prev = NULL; 878 } 879 else { 880 last->next = info; 881 info->prev = last; 882 } 883 temptail = info; 884 last = info; 885 info->next = NULL; 886 } 887 numitems--; 906 //then reorder 907 numitems = (SHORT) WinSendDlgItemMsg(hwnd, CMD_LISTBOX, 908 LM_QUERYITEMCOUNT, 909 MPVOID, MPVOID); 910 911 while (numitems) { 912 913 914 info = (LINKCMDS *) WinSendDlgItemMsg(hwnd, CMD_LISTBOX, 915 LM_QUERYITEMHANDLE, 916 MPFROMSHORT(sSelect++), 917 MPVOID); 918 if (info) { 919 if (!temphead) { 920 temphead = info; 921 info->prev = NULL; 922 } 923 else { 924 last->next = info; 925 info->prev = last; 926 } 927 temptail = info; 928 last = info; 929 info->next = NULL; 930 } 931 numitems--; 932 } 933 cmdhead = temphead; 934 cmdtail = temptail; 935 save_commands(); 936 } 888 937 } 889 }890 save_commands();891 }892 }893 938 } 894 939 break; -
trunk/dll/fm3dll.str
r906 r909 295 295 The FM/2 INI file \"%s\" can not be marked read/write. 296 296 FM/2: Help 297 The program "%s" not found. \nAre the Path and Filename correct?\nDo you wish to save it anyway?297 The program "%s" not found. Are the Path and Filename correct? Do you wish to save it anyway? 298 298 "%s" doesn't appear to be executable.\nDo you wish to save it anyway? 299 299 "%s" isn't an exe file and has no extension.\nFM2 requires an extension for executing a program 300 "%s" doesn't appear to be executable. It doesn't have a standard executable file extension \nDo you wish to save it anyway?300 "%s" doesn't appear to be executable. It doesn't have a standard executable file extension Do you wish to save it anyway? 301 301 "%s" has quoting in the program arguments which may or may not be correct. 302 302 For a command to act on selected files it must be followed by "%%a". Should I add it? 303 303 FM/2: See all files 304 304 <Untitled> -
trunk/dll/fm3str.h
r906 r909 306 306 #define IDS_PROGRAMNOTEXE3TEXT 299 307 307 #define IDS_QUOTESINARGSTEXT 300 308 #define IDS_TOACTONSELECTEDTEXT 301 308 309 #define IDS_SEEALLTITLETEXT 302 309 310 #define IDS_UNTITLEDTEXT 303 -
trunk/dll/systemf.c
r907 r909 1309 1309 PSZ CheckApp_QuoteAddExe(PSZ pszPgm) 1310 1310 { 1311 char szTempPgm[ CCHMAXPATH], tempcom[CCHMAXPATH], temparg[CCHMAXPATH];1312 char *offset , *offsetexe, *offsetcom, *offsetcmd, *offsetbtm, *offsetbat;1311 char szTempPgm[2048], tempcom[2048], temparg[2048]; 1312 char *offset = '\0', *offsetexe, *offsetcom, *offsetcmd, *offsetbtm, *offsetbat; 1313 1313 APIRET ret; 1314 1314 ULONG ulAppType; … … 1328 1328 offsetbtm = strstr(strlwr(pszPgm), ".btm"); 1329 1329 offsetbat = strstr(strlwr(pszPgm), ".bat"); 1330 if (offsetbat){ 1331 if (strstr(strlwr(pszPgm), "command ") < offsetbat) 1332 offset = pszPgm; 1333 else 1334 offset = offsetbat; 1335 } 1336 else if (offsetbtm){ 1337 if (strstr(strlwr(pszPgm), "4os2 ") < offsetbtm) 1338 offset = pszPgm; 1339 else 1340 offset = offsetbtm; 1341 } 1342 else if (offsetcmd){ 1343 if (strstr(strlwr(pszPgm), "cmd ") < offsetcmd || 1344 strstr(strlwr(pszPgm), "4os2 ") < offsetcmd) 1345 offset = pszPgm; 1346 else 1347 offset = offsetcmd; 1348 } 1349 else if (offsetcom) 1350 offset = offsetcom; 1351 else if (offsetexe) 1330 if (offsetexe) 1352 1331 offset = offsetexe; 1353 else { 1354 offset = pszPgm; 1355 } 1356 if (offset - pszPgm != 0){ 1332 else{ 1333 if (offsetcom) 1334 offset = offsetcom; 1335 else{ 1336 if (offsetcmd) 1337 offset = offsetcmd; 1338 else{ 1339 if (offsetbtm) 1340 offset = offsetbtm; 1341 else{ 1342 if (offsetbat) 1343 offset = offsetexe; 1344 } 1345 } 1346 } 1347 } 1348 if (offset){ 1357 1349 tempcom[offset + 4 - pszPgm] = '\0'; 1358 1350 strcpy(temparg, &pszPgm[offset + 4 - pszPgm]);
Note:
See TracChangeset
for help on using the changeset viewer.