diff --git a/data/Tupfile.lua b/data/Tupfile.lua index 2efbd5235b..4d9472ef62 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -201,6 +201,7 @@ extra_files = { {"kolibrios/media/zsea/zsea.ini", PROGS .. "/media/zsea/zSea.ini"}, {"kolibrios/media/zsea/buttons/buttons.png", PROGS .. "/media/zsea/buttons.png"}, {"kolibrios/res/skins/", "../skins/authors.txt"}, + {"kolibrios/settings/app_plus.ini", "common/settings/app_plus.ini"}, {"kolibrios/utils/appearance", PROGS .. "/cmm/appearance/appearance.com"}, } if build_type == "rus" then tup.append_table(extra_files, { @@ -509,6 +510,7 @@ tup.append_table(img_files, { {"TMPDISK", PROGS .. "/cmm/tmpdisk/tmpdisk.com"}, {"GAME_CENTER", PROGS .. "/cmm/software_widget/software_widget.com"}, {"SYSPANEL", PROGS .. "/cmm/software_widget/software_widget.com"}, + {"APP_PLUS", PROGS .. "/cmm/app_plus/app_plus.com"}, }) end -- tup.getconfig('NO_CMM') ~= 'full' diff --git a/data/common/settings/app_plus.ini b/data/common/settings/app_plus.ini new file mode 100644 index 0000000000..9ac29ba8c9 --- /dev/null +++ b/data/common/settings/app_plus.ini @@ -0,0 +1,19 @@ +[Config] +window_width=600 +cell_w=82 +cell_h=78 +window_title=KolibriOS Additional Software + +[Media] +zSea=/kolibrios/media/zsea/zsea,46 + +[3D Tools] +Info3DsPro=/kolibrios/3d/info3ds/info3ds,75 +Info3DsUser=/kolibrios/3d/info3ds/info3ds_u,75 +voxel_editor=/kolibrios/3d/voxel_editor/voxel_editor + +[3D Demos] +3dsHeart=/kolibrios/3d/3dsheart,78 + +[Other] +Life=/kolibrios/demos/life2,13 diff --git a/programs/cmm/app_plus/Tupfile.lua b/programs/cmm/app_plus/Tupfile.lua new file mode 100644 index 0000000000..d9b37dae75 --- /dev/null +++ b/programs/cmm/app_plus/Tupfile.lua @@ -0,0 +1,6 @@ +if tup.getconfig("NO_CMM") ~= "" then return end +if tup.getconfig("LANG") == "ru" +then C_LANG = "LANG_RUS" +else C_LANG = "LANG_ENG" -- this includes default case without config +end +tup.rule("app_plus.c", "c-- /D=AUTOBUILD /D=$(C_LANG) %f" .. tup.getconfig("KPACK_CMD"), "app_plus.com") diff --git a/programs/cmm/app_plus/app_plus.c b/programs/cmm/app_plus/app_plus.c new file mode 100644 index 0000000000..cf35d4289c --- /dev/null +++ b/programs/cmm/app_plus/app_plus.c @@ -0,0 +1,103 @@ +#ifndef AUTOBUILD +#include "lang.h--" +#endif + +#define MEMSIZE 4096*20 +#include "..\lib\strings.h" +#include "..\lib\mem.h" +#include "..\lib\io.h" +#include "..\lib\gui.h" +#include "..\lib\obj\proc_lib.h" +#include "..\lib\patterns\simple_open_dialog.h" +#include "..\lib\added_sysdir.c" + +char default_dir[] = "/rd/1"; +od_filter filter2 = {"",0}; + +proc_info Form; + +dword scr = FROM "scr.raw_8bit"; +dword scr_pal[] = {0xFFFFFF,0xBBDDFF,0x4166B5,0xE0E4E6,0xAFBEDD,0xC4D4E8,0x52ACDD,0x000000, +0xE9DAB2,0xC99811,0xFDF9D4,0xF8B93C,0xFDEEBE,0xFBEBA6,0xDFAF4F,0xF3D57C}; + + + +void CheckKosMounted() +{ + if (isdir("/kolibrios/")) + { + io.run("syspanel", "/kolibrios/settings/app_plus.ini"); + ExitProcess(); + } +} + +void RunAutosearch() +{ + dword searchap_run_id; + searchap_run_id = io.run("/sys/searchap",0); + while (GetProcessSlot(searchap_run_id)) pause(10); +} + +void main() +{ + word id; + + CheckKosMounted(); + RunAutosearch(); + CheckKosMounted(); + + o_dialog.type = 2; + load_dll(Proc_lib, #OpenDialog_init,0); + OpenDialog_init stdcall (#o_dialog); + + loop() switch(WaitEvent()) + { + case evButton: + id=GetButtonID(); + if (id==1) ExitProcess(); + if (id==10) + { + OpenDialog_start stdcall (#o_dialog); + if (o_dialog.status) SetAdditionalSystemDirectory("kolibrios", #openfile_path); + pause(3); + CheckKosMounted(); + } + break; + + case evReDraw: + draw_window(); + } +} + +#define WINDOW_TITLE_TEXT "Error" +#define CONTENT_HEADER_TEXT "/KOLIBRIOS/ NOT MOUNTED" +#define DESCRIPTION_TEXT "Try to find it manually. It should look +like image on the right. +Note: this action can be done only once +per 1 session of the OS running. If you +will choose the wrong folder then you +need to reboot system to try again." +#define MANUALLY_BUTTON_TEXT "Choose /kolibrios/ folder..." + + +void draw_window() +{ + incn y; + dword x=30; + y.n=0; + system.color.get(); + DefineAndDrawWindow(screen.width-570/2, 100, 570, 280+skin_height, 0x34, system.color.work, WINDOW_TITLE_TEXT); + GetProcessInfo(#Form, SelfInfo); + WriteTextB(x+2,y.inc(20)+2,0x81,MixColors(system.color.work, 0xB92234,220),CONTENT_HEADER_TEXT); + WriteTextB(x,y.n,0x81,0xB92234,CONTENT_HEADER_TEXT); + + WriteTextLines(x,y.inc(50),0x90,system.color.work_text,DESCRIPTION_TEXT,20); + + PutPaletteImage(#scr,144,171,Form.cwidth-180,y.n,8,#scr_pal); + DrawRectangle(Form.cwidth-180-1,y.n-1, 144+1,171+1, system.color.work_graph); + + DrawCaptButton(x,Form.cheight-66,300,30,10,system.color.work_button,system.color.work_button_text,MANUALLY_BUTTON_TEXT); +} + + +stop: diff --git a/programs/cmm/app_plus/compile_en.bat b/programs/cmm/app_plus/compile_en.bat new file mode 100644 index 0000000000..3d04d83600 --- /dev/null +++ b/programs/cmm/app_plus/compile_en.bat @@ -0,0 +1,10 @@ +@del lang.h-- +@echo #define LANG_ENG 1 >lang.h-- + +@del app_plus +cls +c-- app_plus.c +@rename app_plus.com app_plus +@del warning.txt +@del lang.h-- +@pause diff --git a/programs/cmm/app_plus/compile_ru.bat b/programs/cmm/app_plus/compile_ru.bat new file mode 100644 index 0000000000..769dda8ca2 --- /dev/null +++ b/programs/cmm/app_plus/compile_ru.bat @@ -0,0 +1,10 @@ +@del lang.h-- +@echo #define LANG_RUS 1 >lang.h-- + +@del app_plus +cls +c-- app_plus.c +@rename app_plus.com app_plus +@del warning.txt +@del lang.h-- +@pause diff --git a/programs/cmm/app_plus/scr.png b/programs/cmm/app_plus/scr.png new file mode 100644 index 0000000000..71c1e18c33 Binary files /dev/null and b/programs/cmm/app_plus/scr.png differ diff --git a/programs/cmm/app_plus/scr.raw_8bit b/programs/cmm/app_plus/scr.raw_8bit new file mode 100644 index 0000000000..8564583b31 Binary files /dev/null and b/programs/cmm/app_plus/scr.raw_8bit differ diff --git a/programs/cmm/installer/installer.c b/programs/cmm/installer/installer.c index fbb1608b6a..67920acba5 100644 --- a/programs/cmm/installer/installer.c +++ b/programs/cmm/installer/installer.c @@ -5,8 +5,7 @@ #include "..\lib\copyf.h" #include "..\lib\patterns\restart_process.h" - -#include "add_appl_dir.c"; +#include "..\lib\added_sysdir.c"; ?define T_END "\'Установка KolibriN успешно завершена.\' -O" ?define T_LESS_RAM "Мало свободной оперативной памяти. Могут возникнуть проблемы" @@ -14,7 +13,7 @@ void main() { - SetAddApplDir("kolibrios", abspath("install/kolibrios")+1); + SetAdditionalSystemDirectory("kolibrios", abspath("install/kolibrios")+1); io.run("/sys/media/kiv", "\\S__/kolibrios/res/Wallpapers/In the wind there is longing.png"); io.del("/sys/docpack"); copyf(abspath("install/sys"), "/sys"); diff --git a/programs/cmm/installer/add_appl_dir.c b/programs/cmm/lib/added_sysdir.c similarity index 76% rename from programs/cmm/installer/add_appl_dir.c rename to programs/cmm/lib/added_sysdir.c index 18a2831b37..ddcf914d26 100644 --- a/programs/cmm/installer/add_appl_dir.c +++ b/programs/cmm/lib/added_sysdir.c @@ -6,7 +6,7 @@ struct sysdir } sysdir; -:int SetAddApplDir(dword tName, tPath) +:int SetAdditionalSystemDirectory(dword tName, tPath) { int i; strcpy(#sysdir.name, tName);