From a428a4fd4284b1b8d7497cf17af427cefab766a7 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Wed, 19 Aug 2015 13:17:24 +0000 Subject: [PATCH] Eolite 3.06: Remember win size and pos git-svn-id: svn://kolibrios.org@5748 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 27 +++++++------- programs/cmm/eolite/compile_ru.bat | 1 + programs/cmm/eolite/include/settings.h | 42 +++++++++++++--------- programs/cmm/eolite/include/translations.h | 4 +-- programs/cmm/pixie/settings.h | 30 ++++++++-------- 5 files changed, 57 insertions(+), 47 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 29475ec713..ed149bcf42 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -58,16 +58,6 @@ byte temp[4096], itdir; -//struct t_settings { -byte font_size=9, - sort_num=2, - show_dev_name=true, - real_files_names_case=false, - info_after_copy=false, - two_panels=false, - active_panel=1; -//} settings; - char active_path[4096], inactive_path[4096]; dword eolite_ini_path; @@ -83,14 +73,22 @@ int action_buf; int rand_n; byte CMD_REFRESH; -signed x_old, y_old, dif_x, dif_y, adif_x, adif_y; - +//struct t_settings { +byte font_size=9, + sort_num=2, + show_dev_name=true, + real_files_names_case=false, + info_after_copy=false, + two_panels=false, + active_panel=1; +//} settings; edit_box new_file_ed = {171,213,180,0xFFFFFF,0x94AECE,0xFFFFFF,0xFFFFFF,0,248,#new_element_name,#mouse_dd,100000000000010b,6,0}; PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0}; PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0}; byte cmd_free=0; #include "include\translations.h" +#include "include\settings.h" #include "include\copy.h" #include "include\gui.h" #include "include\sorting.h" @@ -99,13 +97,13 @@ byte cmd_free=0; #include "include\history.h" #include "include\menu.h" #include "include\about.h" -#include "include\settings.h" #include "include\properties.h" void main() { word id; + signed x_old, y_old, dif_x, dif_y, adif_x, adif_y; char can_show, can_select, stats; dword selected_offset; dword IPC_LEN,IPC_ID; @@ -296,6 +294,7 @@ void main() if (id==1) { KillProcess(about_window); + SaveIniSettings(); ExitProcess(); } if (del_active) @@ -526,7 +525,7 @@ void main() void draw_window() { - DefineAndDrawWindow(GetScreenWidth()-550/4+rand_n,rand_n+30,550,500,0x73,system.color.work,TITLE,0); + DefineAndDrawWindow(WinX+rand_n,WinY+rand_n,WinW,WinH,0x73,system.color.work,TITLE,0); GetProcessInfo(#Form, SelfInfo); if (Form.status_window>2) return; if (Form.height < 350) MoveSize(OLD,OLD,OLD,350); diff --git a/programs/cmm/eolite/compile_ru.bat b/programs/cmm/eolite/compile_ru.bat index ef16bdf7f4..85fcc7a814 100644 --- a/programs/cmm/eolite/compile_ru.bat +++ b/programs/cmm/eolite/compile_ru.bat @@ -6,6 +6,7 @@ cls c-- Eolite.c rem @kpack Eolite.com @rename Eolite.com Eolite +kpack eolite @del warning.txt @del lang.h-- @pause \ No newline at end of file diff --git a/programs/cmm/eolite/include/settings.h b/programs/cmm/eolite/include/settings.h index 2df984adb8..5563d685f0 100644 --- a/programs/cmm/eolite/include/settings.h +++ b/programs/cmm/eolite/include/settings.h @@ -21,8 +21,8 @@ ?define T_DOUBLE_CLICK "Double click time (in hundredths)" #endif -char confir_section = "Config"; - +char config_section[] = "Config"; +int WinX, WinY, WinW, WinH; void settings_dialog() { @@ -89,14 +89,18 @@ void DrawSettingsCheckBoxes() void LoadIniSettings() { - ini_get_color stdcall (eolite_ini_path, #confir_section, "SelectionColor", 0x94AECE); col_selec = EAX; - ini_get_int stdcall (eolite_ini_path, #confir_section, "ShowDeviceName", 1); show_dev_name = EAX; - ini_get_int stdcall (eolite_ini_path, #confir_section, "RealFileNamesCase", 0); real_files_names_case = EAX; - ini_get_int stdcall (eolite_ini_path, #confir_section, "InfoAfterCopy", 0); info_after_copy = EAX; - ini_get_int stdcall (eolite_ini_path, #confir_section, "FontSize", 9); font_size = EAX; - ini_get_int stdcall (eolite_ini_path, #confir_section, "TwoPanels", 0); two_panels = EAX; - ini_get_int stdcall (eolite_ini_path, #confir_section, "LineHeight", 18); files.line_h = EAX; - ini_get_int stdcall (eolite_ini_path, #confir_section, "TimeDoubleClick", 50); MOUSE_TIME = EAX; + ini_get_color stdcall (eolite_ini_path, #config_section, "SelectionColor", 0x94AECE); col_selec = EAX; + ini_get_int stdcall (eolite_ini_path, #config_section, "ShowDeviceName", 1); show_dev_name = EAX; + ini_get_int stdcall (eolite_ini_path, #config_section, "RealFileNamesCase", 0); real_files_names_case = EAX; + ini_get_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", 0); info_after_copy = EAX; + ini_get_int stdcall (eolite_ini_path, #config_section, "FontSize", 9); font_size = EAX; + ini_get_int stdcall (eolite_ini_path, #config_section, "TwoPanels", 0); two_panels = EAX; + ini_get_int stdcall (eolite_ini_path, #config_section, "LineHeight", 18); files.line_h = EAX; + ini_get_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", 50); MOUSE_TIME = EAX; + ini_get_int stdcall (eolite_ini_path, #config_section, "WinX", 200); WinX = EAX; + ini_get_int stdcall (eolite_ini_path, #config_section, "WinY", 50); WinY = EAX; + ini_get_int stdcall (eolite_ini_path, #config_section, "WinW", 550); WinW = EAX; + ini_get_int stdcall (eolite_ini_path, #config_section, "WinH", 500); WinH = EAX; BigFontsChange(); font.no_bg_copy = true; font.load("/sys/font/Tahoma.kf"); @@ -105,13 +109,17 @@ void LoadIniSettings() void SaveIniSettings() { - ini_set_int stdcall (eolite_ini_path, #confir_section, "ShowDeviceName", show_dev_name); - ini_set_int stdcall (eolite_ini_path, #confir_section, "RealFileNamesCase", real_files_names_case); - ini_set_int stdcall (eolite_ini_path, #confir_section, "InfoAfterCopy", info_after_copy); - ini_set_int stdcall (eolite_ini_path, #confir_section, "FontSize", font_size); - ini_set_int stdcall (eolite_ini_path, #confir_section, "TwoPanels", two_panels); - ini_set_int stdcall (eolite_ini_path, #confir_section, "LineHeight", files.line_h); - ini_set_int stdcall (eolite_ini_path, #confir_section, "TimeDoubleClick", MOUSE_TIME); + ini_set_int stdcall (eolite_ini_path, #config_section, "ShowDeviceName", show_dev_name); + ini_set_int stdcall (eolite_ini_path, #config_section, "RealFileNamesCase", real_files_names_case); + ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy); + ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", font_size); + ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels); + ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.line_h); + ini_set_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", MOUSE_TIME); + ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left); + ini_set_int stdcall (eolite_ini_path, #config_section, "WinY", Form.top); + ini_set_int stdcall (eolite_ini_path, #config_section, "WinW", Form.width); + ini_set_int stdcall (eolite_ini_path, #config_section, "WinH", Form.height); } diff --git a/programs/cmm/eolite/include/translations.h b/programs/cmm/eolite/include/translations.h index 40c7dbdc67..907bc72e8a 100644 --- a/programs/cmm/eolite/include/translations.h +++ b/programs/cmm/eolite/include/translations.h @@ -1,5 +1,5 @@ -#define TITLE "Eolite File Manager v3.05" -#define ABOUT_TITLE "Eolite 3.05" +#define TITLE "Eolite File Manager v3.06" +#define ABOUT_TITLE "Eolite 3.06" #ifdef LANG_RUS ?define T_FILE "” ©«" diff --git a/programs/cmm/pixie/settings.h b/programs/cmm/pixie/settings.h index ebe3da4c91..31e93c1131 100644 --- a/programs/cmm/pixie/settings.h +++ b/programs/cmm/pixie/settings.h @@ -1,12 +1,14 @@ +char config_section[] = "Config"; + void LoadIniConfig() { - ini_get_int stdcall (#pixie_ini_path, "Config", "current_theme", THEME_DARK); current_theme = EAX; - ini_get_int stdcall (#pixie_ini_path, "Config", "window_mode", WINDOW_MODE_NORMAL); window_mode = EAX; - ini_get_int stdcall (#pixie_ini_path, "Config", "win_x_normal", 100); win_x_normal = EAX; - ini_get_int stdcall (#pixie_ini_path, "Config", "win_y_normal", 90); win_y_normal = EAX; - ini_get_int stdcall (#pixie_ini_path, "Config", "win_x_small", -1); win_x_small = EAX; - ini_get_int stdcall (#pixie_ini_path, "Config", "win_y_small", -1); win_y_small = EAX; - ini_get_str stdcall (#pixie_ini_path, "Config", "last_folder", #work_folder, sizeof(work_folder), 0); + ini_get_int stdcall (#pixie_ini_path, #config_section, "current_theme", THEME_DARK); current_theme = EAX; + ini_get_int stdcall (#pixie_ini_path, #config_section, "window_mode", WINDOW_MODE_NORMAL); window_mode = EAX; + ini_get_int stdcall (#pixie_ini_path, #config_section, "win_x_normal", 100); win_x_normal = EAX; + ini_get_int stdcall (#pixie_ini_path, #config_section, "win_y_normal", 90); win_y_normal = EAX; + ini_get_int stdcall (#pixie_ini_path, #config_section, "win_x_small", -1); win_x_small = EAX; + ini_get_int stdcall (#pixie_ini_path, #config_section, "win_y_small", -1); win_y_small = EAX; + ini_get_str stdcall (#pixie_ini_path, #config_section, "last_folder", #work_folder, sizeof(work_folder), 0); if (current_theme == THEME_DARK) SetColorThemeDark(); else SetColorThemeLight(); if (win_x_small==-1) win_x_small = 2000; @@ -25,13 +27,13 @@ void SaveIniConfig() win_x_small = Form.left; win_y_small = Form.top; } - ini_set_int stdcall (#pixie_ini_path, "Config", "current_theme", current_theme); - ini_set_int stdcall (#pixie_ini_path, "Config", "window_mode", window_mode); - ini_set_int stdcall (#pixie_ini_path, "Config", "win_x_normal", win_x_normal); - ini_set_int stdcall (#pixie_ini_path, "Config", "win_y_normal", win_y_normal); - ini_set_int stdcall (#pixie_ini_path, "Config", "win_x_small", win_x_small); - ini_set_int stdcall (#pixie_ini_path, "Config", "win_y_small", win_y_small); - ini_set_str stdcall (#pixie_ini_path, "Config", "last_folder", #work_folder, strlen(#work_folder)); + ini_set_int stdcall (#pixie_ini_path, #config_section, "current_theme", current_theme); + ini_set_int stdcall (#pixie_ini_path, #config_section, "window_mode", window_mode); + ini_set_int stdcall (#pixie_ini_path, #config_section, "win_x_normal", win_x_normal); + ini_set_int stdcall (#pixie_ini_path, #config_section, "win_y_normal", win_y_normal); + ini_set_int stdcall (#pixie_ini_path, #config_section, "win_x_small", win_x_small); + ini_set_int stdcall (#pixie_ini_path, #config_section, "win_y_small", win_y_small); + ini_set_str stdcall (#pixie_ini_path, #config_section, "last_folder", #work_folder, strlen(#work_folder)); } struct struct_pixie_colors {