2021-12-31 15:33:49 +01:00
|
|
|
|
#define MEMSIZE 1024*40
|
2016-02-19 00:28:04 +01:00
|
|
|
|
#include "..\lib\strings.h"
|
|
|
|
|
#include "..\lib\mem.h"
|
|
|
|
|
#include "..\lib\gui.h"
|
|
|
|
|
#include "..\lib\obj\proc_lib.h"
|
|
|
|
|
#include "..\lib\patterns\simple_open_dialog.h"
|
2016-02-19 22:07:11 +01:00
|
|
|
|
#include "..\lib\patterns\restart_process.h"
|
2021-01-04 00:02:07 +01:00
|
|
|
|
#include "added_sysdir.c"
|
2016-02-19 00:28:04 +01:00
|
|
|
|
|
2018-11-01 12:31:45 +01:00
|
|
|
|
//===================================================//
|
|
|
|
|
// //
|
|
|
|
|
// DATA //
|
|
|
|
|
// //
|
|
|
|
|
//===================================================//
|
2016-02-19 00:28:04 +01:00
|
|
|
|
|
2021-12-31 15:33:49 +01:00
|
|
|
|
#define WINW 570
|
|
|
|
|
#define WINH 300
|
2018-11-01 12:31:45 +01:00
|
|
|
|
#define CONX 30 //content X pos
|
2021-12-31 15:33:49 +01:00
|
|
|
|
#define SCRX WINW-180
|
|
|
|
|
#define SCRY 20
|
2018-11-01 12:31:45 +01:00
|
|
|
|
|
2022-01-07 02:01:22 +01:00
|
|
|
|
char default_dir[] = "/sys";
|
2021-12-31 15:33:49 +01:00
|
|
|
|
od_filter filter2;
|
2016-02-19 00:28:04 +01:00
|
|
|
|
|
2017-10-01 13:57:00 +02:00
|
|
|
|
#define BTN_MANUAL_SEARCH 10
|
2018-11-01 12:31:45 +01:00
|
|
|
|
#define BTN_OPEN_ANYWAY 11
|
|
|
|
|
|
|
|
|
|
#define APP_PLUS_INI_PATH "/sys/settings/app_plus.ini"
|
|
|
|
|
|
|
|
|
|
//===================================================//
|
|
|
|
|
// //
|
|
|
|
|
// TRANSLATIONS //
|
|
|
|
|
// //
|
|
|
|
|
//===================================================//
|
|
|
|
|
|
|
|
|
|
#ifdef LANG_RUS
|
|
|
|
|
?define WINDOW_TITLE_TEXT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>! <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>."
|
|
|
|
|
?define CONTENT_HEADER_TEXT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> /KOLIBRIOS/ <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
?define DESCRIPTION_TEXT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> ᠬ<><E1A0AC><EFBFBD><EFBFBD><EFBFBD>⥫쭮.
|
2019-03-16 22:06:09 +01:00
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
|
2018-11-01 12:31:45 +01:00
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD>⨭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ࠢ<EFBFBD>. <EFBFBD> <EFBFBD><EFBFBD><EFBFBD>砥 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>୮
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ॡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>믮<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
<EFBFBD><EFBFBD>१<EFBFBD><EFBFBD><EFBFBD>㧪<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᭮<EFBFBD><EFBFBD>."
|
2021-12-31 15:33:49 +01:00
|
|
|
|
?define MANUALLY_BUTTON_TEXT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> /kolibrios/..."
|
2018-11-01 12:31:45 +01:00
|
|
|
|
?define OPEN_ANYWAY_BUTTON_TEXT "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> APP+ (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㯭<EFBFBD>)"
|
|
|
|
|
#else
|
|
|
|
|
?define WINDOW_TITLE_TEXT "Warning! It's important."
|
|
|
|
|
?define CONTENT_HEADER_TEXT "/KOLIBRIOS/ IS NOT MOUNTED"
|
|
|
|
|
?define DESCRIPTION_TEXT "Try to find it manually. It should look
|
2016-02-19 01:33:21 +01:00
|
|
|
|
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
|
2021-12-31 15:33:49 +01:00
|
|
|
|
need to reboot a system to try again."
|
2018-11-01 12:31:45 +01:00
|
|
|
|
?define MANUALLY_BUTTON_TEXT "Choose /kolibrios/ folder..."
|
2021-12-31 15:33:49 +01:00
|
|
|
|
?define OPEN_ANYWAY_BUTTON_TEXT "Open APP+ anyway (some programs won't be available) "
|
2018-11-01 12:31:45 +01:00
|
|
|
|
#endif
|
2016-02-19 00:28:04 +01:00
|
|
|
|
|
2021-12-31 15:33:49 +01:00
|
|
|
|
char kolibrios_dirs[] = "..\0 3D \0demos \0develop\0drivers\0emul \0games \0grafx2";
|
|
|
|
|
|
2018-11-01 12:31:45 +01:00
|
|
|
|
//===================================================//
|
|
|
|
|
// //
|
|
|
|
|
// CODE //
|
|
|
|
|
// //
|
|
|
|
|
//===================================================//
|
2016-02-19 00:28:04 +01:00
|
|
|
|
|
|
|
|
|
void main()
|
|
|
|
|
{
|
2020-12-14 16:54:00 +01:00
|
|
|
|
if (param) {
|
|
|
|
|
SetAdditionalSystemDirectory("kolibrios", #param+1);
|
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-01 13:57:00 +02:00
|
|
|
|
WaitAutosearch();
|
2016-02-19 00:28:04 +01:00
|
|
|
|
CheckKosMounted();
|
|
|
|
|
|
|
|
|
|
o_dialog.type = 2;
|
2020-05-26 02:17:12 +02:00
|
|
|
|
#define NO_DLL_INIT
|
2016-02-19 00:28:04 +01:00
|
|
|
|
load_dll(Proc_lib, #OpenDialog_init,0);
|
|
|
|
|
OpenDialog_init stdcall (#o_dialog);
|
2017-10-01 13:57:00 +02:00
|
|
|
|
active_button_id = BTN_MANUAL_SEARCH;
|
2016-02-19 00:28:04 +01:00
|
|
|
|
|
2020-05-26 02:17:12 +02:00
|
|
|
|
loop() switch(@WaitEvent())
|
2016-02-19 00:28:04 +01:00
|
|
|
|
{
|
|
|
|
|
case evButton:
|
2018-11-01 12:31:45 +01:00
|
|
|
|
EventButton(GetButtonID());
|
2017-10-01 13:57:00 +02:00
|
|
|
|
break;
|
|
|
|
|
case evKey:
|
2020-12-14 02:55:05 +01:00
|
|
|
|
@GetKeyScancode();
|
2020-05-26 02:17:12 +02:00
|
|
|
|
if (AL == SCAN_CODE_ENTER) {
|
2018-11-01 12:31:45 +01:00
|
|
|
|
EventButton(active_button_id);
|
2020-05-26 02:17:12 +02:00
|
|
|
|
} else if (AL == SCAN_CODE_TAB) {
|
2018-11-01 12:31:45 +01:00
|
|
|
|
active_button_id = active_button_id-10^1 + 10;
|
|
|
|
|
DrawButtons();
|
|
|
|
|
}
|
2016-02-19 00:28:04 +01:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evReDraw:
|
|
|
|
|
draw_window();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void draw_window()
|
|
|
|
|
{
|
2020-04-18 01:52:24 +02:00
|
|
|
|
sc.get();
|
2022-01-08 21:22:10 +01:00
|
|
|
|
DefineAndDrawWindow(screen.w-WINW/2, 100, WINW, WINH+skin_h, 0x34, sc.work, WINDOW_TITLE_TEXT,0);
|
2021-12-31 15:33:49 +01:00
|
|
|
|
WriteTextB(CONX+2,SCRY+2,0x81,MixColors(sc.work, 0xB92234,220),CONTENT_HEADER_TEXT);
|
|
|
|
|
WriteTextB(CONX,SCRY,0x81,0xB92234,CONTENT_HEADER_TEXT);
|
|
|
|
|
draw_screen();
|
|
|
|
|
WriteTextLines(CONX,SCRY+50,0x90,sc.work_text,DESCRIPTION_TEXT,20);
|
2018-11-01 12:31:45 +01:00
|
|
|
|
DrawButtons();
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-31 15:33:49 +01:00
|
|
|
|
void draw_screen()
|
|
|
|
|
{
|
|
|
|
|
char i;
|
|
|
|
|
int icon_n=1;
|
2022-01-09 07:36:16 +01:00
|
|
|
|
DrawRectangle(WINW-180-1,SCRY-1, 145+1,170+1, sc.line);
|
2021-12-31 15:33:49 +01:00
|
|
|
|
DrawBar(SCRX,SCRY,145,170,0xFFFfff);
|
|
|
|
|
DrawBar(SCRX+25,SCRY+5,144-25,20,0xBBDDFF);
|
|
|
|
|
for (i=0; i<8; i++) {
|
|
|
|
|
draw_icon_16(SCRX+5, i*20+SCRY+5, icon_n);
|
|
|
|
|
WriteText(SCRX+27, i*20+SCRY+11, 0x80, 0, i*8 + #kolibrios_dirs);
|
|
|
|
|
icon_n = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-01 12:31:45 +01:00
|
|
|
|
void DrawButtons()
|
|
|
|
|
{
|
2021-12-31 15:33:49 +01:00
|
|
|
|
DrawStandartCaptButton(CONX, WINH-80, BTN_MANUAL_SEARCH, MANUALLY_BUTTON_TEXT);
|
|
|
|
|
DrawStandartCaptButton(CONX, WINH-42, BTN_OPEN_ANYWAY, OPEN_ANYWAY_BUTTON_TEXT);
|
|
|
|
|
//DrawCaptButton(CONX, WINH-80, 300, 25, BTN_MANUAL_SEARCH, sc.button, sc.button_text, MANUALLY_BUTTON_TEXT);
|
|
|
|
|
//DrawCaptButton(CONX, WINH-42, 500, 25, BTN_OPEN_ANYWAY, sc.button, sc.button_text, OPEN_ANYWAY_BUTTON_TEXT);
|
2018-11-01 12:31:45 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CheckKosMounted()
|
|
|
|
|
{
|
|
|
|
|
if (dir_exists("/kolibrios"))
|
|
|
|
|
{
|
|
|
|
|
if (file_exists(APP_PLUS_INI_PATH)) EventOpenApp();
|
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WaitAutosearch()
|
|
|
|
|
{
|
|
|
|
|
while (CheckProcessExists("SEARCHAP")) pause(2);
|
2017-10-01 13:57:00 +02:00
|
|
|
|
}
|
|
|
|
|
|
2018-11-01 12:31:45 +01:00
|
|
|
|
//===================================================//
|
|
|
|
|
// //
|
|
|
|
|
// EVENTS //
|
|
|
|
|
// //
|
|
|
|
|
//===================================================//
|
|
|
|
|
|
2017-10-01 13:57:00 +02:00
|
|
|
|
void EventManualSearch()
|
|
|
|
|
{
|
|
|
|
|
OpenDialog_start stdcall (#o_dialog);
|
|
|
|
|
if (o_dialog.status) SetAdditionalSystemDirectory("kolibrios", #openfile_path+1);
|
|
|
|
|
pause(3);
|
|
|
|
|
CheckKosMounted();
|
2016-02-19 00:28:04 +01:00
|
|
|
|
}
|
|
|
|
|
|
2018-11-01 12:31:45 +01:00
|
|
|
|
void EventOpenApp()
|
|
|
|
|
{
|
2019-03-18 23:31:13 +01:00
|
|
|
|
if (RunProgram("/sys/syspanel", APP_PLUS_INI_PATH) < 0) {
|
|
|
|
|
notify("'App+ can not be started because\n/sys/syspanel does not exists' -E");
|
|
|
|
|
}
|
2018-11-01 12:31:45 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EventButton(dword id)
|
|
|
|
|
{
|
|
|
|
|
if (id==CLOSE_BTN) ExitProcess();
|
|
|
|
|
else if (id==BTN_MANUAL_SEARCH) EventManualSearch();
|
2021-12-31 15:33:49 +01:00
|
|
|
|
else if (id==BTN_OPEN_ANYWAY) { EventOpenApp(); ExitProcess(); }
|
2018-11-01 12:31:45 +01:00
|
|
|
|
}
|
|
|
|
|
|
2016-02-19 00:28:04 +01:00
|
|
|
|
|
|
|
|
|
stop:
|