KFM - rebuilding the device list before calling the menu "select disk", it is necessary to support the reconnection of devices (usb, tmp, etc.)

git-svn-id: svn://kolibrios.org@3755 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2013-07-04 07:04:29 +00:00
parent 1dc693eed6
commit eabaacbe1b
6 changed files with 79 additions and 30 deletions

View File

@ -91,12 +91,14 @@ left_start_draw_line rd 1
left_folder_block rd 1 left_folder_block rd 1
left_start_draw_cursor_line rw 1 left_start_draw_cursor_line rw 1
;left_panel_clear_all rb 1 ;left_panel_clear_all rb 1
left_folder_block_1 rd 1
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4 align 4
right_start_draw_line rd 1 right_start_draw_line rd 1
right_folder_block rd 1 right_folder_block rd 1
right_start_draw_cursor_line rw 1 right_start_draw_cursor_line rw 1
;right_panel_clear_all rb 1 ;right_panel_clear_all rb 1
right_folder_block_1 rd 1
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4 align 4
sort_counter rd 1 sort_counter rd 1
@ -175,6 +177,14 @@ create_dir_name:
rb 256 rb 256
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
align 4 align 4
left_folder_data_1:
rb 304*32+32
;---------------------------------------------------------------------
align 4
right_folder_data_1:
rb 304*32+32
;---------------------------------------------------------------------
align 4
retrieved_devices_table: retrieved_devices_table:
rb 10*100 rb 10*100
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
@ -242,4 +252,12 @@ read_folder_name:
align 4 align 4
read_folder_1_name: read_folder_1_name:
rb 4096 rb 4096
;---------------------------------------------------------------------
align 4
read_folder_2_name:
rb 64
;---------------------------------------------------------------------
align 4
read_folder_3_name:
rb 64
;--------------------------------------------------------------------- ;---------------------------------------------------------------------

View File

@ -49,34 +49,37 @@ device_detect: ; f1811
ret ret
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
device_detect_f70: device_detect_f70:
mov eax,[left_folder_data] mov ax,[select_disk_char]
mov [read_folder.return],eax mov [read_folder_2_name],ax
mcall 70, read_folder mov [read_folder_3_name],ax
; mov eax,left_folder_data_1
; mov [read_folder_2.return],eax
mcall 70, read_folder_2
test eax,eax test eax,eax
jz @f jz @f
cmp eax,6 cmp eax,6
jne read_folder_error jne read_folder_error
@@: @@:
mov [left_folder_block],ebx mov [left_folder_block_1],ebx
mov [temp_counter_1],0 mov [temp_counter_1],0
mov [retrieved_devices_table_counter],0 mov [retrieved_devices_table_counter],0
.start_temp_counter_1: .start_temp_counter_1:
imul esi,[temp_counter_1],304 imul esi,[temp_counter_1],304
add esi,[left_folder_data] add esi,left_folder_data_1
add esi,32+40 ;[eax+32+40] add esi,32+40 ;[eax+32+40]
call copy_folder_name_1 call copy_folder_name_3
mov eax,[right_folder_data] ; mov eax,right_folder_data_1
mov [read_folder_1.return],eax ; mov [read_folder_3.return],eax
mcall 70, read_folder_1 mcall 70, read_folder_3
test eax,eax test eax,eax
jz @f jz @f
cmp eax,6 cmp eax,6
jne read_folder_1_error jne read_folder_1_error
@@: @@:
mov eax,[right_folder_data] mov eax,right_folder_data_1
cmp [eax+4],dword 0 cmp [eax+4],dword 0
je .continue je .continue
mov [right_folder_block],ebx mov [right_folder_block_1],ebx
mov ebp,0 mov ebp,0
.start_copy_device_patch: .start_copy_device_patch:
imul edi,[retrieved_devices_table_counter],10 imul edi,[retrieved_devices_table_counter],10
@ -84,22 +87,22 @@ device_detect_f70:
mov [edi],byte '/' mov [edi],byte '/'
inc edi inc edi
imul esi,[temp_counter_1],304 imul esi,[temp_counter_1],304
add esi,[left_folder_data] add esi,left_folder_data_1
add esi,32+40 ;[eax+32+40] add esi,32+40 ;[eax+32+40]
call proc_copy_patch call proc_copy_patch
imul esi,ebp,304 imul esi,ebp,304
add esi,[right_folder_data] add esi,right_folder_data_1
add esi,32+40 ;[eax+32+40] add esi,32+40 ;[eax+32+40]
mov [edi-1],byte '/' mov [edi-1],byte '/'
call proc_copy_patch call proc_copy_patch
inc [retrieved_devices_table_counter] inc [retrieved_devices_table_counter]
inc ebp inc ebp
cmp ebp,[right_folder_block] cmp ebp,[right_folder_block_1]
jb .start_copy_device_patch jb .start_copy_device_patch
.continue: .continue:
inc [temp_counter_1] inc [temp_counter_1]
mov eax,[temp_counter_1] mov eax,[temp_counter_1]
cmp eax,[left_folder_block] cmp eax,[left_folder_block_1]
jb .start_temp_counter_1 jb .start_temp_counter_1
mov esi,retrieved_devices_table+1 mov esi,retrieved_devices_table+1
call copy_folder_name call copy_folder_name

View File

@ -365,9 +365,10 @@ proc_read_folder_1:
jmp still jmp still
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
copy_folder_name: copy_folder_name:
mov edi,read_folder_name+1 ;read_folder.name+1 mov edi,read_folder_name+1
@@: .1:
cld cld
@@:
lodsb lodsb
stosb stosb
cmp al,0 cmp al,0
@ -375,21 +376,23 @@ copy_folder_name:
ret ret
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
copy_folder_name_1: copy_folder_name_1:
mov edi,read_folder_1_name+1 ;read_folder_1.name+1 mov edi,read_folder_1_name+1
@@: jmp copy_folder_name.1
cld ;---------------------------------------------------------------------
lodsb copy_folder_name_2:
stosb mov edi,read_folder_2_name+1
cmp al,0 jmp copy_folder_name.1
jne @r ;---------------------------------------------------------------------
ret copy_folder_name_3:
mov edi,read_folder_3_name+1
jmp copy_folder_name.1
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
read_folder: read_folder:
.subfunction dd 1 .subfunction dd 1
.start dd 0 .start dd 0
.flags dd 0 .flags dd 0
.size dd 5000 .size dd 5000
.return dd 0 ;folder_data .return dd 0
db 0 db 0
.name: dd read_folder_name .name: dd read_folder_name
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
@ -397,11 +400,29 @@ read_folder_1:
.subfunction dd 1 .subfunction dd 1
.start dd 0 .start dd 0
.flags dd 0 .flags dd 0
.size dd 5000 .size dd 5000
.return dd 0 ;folder_data_1 .return dd 0
db 0 db 0
.name: dd read_folder_1_name .name: dd read_folder_1_name
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
read_folder_2:
.subfunction dd 1
.start dd 0
.flags dd 0
.size dd 5000
.return dd left_folder_data_1
db 0
.name: dd read_folder_2_name
;---------------------------------------------------------------------
read_folder_3:
.subfunction dd 1
.start dd 0
.flags dd 0
.size dd 5000
.return dd right_folder_data_1
db 0
.name: dd read_folder_3_name
;---------------------------------------------------------------------
read_file_features: read_file_features:
.subfunction dd 5 .subfunction dd 5
.Offset dd 0 .Offset dd 0

View File

@ -364,6 +364,11 @@ add_memory_for_folders:
add ecx,304*32+32 add ecx,304*32+32
mov [appl_memory],ecx mov [appl_memory],ecx
mcall 64,1 mcall 64,1
mov eax,[left_folder_data]
mov [read_folder.return],eax
mov eax,[right_folder_data]
mov [read_folder_1.return],eax
ret ret
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
copy_path: copy_path:

View File

@ -226,6 +226,7 @@ key_menu_right:
jmp still jmp still
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
draw_left_select_disk_menu: draw_left_select_disk_menu:
call device_detect_f70
mov [select_panel_counter],0 mov [select_panel_counter],0
call draw_left_panel call draw_left_panel
call draw_right_panel call draw_right_panel
@ -248,6 +249,7 @@ draw_left_select_disk_menu:
jmp button jmp button
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
draw_right_select_disk_menu: draw_right_select_disk_menu:
call device_detect_f70
mov [select_panel_counter],1 mov [select_panel_counter],1
call draw_left_panel call draw_left_panel
call draw_right_panel call draw_right_panel

View File

@ -1,4 +1,4 @@
header_text db 'KFM - Kolibri File Manager v0.47e',0 header_text db 'Kolibri File Manager v0.47f 04/07/2013',0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
fbutton_name: fbutton_name:
.f1 db '1 Help',0 .f1 db '1 Help',0