Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 8946 → Rev 8947

/programs/cmm/eolite/Eolite.c
3,9 → 3,9
 
// 70.5 - get volume info and label
 
#define ABOUT_TITLE "EOLITE 5 RC5"
#define TITLE_EOLITE "Eolite File Manager 5 RC5"
#define TITLE_KFM "Kolibri File Manager 2 RC5";
#define ABOUT_TITLE "EOLITE 5 Beta8"
#define TITLE_EOLITE "Eolite File Manager 5 Beta8"
#define TITLE_KFM "Kolibri File Manager 2 Beta8";
 
#define MEMSIZE 1024 * 250
#include "../lib/clipboard.h"
28,37 → 28,8
 
#include "imgs/images.h"
 
//Button IDs
enum {
PATH_BTN = 10,
POPUP_BTN1 = 201,
POPUP_BTN2 = 202,
KFM_DEV_DROPDOWN_1 = 205,
KFM_DEV_DROPDOWN_2 = 207,
BREADCRUMB_ID = 300,
#include "include/const.h"
 
BACK_BTN = 400,
FWRD_BTN,
GOUP_BTN,
COPY_BTN,
CUT_BTN,
PASTE_BTN,
KFM_FUNC_ID = 450
};
 
//NewElement options
enum {
CREATE_FILE=1,
CREATE_FOLDER,
RENAME_ITEM
};
 
//OpenDir options
enum {
WITH_REDRAW,
ONLY_OPEN
};
 
_history history;
 
struct Eolite_colors
84,15 → 55,12
 
int toolbar_buttons_x[7]={9,46,85,134,167,203};
 
bool active_about = false;
bool active_settings = false;
bool _not_draw = false;
bool dir_at_fat16 = NULL;
 
bool disk_popin_active_on_panel=0;
 
dword about_thread_id;
dword settings_window;
bool active_about = false;
bool active_settings = false;
 
byte del_active=0;
byte new_element_active=0;
99,14 → 67,17
 
llist files, files_active, files_inactive;
 
byte list_full_redraw;
bool list_full_redraw;
 
//Folder data
dword buf;
collection_int items=0;
int selected_count;
int count_dir;
int folder_count;
//dword path;
char path[4096];
 
byte path[4096];
//Sselected element data
byte file_path[4096];
byte file_name[256];
byte new_element_name[256];
113,24 → 84,26
byte temp[4096];
bool itdir;
 
char active_path[4096], inactive_path[4096];
 
dword eolite_ini_path[4096];
_ini ini;
 
char scroll_used=false;
 
dword about_stak=0,properties_stak=0,settings_stak=0;
 
//Window data
proc_info Form;
int sc_slider_h;
int action_buf;
int rand_n;
 
bool scroll_used=false;
char sort_type=2;
bool sort_desc=false;
int status_bar_h;
int icon_size = 18;
 
 
int active_panel=0;
int disk_popin_active_on_panel=0;
#define PANES_COUNT 2
unsigned char location[PANES_COUNT];
 
char active_path[4096], inactive_path[4096];
 
dword about_stak=0,properties_stak=0,settings_stak=0;
byte cmd_free=0;
 
libimg_image icons16_default;
libimg_image icons16_selected;
 
137,16 → 110,11
libimg_image icons32_default;
libimg_image icons32_selected;
 
int status_bar_h;
 
int icon_size = 18;
 
edit_box new_file_ed = {200,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0x10000000,
248,#new_element_name,0,ed_focus+ed_always_focus,6,0};
PathShow_data FileShow = {0, 56,215, 8, 100, 1, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
byte cmd_free=0;
#include "include\translations.h"
 
 
#include "include\gui.h"
#include "include\settings.h"
#include "include\progress_dialog.h"
159,18 → 127,12
#include "include\properties.h"
#include "include\breadcrumbs.h"
 
void load_libraries()
{
load_dll(boxlib, #box_lib_init,0);
load_dll(libini, #lib_init,1);
load_dll(libimg, #libimg_init,1);
}
 
void handle_param()
{
//-p <path> : just show file/folder properties dialog
//-d <path> : delete file/folder
//-v : paste files/folder from clipboard
int i;
dword p = #param;
if (param[0]=='\\') && (param[1]=='E') && (param[2]=='F') && (param[3]=='M') {
efm = true;
180,6 → 142,12
 
LoadIniSettings();
 
for (i=0; i<PANES_COUNT; i++) {
location[i] = malloc(4096);
strcpy(location[i], #path_start);
}
//path = location[0];
 
if (ESBYTE[p]=='\0') return;
 
if (ESBYTE[p]=='-') switch (ESBYTE[p+1])
225,13 → 193,12
dword id;
int old_cur_y;
 
load_libraries();
load_dll(boxlib, #box_lib_init,0);
load_dll(libini, #lib_init,1);
load_dll(libimg, #libimg_init,1);
 
SetAppColors();
 
ESBYTE[0] = NULL;
 
handle_param();
rand_n = random(80);
 
ESBYTE[0] = NULL;
 
240,7 → 207,7
strcpy(#inactive_path, #path);
llist_copy(#files_inactive, #files);
SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER);
loop() switch(@WaitEventTimeout(80))
loop() switch(@WaitEventTimeout(100))
{
case evMouse:
if (del_active) || (disk_popin_active_on_panel) || (Form.status_window&ROLLED_UP) break;
318,8 → 285,8
 
//Scrooll
if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y)
&& (mouse.y<files.y+files.h-18) && (mouse.lkm) && (!scroll_used) {scroll_used=true; Scroll();}
if (scroll_used) && (!mouse.key&MOUSE_LEFT) { scroll_used=false; Scroll(); }
&& (mouse.y<files.y+files.h-18) && (mouse.lkm) && (!scroll_used) {scroll_used=true; DrawScroll(scroll_used);}
if (scroll_used) && (!mouse.key&MOUSE_LEFT) { scroll_used=false; DrawScroll(scroll_used); }
if (scroll_used)
{
488,7 → 455,7
EventOpenNewEolite();
break;
case SCAN_CODE_KEY_R:
EventRefreshDisksAndFolders();
EventManualFolderRefresh();
break;
case SCAN_CODE_ENTER:
if (!itdir) ShowOpenWithDialog();
546,15 → 513,9
case evReDraw:
draw_window();
if (CheckActiveProcess(Form.ID)) && (GetMenuClick()) break;
if (action_buf==OPERATION_END) {
EventRefresh();
action_buf=0;
}
break;
default:
if (Form.status_window<=2) EventRefreshDisksAndFolders();
//sprintf(#param, "/tmp0/1/%i", random(99999)); //for testing purpose
//CreateFile(0, 0, #param);
if (!Form.status_window&ROLLED_UP) EventRefreshDisksAndFolders();
}
if(cmd_free)
571,6 → 532,9
dword i=0;
incn x;
dword title;
static int rand_n;
if (rand_n) rand_n = random(80);
 
if (show_status_bar.checked) {
#define STBAR_EOLITE_H 16;
#define STBAR_KFM_H 21+16;
677,7 → 641,7
if (!show_status_bar.checked) return;
if (files.count>0) && (streq(items.get(0)*304+buf+72,"..")) go_up_folder_exists=1;
DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, status_bar_h, sc.work);
sprintf(#status_bar_str, T_STATUS_EVEMENTS, count_dir-go_up_folder_exists, files.count-count_dir);
sprintf(#status_bar_str, T_STATUS_EVEMENTS, folder_count-go_up_folder_exists, files.count-folder_count);
WriteText(6,Form.cheight - 13,0x80,sc.work_text,#status_bar_str);
if (selected_count) {
sprintf(#status_bar_str, T_STATUS_SELECTED, selected_count);
772,7 → 736,7
if (colored_lines.checked) separator_color = col.list_bg; else separator_color = col.list_vert_line;
DrawBar(files.x+files.w-141,all_lines_h + files.y,1,files.h - all_lines_h, separator_color);
DrawBar(files.x+files.w-68,all_lines_h + files.y,1,files.h - all_lines_h, separator_color);
Scroll();
DrawScroll(scroll_used);
 
if (del_active) Del_Form();
if (new_element_active) && (col.selec != 0xCCCccc) NewElement_Form(new_element_active, #new_element_name);
891,9 → 855,6
}
if (files.count>0) && (files.cur_y-files.first==-1) files.cur_y=0;
 
if (files.count!=-1)
{
if(!_not_draw) DrawPathBar();
history.add(#path);
SystemDiscs.Draw();
files.visible = files.h / files.item_h;
902,15 → 863,13
dir_at_fat16 = true; else dir_at_fat16 = false;
Sorting();
list_full_redraw = true;
if (redraw!=ONLY_OPEN)&&(!_not_draw) {DrawStatusBar(); List_ReDraw();}
SetCurDir(dir_path);
DrawPathBar();
if (redraw!=ONLY_OPEN) {
List_ReDraw();
DrawStatusBar();
}
if (files.count==-1) && (redraw!=ONLY_OPEN)
{
files.KeyHome();
if(!_not_draw) { list_full_redraw=true; DrawStatusBar(); List_ReDraw(); }
}
}
 
inline Sorting()
{
923,7 → 882,7
if (!strcmp(#path,"/")) //do not sort root folder
{
for(d=1;d<files.count;d++;) items.set(d, d);
count_dir = d;
folder_count = d;
return;
}
for (j=files.count-1, file_off=files.count-1*304+buf+32; j>=0; j--, file_off-=304;) //files | folders
937,7 → 896,7
f++;
}
}
count_dir = d;
folder_count = d;
//sorting: files first, then folders
Sort_by_Name(0,d-1);
if (sort_type==1) Sort_by_Name(d,files.count-1);
1169,7 → 1128,7
CopyFilesListToClipboard(COPY);
EventPaste(#inactive_path);
} else {
EventRefreshDisksAndFolders();
EventManualFolderRefresh();
}
break;
case 6:
1202,19 → 1161,6
}
}
 
void EventRefresh()
{
if (efm)
{
DrawFilePanels();
} else {
Tip(56, T_DEVICES, 55, "-");
Open_Dir(#path,WITH_REDRAW);
pause(10);
DrawDeviceAndActionsLeftPanel();
}
}
 
void SetActivePanel(int _active)
{
if (active_panel != _active) {
1266,17 → 1212,28
 
void EventRefreshDisksAndFolders()
{
if(efm) {
if (GetRealFileCountInFolder(#inactive_path) != files_inactive.count) {
DrawFilePanels();
return;
}
} else {
if(GetRealFileCountInFolder("/")+dir_exists("/kolibrios") != SystemDiscs.dev_num) {
SystemDiscs.Get();
EventRefresh();
} else {
if(GetRealFileCountInFolder(#path) != files.count) EventRefresh();
else if(efm) && (GetRealFileCountInFolder(#inactive_path) != files_inactive.count) {
EventRefresh();
DrawDeviceAndActionsLeftPanel();
}
}
if(GetRealFileCountInFolder(#path) != files.count) Open_Dir(#path,WITH_REDRAW);
}
 
void EventManualFolderRefresh()
{
Tip(56, T_DEVICES, 55, "-");
pause(10);
EventRefreshDisksAndFolders();
DrawDeviceAndActionsLeftPanel();
}
 
void EventSort(dword id)
{
char selected_filename[256];
/programs/cmm/eolite/include/translations.h
File deleted
/programs/cmm/eolite/include/const.h
0,0 → 1,113
#ifdef LANG_RUS
?define T_FILE "” ©«"
?define T_TYPE "’¨¯"
?define T_SIZE " §¬¥à"
?define T_NEW_FOLDER "®¢ ï ¯ ¯ª "
?define T_NEW_FILE "®¢ë© ä ©«"
?define T_DELETE_FILE "‚ë ¤¥©á⢨⥫쭮 å®â¨â¥ 㤠«¨âì"
?define T_YES "„ "
?define T_NO "¥â"
?define T_CANCEL "Žâ¬¥­ "
?define T_CREATE "‘®§¤ âì"
?define T_RENAME "¥à¥­ §¢ âì"
?define FS_ITEM_ALREADY_EXISTS "'«¥¬¥­â á â ª¨¬ ¨¬¥­¥¬ 㦥 áãé¥áâ¢ã¥â' -E"
?define NOT_CREATE_FOLDER "'¥ 㤠«®áì ᮧ¤ âì ¯ ¯ªã.' -E"
?define NOT_CREATE_FILE "'¥ 㤠«®áì ᮧ¤ âì ä ©«.' -E"
?define T_NOTIFY_APP_PARAM_WRONG "' à ¬¥âà ¤«ï § ¯ã᪠ Eolite ­¥ ¢¥à¥­: ¯ ¯ª  ­¥ áãé¥áâ¢ã¥â!' -E"
?define T_COPY_WINDOW_TITLE "Š®¯¨àãî..."
?define T_MOVE_WINDOW_TITLE "¥à¥¬¥é î..."
?define T_DELETE_WINDOW_TITLE "“¤ «ïî..."
?define T_ABORT_WINDOW_BUTTON "à¥à¢ âì"
?define T_SELECT_APP_TO_OPEN_WITH "‚ë¡¥à¨â¥ ¯à®£à ¬¬ã ¤«ï ®âªàëâ¨ï ä ©« "
?define DEL_MORE_FILES_1 "¢ë¡à ­­ë¥ í«¥¬¥­âë ("
?define DEL_MORE_FILES_2 " èâ.)?"
?define T_STATUS_EVEMENTS " ¯®ª: %d ” ©«®¢: %d"
?define T_STATUS_SELECTED "‚뤥«¥­­®: %d"
?define COPY_PATH_STR "'ãâì ¯ ¯ª¨ ᪮¯¨à®¢ ­ ¢ ¡ãä¥à ®¡¬¥­ ' -I"
?define T_ABOUT "Ž ¯à®£à ¬¬¥"
?define T_USE_SHIFT_ENTER "'ˆá¯®«ì§ã©â¥ Shift+Enter çâ®¡ë ®âªàëâì ¢á¥ ¢ë¤¥«¥­­ë¥ ä ©«ë.' -I"
char *kfm_func = {
"ˆ­ä®",
"¥à¥¨¬¥­.",
"à®á¬®âà",
"¥¤ ªâ.",
"Š®¯¨à®¢ âì",
"¥à¥¬¥áâ¨âì",
" ¯ª ",
"“¤ «¨âì",
"” ©«",
"  áâனª¨"
};
#else
?define T_FILE "File"
?define T_TYPE "Type"
?define T_SIZE "Size"
?define T_NEW_FOLDER "New folder"
?define T_NEW_FILE "New file"
?define T_DELETE_FILE "Do you really want to delete"
?define T_YES "Yes"
?define T_NO "No"
?define T_CANCEL "Cancel"
?define T_CREATE "Create"
?define T_RENAME "Rename"
?define FS_ITEM_ALREADY_EXISTS "'An item with that name already exists' -E"
?define WAIT_DELETING_FOLDER "Deleting folder. Please, wait..."
?define NOT_CREATE_FOLDER "'Folder can not be created.' -E"
?define NOT_CREATE_FILE "'File can not be created.' -E"
?define T_NOTIFY_APP_PARAM_WRONG "'Eolite param is wrong: directory does not exist!' -E"
?define T_COPY_WINDOW_TITLE "Copying..."
?define T_MOVE_WINDOW_TITLE "Moving..."
?define T_DELETE_WINDOW_TITLE "Deleting..."
?define T_ABORT_WINDOW_BUTTON "Abort"
?define T_SELECT_APP_TO_OPEN_WITH "Select application to open file"
?define DEL_MORE_FILES_1 "selected items("
?define DEL_MORE_FILES_2 " pcs.)?"
?define T_STATUS_EVEMENTS "Dirs: %d Files: %d"
?define T_STATUS_SELECTED "Selected: %d"
?define COPY_PATH_STR "'Directory path copied to clipboard' -I"
?define T_ABOUT "About"
?define T_USE_SHIFT_ENTER "'Use Shift+Enter to open all selected files.' -I"
char *kfm_func = {
"Info",
"Rename",
"View",
"Edit",
"Copy",
"Move",
"Folder",
"Delete",
"File",
" Settings"
};
#endif
 
//Button IDs
enum {
PATH_BTN = 10,
POPUP_BTN1 = 201,
POPUP_BTN2 = 202,
KFM_DEV_DROPDOWN_1 = 205,
KFM_DEV_DROPDOWN_2 = 207,
BREADCRUMB_ID = 300,
 
BACK_BTN = 400,
FWRD_BTN,
GOUP_BTN,
COPY_BTN,
CUT_BTN,
PASTE_BTN,
KFM_FUNC_ID = 450
};
 
//NewElement options
enum {
CREATE_FILE=1,
CREATE_FOLDER,
RENAME_ITEM
};
 
//OpenDir options
enum {
WITH_REDRAW,
ONLY_OPEN
};
/programs/cmm/eolite/include/gui.h
1,5 → 1,5
 
void Scroll() {
void DrawScroll(bool _scroll_used) {
dword i;
 
dword sc_x = files.x + files.w;
23,8 → 23,10
//slider
DrawRectangle(sc_x,sc_slider_y,16,sc_slider_h,sc.work_graph);
DrawRectangle3D(sc_x+1,sc_slider_y+1,14,sc_slider_h-2, sc.work_light , sc.work_dark);
if (!scroll_used) for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col.work_gradient[13-i]);
if (scroll_used) for (i=0; i<13; i++) DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, col.work_gradient[i]);
for (i=0; i<13; i++) {
if (!_scroll_used) EDX = col.work_gradient[13-i]; else EDX = col.work_gradient[i];
DrawBar(sc_x + 2 + i, sc_slider_y+2, 1, sc_slider_h-3, EDX);
}
 
sc_center = sc_slider_h / 2 + sc_slider_y;
 
/programs/cmm/eolite/include/progress_dialog.h
14,7 → 14,6
COPY_FLAG,
MOVE_FLAG,
DELETE_FLAG,
OPERATION_END
};
 
void DisplayOperationForm(int operation_flag)
57,7 → 56,6
}
 
void DialogExit() {
action_buf = OPERATION_END;
ActivateWindow(GetProcessSlot(Form.ID));
ExitProcess();
}
/programs/cmm/eolite/include/properties.h
131,10 → 131,7
}
 
cmd_free=3;
_not_draw = true;
Open_Dir(#path,WITH_REDRAW);
_not_draw = false;
EventRedrawWindow(Form.left,Form.top);
Open_Dir(#path,ONLY_OPEN);
ExitProcess();
}
 
/programs/cmm/eolite/include/settings.h
27,6 → 27,9
?define START_PATH " Start path: "
#endif
 
dword eolite_ini_path[4096];
_ini ini;
 
char path_start[4096];
edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,4098,
#path_start,0, 100000000000010b,0,0};