From 00b4e63b4ed3768ace2daecb84b7e2a84023ba78 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Tue, 4 Jul 2017 15:14:51 +0000 Subject: [PATCH] Eolite: fix http://board.kolibrios.org/viewtopic.php?p=67807#p67807 git-svn-id: svn://kolibrios.org@6930 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 20 ++++++++++++++------ programs/cmm/eolite/include/about.h | 2 +- programs/cmm/eolite/include/gui.h | 9 +-------- programs/cmm/eolite/include/translations.h | 2 ++ programs/cmm/lib/file_system.h | 2 +- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index f7c2c06017..cf367ba067 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -146,8 +146,16 @@ void main() SetAppColors(); if (param) { - strcpy(#path, #param); - if (path[strlen(#path)-1]=='/') path[strlen(#path)-1]=NULL; //no "/" in the end + if (param[strlen(#param)-1]=='/') param[strlen(#param)-1]=NULL; //no "/" in the end + + if (dir_exists(#param)==true) + { + strcpy(#path, #param); + } + else + { + notify(T_NOTIFY_APP_PARAM_WRONG); + } } Open_Dir(#path,ONLY_OPEN); @@ -214,7 +222,7 @@ void main() if (mouse.key&MOUSE_LEFT) && (mouse.up) { if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw(); - else if (mouse.dblclick)) Open(0); + else if (mouse.dblclick) Open(0); } //file menu if (mouse.key&MOUSE_RIGHT) @@ -909,9 +917,9 @@ inline fastcall void GoBack() void ShowOpenWithDialog() { - byte param[4097]; - sprintf(#param,"~%s",#file_path); - RunProgram("/sys/@open", #param); + byte open_param[4097]; + sprintf(#open_param,"~%s",#file_path); + RunProgram("/sys/@open", #open_param); } void NewElement(byte newf) diff --git a/programs/cmm/eolite/include/about.h b/programs/cmm/eolite/include/about.h index 780a6eb6ce..24e0f4fcd5 100644 --- a/programs/cmm/eolite/include/about.h +++ b/programs/cmm/eolite/include/about.h @@ -43,7 +43,7 @@ void about_dialog() WriteTextB(about_x+2,107,0x82,0xD49CD2,ABOUT_TITLE); WriteTextB(about_x,105,0x82,0x9D129D,ABOUT_TITLE); DrawRectangle3D(0,154,about_form.cwidth,1,system.color.work_dark,system.color.work_light); - WriteTextLines(7,163,0x90,system.color.work_text,"KolibriOS File Manager\nAuthors: Leency, Veliant\nPunk_Joker, Pavelyakov\n(c) 2008 - 2016",20); + WriteTextLines(7,163,0x90,system.color.work_text,"KolibriOS File Manager\nAuthors: Leency, Veliant\nPunk_Joker, Pavelyakov\n(c) 2008 - 2017",20); #ifdef LANG_RUS DrawFlatButton(60,about_form.cheight-38,11,"История разработки"); #endif diff --git a/programs/cmm/eolite/include/gui.h b/programs/cmm/eolite/include/gui.h index fae3419def..5889598d30 100644 --- a/programs/cmm/eolite/include/gui.h +++ b/programs/cmm/eolite/include/gui.h @@ -57,14 +57,7 @@ int DrawFlatButton(dword x, y, id, text) int padding_w = 15; int width = strlen(text) * 8 + padding_w + padding_w; int height = 25; - dword border_3d_light = MixColors(system.color.work_button,0xFFFfff,140); - dword border_3d_dark = MixColors(system.color.work_button,0x111111,220); - dword border_light = MixColors(system.color.work_button,0x111111,140); - dword border_dark = MixColors(system.color.work_button,0x111111,100); - DrawRectangle3D(x,y,width,height,border_light, border_dark); - DrawRectangle3D(x+1,y+1,width-2,height-2, border_3d_light, border_3d_dark); - DrawBar(x+2, y+2, width-3, height-3, system.color.work_button); - if (id) DefineButton(x+1,y+1,width-2,height-2,id+BT_HIDE,0xEFEBEF); + if (id) DefineButton(x+1,y+1,width-2,height-2,id,system.color.work_button); WriteText(x+padding_w,height/2+y-6,0x90,system.color.work_button_text,text); return width + padding_w; } diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index 1b453e04d6..5f43e00e43 100644 --- a/programs/cmm/eolite/include/translations.h +++ b/programs/cmm/eolite/include/translations.h @@ -16,6 +16,7 @@ ?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_COPY_WINDOW_TEXT "Копируется файл:" ?define T_MOVE_WINDOW_TITLE "Перемещаю..." @@ -45,6 +46,7 @@ ?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 exists!' -E" ?define T_COPY_WINDOW_TITLE "Copying..." ?define T_COPY_WINDOW_TEXT "Copying file:" ?define T_MOVE_WINDOW_TITLE "Moving..." diff --git a/programs/cmm/lib/file_system.h b/programs/cmm/lib/file_system.h index f19696869b..ba526098ed 100644 --- a/programs/cmm/lib/file_system.h +++ b/programs/cmm/lib/file_system.h @@ -200,7 +200,7 @@ :char dir_exists(dword fpath) { BDVK fpath_atr; - GetFileInfo(fpath, #fpath_atr); + if (GetFileInfo(fpath, #fpath_atr) != 0) return false; return fpath_atr.isfolder; } :char file_exists(dword fpath)