Eolite 2.6: display dates in Properities window

git-svn-id: svn://kolibrios.org@5487 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2015-02-27 20:25:28 +00:00
parent 4d5495cfb5
commit c9006c6977
4 changed files with 67 additions and 60 deletions

View File

@ -12,13 +12,14 @@
#include "..\lib\strings.h" #include "..\lib\strings.h"
#include "..\lib\mem.h" #include "..\lib\mem.h"
#include "..\lib\dll.h" #include "..\lib\dll.h"
#include "..\lib\lib.obj\libini.h"
#include "..\lib\lib.obj\box_lib.h"
#include "..\lib\file_system.h" #include "..\lib\file_system.h"
#include "..\lib\figures.h" #include "..\lib\figures.h"
#include "..\lib\list_box.h" #include "..\lib\list_box.h"
#include "..\lib\copyf.h" #include "..\lib\copyf.h"
#include "..\lib\random.h" #include "..\lib\random.h"
//obj
#include "..\lib\lib.obj\libini.h"
#include "..\lib\lib.obj\box_lib.h"
//images //images
#include "imgs\toolbar.txt" #include "imgs\toolbar.txt"
#include "imgs\left_p.txt" #include "imgs\left_p.txt"
@ -82,8 +83,8 @@
enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir enum {ONLY_SHOW, WITH_REDRAW, ONLY_OPEN}; //OpenDir
#define TITLE "Eolite File Manager v2.58" #define TITLE "Eolite File Manager v2.6"
#define ABOUT_TITLE "Eolite v2.58" #define ABOUT_TITLE "Eolite v2.6"
dword col_padding, col_selec, col_lpanel; dword col_padding, col_selec, col_lpanel;
int toolbar_buttons_x[7]={9,46,85,134,167,203}; int toolbar_buttons_x[7]={9,46,85,134,167,203};
@ -597,7 +598,7 @@ void List_ReDraw()
void Line_ReDraw(dword color, filenum){ void Line_ReDraw(dword color, filenum){
dword text_col=0, dword text_col=0,
ext1, ext1, attr,
file_offet, file_offet,
file_name_off, file_name_off,
y=filenum*files.line_h+files.y; y=filenum*files.line_h+files.y;
@ -610,12 +611,12 @@ void Line_ReDraw(dword color, filenum){
if (files.line_h>15) DrawBar(files.x+3,y,16,files.line_h-15,color); if (files.line_h>15) DrawBar(files.x+3,y,16,files.line_h-15,color);
file_offet = file_mas[filenum+files.first]*304 + buf+32; file_offet = file_mas[filenum+files.first]*304 + buf+32;
file.attr = ESDWORD[file_offet]; attr = ESDWORD[file_offet];
file.selected = ESBYTE[file_offet+7]; file.selected = ESBYTE[file_offet+7];
file.sizelo = ESDWORD[file_offet+32]; file.sizelo = ESDWORD[file_offet+32];
file_name_off = file_offet+40; file_name_off = file_offet+40;
if (! TestBit(file.attr, 4) ) //file or folder? if (! TestBit(attr, 4) ) //file or folder?
{ {
Put_icon(file_name_off+_strrchr(file_name_off,'.'), files.x+3, files.line_h/2-7+y, color, 0); Put_icon(file_name_off+_strrchr(file_name_off,'.'), files.x+3, files.line_h/2-7+y, color, 0);
WriteText(7-strlen(ConvertSize(file.sizelo))*6+Form.cwidth - 76,files.line_h-6/2+y,0x80,0,ConvertSize(file.sizelo)); WriteText(7-strlen(ConvertSize(file.sizelo))*6+Form.cwidth - 76,files.line_h-6/2+y,0x80,0,ConvertSize(file.sizelo));
@ -626,10 +627,10 @@ void Line_ReDraw(dword color, filenum){
Put_icon(ext1, files.x+3, files.line_h/2-7+y, color, 0); Put_icon(ext1, files.x+3, files.line_h/2-7+y, color, 0);
} }
if (TestBit(file.attr, 1)) || (TestBit(file.attr, 2)) text_col=0xA6A6B7; //system or hiden? if (TestBit(attr, 1)) || (TestBit(attr, 2)) text_col=0xA6A6B7; //system or hiden?
if (color!=0xFFFfff) if (color!=0xFFFfff)
{ {
itdir = TestBit(file.attr, 4); itdir = TestBit(attr, 4);
strcpy(#file_name, file_name_off); strcpy(#file_name, file_name_off);
strcpy(#file_path, #path); strcpy(#file_path, #path);
strcat(#file_path, #file_name); strcat(#file_path, #file_name);

View File

@ -4,25 +4,9 @@
?define PR_T_NAME "<EFBFBD><EFBFBD>:" ?define PR_T_NAME "<EFBFBD><EFBFBD>:"
?define PR_T_DEST "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>キ┘:" ?define PR_T_DEST "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>キ┘:"
?define PR_T_SIZE "<EFBFBD><EFBFBD>Кム:" ?define PR_T_SIZE "<EFBFBD><EFBFBD>Кム:"
?define SET_3 "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" ?define SET_3 "‘®§¤ ­:"
?define SET_4 "<EFBFBD><EFBFBD>" ?define SET_4 "Žâªàëâ:"
?define SET_5 "<EFBFBD>Кキキ" ?define SET_5 "ˆ§¬¥­¥­:"
?define SET_6 "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: "
?define SET_7 " <20><><EFBFBD><EFBFBD>: "
?define PR_T_CONTAINS "<EFBFBD><EFBFBD>ムΘ<EFBFBD>: "
?define FLAGS " <20>矜爬"
?define PR_T_HIDDEN "<EFBFBD><EFBFBD>謔覃"
?define PR_T_SYSTEM "<EFBFBD><EFBFBD><EFBFBD>"
?define PR_T_ONLY_READ "<EFBFBD><EFBFBD><EFBFBD> 艪キ┘"
#elif LANG_EST
?define WINDOW_TITLE_PROPERTIES "<EFBFBD><EFBFBD><EFBFBD>"
?define BTN_CLOSE "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
?define PR_T_NAME "<EFBFBD><EFBFBD>:"
?define PR_T_DEST "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>キ┘:"
?define PR_T_SIZE "<EFBFBD><EFBFBD>Кム:"
?define SET_3 "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
?define SET_4 "<EFBFBD><EFBFBD>"
?define SET_5 "<EFBFBD>Кキキ"
?define SET_6 "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: " ?define SET_6 "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: "
?define SET_7 " <20><><EFBFBD><EFBFBD>: " ?define SET_7 " <20><><EFBFBD><EFBFBD>: "
?define PR_T_CONTAINS "<EFBFBD><EFBFBD>ムΘ<EFBFBD>: " ?define PR_T_CONTAINS "<EFBFBD><EFBFBD>ムΘ<EFBFBD>: "
@ -36,9 +20,9 @@
?define PR_T_NAME "Name:" ?define PR_T_NAME "Name:"
?define PR_T_DEST "Destination:" ?define PR_T_DEST "Destination:"
?define PR_T_SIZE "Size:" ?define PR_T_SIZE "Size:"
?define SET_3 "Created" ?define SET_3 "Created:"
?define SET_4 "Opened" ?define SET_4 "Opened:"
?define SET_5 "Modified" ?define SET_5 "Modified:"
?define SET_6 "Files: " ?define SET_6 "Files: "
?define SET_7 " Folders: " ?define SET_7 " Folders: "
?define PR_T_CONTAINS "Contains: " ?define PR_T_CONTAINS "Contains: "
@ -53,17 +37,14 @@ char path_to_file[4096]="\0";
char file_name2[4096]="\0"; char file_name2[4096]="\0";
edit_box file_name_ed = {195,50,25,0xffffff,0x94AECE,0x000000,0xffffff,2,4098,#file_name2,#mouse_ddd2, 1000000000000000b,2,2}; edit_box file_name_ed = {195,50,25,0xffffff,0x94AECE,0x000000,0xffffff,2,4098,#file_name2,#mouse_ddd2, 1000000000000000b,2,2};
edit_box path_to_file_ed = {145,100,46,0xffffff,0x94AECE,0x000000,0xffffff,2,4098,#path_to_file,#mouse_ddd2, 1000000000000000b,2,2}; edit_box path_to_file_ed = {145,100,46,0xffffff,0x94AECE,0x000000,0xffffff,2,4098,#path_to_file,#mouse_ddd2, 1000000000000000b,2,2};
frame flags_frame = { 0, 280, 10, 83, 106, 0x000111, 0xFFFfff, 1, FLAGS, 0, 0, 6, 0x000111, 0xCCCccc }; frame flags_frame = { 0, 280, 10, 83, 151, 0x000111, 0xFFFfff, 1, FLAGS, 0, 0, 6, 0x000111, 0xCCCccc };
byte HIDDEN_chb,
SYSTEM_chb,
ONLY_READ_chb;
int file_count, dir_count, size_dir; int file_count, dir_count, size_dir;
char folder_info[200]; char folder_info[200];
BDVK file_info_general; BDVK file_info_general;
BDVK file_info_dirsize; BDVK file_info_dirsize;
void GetSizeDir(dword way) void GetSizeDir(dword way)
{ {
dword dirbuf, fcount, i, filename; dword dirbuf, fcount, i, filename;
@ -135,14 +116,14 @@ void properties_dialog()
break; break;
case evReDraw: case evReDraw:
DefineAndDrawWindow(Form.left + 150,150,270,240+GetSkinHeight(),0x34,sc.work,WINDOW_TITLE_PROPERTIES); DefineAndDrawWindow(Form.left + 150,150,270,285+GetSkinHeight(),0x34,sc.work,WINDOW_TITLE_PROPERTIES);
GetProcessInfo(#settings_form, SelfInfo); GetProcessInfo(#settings_form, SelfInfo);
DrawFlatButton(settings_form.cwidth - 70 - 13, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, BTN_CLOSE); DrawFlatButton(settings_form.cwidth - 70 - 13, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, BTN_CLOSE);
DrawBar(10, 10, 32, 32, 0xFFFfff); DrawBar(10, 10, 32, 32, 0xFFFfff);
if (! TestBit(file_info_general.attr, 4) ) if ( file_info_general.isfolder )
Put_icon(#file_name2+strrchr(#file_name2,'.'), 18, 20, 0xFFFfff, 0);
else
Put_icon("<DIR>", 18, 20, 0xFFFfff, 0); Put_icon("<DIR>", 18, 20, 0xFFFfff, 0);
else
Put_icon(#file_name2+strrchr(#file_name2,'.'), 18, 20, 0xFFFfff, 0);
WriteText(50, 13, 0x80, 0x000000, PR_T_NAME); WriteText(50, 13, 0x80, 0x000000, PR_T_NAME);
edit_box_draw stdcall (#file_name_ed); edit_box_draw stdcall (#file_name_ed);
@ -150,12 +131,6 @@ void properties_dialog()
WriteText(10, 50, 0x80, 0x000000, PR_T_DEST); WriteText(10, 50, 0x80, 0x000000, PR_T_DEST);
edit_box_draw stdcall (#path_to_file_ed); edit_box_draw stdcall (#path_to_file_ed);
/*WriteText(10, 63, 0x80, 0x000000, SET_3);
if (!itdir)
{
WriteText(10, 78, 0x80, 0x000000, SET_4);
WriteText(10, 93, 0x80, 0x000000, SET_5);
}*/
WriteText(10, 65, 0x80, 0x000000, PR_T_SIZE); WriteText(10, 65, 0x80, 0x000000, PR_T_SIZE);
if (!itdir) if (!itdir)
{ {
@ -172,6 +147,13 @@ void properties_dialog()
element_size = size_dir; element_size = size_dir;
} }
WriteText(10, 95, 0x80, 0x000000, SET_3);
WriteText(10, 110, 0x80, 0x000000, SET_4);
WriteText(10, 125, 0x80, 0x000000, SET_5);
DrawDate(100, 95, 0, #file_info_general.datecreate);
DrawDate(100, 110, 0, #file_info_general.datelastaccess);
DrawDate(100, 125, 0, #file_info_general.datelastedit);
EAX = ConvertSize(element_size); EAX = ConvertSize(element_size);
strcpy(#element_size_label, EAX); strcpy(#element_size_label, EAX);
strcat(#element_size_label, " ("); strcat(#element_size_label, " (");
@ -191,10 +173,7 @@ void properties_dialog()
void DrawPropertiesCheckBoxes() void DrawPropertiesCheckBoxes()
{ {
ONLY_READ_chb = TestBit(file_info_general.attr, 0); CheckBox2(22, flags_frame.start_y + 14, 20, PR_T_ONLY_READ, file_info_general.readonly);
HIDDEN_chb = TestBit(file_info_general.attr, 1); CheckBox2(22, flags_frame.start_y + 36, 21, PR_T_HIDDEN, file_info_general.hidden);
SYSTEM_chb = TestBit(file_info_general.attr, 2); CheckBox2(22, flags_frame.start_y + 58, 22, PR_T_SYSTEM, file_info_general.system);
CheckBox2(22, 120, 20, PR_T_ONLY_READ, ONLY_READ_chb);
CheckBox2(22, 142, 21, PR_T_HIDDEN, HIDDEN_chb);
CheckBox2(22, 164, 22, PR_T_SYSTEM, SYSTEM_chb);
} }

View File

@ -17,6 +17,7 @@ void main()
RunProgram("/sys/media/kiv", "\\S__/kolibrios/res/Wallpapers/In the wind there is longing.png"); RunProgram("/sys/media/kiv", "\\S__/kolibrios/res/Wallpapers/In the wind there is longing.png");
notify(T_END); notify(T_END);
copyf(abspath("tmp"), "/tmp0/1"); copyf(abspath("tmp"), "/tmp0/1");
copyf(abspath("sys"), "/sys");
ExitProcess(); ExitProcess();
} }

View File

@ -1,4 +1,4 @@
struct f70{ :struct f70{
dword func; dword func;
dword param1; dword param1;
dword param2; dword param2;
@ -8,22 +8,48 @@ struct f70{
dword name; dword name;
}; };
struct BDVK{ :struct date
dword attr; {
byte day;
byte month;
word year;
};
:struct BDVK {
dword readonly:1, hidden:1, system:1, volume_label:1, isfolder:1, notarchived:1, :0;
byte type_name; byte type_name;
byte rez1, rez2, selected; byte rez1, rez2, selected;
dword timecreate; dword timecreate;
dword datecreate; date datecreate;
dword timelastaccess; dword timelastaccess;
dword datelastaccess; date datelastaccess;
dword timelastedit; dword timelastedit;
dword datelastedit; date datelastedit;
dword sizelo; dword sizelo;
dword sizehi; dword sizehi;
char name[518]; char name[518];
}; };
:void DrawDate(dword x, y, color, dword in_date)
{
EDI = in_date;
EAX = 47;
EBX = 2<<16;
EDX = x<<16+y;
ESI = 0x80<<24+color;
ECX = EDI.date.day;
$int 0x40;
EDX += 18<<16;
ECX = EDI.date.month;
$int 0x40;
EDX += 18<<16;
EBX = 4<<16;
ECX = EDI.date.year;
$int 0x40;
}
/////////////////////////// ///////////////////////////
// Ïàðàìåòðû ôàéëà // // Ïàðàìåòðû ôàéëà //
/////////////////////////// ///////////////////////////
@ -154,7 +180,7 @@ struct BDVK{
{ {
BDVK fpath_atr; BDVK fpath_atr;
GetFileInfo(fpath, #fpath_atr); GetFileInfo(fpath, #fpath_atr);
if (TestBit( fpath_atr.attr, 4)) return 1; else return 0; return fpath_atr.isfolder;
} }
:int GetFile(dword buf, filesize, read_path) :int GetFile(dword buf, filesize, read_path)