@ss: if no program set then exit

appearance: show timeout of ss, now you can set screensaver
ndn: new version by CandyMan (no screen blinking on app run, no ".." in the root of /cd disks)
fnav: pack images, add tup file to kpack readme (I hope this won't fail)

git-svn-id: svn://kolibrios.org@9489 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-12-27 15:48:22 +00:00
parent c0671d602c
commit 65293bdde2
8 changed files with 36 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1 @@
tup.rule("ABOUT.TXT", "%f %o " .. tup.getconfig("KPACK_CMD"), "ABOUT.TXT")

Binary file not shown.

View File

@ -14,8 +14,10 @@ double_click_delay=64
LBA=off
PCI=on
;timeout in minutes
;program needs a full path
[screensaver]
timeout=10 ;in minutes
timeout=10
program=/sys/demos/spiral
available=3d/crownscr|demos/web|demos/zeroline|demos/spiral

View File

@ -27,11 +27,6 @@
int active_skin, active_wallpaper, active_screensaver;
enum {
BASE_TAB_BUTTON_ID=3,
BTN_SELECT_WALLP_FOLDER=10,
BTN_TEST_SCREENSAVER };
char folder_path[4096];
char cur_file_path[4096];
char cur_skin_path[4096];
@ -99,6 +94,7 @@ void main()
}
if (tabs.active_tab == TAB_SCREENSAVERS) {
if (id==BTN_TEST_SCREENSAVER) EventOpenFile();
if (id==BTN_SET_SCREENSAVER) EventSetSs();
}
break;
@ -185,7 +181,10 @@ void DrawWindowContent()
}
if (tabs.active_tab == TAB_SCREENSAVERS)
{
DrawStandartCaptButton(RIGHTx, PANEL_H, BTN_TEST_SCREENSAVER, T_SS_PREVIEW);
miniprintf(#param, T_SS_TIMEOUT, screensaver_timeout);
WriteTextWithBg(RIGHTx, PANEL_H, 0xD0, sc.work_text, #param, sc.work);
ESI = DrawStandartCaptButton(RIGHTx, PANEL_H + 25, BTN_TEST_SCREENSAVER, T_SS_PREVIEW);
DrawStandartCaptButton(RIGHTx+ESI, PANEL_H + 25, BTN_SET_SCREENSAVER, T_SS_SET);
}
}
@ -431,8 +430,9 @@ void EventApply()
void EventUpdateDocky()
{
if (!update_docky.checked) return;
KillProcessByName("@docky", MULTIPLE);
RunProgram("/sys/@docky",NULL);
// KillProcessByName("@docky", MULTIPLE);
// RunProgram("/sys/@docky",NULL);
RestartProcessByName("/sys/@docky", MULTIPLE);
pause(50);
ActivateWindow_Self();
}
@ -455,4 +455,12 @@ void EventExit()
ExitProcess();
}
void EventSetSs()
{
dword cur_ss = list.get(select_list.cur_y);
ini.section = "screensaver";
ini.SetString("program", cur_ss, strlen(cur_ss));
RestartProcessByName("/sys/@ss", MULTIPLE);
}
stop:

View File

@ -11,7 +11,9 @@
?define T_UPDATE_DOCK "Ž¡­®¢«ïâì Dock-¯ ­¥«ì"
?define T_NO_FILES "'<27>®¤¤¥à¦¨¢ ¥¬ë¥ ä ©«ë ­¥ ­ ©¤¥­ë' -E"
?define T_UI_PREVIEW " <20>ਬ¥à ª®¬¯®­¥­â®¢ "
?define T_SS_TIMEOUT "ˆ­â¥à¢ «: %i ¬¨­ãâ "
?define T_SS_PREVIEW "<EFBFBD>à®á¬®âà"
?define T_SS_SET "“áâ ­®¢¨âì"
?define T_NO_SS "[‚몫î祭]"
?define T_DEFAULT "[<5B>® 㬮«ç ­¨î]"
#else
@ -27,7 +29,9 @@
?define T_UPDATE_DOCK "Update Dock"
?define T_NO_FILES "'No supported files were found' -E"
?define T_UI_PREVIEW " Components Preview "
?define T_SS_PREVIEW "Preview"
?define T_SS_TIMEOUT "Wait: %i minutes "
?define T_SS_PREVIEW "View"
?define T_SS_SET "Set"
?define T_NO_SS "[Disable]"
?define T_DEFAULT "[Default]"
#endif
@ -49,6 +53,13 @@ enum {
TAB_SCREENSAVERS
};
enum {
BASE_TAB_BUTTON_ID=3,
BTN_SELECT_WALLP_FOLDER=10,
BTN_TEST_SCREENSAVER,
BTN_SET_SCREENSAVER
};
_ini ini = { "/sys/settings/system.ini" };
char default_dir[] = "/rd/1";

View File

@ -21,6 +21,10 @@ start:
test eax, eax
jnz exit
invoke ini.get_str, ini_file, ini_section, ini_key_program, ini_program_buf, ini_program_buf.size, 0
cmp [ini_program_buf], 0 ; if nothing set then exit
je exit
invoke ini.get_int, ini_file, ini_section, ini_key_timeout, DEFAULT_TIMEOUT_MINS
imul eax, 60*100 ; cs
mov [timeout], eax