Subversion Repositories Kolibri OS

Rev

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

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