@MENU: allow to set links to files that would be open using @open

MENU.DAT: add a "Welcome" link, small resort
WEBVIEW: fix links browsing at bugs.kolibri-n.org
@RESHARE: fix crash on skin change
CMM: use @reshare for some apps which leads to size decrease
OSUPDATE: rework UI

git-svn-id: svn://kolibrios.org@9439 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-12-18 15:21:21 +00:00
parent d888aca21b
commit 8bf60cac6d
19 changed files with 155 additions and 80 deletions

View File

@ -1,5 +1,5 @@
#0 **** MAIN
23 Game Center |allgames
58 Welcome |index.htm
00 2D Demos > |@1
00 3D Demos > |@2
00 Graphics > |@3
@ -9,6 +9,7 @@
00 Data processing > |@10
00 Network > |@11
00 Other > |@14
23 Game Center |allgames
60 System panel |syspanel
18 Documentation |docpack
53 Run |run
@ -48,11 +49,11 @@
22 Toy piano |media/piano
11 Fplay Video player * |/kolibrios/media/fplay
#5 **** DEV
09 KPack Archiver |kpack
54 Flat Assembler |develop/fasm
20 Diff Tool |develop/diff
13 Debug Board |develop/board
16 Debugger |develop/mtdbg
13 Debug Board |develop/board
09 KPack Archiver |kpack
20 Diff Tool |develop/diff
34 Base Converter |develop/h2d2b
59 Character table |develop/ASCIIVju
59 Key ASCII-codes |develop/keyascii

View File

@ -1,5 +1,5 @@
#0 **** MAIN
23 ˆ£à®¢®© 業âà |allgames
58 ‚áâ㯫¥­¨¥ |index.htm
00 2D „¥¬ª¨ > |@1
00 3D „¥¬ª¨ > |@2
00 ƒà ä¨ª  > |@3
@ -9,6 +9,7 @@
00 Žä¨á > |@10
00 ‘¥âì > |@11
00 <20> §­®¥ > |@14
23 ˆ£à®¢®© 業âà |allgames
60 ‘¨á⥬­ ï ¯ ­¥«ì |syspanel
18 „®ªã¬¥­â æ¨ï |docpack
53 ‡ ¯ã᪠¯à®£à ¬¬ë |run
@ -48,12 +49,12 @@
22 „¥â᪮¥ ¯¨ ­¨­® |media/piano
11 ‚¨¤¥®¯«¥¥à Fplay * |/kolibrios/media/fplay
#5 **** <20> §à ¡®âª 
09 “¯ ª®¢é¨ª KPack |kpack
54 Flat Assembler |develop/fasm
09 “¯ ª®¢é¨ª KPack |kpack
16 Žâ« ¤ç¨ª |develop/mtdbg
13 „®áª  ®â« ¤ª¨ |develop/board
59 HEX-। ªâ®à |develop/heed
20 Diff tool |develop/diff
16 Žâ« ¤ç¨ª |develop/mtdbg
34 Hex2Dec2Bin |develop/h2d2b
59 ’ ¡«¨æ  ᨬ¢®«®¢ |develop/ASCIIVju
59 ASCII-ª®¤ë |develop/keyascii

View File

@ -6,7 +6,6 @@
#include "../lib/strings.h"
#include "../lib/io.h"
#include "../lib/list_box.h"
#include "../lib/obj/libimg.h"
#include "../lib/gui.h"
#include "../lib/obj/box_lib.h"
@ -102,7 +101,6 @@ void main()
load_dll(boxlib, #box_lib_init,0);
load_dll(libini, #lib_init,1);
load_dll(libimg, #libimg_init,1);
load_dll(Proc_lib, #OpenDialog_init,0);
o_dialog.type = 2; //select folder
OpenDialog_init stdcall (#o_dialog);
@ -196,8 +194,8 @@ void DrawWindowContent()
tabs.w = Form.cwidth-LP-LP;
tabs.draw();
DrawIcon16(tabs.x + TAB_PADDING, 15, sc.work, 17);
DrawIcon16(strlen(T_SKINS)*8 + tabs.x + TAB_PADDING + TAB_PADDING, 15, sc.work, 6);
draw_icon_16w(tabs.x + TAB_PADDING, 15, 17);
draw_icon_16w(strlen(T_SKINS)*8 + tabs.x + TAB_PADDING + TAB_PADDING, 15, 6);
id = select_list.cur_y;
SelectList_Init(

View File

@ -107,4 +107,4 @@ char editbox_icons[] = FROM "res/editbox_icons.raw";
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
char version[]="WebView 3.66-2";
char version[]="WebView 3.66-3";

View File

@ -145,7 +145,7 @@ void Draw_DriverListWindow()
//RIGHT FRAME
GetCurrentSectionData();
DrawBar(right_frame_x, PADDING+3, Form.cwidth - right_frame_x - PADDING, 80, sc.work);
DrawIcon32(right_frame_x, PADDING, sc.work, cur_icon);
draw_icon_32(right_frame_x, PADDING, sc.work, cur_icon);
WriteTextB(right_frame_x+44, PADDING+3, 0x81, sc.work_text, ini_sections.get(select_list.cur_y));
WriteText(right_frame_x+44, PADDING+23, 0x80, sc.work_text, #cur_version);
if(cur_readme_path[0]) readme_w = DrawStandartCaptButton(right_frame_x, PADDING+45, BUTTON_ID_README, T_README);

View File

@ -9,9 +9,9 @@ TODO:
http://board.kolibrios.org/viewtopic.php?f=23&t=4521&p=77334#p77334
*/
#define ABOUT_TITLE "EOLITE 5.15"
#define TITLE_EOLITE "Eolite File Manager 5.15"
#define TITLE_KFM "Kolibri File Manager 2.15";
#define ABOUT_TITLE "EOLITE 5.15-1"
#define TITLE_EOLITE "Eolite File Manager 5.15-1"
#define TITLE_KFM "Kolibri File Manager 2.15-1";
#define MEMSIZE 1024 * 250
#include "../lib/clipboard.h"

View File

@ -160,7 +160,7 @@ void SaveIniSettings()
void Write_Error(int error_number)
{
char error_message[500];
sprintf(#error_message,"\"%s\n%s\" -%s","Eolite",get_error(error_number),"tE");
sprintf(#error_message,"\"Eolite\n%s\" -tE", get_error(error_number));
notify(#error_message);
}

View File

@ -27,6 +27,7 @@
#include "../lib/gui/child_window.h"
#include "../lib/gui/text_view_area.h"
#include "../lib/gui/reshare.h"
#ifndef INCLUDE_MENU_H
#include "../lib/gui/menu.h"
@ -357,7 +358,4 @@ struct block {
}
#endif

View File

@ -0,0 +1,45 @@
:bool draw_icon_32(dword _x,_y, _bg, _icon_n) {
static dword bg;
static dword shared;
static dword icon32mem;
dword size;
if (!shared) || (bg!=_bg) {
if (shared = memopen("ICONS32", NULL, SHM_READ))
{
size = EDX;
if (!icon32mem) icon32mem = malloc(size);
memmov(icon32mem, shared, size);
EDX = icon32mem + size;
EAX = bg = _bg;
for (ESI = icon32mem; ESI < EDX; ESI += 4) {
if (DSDWORD[ESI]==0x00000000) DSDWORD[ESI] = EAX;
}
}
}
if (icon32mem) {
PutPaletteImage(32*32*4*_icon_n + icon32mem, 32, 32,_x, _y, 32, 0);
return true;
}
return false;
}
:bool draw_icon_16(dword _x,_y, _icon_n) {
static dword shared_i16;
if (!shared_i16) shared_i16 = memopen("ICONS18", NULL, SHM_READ);
if (shared_i16) {
PutPaletteImage(18*18*4*_icon_n + shared_i16, 18, 18,_x, _y, 32, 0);
return true;
}
return false;
}
:bool draw_icon_16w(dword _x,_y, _icon_n) {
static dword shared_i16w;
if (!shared_i16w) shared_i16w = memopen("ICONS18W", NULL, SHM_READ);
if (shared_i16w) {
PutPaletteImage(18*18*4*_icon_n + shared_i16w, 18, 18,_x, _y, 32, 0);
return true;
}
return false;
}

View File

@ -224,6 +224,8 @@ void _http::receive()
case '?':
strchr(#newurl+8, '?'); //returns EAX
if (EAX) ESBYTE[EAX] = '\0';
strchr(#newurl+8, '/'); //returns EAX
if (!EAX) chrcat(#newurl, '/');
break;
case '/':
new_URL++;

View File

@ -905,11 +905,17 @@ inline signed csshexdec(dword text)
:void miniprintf(dword dst, format, insert_line)
{
dword in_pos = strchr(format, '%');
if (ESBYTE[in_pos+1] == 's') {
strlcpy(dst, format, in_pos - format);
EBX = ESBYTE[EAX+1];
if (EBX == 's') {
strncpy(dst, format, in_pos - format);
strcat(dst, insert_line);
strcat(dst, in_pos+2);
}
if (EBX == 'd') || (EBX == 'i') {
strncpy(dst, format, in_pos - format);
strcat(dst, itoa(insert_line));
strcat(dst, in_pos+2);
}
}
inline cdecl int sprintf(dword buf, format,...)

View File

@ -14,4 +14,4 @@ cd ..
del warning.txt
pause
rem pause

View File

@ -5,7 +5,6 @@
#include "../lib/copyf.h"
#include "../lib/obj/libini.h"
#include "../lib/obj/libimg.h"
#include "../lib/patterns/restart_process.h"
@ -40,8 +39,7 @@ void main()
{
word btn;
load_dll(libini, #lib_init,1);
load_dll(libimg, #libimg_init,1);
loop() switch(WaitEventTimeout(300) & 0xFF)
loop() switch(@WaitEventTimeout(300))
{
case evButton:
btn = GetButtonID();
@ -89,7 +87,7 @@ void DrawIntro()
void DrawInstallComplete()
{
DrawIcon32(WINW-32/2, 140, sc.work, 49);
draw_icon_32(WINW-32/2, 140, sc.work, 49);
WriteTextCenter(0,185, WINW, sc.work_text, T_COMPLETE);
DrawCaptButton(WINW-110/2, WINH-70, 110, 28, B_EXIT,
0x0092D8, 0xFFFfff, T_EXIT);

View File

@ -10,8 +10,6 @@
#include "..\lib\gui.h"
#include "..\lib\random.h"
#include "..\lib\obj\libimg.h"
#define BTN_CLOSED 0
#define BTN_PRESSED 1
#define BTN_OPEN 2
@ -40,8 +38,8 @@ int count;
void main()
{
dword id;
load_dll(libimg, #libimg_init,1);
mem_init();
NewGame();
loop() switch(@WaitEvent())
@ -151,7 +149,7 @@ void ReDraw_Game_Button(int id)
case BTN_OPEN:
DrawBar(xx+1, yy+1, CELL_SIZE-1, CELL_SIZE-1, 0xFFFfff);//background
}
DrawIcon32(xx+6, yy+6, 0xFFFfff, bitpict[id]+51); //skip first 51 icons as they are boring for game
draw_icon_32(xx+6, yy+6, 0xffFFFfff, bitpict[id]+51); //skip first 51 icons as they are boring for game
}
void Draw_Panel()

View File

@ -3,8 +3,6 @@
#include "../lib/gui.h"
#include "../lib/copyf.h"
#include "../lib/obj/libini.h"
#include "../lib/obj/libimg.h"
#include "../lib/obj/http.h"
#include "../lib/obj/network.h"
@ -12,47 +10,50 @@
bool install_complete = false;
_http http;
dword unimg_id;
#define WINW 460
#define WINH 380
#define WINH 330
//#define LANG_RUS 1
#ifdef LANG_RUS
#define T_WINDOW_TITLE "Ž­« ©­ ®¡­®¢«¥­¨¥ KolibriOS"
#define T_TITLE_H1 "Ž<EFBFBD>€‰<EFBFBD> Ž<><C5BD>Ž<E280B9>ˆ"
#define T_TITLE_H1 "Ž­« ©­ ®¡­®¢«¥­¨¥"
#define T_INTRO "„ ­­®¥ ¯à¨«®¦¥­¨¥ ᪠砥⠯®á«¥¤­îî ¢¥àá¨î KolibriOS ¨ à á¯ ªã¥â ¥¥ ­  RAM-¤¨áª. <20>ਠí⮬ ï¤à® ­¥ ¡ã¤¥â ¯¥à¥§ ¯ã饭®, ¤«ï í⮣® ­¥®¡å®¤¨¬® á®åà ­¨âì ®¡à § ¨ ¯¥à¥§ £à㧨âáï. <20>®¦ «ã©áâ , § ªà®©â¥ ¢á¥ ®âªàëâë¥ ¯à¨«®¦¥­¨ï ¯¥à¥¤ ­ ç «®¬ ®¡­®¢«¥­¨ï.
<EFBFBD>ˆŒ<EFBFBD>ˆ: ᥠ¨§¬¥­­ë¥ ä ©«ë ­  RAM-¤¨áª¥ ¡ã¤ãâ ¯¥à¥§ ¯¨á ­ë!";
#define T_INSTALL "Ž¡­®¢¨âì"
#define T_COMPLETE "Ž¡­®¢«¥­¨¥ § ¢¥à襭®"
#define T_DOWNLOADING "‘ª ç¨¢ î ᢥ¦¨© ®¡à § kolibri.img..."
#define T_UNPACKING "<22> á¯ ª®¢ë¢ î ¨ ª®¯¨àãî ä ©«ë..."
#define T_COMPLETE "Ž¡­®¢«¥­¨¥ ãᯥ譮 § ¢¥à襭®."
#define T_EXIT "‚ë室"
#define IMG_URL "http://builds.kolibrios.org/rus/data/data/kolibri.img"
#define KS "‘®åà ­¨âì ­ áâனª¨"
#define checkbox_h 190
#else
#define T_WINDOW_TITLE "KolibriOS Online Updater"
#define T_TITLE_H1 "ONLINE UPDATE"
#define T_TITLE_H1 "Online Updater"
#define T_INTRO "This app will download the latest KolibriOS dirsto and update your RAM-disk with it. Kernel won't be restarted.
Please close all opened apps before start.
Note that all changes on RAM-disk will be lost.";
#define T_INSTALL "Update"
#define T_COMPLETE "Update complete"
#define T_DOWNLOADING "Downloading the latest kolibri.img..."
#define T_UNPACKING "Unpacking and copying files..."
#define T_COMPLETE "Update complete successfully."
#define T_EXIT "Exit"
#define IMG_URL "http://builds.kolibrios.org/eng/data/data/kolibri.img"
#define KS "Keep settings folder"
#define checkbox_h 210
#endif
char accept_language[]="en"; //not used, necessary for http.get()
void Operation_Draw_Progress(dword f) {} //not used, necessary for copyf()
checkbox keep_settings = { KS, true };
sensor progress = { 40, WINH-70, WINW-80, 20 };
void main()
{
int btn;
sensor progress;
load_dll(libimg, #libimg_init,1);
load_dll(libHTTP, #http_lib_init,1);
SetWindowLayerBehaviour(-1, ZPOS_ALWAYS_TOP);
@SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_STACK);
loop() switch(@WaitEventTimeout(300))
{
@ -78,23 +79,7 @@ void main()
case evReDraw:
_DRAW_WINDOW:
sc.get();
DefineAndDrawWindow(screen.width-WINW/2,screen.height-WINH/2,
WINW+9,WINH+skin_height,0x34,sc.work,T_WINDOW_TITLE,0);
WriteText(30, 20, 0x81, 0xEC008C, T_TITLE_H1);
if (!install_complete) {
DrawTextViewArea(30, 50, WINW-60, WINH-80, T_INTRO, -1, sc.work_text);
progress.set_size(30, WINH-130, WINW-60, 20);
if (http.transfer<=0) {
DrawCaptButton(WINW-110/2, WINH-70, 110, 28, 9, 0x0092D8, 0xFFFfff, T_INSTALL);
keep_settings.draw(30, WINH - checkbox_h);
}
} else {
DrawIcon32(WINW-32/2, 140, sc.work, 49);
WriteTextCenter(0,185, WINW, sc.work_text, T_COMPLETE);
DrawCaptButton(WINW-110/2, WINH-70, 110, 28, 2,
0x0092D8, 0xFFFfff, T_EXIT);
}
draw_window();
case evNetwork:
if (http.transfer <= 0) break;
@ -112,6 +97,37 @@ void main()
}
}
void draw_window()
{
sc.get();
DefineAndDrawWindow(screen.width-WINW/2,screen.height-WINH/2,
WINW+9,WINH+skin_height,0x34,sc.work,T_WINDOW_TITLE,0);
WriteText(30, 20, 0x91, 0xEC008C, T_TITLE_H1);
if (!install_complete) {
if (GetProcessSlot(unimg_id)) {
//UNPACKING
draw_icon_32(WINW-32/2, 140, sc.work, 89);
WriteTextCenter(0, 185, WINW, sc.work_text, T_UNPACKING);
} else if (http.transfer<=0) {
//INTRO
DrawTextViewArea(30, 65, WINW-60, WINH-80, T_INTRO, -1, sc.work_text);
DrawCaptButton(WINW-160, WINH-70, 110, 28, 9, 0x0092D8, 0xFFFfff, T_INSTALL);
keep_settings.draw(30, WINH-65);
} else {
//DOWNLOADING
draw_icon_32(WINW-32/2, 140, sc.work, 51);
WriteTextCenter(0, 185, WINW, sc.work_text, T_DOWNLOADING);
progress.draw_wrapper();
}
} else {
//COMPLETE
draw_icon_32(WINW-32/2, 140, sc.work, 49);
WriteTextCenter(0, 185, WINW, sc.work_text, T_COMPLETE);
DrawCaptButton(WINW-110/2, WINH-70, 110, 28, 2,
0x0092D8, 0xFFFfff, T_EXIT);
}
}
dword GetFreeSpaceOfRamdisk()
{
dword rdempty = malloc(1440*1024);
@ -142,7 +158,7 @@ signed CheckFreeSpace(dword _latest, _combined)
void EventDownloadComplete()
{
dword unimg_id, slot_n;
dword slot_n;
signed space_delta;
int i=0;
@ -153,18 +169,19 @@ void EventDownloadComplete()
char exract_param[64];
char backup_settings[64];
do { sprintf(#osupdate, "/tmp0/1/osupdate%d", i); i++;
do { miniprintf(#osupdate, "/tmp0/1/osupdate%d", i); i++;
} while (dir_exists(#osupdate));
CreateDir(#osupdate);
sprintf(#latest, "%s/latest", #osupdate);
sprintf(#backup, "%s/rdbackup", #osupdate);
sprintf(#combined, "%s/combined", #osupdate);
sprintf(#backup_settings, "%s/settings", #backup);
sprintf(#exract_param, "/tmp0/1/latest.img %s -e", #latest);
miniprintf(#latest, "%s/latest", #osupdate);
miniprintf(#backup, "%s/rdbackup", #osupdate);
miniprintf(#combined, "%s/combined", #osupdate);
miniprintf(#backup_settings, "%s/settings", #backup);
miniprintf(#exract_param, "/tmp0/1/latest.img %s -e", #latest);
unimg_id = RunProgram("/sys/unimg", #exract_param);
draw_window();
do {
slot_n = GetProcessSlot(unimg_id);
pause(10);
@ -172,7 +189,7 @@ void EventDownloadComplete()
space_delta = CheckFreeSpace(#latest, #combined);
if (space_delta<0) {
sprintf(#param, "'Not enought free space! You need %d KB more.'E", -space_delta);
miniprintf(#param, "'Not enought free space! You need %d KB more.'E", -space_delta);
notify(#param);
} else {
copyf("/sys", #backup);

View File

@ -38,11 +38,12 @@ UPDATE_ICONS18WORK:
$push sc.work
sc.get();
$pop eax
IF (sc.work != EAX) {
if (sc.work != EAX) {
icons16w.load("/sys/icons16.png");
icons16w.replace_2colors(0xffFFFfff, sc.work, 0xffCACBD6, MixColors(sc.work, 0, 200));
memmov(shared_i16w, icons16w.imgsrc, size16);
img_destroy stdcall(icons16w.image);
icons16w.image = NULL;
}
loop() IF(WaitEvent()==evDesktop) GOTO UPDATE_ICONS18WORK;

View File

@ -294,14 +294,8 @@ void MonitorTmp()
void DrawIconWithText(dword _x, _y, _icon, _title)
{
static dword shared_icons_16;
if (!shared_icons_16) shared_icons_16 = memopen("ICONS18W", NULL, SHM_READ);
if (shared_icons_16) {
PutPaletteImage(18*18*4*_icon + shared_icons_16, 18, 18,_x, _y, 32, 0);
} else {
_x -= ICONGAP;
}
WriteTextWithBg(_x+ICONGAP, _y + 2, 0xD0, sc.work_text, _title, sc.work);
if (draw_icon_16w(_x, _y, _icon)) _x += ICONGAP;
WriteTextWithBg(_x, _y + 2, 0xD0, sc.work_text, _title, sc.work);
}
dword GetCpuLoad(dword max_h)

View File

@ -896,13 +896,13 @@ if lang eq ru
t_notes db '„Ž <20>… Œˆ ”€ ‘Ž‹œ ‹Ÿ ˆ „Ž',0
caption db '„¥â᪮¥ ¯¨ ­¨­®',0
else
message db 'To see help click twice on the window header',0
message db 'Click twice on the window header to see help.',0
message1 db 'Press any key in English keyboard layout - ',0
message2 db 'so you will hear the sound from the PC-speaker (Beeper)',0
message3 db 'Note "C" is the key V,Tab,U,Enter',0
message4 db 'and when Caps Lock is on then the keys V,Q,I.',0
t_notes db 'C D E F G A B C ',0
caption db 'Baby piano',0
caption db 'Toy piano',0
end if
;---------------------------------------------------------------------

View File

@ -462,9 +462,15 @@ align 4
rep movsb ; copy string
mov [edi],byte 0 ; store terminator
mcall 70,fileinfo_start ; start program
or [close_now],1 ; set close flag
pop edi
or [close_now],1 ; set close flag
mov [mousemask],0
; if program run failed then start /sys/@open with param
test eax,eax
jns close
mov eax, fileinfo_start.name
mov [file_open.params], eax
mcall 70,file_open
jmp close
;--------------------------------------
align 4
@ -1070,6 +1076,16 @@ fileinfo_start:
.rezerved_1 dd 0x0 ; nop
.name:
times 50 db ' '
;--------------------------------------
align 4
file_open:
.subfunction dd 7 ; 7=START /SYS/@OPEN APP WITH PARAM
.flags dd 0 ; flags
.params dd 0x0 ; nop
.rezerved dd 0x0 ; nop
.rezerved_1 dd 0x0 ; nop
.name:
db '/SYS/@OPEN',0
;------------------------------------------------------------------------------
IM_END:
;------------------------------------------------------------------------------