Subversion Repositories Kolibri OS

Rev

Rev 5511 | Rev 5513 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5481 leency 1
//Leency, Veliant, Punk_Joker & KolibriOS Team 2008-2015
3363 leency 2
//GNU GPL licence.
3
 
4022 leency 4
#ifndef AUTOBUILD
5
#include "lang.h--"
6
#endif
7
 
3363 leency 8
//libraries
4049 leency 9
#define MEMSIZE 0xD0000
3363 leency 10
#include "..\lib\kolibri.h"
4427 punk_joker 11
#include "..\lib\clipboard.h"
3363 leency 12
#include "..\lib\strings.h"
13
#include "..\lib\mem.h"
14
#include "..\lib\dll.h"
15
#include "..\lib\file_system.h"
5499 leency 16
#include "..\lib\gui.h"
3434 leency 17
#include "..\lib\list_box.h"
18
#include "..\lib\copyf.h"
4863 leency 19
#include "..\lib\random.h"
5487 leency 20
//obj
5499 leency 21
#include "..\lib\obj\libini.h"
22
#include "..\lib\obj\box_lib.h"
3363 leency 23
//images
24
#include "imgs\toolbar.txt"
25
#include "imgs\left_p.txt"
4846 leency 26
#include "imgs\icons.txt"
3363 leency 27
 
3848 punk_joker 28
#ifdef LANG_RUS
29
	?define T_FILE "Файл"
30
	?define T_TYPE "Тип"
31
	?define T_SIZE "Размер"
32
	?define T_NEW_FOLDER "Новая папка"
33
	?define T_NEW_FILE "Новый файл"
34
	?define T_DELETE_FILE "Вы действительно хотите удалить"
35
	?define T_YES "Да"
36
	?define T_NO "Нет"
37
	?define T_DEL_ERROR_1 "Ошибка. Папка не пустая."
3997 leency 38
	?define WAIT_DELETING_FOLDER "Удаляется папка. Подожите..."
3848 punk_joker 39
	?define NOT_CREATE_FOLDER "Не удалось создать папку."
40
	?define NOT_CREATE_FILE "Не удалось создать файл."
5506 punk_joker 41
	?define ERROR_1 "Ошибка при загрузке библиотеки /rd/1/lib/box_lib.obj"
3883 leency 42
	?define T_PASTE_WINDOW "Копирую..."
43
	?define T_PASTE_WINDOW_TEXT "Копируется файл:"
4022 leency 44
	?define T_CANCEL_PASTE "Копирование прекращено. Папка скопирована не полностью."
4049 leency 45
	?define T_SELECT_APP_TO_OPEN_WITH "Выберите программу для открытия файла"
5512 punk_joker 46
	?define DEL_MORE_FILES_1 "эти элементы ("
47
	?define DEL_MORE_FILES_2 " шт.)?"
3933 kaitz 48
#elif LANG_EST
49
	?define T_FILE "Fail"
50
	?define T_TYPE "T№№p"
51
	?define T_SIZE "Suurus"
52
	?define T_NEW_FOLDER "Uus kataloog"
53
	?define T_NEW_FILE "Uus fail"
54
	?define T_DELETE_FILE "Kas sa tahad tїesti kustutada"
55
	?define T_YES "Jah"
56
	?define T_NO "Ei"
57
	?define T_DEL_ERROR_1 "Viga. Kataloog ei ole t№hi."
3997 leency 58
	?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..."
3933 kaitz 59
	?define NOT_CREATE_FOLDER "Kataloogi ei saa luua."
60
	?define NOT_CREATE_FILE "Faili ei saa luua."
5506 punk_joker 61
	?define ERROR_1 "Viga teegi laadimisel /rd/1/lib/box_lib.obj"
3933 kaitz 62
	?define T_PASTE_WINDOW "Kopeerin..."
63
	?define T_PASTE_WINDOW_TEXT "Kopeerin faili:"
4022 leency 64
	?define T_CANCEL_PASTE "Copy process terminated. Folder copied incompletely."
4049 leency 65
	?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file"
5512 punk_joker 66
	?define DEL_MORE_FILES_1 "эти элементы ("
67
	?define DEL_MORE_FILES_2 " шт.)?"
3848 punk_joker 68
#else
69
	?define T_FILE "File"
70
	?define T_TYPE "Type"
71
	?define T_SIZE "Size"
72
	?define T_NEW_FOLDER "New folder"
73
	?define T_NEW_FILE "New file"
74
	?define T_DELETE_FILE "Do you really want to delete"
75
	?define T_YES "Yes"
76
	?define T_NO "No"
77
	?define T_DEL_ERROR_1 "Error. Folder isn't empty."
3997 leency 78
	?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..."
3848 punk_joker 79
	?define NOT_CREATE_FOLDER "Folder can not be created."
80
	?define NOT_CREATE_FILE "File can not be created."
5506 punk_joker 81
	?define ERROR_1 "Error while loading library /rd/1/lib/box_lib.obj"
3883 leency 82
	?define T_PASTE_WINDOW "Copying..."
83
	?define T_PASTE_WINDOW_TEXT "Copying file:"
4022 leency 84
	?define T_CANCEL_PASTE "Copy process terminated. Folder copied incompletely."
4049 leency 85
	?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file"
5512 punk_joker 86
	?define DEL_MORE_FILES_1 "эти элементы ("
87
	?define DEL_MORE_FILES_2 " шт.)?"
3848 punk_joker 88
#endif
89
 
3444 leency 90
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
91
 
5512 punk_joker 92
#define TITLE "Eolite File Manager v2.63"
93
#define ABOUT_TITLE "Eolite v2.63"
4076 leency 94
dword col_padding, col_selec, col_lpanel;
3363 leency 95
 
3434 leency 96
int toolbar_buttons_x[7]={9,46,85,134,167,203};
5150 leency 97
char tmp_disk_del_param[]="d0";
3434 leency 98
struct path_string { char Item[4096]; };
3363 leency 99
 
4136 punk_joker 100
byte active_about=0;
4070 punk_joker 101
word about_window;
5416 punk_joker 102
byte active_settings=0;
103
word settings_window;
4040 punk_joker 104
 
4136 punk_joker 105
byte menu_call_mouse=0;
106
 
3434 leency 107
llist files;
108
 
109
byte
3363 leency 110
	path[4096],
111
	file_path[4096],
3404 leency 112
	file_name[256],
3434 leency 113
	temp[4096];
114
byte
3439 leency 115
	rename_active=0,
116
	del_active=0,
4399 punk_joker 117
	show_dev_name=1,
4225 punk_joker 118
	real_files_names_case=0,
5459 punk_joker 119
	info_after_copy=0,
3434 leency 120
	sort_num=2,
3441 leency 121
	itdir;
3363 leency 122
 
5441 leency 123
dword eolite_ini_path;
124
 
3363 leency 125
proc_info Form;
4076 leency 126
system_colors sc;
3363 leency 127
mouse m;
4057 leency 128
int mouse_dd, scroll_used, scroll_size, sorting_arrow_x, kolibrios_drive;
4897 leency 129
dword buf;
3434 leency 130
dword file_mas[6898];
131
int j, i;
4028 leency 132
int action_buf;
4863 leency 133
int rand_n;
3363 leency 134
 
4028 leency 135
edit_box edit2 = {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xffffff,0,248,#file_name,#mouse_dd,64,6,6};
3434 leency 136
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
3363 leency 137
PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
138
 
4042 leency 139
#include "include\copy.h"
5435 leency 140
#include "include\gui.h"
3363 leency 141
#include "include\sorting.h"
4042 leency 142
#include "include\icons.h"
3363 leency 143
#include "include\left_panel.h"
144
#include "include\history.h"
4042 leency 145
#include "include\menu.h"
146
#include "include\about.h"
5416 punk_joker 147
#include "include\settings.h"
5447 punk_joker 148
#include "include\properties.h"
3363 leency 149
 
150
void main()
151
{
3444 leency 152
	word key, id, can_show, can_select, m_selected;
4897 leency 153
	dword selected_offset;
4863 leency 154
	rand_n = random(40);
3363 leency 155
 
156
	mem_Init();
3848 punk_joker 157
	if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(ERROR_1);
5399 punk_joker 158
    if (load_dll2(libini, #lib_init,1)!=0) notify("Error: library doesn't exists - libini");
5441 leency 159
	eolite_ini_path = abspath("Eolite.ini");
160
	LoadIniSettings();
161
	GetSystemDiscs();
4076 leency 162
	SetAppColors();
3363 leency 163
	if (param)
164
	{
165
		strcpy(#path, #param);
3434 leency 166
		if (path[strlen(#path)-1]!='/') chrcat(#path, '/'); //add "/" to the end of the string
3363 leency 167
	}
168
	else
3695 leency 169
	{
3432 leency 170
		strcpy(#path, "/rd/1/");
3695 leency 171
	}
3363 leency 172
	Open_Dir(#path,ONLY_OPEN);
3432 leency 173
	SetEventMask(0x27);
3434 leency 174
	loop() switch(WaitEvent())
3363 leency 175
	{
176
		case evMouse:
4081 leency 177
			if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break;
178
			if (rename_active) { edit_box_mouse stdcall(#edit2); break; }
3363 leency 179
 
180
			m.get();
181
 
4078 leency 182
			if (files.MouseOver(m.x, m.y)) && (!can_select)