Rev 5591 | Rev 5608 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5591 | Rev 5606 | ||
---|---|---|---|
Line 120... | Line 120... | ||
120 | 120 | ||
121 | byte active_about=0; |
121 | byte active_about=0; |
122 | word about_window; |
122 | word about_window; |
123 | byte active_settings=0; |
123 | byte active_settings=0; |
124 | word settings_window; |
- | |
- | 124 | word settings_window; |
|
125 | 125 | dword _not_draw = false; |
|
Line 126... | Line 126... | ||
126 | byte menu_call_mouse=0; |
126 | byte menu_call_mouse=0; |
Line 127... | Line 127... | ||
127 | 127 | ||
Line 206... | Line 206... | ||
206 | else |
206 | else |
207 | { |
207 | { |
208 | strncpy(#path, "/rd/1/", 6); |
208 | strncpy(#path, "/rd/1/", 6); |
209 | } |
209 | } |
210 | Open_Dir(#path,ONLY_OPEN); |
210 | Open_Dir(#path,ONLY_OPEN); |
211 | SetEventMask(0x27); |
211 | SetEventMask(1100111b); |
212 | loop(){ |
212 | loop(){ |
213 | switch(WaitEvent()) |
213 | switch(WaitEvent()) |
214 | { |
214 | { |
215 | case evMouse: |
215 | case evMouse: |
216 | if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break; |
216 | if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break; |
Line 556... | Line 556... | ||
556 | { |
556 | { |
557 | menu_action(action_buf); |
557 | menu_action(action_buf); |
558 | action_buf=0; |
558 | action_buf=0; |
559 | } |
559 | } |
560 | break; |
560 | break; |
561 | /*default: |
561 | case evIPC: |
562 | if(CMD_REFRESH) |
- | |
563 | { |
- | |
564 | CMD_REFRESH = false; |
- | |
565 | goto DRAW_WINDOW; |
562 | goto DRAW_WINDOW; |
566 | } |
- | |
567 | */ |
563 | break; |
568 | } |
564 | } |
Line 569... | Line 565... | ||
569 | 565 | ||
570 | if(cmd_free) |
566 | if(cmd_free) |
571 | { |
567 | { |
Line 767... | Line 763... | ||
767 | Put_icon(file_name_off+_strrchr(file_name_off,'.'), files.x+3, files.line_h/2-7+y, color, 0); |
763 | Put_icon(file_name_off+_strrchr(file_name_off,'.'), files.x+3, files.line_h/2-7+y, color, 0); |
768 | WriteText(7-strlen(ConvertSize(file.sizelo))*6+Form.cwidth - 76,files.line_h-6/2+y,font_type,0,ConvertSize(file.sizelo)); |
764 | WriteText(7-strlen(ConvertSize(file.sizelo))*6+Form.cwidth - 76,files.line_h-6/2+y,font_type,0,ConvertSize(file.sizelo)); |
769 | } |
765 | } |
770 | else |
766 | else |
771 | { |
767 | { |
772 | if (strcmp("..",file_name_off)==0) ext1=".."; else ext1=" |
768 | if (!strncmp(file_name_off,"..",3)) ext1=".."; else ext1=" |
773 | Put_icon(ext1, files.x+3, files.line_h/2-7+y, color, 0); |
769 | Put_icon(ext1, files.x+3, files.line_h/2-7+y, color, 0); |
774 | } |
770 | } |
Line 775... | Line 771... | ||
775 | 771 | ||
776 | if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden? |
772 | if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden? |
777 | if (color!=0xFFFfff) |
773 | if (color!=0xFFFfff) |
778 | { |
774 | { |
779 | itdir = TestBit(attr, 4); |
775 | itdir = TestBit(attr, 4); |
780 | strcpy(#file_name, file_name_off); |
- | |
781 | strcpy(#file_path, #path); |
776 | strcpy(#file_name, file_name_off); |
782 | strcat(#file_path, #file_name); |
777 | sprintf(#file_path,"%s%s",#path,file_name_off); |
783 | if (text_col==0xA6A6B7) text_col=0xFFFFFF; |
778 | if (text_col==0xA6A6B7) text_col=0xFFFFFF; |
784 | } |
779 | } |
785 | if (file.selected) text_col=0xFF0000; |
780 | if (file.selected) text_col=0xFF0000; |
786 | if (Form.width>=480) |
781 | if (Form.width>=480) |
Line 818... | Line 813... | ||
818 | if (files.count>maxcount) files.count = maxcount; |
813 | if (files.count>maxcount) files.count = maxcount; |
819 | if (files.count>0) && (files.current==-1) files.current=0; |
814 | if (files.count>0) && (files.current==-1) files.current=0; |
820 | } |
815 | } |
821 | if (files.count!=-1) |
816 | if (files.count!=-1) |
822 | { |
817 | { |
823 | KEdit(); |
818 | if(!_not_draw)KEdit(); |
824 | HistoryPath(ADD_NEW_PATH); |
819 | HistoryPath(ADD_NEW_PATH); |
825 | files.visible = files.h / files.line_h; |
820 | files.visible = files.h / files.line_h; |
826 | if (files.count < files.visible) files.visible = files.count; |
821 | if (files.count < files.visible) files.visible = files.count; |
827 | if (sort_num==1) sorting_arrow_x = Form.width+60/2; |
822 | if (sort_num==1) sorting_arrow_x = Form.width+60/2; |
828 | if (sort_num==2) sorting_arrow_x = Form.width-115; |
823 | if (sort_num==2) sorting_arrow_x = Form.width-115; |
829 | if (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w; |
824 | if (sort_num==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w; |
830 | WriteText(sorting_arrow_x,45,0x80,sc.work_graph,"\x19"); |
825 | WriteText(sorting_arrow_x,45,0x80,sc.work_graph,"\x19"); |
831 | if (redraw!=ONLY_SHOW) Sorting(); |
826 | if (redraw!=ONLY_SHOW) Sorting(); |
832 | if (redraw!=ONLY_OPEN) List_ReDraw(); |
827 | if (redraw!=ONLY_OPEN)&&(!_not_draw) List_ReDraw(); |
833 | } |
828 | } |
834 | if (files.count==-1) && (redraw!=ONLY_OPEN) {files.visible=files.count=0; List_ReDraw();} |
829 | if (files.count==-1) && (redraw!=ONLY_OPEN) {files.visible=files.count=0; if(!_not_draw)List_ReDraw();} |
835 | } |
830 | } |
Line 836... | Line 831... | ||
836 | 831 | ||
837 | 832 | ||
838 | inline Sorting() |
833 | inline Sorting() |
839 | { |
834 | { |
840 | dword k=0, l=1; |
835 | dword k=0, l=1; |
841 | dword file_off; |
836 | dword file_off; |
842 | int i; |
837 | int i; |
843 | if (!strcmp(#path,"/")) //do not sort |
838 | if (!strncmp(#path,"/",2)) //do not sort |
844 | { |
839 | { |
845 | for(k=1;k |
840 | for(k=1;k |
846 | return; |
841 | return; |
Line 863... | Line 858... | ||
863 | Sort_by_Name(0,k-1); |
858 | Sort_by_Name(0,k-1); |
864 | if (sort_num==1) Sort_by_Name(k,files.count-1); |
859 | if (sort_num==1) Sort_by_Name(k,files.count-1); |
865 | if (sort_num==2) Sort_by_Type(k,files.count-1); |
860 | if (sort_num==2) Sort_by_Type(k,files.count-1); |
866 | if (sort_num==3) Sort_by_Size(k,files.count-1); |
861 | if (sort_num==3) Sort_by_Size(k,files.count-1); |
867 | //make ".." first item in list |
862 | //make ".." first item in list |
868 | if (k>0) && (strcmp(file_mas[0]*304+buf+72,"..")!=0) |
863 | if (k>0) && (!strncmp(file_mas[0]*304+buf+72,"..",3)) |
869 | for(k--; k>0; k--;) if (!strcmp(file_mas[k]*304+buf+72,"..")) {file_mas[k]> |
864 | for(k--; k>0; k--;) if (!strncmp(file_mas[k]*304+buf+72,"..",3)) {file_mas[k]> |
870 | } |
865 | } |
Line 871... | Line 866... | ||
871 | 866 | ||
872 | 867 | ||
873 | void Del_Form() |
868 | void Del_Form() |
874 | { |
869 | { |
875 | dword selected_offset2; |
870 | dword selected_offset2; |
876 | int cont = 0; |
871 | int cont = 0; |
877 | byte f_count[128]; |
872 | byte f_count[128]; |
878 | int dform_x = files.w - 220 / 2 + files.x; |
873 | int dform_x = files.w - 220 / 2 + files.x; |
879 | if (!strncmp(#file_name,".",1)) || (!strncmp(#file_name,"..",2)) return; |
874 | if (!strncmp(#file_name,".",2)) || (!strncmp(#file_name,"..",2)) return; |
880 | if (del_active==2) |
875 | if (del_active==2) |
881 | { |
876 | { |
882 | if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0); |
877 | if (itdir) ShowMessage(WAIT_DELETING_FOLDER, 0); |
Line 927... | Line 922... | ||
927 | if (error = GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL)) del_error = error; |
922 | if (error = GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL)) del_error = error; |
928 | for (i=0; i |
923 | for (i=0; i |
929 | { |
924 | { |
930 | if (CheckEvent()==evReDraw) draw_window(); |
925 | if (CheckEvent()==evReDraw) draw_window(); |
931 | filename = i*304+dirbuf+72; |
926 | filename = i*304+dirbuf+72; |
932 | /*strcpy(#del_from, way); |
- | |
933 | chrcat(#del_from, '/'); |
- | |
934 | strcat(#del_from, filename);*/ |
- | |
935 | sprintf(#del_from,"%s/%s",way,filename); |
927 | sprintf(#del_from,"%s/%s",way,filename); |
936 | if ( TestBit(ESDWORD[filename-40], 4) ) |
928 | if ( TestBit(ESDWORD[filename-40], 4) ) |
937 | { |
929 | { |
938 | Del_File2(#del_from); |
930 | Del_File2(#del_from); |
939 | } |
931 | } |
Line 963... | Line 955... | ||
963 | { |
955 | { |
964 | for (i=0; i |
956 | for (i=0; i |
965 | { |
957 | { |
966 | selected_offset2 = file_mas[i]*304 + buf+32 + 7; |
958 | selected_offset2 = file_mas[i]*304 + buf+32 + 7; |
967 | if (ESBYTE[selected_offset2]) { |
959 | if (ESBYTE[selected_offset2]) { |
968 | /*strcpy(#del_from, #path); |
- | |
969 | strcat(#del_from, file_mas[i]*304+buf+72);*/ |
- | |
970 | sprintf(#del_from,"%s%s",#path,file_mas[i]*304+buf+72); |
960 | sprintf(#del_from,"%s%s",#path,file_mas[i]*304+buf+72); |
971 | Del_File2(#del_from); |
961 | Del_File2(#del_from); |
972 | } |
962 | } |
973 | } |
963 | } |
974 | } |
964 | } |
Line 1013... | Line 1003... | ||
1013 | { |
1003 | { |
1014 | byte temp[4096]; |
1004 | byte temp[4096]; |
1015 | selected_count = 0; |
1005 | selected_count = 0; |
1016 | if (rez) |
1006 | if (rez) |
1017 | { |
1007 | { |
1018 | if (!strncmp(#file_name,"..",2)) return; |
1008 | if (!strncmp(#file_name,"..",3)) return; |
1019 | strcpy(#temp, #file_path); |
1009 | strcpy(#temp, #file_path); |
1020 | if (path[strlen(#temp)-1]!='/') chrcat(#temp, '/'); //need "/" in the end |
1010 | if (path[strlen(#temp)-1]!='/') chrcat(#temp, '/'); //need "/" in the end |
1021 | RunProgram("/sys/File Managers/Eolite", #temp); |
1011 | RunProgram("/sys/File Managers/Eolite", #temp); |
1022 | return; |
1012 | return; |
1023 | } |
1013 | } |
Line 1026... | Line 1016... | ||
1026 | { |
1016 | { |
1027 | if (strrchr(#file_name, '.')==0) RunProgram(#file_path, ""); else RunProgram("/sys/@open", #file_path); |
1017 | if (strrchr(#file_name, '.')==0) RunProgram(#file_path, ""); else RunProgram("/sys/@open", #file_path); |
1028 | } |
1018 | } |
1029 | else |
1019 | else |
1030 | { |
1020 | { |
1031 | if (!strncmp(#file_name,"..",2)) { Dir_Up(); return; } |
1021 | if (!strncmp(#file_name,"..",3)) { Dir_Up(); return; } |
1032 | strcpy(#path, #file_path); |
1022 | strcpy(#path, #file_path); |
1033 | if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end |
1023 | if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //need "/" in the end |
1034 | files.first=files.current=0; |
1024 | files.first=files.current=0; |
1035 | Open_Dir(#path,WITH_REDRAW); |
1025 | Open_Dir(#path,WITH_REDRAW); |
1036 | } |
1026 | } |
Line 1045... | Line 1035... | ||
1045 | } |
1035 | } |
Line 1046... | Line 1036... | ||
1046 | 1036 | ||
1047 | void ShowOpenWithDialog() |
1037 | void ShowOpenWithDialog() |
1048 | { |
1038 | { |
1049 | byte param[4097]; |
- | |
1050 | /*param[0] = '~'; |
- | |
1051 | param[1] = '\0'; |
- | |
1052 | strcat(#param, #file_path);*/ |
1039 | byte param[4097]; |
1053 | sprintf(#param,"~%s",#file_path); |
1040 | sprintf(#param,"~%s",#file_path); |
1054 | RunProgram("/sys/@open", #param); |
1041 | RunProgram("/sys/@open", #param); |
Line 1055... | Line 1042... | ||
1055 | } |
1042 | } |
1056 | 1043 | ||
1057 | void NewElement(byte newf) |
1044 | void NewElement(byte newf) |
1058 | { |
1045 | { |
1059 | BDVK element_info; |
1046 | BDVK element_info; |
1060 | byte del_rezult, copy_rezult, info_result; |
1047 | byte del_rezult, copy_rezult, info_result; |
1061 | if (newf) |
- | |
1062 | { |
- | |
1063 | /*strcpy(#temp, #path); |
1048 | if (newf) |
1064 | strcat(#temp, new_file_ed.text);*/ |
1049 | { |
1065 | sprintf(#temp,"%s%s",#path,new_file_ed.text); |
1050 | sprintf(#temp,"%s%s",#path,new_file_ed.text); |
1066 | info_result = GetFileInfo(#temp, #element_info); |
1051 | info_result = GetFileInfo(#temp, #element_info); |
1067 | switch(new_element_active) |
1052 | switch(new_element_active) |