2016-02-19 00:28:04 +01:00
|
|
|
#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"
|
2016-02-19 22:07:11 +01:00
|
|
|
#include "..\lib\patterns\restart_process.h"
|
2016-02-19 00:28:04 +01:00
|
|
|
#include "..\lib\added_sysdir.c"
|
|
|
|
|
2016-02-19 22:07:11 +01:00
|
|
|
|
2016-02-19 00:28:04 +01:00
|
|
|
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};
|
|
|
|
|
2017-10-01 13:57:00 +02:00
|
|
|
#define BTN_MANUAL_SEARCH 10
|
|
|
|
|
2016-02-19 01:33:21 +01:00
|
|
|
#define APP_PLUS_INI_PATH "/kolibrios/settings/app_plus.ini"
|
|
|
|
|
2017-10-01 13:57:00 +02:00
|
|
|
#define APP_PLUS_INI_NOT_EXISTS "'APP+\n/kolibrios/settings/app_plus.ini does not exists.\nProgram terminated.' -tE"
|
2016-02-19 01:33:21 +01:00
|
|
|
|
|
|
|
#define WINDOW_TITLE_TEXT "Error"
|
2016-02-19 14:34:31 +01:00
|
|
|
#define CONTENT_HEADER_TEXT "/KOLIBRIOS/ IS NOT MOUNTED"
|
2016-02-19 01:33:21 +01:00
|
|
|
#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..."
|
2016-02-19 00:28:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
void CheckKosMounted()
|
|
|
|
{
|
2016-10-07 16:43:24 +02:00
|
|
|
if (dir_exists("/kolibrios"))
|
2016-02-19 00:28:04 +01:00
|
|
|
{
|
2016-02-19 01:33:21 +01:00
|
|
|
if (file_exists(APP_PLUS_INI_PATH))
|
|
|
|
io.run("syspanel", APP_PLUS_INI_PATH);
|
|
|
|
else
|
|
|
|
notify(APP_PLUS_INI_NOT_EXISTS);
|
2016-02-19 00:28:04 +01:00
|
|
|
ExitProcess();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-01 13:57:00 +02:00
|
|
|
void WaitAutosearch()
|
2016-02-19 00:28:04 +01:00
|
|
|
{
|
2016-02-20 23:09:50 +01:00
|
|
|
while (CheckProcessExists("SEARCHAP")) pause(2);
|
2016-02-19 00:28:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
word id;
|
|
|
|
|
|
|
|
CheckKosMounted();
|
2017-10-01 13:57:00 +02:00
|
|
|
WaitAutosearch();
|
2016-02-19 00:28:04 +01:00
|
|
|
CheckKosMounted();
|
|
|
|
|
|
|
|
o_dialog.type = 2;
|
|
|
|
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
|
|
|
|
|
|
|
loop() switch(WaitEvent())
|
|
|
|
{
|
|
|
|
case evButton:
|
|
|
|
id=GetButtonID();
|
|
|
|
if (id==1) ExitProcess();
|
2017-10-01 13:57:00 +02:00
|
|
|
if (id==BTN_MANUAL_SEARCH) EventManualSearch();
|
|
|
|
break;
|
|
|
|
case evKey:
|
|
|
|
GetKeys();
|
|
|
|
if (key_scancode == SCAN_CODE_ENTER) EventManualSearch();
|
2016-02-19 00:28:04 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case evReDraw:
|
|
|
|
draw_window();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void draw_window()
|
|
|
|
{
|
|
|
|
incn y;
|
|
|
|
dword x=30;
|
|
|
|
y.n=0;
|
|
|
|
system.color.get();
|
2016-11-23 12:37:13 +01:00
|
|
|
DefineAndDrawWindow(screen.width-570/2, 100, 570, 280+skin_height, 0x34, system.color.work, WINDOW_TITLE_TEXT,0);
|
2016-02-19 00:28:04 +01:00
|
|
|
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);
|
|
|
|
|
2017-10-01 13:57:00 +02:00
|
|
|
DrawStandartCaptButton(x, Form.cheight-66, BTN_MANUAL_SEARCH, MANUALLY_BUTTON_TEXT);
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
stop:
|