Subversion Repositories Kolibri OS

Rev

Rev 9538 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
9505 leency 1
#define MEMSIZE 1024*60
4113 leency 2
 
7660 leency 3
#include "../lib/gui.h"
4
#include "../lib/copyf.h"
7661 leency 5
 
7660 leency 6
#include "../lib/obj/libini.h"
7661 leency 7
 
7660 leency 8
#include "../lib/patterns/restart_process.h"
7654 leency 9
 
7660 leency 10
char logo[] = "
9538 punk_joker 11
████   ████ ██████████ ████   ████ ███████████
12
 ████   ██   ███         ███ ███   ██  ███  ██
13
 █████  ██   ███          █████    ██  ███  ██
14
 ██ ███ ██   ███████       ███         ███
15
 ██  █████   ███          █████        ███
16
 ██   ████   ███         ███ ███       ███
17
████   ███  ██████████ ████   ████    █████
7660 leency 18
";
5548 leency 19
 
7661 leency 20
#ifdef LANG_RUS
9538 punk_joker 21
#define T_INTRO "Попробуйте новое визуальное оформление Колибри, которое раньше было доступно только в KolibriNext.";
22
#define T_INSTALL "Установить"
23
#define T_COMPLETE "Установка завершена"
24
#define T_EXIT "Выход"
7661 leency 25
#else
26
#define T_INTRO "Try a new visual design of KolibriOS, which previously was available only in KolibriNext.";
27
#define T_INSTALL "Install"
28
#define T_COMPLETE "Install complete"
29
#define T_EXIT "Exit"
30
#endif
7660 leency 31
 
32
#define B_INSTALL 10
8278 leency 33
#define B_EXIT 11
7660 leency 34
 
7661 leency 35
bool install_complete = false;
36
 
4113 leency 37
void main()
38
{
7660 leency 39
	word btn;
9536 punk_joker 40
	saved_state = FILE_REPLACE;
7660 leency 41
	load_dll(libini, #lib_init,1);
9505 leency 42
	loop() switch(WaitEvent())
7660 leency 43
	{
44
		case evButton:
45
			btn = GetButtonID();
8278 leency 46
			if (btn == 1) || (B_EXIT == btn) ExitProcess();
47
			if (B_INSTALL == btn) EventInstall();
7660 leency 48
			break;
49
 
50
		case evKey:
51
			GetKeys();
52
			if (key_scancode == SCAN_CODE_ESC) ExitProcess();
7661 leency 53
			if (key_scancode == SCAN_CODE_ENTER) {
54
				if (install_complete) ExitProcess();
55
				else EventInstall();
56
			}
7660 leency 57
			break;
58
 
59
		case evReDraw:
60
			draw_window();
61
			break;
62
	}
63
}
64
 
65
#define WINW 400
66
#define WINH 300
67
void draw_window()
68
{
7806 leency 69
	sc.get();
9597 leency 70
	DefineAndDrawWindow(screen.w-WINW/2,screen.h-WINH/2,
71
		WINW+9,WINH+skin_h,0x34,sc.work,"KolibriN10",0);
7660 leency 72
	DrawLogo();
7661 leency 73
	if (install_complete) DrawInstallComplete(); else DrawIntro();
74
}
7660 leency 75
 
7661 leency 76
void DrawIntro()
77
{
7660 leency 78
	DrawTextViewArea(30, 140, WINW-60, WINH-80,
7806 leency 79
		T_INTRO, -1, sc.work_text);
7660 leency 80
	DrawCaptButton(WINW-110/2, WINH-70, 110, 28, B_INSTALL,
7661 leency 81
		0x0092D8, 0xFFFfff, T_INSTALL);
7660 leency 82
}
83
 
7661 leency 84
void DrawInstallComplete()
85
{
9439 leency 86
	draw_icon_32(WINW-32/2, 140, sc.work, 49);
7806 leency 87
	WriteTextCenter(0,185, WINW, sc.work_text, T_COMPLETE);
8278 leency 88
	DrawCaptButton(WINW-110/2, WINH-70, 110, 28, B_EXIT,
7661 leency 89
		0x0092D8, 0xFFFfff, T_EXIT);
90
}
91
 
7660 leency 92
void DrawLogo()
93
{
94
	#define LX -46*6+WINW/2
95
	#define LY 25
7661 leency 96
	WriteTextLines(LX-2, LY, 0x80, 0xF497C0, #logo, 9);
7660 leency 97
	WriteTextLines(LX+3, LY, 0x80, 0x7ED1E3, #logo, 9);
98
 
99
	pause(1);
100
 
101
	WriteTextLines(LX+1, LY, 0x80, 0xEC008C, #logo, 9);
102
	WriteTextLines(LX,   LY, 0x80, 0xEC008C, #logo, 9);
103
}
104
 
105
void EventInstall()
106
{
7654 leency 107
	ini_set_int stdcall ("/sys/settings/taskbar.ini", "Flags", "Attachment", 0);
9505 leency 108
	writing_error_channel = WRITE_ERROR_NOTIFY;
109
	copy_state = FILE_REPLACE;
110
	//if (copyf("/kolibrios/KolibriNext/settings", "/sys/settings")) return;
111
	CopyFile("/kolibrios/KolibriNext/settings/app_plus.ini", "/sys/settings/app_plus.ini");
112
	CopyFile("/kolibrios/KolibriNext/settings/docky.ini", "/sys/settings/docky.ini");
113
	CopyFile("/kolibrios/KolibriNext/settings/icon.ini", "/sys/settings/icon.ini");
5651 pavelyakov 114
 
7654 leency 115
	RestartProcessByName("/sys/@icon", MULTIPLE);
116
	RestartProcessByName("/sys/@taskbar", SINGLE);
117
	RestartProcessByName("/sys/@docky", SINGLE);
7422 leency 118
 
7654 leency 119
	RunProgram("/sys/media/kiv", "\\S__/kolibrios/res/Wallpapers/Free yourself.jpg");
7661 leency 120
 
121
	install_complete = true;
9341 leency 122
 
123
	pause(150);
124
	ActivateWindow_Self();
4113 leency 125
}
126
 
8013 leency 127
void Operation_Draw_Progress(dword filename) { }