Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 8854 → Rev 8853

/programs/cmm/eolite/Eolite.c
3,8 → 3,8
 
// 70.5 - get volume info and label
 
#define TITLE "Eolite File Manager 5 Beta"
#define ABOUT_TITLE "EOLITE 5 Beta"
#define TITLE "Eolite File Manager 4.80"
#define ABOUT_TITLE "EOLITE 4.80"
 
#ifndef AUTOBUILD
#include "lang.h--"
37,16 → 37,7
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
BREADCRUMB_ID = 300
};
 
//NewElement options
94,11 → 85,9
bool exif_load = false;
bool dir_at_fat16 = NULL;
 
bool dev_popin_active_on_panel=0;
word about_thread_id;
word settings_window;
 
dword about_thread_id;
dword settings_window;
 
byte del_active=0;
byte new_element_active=0;
 
252,7 → 241,7
loop() switch(@WaitEventTimeout(80))
{
case evMouse:
if (del_active) || (dev_popin_active_on_panel) || (Form.status_window>2) break;
if (del_active) || (Form.status_window>2) break;
if (new_element_active)
{
edit_box_mouse stdcall(#new_file_ed);
342,7 → 331,7
break;
}
 
if (efm) && (mouse.y > files.y) && (mouse.down) {
if (two_panels.checked) && (mouse.y > files.y) && (mouse.down) {
if (mouse.x<Form.cwidth/2)
{
if (active_panel!=1)
365,11 → 354,10
case evButton:
id = GetButtonID();
 
if (new_element_active) || (del_active) || (dev_popin_active_on_panel) {
if (new_element_active) || (del_active) {
if (POPUP_BTN1==id) && (del_active) EventDelete();
if (POPUP_BTN1==id) && (new_element_active) NewElement();
if (POPUP_BTN2==id) EventClosePopinForm();
if (dev_popin_active_on_panel) EventDriveClick(id);
break;
}
 
383,30 → 371,24
notify(COPY_PATH_STR);
Clipboard__CopyText(#path);
break;
case KFM_DEV_DROPDOWN_1:
case KFM_DEV_DROPDOWN_1+1:
dev_popin_active_on_panel = 1;
SystemDiscs.DrawOptions(Form.cwidth/2-DDW, 8+DEV_H_HOR+3);
case 21: //Back
EventHistoryGoBack();
break;
case KFM_DEV_DROPDOWN_2:
case KFM_DEV_DROPDOWN_2+1:
dev_popin_active_on_panel = 2;
SystemDiscs.DrawOptions(Form.cwidth-DDW-2, 8+DEV_H_HOR+3);
case 22: //Forward
EventHistoryGoForward();
break;
case BACK_BTN...PASTE_BTN:
if (active_panel==2) {
active_panel = 1;
ChangeActivePanel();
}
EventToolbarButtonClick(id);
case 23:
Dir_Up();
break;
case BACK_BTN+100...PASTE_BTN+100:
if (active_panel==1) {
active_panel = 2;
ChangeActivePanel();
}
EventToolbarButtonClick(id-100);
case 24:
EventCopy(CUT);
break;
case 25:
EventCopy(NOCUT);
break;
case 26:
EventPaste();
break;
case 31...33:
EventSort(id-30);
break;
420,7 → 402,7
SetDefaultPath(#path);
break;
case 100...120:
EventDriveClick(id);
SystemDiscs.Click(id-100);
break;
case BREADCRUMB_ID...360:
ClickOnBreadCrumb(id-BREADCRUMB_ID);
434,16 → 416,15
 
if (Form.status_window>2) break;
 
if (new_element_active) || (del_active) || (dev_popin_active_on_panel)
if (new_element_active) || (del_active)
{
if (dev_popin_active_on_panel) {
if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm();
}
if (del_active) {
if (del_active)
{
if (key_scancode == SCAN_CODE_ENTER) EventDelete();
if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm();
}
if (new_element_active) {
if (new_element_active)
{
if (key_scancode == SCAN_CODE_ENTER) NewElement();
if (key_scancode == SCAN_CODE_ESC) EventClosePopinForm();
EAX = key_editbox;
481,7 → 462,7
case SCAN_CODE_1...SCAN_CODE_10:
key_scancode-=2;
if (key_scancode >= SystemDiscs.list.count) break;
if (!efm)
if (!two_panels.checked)
{
DrawRectangle(17,key_scancode*16+74,159,16, 0); //display click
pause(7);
498,7 → 479,7
EventOpenConsoleHere();
break;
case SCAN_CODE_KEY_V:
EventPaste(#path);
EventPaste();
break;
case SCAN_CODE_KEY_D: //set image as bg
strlcpy(#temp, "\\S__",4);
511,9 → 492,6
case SCAN_CODE_KEY_M:
Open_Dir(#inactive_path,WITH_REDRAW);
break;
case SCAN_CODE_KEY_R:
EventRefresh();
break;
case SCAN_CODE_ENTER:
if (!itdir) ShowOpenWithDialog();
else EventOpen(1);
531,6 → 509,7
switch (key_scancode)
{
case SCAN_CODE_BS:
//EventHistoryGoBack();
Dir_Up();
break;
case SCAN_CODE_ENTER:
537,7 → 516,7
EventOpen(0);
break;
case SCAN_CODE_TAB:
if (!efm) break;
if (!two_panels.checked) break;
if (active_panel==1) active_panel=2; else active_panel=1;
ChangeActivePanel();
DrawFilePanels();
569,7 → 548,7
if (CheckActiveProcess(Form.ID)) && (GetMenuClick()) break;
if (action_buf==OPERATION_END)
{
EventRefresh();
FnProcess(5);
action_buf=0;
}
break;
590,35 → 569,29
 
void draw_window()
{
dword i=0;
dword i;
incn x;
dword title;
if (show_status_bar.checked) status_bar_h = STATUS_BAR_H; else status_bar_h = 0;
if (efm) title = "Kolibri File Manager 2 - BETA"; else title = TITLE;
DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,title,0);
DefineAndDrawWindow(Form.left+rand_n,Form.top+rand_n,Form.width,Form.height,0x73,NULL,TITLE,0);
GetProcessInfo(#Form, SelfInfo);
if (Form.status_window>2) return;
if (Form.height < 356) { MoveSize(OLD,OLD,OLD,356); return; }
if (Form.height < 350) { MoveSize(OLD,OLD,OLD,350); return; }
GetProcessInfo(#Form, SelfInfo);
SetAppColors();
if (efm) {
if (screen.width > 693) && (Form.width < 693) { MoveSize(OLD,OLD,693,OLD); return; }
if (two_panels.checked) {
if (Form.width < 573) { MoveSize(OLD,OLD,573,OLD); return; }
DrawBar(0, 0, Form.cwidth, 34, sc.work);
#define PAD 7
#define GAP_S 26+5
#define GAP_B 26+14
x.set(Form.cwidth/2-DDW-203/2-GAP_S);
while (i<200) {
DrawTopPanelButton(i+BACK_BTN, x.inc(GAP_S), PAD, 30, false);
DrawTopPanelButton(i+FWRD_BTN, x.inc(GAP_S), PAD, 31, false);
DrawTopPanelButton(i+GOUP_BTN, x.inc(GAP_B), PAD, 01, false);
DrawTopPanelButton(i+COPY_BTN, x.inc(GAP_B), PAD, 55, false);
DrawTopPanelButton(i+CUT_BTN, x.inc(GAP_S), PAD, 20, false);
DrawTopPanelButton(i+PASTE_BTN,x.inc(GAP_S), PAD, 56, false);
x.set(Form.cwidth/2-DDW-203/2-GAP_S+calc(Form.cwidth/2));
i+=100;
}
//DrawTopPanelButton(51, Form.cwidth-GAP_S-PAD, PAD, -1, false); //burger menu
x.set(-GAP_S+8);
DrawTopPanelButton(21, x.inc(GAP_S), PAD, 30, false);
DrawTopPanelButton(22, x.inc(GAP_S), PAD, 31, false);
DrawTopPanelButton(23, x.inc(GAP_B), PAD, 01, false);
DrawTopPanelButton(24, x.inc(GAP_B), PAD, 55, false);
DrawTopPanelButton(25, x.inc(GAP_S), PAD, 20, false);
DrawTopPanelButton(26, x.inc(GAP_S), PAD, 56, false);
DrawTopPanelButton(51, Form.cwidth-GAP_S-PAD, PAD, -1, false); //burger menu
} else {
if (Form.width < 480) { MoveSize(OLD,OLD,480,OLD); return; }
ESDWORD[#toolbar_pal] = sc.work;
643,7 → 616,6
DrawStatusBar();
if (!selected_count) Open_Dir(#path,ONLY_OPEN); //if there are no selected files -> refresh folder [L001]
DrawFilePanels();
dev_popin_active_on_panel = 0;
}
 
void DrawList()
661,7 → 633,7
if (sort_type==3) sorting_arrow_x = strlen(T_SIZE)*3-30+files.x+files.w;
WriteText(sorting_arrow_x,files.y-12,0x80, sc.work_text, sorting_arrow_t);
DrawBar(files.x+files.w,files.y,1,files.h,sc.work_graph);
if (efm) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,sc.work_graph);
if (two_panels.checked) && (files.x<5) DrawBar(files.x+files.w+16,files.y,1,files.h,sc.work_graph);
}
 
void DrawStatusBar()
668,13 → 640,6
{
char status_bar_str[80];
int go_up_folder_exists=0;
 
if (efm) {
DrawBar(0, Form.cheight - status_bar_h, Form.cwidth, status_bar_h, sc.work);
WriteTextCenter(0,Form.cheight - 12, Form.cwidth,sc.work_text,T_KFM_FUNC);
return;
}
 
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);
692,7 → 657,7
int files_y;
int w2 = -Form.cwidth-1/2+Form.cwidth;
int h2;
if (!efm)
if (!two_panels.checked)
{
DrawDeviceAndActionsLeftPanel();
files.SetSizes(192, 57, Form.cwidth - 210, Form.cheight - 59 - status_bar_h, files.item_h);
890,7 → 855,7
kfont.WriteIntoWindow(files.x + icon_size+7, files.item_h - kfont.height / 2 + y,
bgcol, text_col, kfont.size.pt, #label_file_name);
}
if (bgcol == col.selec_inactive) DrawWideRectangle(files.x+2, y, files.w-4, files.item_h, 2, col.selec_active);
if (bgcol == col.selec_inactive) DrawWideRectangle(files.x+2, y, files.w-4, files.item_h, 2, 0x92B1D9);
 
sprintf(#full_path,"%s/%s",#path,file_name_off);
DrawIconByExtension(#full_path, ext1, files.x+4, icon_y, bgcol);
915,7 → 880,7
}
if (files.count!=-1)
{
if(!_not_draw) DrawPathBar();
if(!_not_draw) if (show_breadcrumb.checked) DrawBreadCrumbs(); else DrawPathBar();
history.add(#path);
SystemDiscs.Draw();
files.visible = files.h / files.item_h;
1191,19 → 1156,21
case 4:
if (files.count) && (!itdir) RunProgram("/sys/develop/cedit", #file_path);
break;
case 5:
if (efm) {
EventCopy(false);
EventPaste(#inactive_path);
case 5: //refresh cur dir & devs
if (two_panels.checked)
{
DrawFilePanels();
} else {
EventRefresh();
Tip(56, T_DEVICES, 55, "-");
Open_Dir(#path,WITH_REDRAW);
pause(10);
SystemDiscs.Get();
Open_Dir(#path,WITH_REDRAW);
DrawDeviceAndActionsLeftPanel();
}
break;
case 6:
if (efm) {
EventCopy(true);
EventPaste(#inactive_path);
}
//Move
break;
case 7:
NewElement_Form(CREATE_FOLDER, T_NEW_FOLDER);
1229,21 → 1196,6
}
}
 
void EventRefresh()
{
if (efm)
{
DrawFilePanels();
} else {
Tip(56, T_DEVICES, 55, "-");
Open_Dir(#path,WITH_REDRAW);
pause(10);
SystemDiscs.Get();
Open_Dir(#path,WITH_REDRAW);
DrawDeviceAndActionsLeftPanel();
}
}
 
void ChangeActivePanel()
{
llist_copy(#files_active, #files_inactive);
1294,9 → 1246,9
void EventRefreshDisksAndFolders()
{
if(GetRealFileCountInFolder("/")+dir_exists("/kolibrios") != SystemDiscs.dev_num) {
EventRefresh();
FnProcess(5);
}
if(efm)
if(two_panels.checked)
{
if(GetRealFileCountInFolder(#inactive_path) != files_inactive.count) {
ChangeActivePanel();
1304,7 → 1256,9
ChangeActivePanel();
}
if(GetRealFileCountInFolder(#path) != files.count) Open_Dir(#path,WITH_REDRAW);
} else {
}
else
{
if(GetRealFileCountInFolder(#path) != files.count) Open_Dir(#path,WITH_REDRAW);
}
}
1376,9 → 1330,9
}
}
 
void EventPaste(dword _into_path) {
void EventPaste() {
char paste_line[4096+6];
sprintf(#paste_line, "-v%i %s", cut_active, _into_path);
sprintf(#paste_line, "-v%i %s", cut_active, #path);
RunProgram(#program_path, #paste_line);
EventClosePopinForm();
}
1400,10 → 1354,9
{
del_active = 0;
new_element_active = 0;
dev_popin_active_on_panel = 0;
draw_window();
//DeleteButton(POPUP_BTN1);
//DeleteButton(POPUP_BTN2);
DeleteButton(POPUP_BTN1);
DeleteButton(POPUP_BTN2);
}
 
void EventShowProperties()
1447,29 → 1400,6
DrawStatusBar();
}
 
void EventToolbarButtonClick(int _btid)
{
switch(_btid) {
case BACK_BTN: EventHistoryGoBack(); break;
case FWRD_BTN: EventHistoryGoForward(); break;
case GOUP_BTN: Dir_Up(); break;
case COPY_BTN: EventCopy(CUT); break;
case CUT_BTN: EventCopy(NOCUT); break;
case PASTE_BTN:EventPaste(#path); break;
}
}
 
void EventDriveClick(int __id)
{
if (dev_popin_active_on_panel != active_panel) {
if (active_panel == 1) active_panel=2; else active_panel=1;
ChangeActivePanel();
}
 
SystemDiscs.Click(__id-100);
if (efm) {
draw_window();
}
}
 
stop: