2013-10-24 00:05:17 +02:00
|
|
|
//11.03.12 - start!
|
2020-11-27 14:25:36 +01:00
|
|
|
//ver 2.31
|
2013-10-24 00:05:17 +02:00
|
|
|
|
2019-05-20 12:40:10 +02:00
|
|
|
#define MEMSIZE 200*1024
|
2020-05-10 14:49:02 +02:00
|
|
|
#include "../lib/mem.h"
|
|
|
|
#include "../lib/strings.h"
|
|
|
|
#include "../lib/io.h"
|
|
|
|
#include "../lib/list_box.h"
|
|
|
|
#include "../lib/gui.h"
|
2018-09-11 23:09:14 +02:00
|
|
|
|
2020-05-10 14:49:02 +02:00
|
|
|
#include "../lib/obj/box_lib.h"
|
|
|
|
#include "../lib/obj/proc_lib.h"
|
|
|
|
#include "../lib/obj/libini.h"
|
2013-10-24 23:45:17 +02:00
|
|
|
|
2020-05-10 14:49:02 +02:00
|
|
|
#include "../lib/patterns/select_list.h"
|
|
|
|
#include "../lib/patterns/simple_open_dialog.h"
|
2021-12-21 18:22:15 +01:00
|
|
|
#include "../lib/patterns/restart_process.h"
|
2016-02-13 12:00:14 +01:00
|
|
|
|
2019-03-18 23:31:13 +01:00
|
|
|
#include "ui_elements_preview.h"
|
2021-12-22 02:26:10 +01:00
|
|
|
#include "const.h"
|
2019-03-18 23:31:13 +01:00
|
|
|
|
2016-02-13 12:00:14 +01:00
|
|
|
//===================================================//
|
|
|
|
// //
|
|
|
|
// DATA //
|
|
|
|
// //
|
|
|
|
//===================================================//
|
|
|
|
|
2021-12-21 18:22:15 +01:00
|
|
|
signed int active_skin=-1, active_wallpaper=-1, active_screensaver=-1;
|
2018-09-11 23:09:14 +02:00
|
|
|
enum {
|
2021-12-21 18:22:15 +01:00
|
|
|
BASE_TAB_BUTTON_ID=3,
|
|
|
|
BTN_SELECT_WALLP_FOLDER=10,
|
|
|
|
BTN_TEST_SCREENSAVER };
|
2013-10-24 00:05:17 +02:00
|
|
|
|
|
|
|
char folder_path[4096];
|
|
|
|
char cur_file_path[4096];
|
2018-11-12 17:27:48 +01:00
|
|
|
char cur_skin_path[4096];
|
2016-01-26 00:13:50 +01:00
|
|
|
int files_mas[400];
|
2013-10-24 00:05:17 +02:00
|
|
|
|
2021-12-21 18:22:15 +01:00
|
|
|
_tabs tabs = { -sizeof(t_skins)-sizeof(t_wallpapers)-sizeof(t_screensaver)-3*8+WIN_W
|
|
|
|
- TAB_PADDING / 2, LP, NULL, BASE_TAB_BUTTON_ID };
|
2018-04-11 19:46:08 +02:00
|
|
|
|
2019-03-15 15:05:59 +01:00
|
|
|
checkbox update_docky = { T_UPDATE_DOCK, false };
|
2018-04-22 15:33:01 +02:00
|
|
|
|
2019-03-15 13:19:45 +01:00
|
|
|
checkbox optionbox_stretch = { T_CHECKBOX_STRETCH, true };
|
|
|
|
checkbox optionbox_tiled = { T_CHECKBOX_TILED, false };
|
|
|
|
|
2021-12-23 13:27:15 +01:00
|
|
|
struct SCREENSAVER_SETTINGS {
|
|
|
|
int timeout;
|
|
|
|
char program[60];
|
|
|
|
char available[200];
|
|
|
|
} ss_settings;
|
|
|
|
|
2016-02-13 12:00:14 +01:00
|
|
|
//===================================================//
|
|
|
|
// //
|
|
|
|
// CODE //
|
|
|
|
// //
|
|
|
|
//===================================================//
|
2013-10-24 00:05:17 +02:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2021-12-23 13:27:15 +01:00
|
|
|
int id, i;
|
2015-07-29 22:43:05 +02:00
|
|
|
load_dll(boxlib, #box_lib_init,0);
|
2018-11-06 18:05:54 +01:00
|
|
|
load_dll(libini, #lib_init,1);
|
2018-09-11 23:09:14 +02:00
|
|
|
load_dll(Proc_lib, #OpenDialog_init,0);
|
|
|
|
o_dialog.type = 2; //select folder
|
|
|
|
OpenDialog_init stdcall (#o_dialog);
|
|
|
|
|
2021-12-21 18:22:15 +01:00
|
|
|
tabs.add(#t_skins, #EventTabSkinsClick);
|
|
|
|
tabs.add(#t_wallpapers, #EventTabWallpappersClick);
|
|
|
|
tabs.add(#t_screensaver, #EventTabScreensaverClick);
|
2020-05-10 14:49:02 +02:00
|
|
|
tabs.draw_active_tab();
|
2018-09-11 23:09:14 +02:00
|
|
|
|
2018-11-12 17:27:48 +01:00
|
|
|
SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
|
2016-01-26 00:13:50 +01:00
|
|
|
loop() switch(WaitEvent())
|
2013-10-24 00:05:17 +02:00
|
|
|
{
|
|
|
|
case evMouse:
|
2016-11-02 15:30:45 +01:00
|
|
|
SelectList_ProcessMouse();
|
2013-10-24 00:05:17 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case evButton:
|
|
|
|
id=GetButtonID();
|
2018-11-12 17:27:48 +01:00
|
|
|
if (id==1) EventExit();
|
2018-09-11 23:09:14 +02:00
|
|
|
if (id==BTN_SELECT_WALLP_FOLDER) EventSelectWallpFolder();
|
2020-05-10 14:49:02 +02:00
|
|
|
tabs.click(id);
|
2018-04-19 22:12:07 +02:00
|
|
|
checkbox1.click(id);
|
2018-04-21 14:28:00 +02:00
|
|
|
spinbox1.click(id);
|
2019-03-15 15:05:59 +01:00
|
|
|
if (update_docky.click(id)) EventUpdateDocky();
|
2019-03-15 13:19:45 +01:00
|
|
|
if (!optionbox_stretch.checked) && (optionbox_stretch.click(id)) EventSetWallpMode_Stretch();
|
|
|
|
if (!optionbox_tiled.checked) && (optionbox_tiled.click(id)) EventSetWallpMode_Tiled();
|
2013-10-24 00:05:17 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case evKey:
|
2015-08-10 12:47:21 +02:00
|
|
|
GetKeys();
|
2016-11-02 13:19:15 +01:00
|
|
|
if (select_list.ProcessKey(key_scancode)) EventApply();
|
2016-02-13 12:00:14 +01:00
|
|
|
if (key_scancode==SCAN_CODE_ENTER) EventOpenFile();
|
|
|
|
if (key_scancode==SCAN_CODE_DEL) EventDeleteFile();
|
2021-12-21 18:22:15 +01:00
|
|
|
if (key_scancode==SCAN_CODE_TAB) {
|
|
|
|
id = tabs.active_tab+1;
|
|
|
|
if(id==3)id=0;
|
|
|
|
tabs.click(id + tabs.base_id);
|
2021-12-22 02:26:10 +01:00
|
|
|
DrawWindowContent();
|
2021-12-21 18:22:15 +01:00
|
|
|
break;
|
|
|
|
}
|
2018-09-10 21:47:52 +02:00
|
|
|
|
2018-10-29 12:39:31 +01:00
|
|
|
if (! edit_cmm.flags & ed_focus) && (! edit_st.flags & ed_focus)
|
2021-12-23 13:27:15 +01:00
|
|
|
for (i=select_list.cur_y+1; i<select_list.count; i++)
|
2013-10-24 00:05:17 +02:00
|
|
|
{
|
2021-12-23 13:27:15 +01:00
|
|
|
id = ESBYTE[io.dir.position(files_mas[i])];
|
|
|
|
if (id==ESBYTE[EAX]) || (id==key_ascii-32)
|
2016-02-13 12:00:14 +01:00
|
|
|
{
|
2021-12-23 13:27:15 +01:00
|
|
|
select_list.cur_y = i - 1;
|
2016-11-02 13:19:15 +01:00
|
|
|
select_list.KeyDown();
|
2016-02-13 12:00:14 +01:00
|
|
|
EventApply();
|
|
|
|
break;
|
|
|
|
}
|
2013-10-24 00:05:17 +02:00
|
|
|
}
|
2018-09-10 21:47:52 +02:00
|
|
|
|
2021-12-23 13:27:15 +01:00
|
|
|
if (tabs.active_tab == TAB_SKINS) {
|
|
|
|
EAX = key_editbox;
|
2018-09-11 23:09:14 +02:00
|
|
|
edit_box_key stdcall (#edit_cmm);
|
|
|
|
edit_box_key stdcall (#edit_st);
|
|
|
|
}
|
2013-10-24 00:05:17 +02:00
|
|
|
break;
|
|
|
|
|
2018-09-11 23:09:14 +02:00
|
|
|
case evReDraw:
|
|
|
|
draw_window();
|
2013-10-24 00:05:17 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-11 23:09:14 +02:00
|
|
|
void draw_window()
|
|
|
|
{
|
2020-05-10 14:49:02 +02:00
|
|
|
sc.get();
|
2021-12-23 13:27:15 +01:00
|
|
|
DefineAndDrawWindow(screen.width-WIN_W-9/2,80,WIN_W+9,WIN_H+4+skin_height,0x34,sc.work,WINDOW_HEADER,0);
|
2018-09-11 23:09:14 +02:00
|
|
|
DrawWindowContent();
|
|
|
|
}
|
2018-04-19 22:12:07 +02:00
|
|
|
|
2016-02-13 12:00:14 +01:00
|
|
|
void DrawWindowContent()
|
|
|
|
{
|
2020-04-18 01:52:24 +02:00
|
|
|
sc.get();
|
2019-03-15 15:05:59 +01:00
|
|
|
|
2020-05-10 14:49:02 +02:00
|
|
|
tabs.draw();
|
2021-12-22 02:26:10 +01:00
|
|
|
draw_icon_16w(tabs.x + TAB_PADDING, LP+5, 17);
|
|
|
|
draw_icon_16w(sizeof(t_skins)-1*8 + TAB_PADDING + TAB_PADDING + tabs.x, LP+5, 6);
|
|
|
|
draw_icon_16w(sizeof(t_wallpapers)+sizeof(t_skins)-2*8 + TAB_PADDING + TAB_PADDING + TAB_PADDING + tabs.x, LP+5, 61);
|
2020-05-10 14:49:02 +02:00
|
|
|
|
2021-12-23 13:27:15 +01:00
|
|
|
$push select_list.cur_y
|
2016-11-02 15:30:45 +01:00
|
|
|
SelectList_Init(
|
2021-12-21 18:22:15 +01:00
|
|
|
LP + TAB_PADDING,
|
|
|
|
PANEL_H,
|
|
|
|
LIST_W,
|
2021-12-23 13:27:15 +01:00
|
|
|
WIN_H - LP - TAB_PADDING - PANEL_H
|
2016-11-02 15:30:45 +01:00
|
|
|
);
|
2021-12-23 13:27:15 +01:00
|
|
|
$pop select_list.cur_y
|
2018-04-19 22:12:07 +02:00
|
|
|
|
2021-12-23 13:27:15 +01:00
|
|
|
DrawBar(RIGHTx, PANEL_H, RIGHTw, WIN_H-PANEL_H-LP, sc.work);
|
2018-04-19 22:12:07 +02:00
|
|
|
|
2016-11-02 15:30:45 +01:00
|
|
|
SelectList_Draw();
|
2016-11-03 13:41:15 +01:00
|
|
|
SelectList_DrawBorder();
|
2018-04-19 22:12:07 +02:00
|
|
|
|
2021-12-23 13:27:15 +01:00
|
|
|
if (tabs.active_tab == TAB_SKINS)
|
2018-04-19 22:12:07 +02:00
|
|
|
{
|
2021-12-23 13:27:15 +01:00
|
|
|
DrawFrame(RIGHTx, PANEL_H+5, RIGHTw, RIGHTh, T_UI_PREVIEW);
|
|
|
|
DrawUiElementsPreview(RIGHTx+20, PANEL_H+5, RIGHTh);
|
|
|
|
if (CheckProcessExists("@DOCKY")) update_docky.draw(RIGHTx, PANEL_H+250);
|
2018-04-19 22:12:07 +02:00
|
|
|
}
|
2021-12-23 13:27:15 +01:00
|
|
|
if (tabs.active_tab == TAB_WALLPAPERS)
|
2018-09-11 23:09:14 +02:00
|
|
|
{
|
2021-12-23 13:27:15 +01:00
|
|
|
DrawFrame(RIGHTx, PANEL_H+5, 180, 80, T_PICTURE_MODE);
|
|
|
|
optionbox_stretch.draw(RIGHTx+14, PANEL_H+25);
|
|
|
|
optionbox_tiled.draw(RIGHTx+14, PANEL_H+52);
|
|
|
|
DrawStandartCaptButton(RIGHTx, PANEL_H+100, BTN_SELECT_WALLP_FOLDER, T_SELECT_FOLDER);
|
2021-12-21 18:22:15 +01:00
|
|
|
}
|
2021-12-23 13:27:15 +01:00
|
|
|
if (tabs.active_tab == TAB_SCREENSAVERS)
|
2021-12-21 18:22:15 +01:00
|
|
|
{
|
2021-12-23 13:27:15 +01:00
|
|
|
DrawStandartCaptButton(RIGHTx, PANEL_H, BTN_TEST_SCREENSAVER, "Test");
|
2018-09-11 23:09:14 +02:00
|
|
|
}
|
2016-02-13 12:00:14 +01:00
|
|
|
}
|
2013-10-24 00:05:17 +02:00
|
|
|
|
2021-12-22 02:26:10 +01:00
|
|
|
bool strreqi(dword _left, _right)
|
|
|
|
{
|
2021-12-23 13:27:15 +01:00
|
|
|
return strcmp(_left+strrchr(_left,'.'), _right);
|
2021-12-22 02:26:10 +01:00
|
|
|
}
|
2013-10-24 00:05:17 +02:00
|
|
|
|
2016-02-13 12:00:14 +01:00
|
|
|
void Open_Dir()
|
2013-10-24 00:05:17 +02:00
|
|
|
{
|
2016-02-13 12:00:14 +01:00
|
|
|
int j;
|
2021-12-23 13:27:15 +01:00
|
|
|
char temp_filename[4096];
|
2016-11-02 13:19:15 +01:00
|
|
|
select_list.count = 0;
|
2016-02-13 12:00:14 +01:00
|
|
|
if(io.dir.buffer)free(io.dir.buffer);
|
|
|
|
io.dir.load(#folder_path,DIR_ONLYREAL);
|
|
|
|
for (j=0; j<io.dir.count; j++)
|
2013-12-26 23:51:43 +01:00
|
|
|
{
|
2016-02-13 12:00:14 +01:00
|
|
|
strcpy(#temp_filename, io.dir.position(j));
|
|
|
|
strlwr(#temp_filename);
|
2021-12-23 13:27:15 +01:00
|
|
|
if (tabs.active_tab==TAB_SKINS) {
|
|
|
|
if (strreqi(#temp_filename,"skn")!=0) continue;
|
2018-09-11 23:09:14 +02:00
|
|
|
}
|
2021-12-23 13:27:15 +01:00
|
|
|
if (tabs.active_tab==TAB_WALLPAPERS) {
|
|
|
|
if (strreqi(#temp_filename,"png")!=0)
|
|
|
|
&& (strreqi(#temp_filename,"jpg")!=0)
|
|
|
|
&& (strreqi(#temp_filename,"jpeg")!=0)
|
|
|
|
&& (strreqi(#temp_filename,"bmp")!=0)
|
|
|
|
&& (strreqi(#temp_filename,"gif")!=0) continue;
|
2018-09-11 23:09:14 +02:00
|
|
|
}
|
2021-12-23 13:27:15 +01:00
|
|
|
files_mas[calc(select_list.count)]=j;
|
2016-11-02 13:19:15 +01:00
|
|
|
select_list.count++;
|
2013-12-26 23:51:43 +01:00
|
|
|
}
|
2020-11-27 14:25:36 +01:00
|
|
|
Sort_by_Name(0, select_list.count-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Sort_by_Name(int a, b) // for the first call: a = 0, b = sizeof(mas) - 1
|
|
|
|
{
|
|
|
|
int j;
|
|
|
|
int isn = a;
|
|
|
|
if (a >= b) return;
|
|
|
|
for (j = a; j <= b; j++) {
|
|
|
|
if (strcmpi(io.dir.position(files_mas[j]), io.dir.position(files_mas[b]))<=0) {
|
|
|
|
files_mas[isn] >< files_mas[j];
|
|
|
|
isn++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Sort_by_Name(a, isn-2);
|
|
|
|
Sort_by_Name(isn, b);
|
2016-02-13 12:00:14 +01:00
|
|
|
}
|
|
|
|
|
2016-11-02 15:30:45 +01:00
|
|
|
void SelectList_DrawLine(dword i)
|
2016-02-13 12:00:14 +01:00
|
|
|
{
|
2021-12-23 13:27:15 +01:00
|
|
|
int draw_y = i*SELECT_LIST_ITEMH+PANEL_H;
|
|
|
|
int i_abs = select_list.first + i;
|
|
|
|
char filename[4096];
|
2016-11-02 13:19:15 +01:00
|
|
|
|
2021-12-23 13:27:15 +01:00
|
|
|
strcpy(#filename, io.dir.position(files_mas[i_abs]));
|
|
|
|
EAX = math.min(strrchr(#filename,'.')-1, LIST_W - 24 / 8);
|
|
|
|
filename[EAX] = '\0';
|
2016-11-02 13:19:15 +01:00
|
|
|
|
2021-12-23 13:27:15 +01:00
|
|
|
if (select_list.cur_y == i_abs)
|
2016-11-02 13:19:15 +01:00
|
|
|
{
|
2021-12-23 13:27:15 +01:00
|
|
|
DrawBar(select_list.x, draw_y, LIST_W, SELECT_LIST_ITEMH, sc.button);
|
|
|
|
WriteText(select_list.x+12,draw_y+select_list.text_y,select_list.font_type,sc.button_text, #filename);
|
2016-11-02 13:19:15 +01:00
|
|
|
}
|
|
|
|
else
|
2013-12-26 23:51:43 +01:00
|
|
|
{
|
2021-12-23 13:27:15 +01:00
|
|
|
DrawBar(select_list.x,draw_y,LIST_W, SELECT_LIST_ITEMH, 0xFFFfff);
|
|
|
|
WriteText(select_list.x+12,draw_y+select_list.text_y,select_list.font_type,0, #filename);
|
2013-12-26 23:51:43 +01:00
|
|
|
}
|
2013-10-24 00:05:17 +02:00
|
|
|
}
|
|
|
|
|
2016-11-02 15:30:45 +01:00
|
|
|
void SelectList_LineChanged()
|
|
|
|
{
|
|
|
|
EventApply();
|
|
|
|
}
|
|
|
|
|
2020-05-20 21:34:09 +02:00
|
|
|
void ActivateTab(int _id)
|
|
|
|
{
|
|
|
|
select_list.ClearList();
|
|
|
|
Open_Dir();
|
2021-12-23 13:27:15 +01:00
|
|
|
if (!select_list.count) notify(T_NO_FILES);
|
2020-05-20 21:34:09 +02:00
|
|
|
select_list.cur_y = _id;
|
|
|
|
if (select_list.cur_y>select_list.visible) select_list.first=select_list.cur_y;
|
|
|
|
select_list.CheckDoesValuesOkey();
|
2021-12-23 13:27:15 +01:00
|
|
|
if (LIST_W) DrawWindowContent();
|
2021-12-22 02:26:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
dword GetRealKolibriosPath()
|
|
|
|
{
|
|
|
|
char real_kolibrios_path[4096];
|
|
|
|
SetCurDir("/kolibrios");
|
|
|
|
GetCurDir(#real_kolibrios_path, sizeof(real_kolibrios_path));
|
|
|
|
return #real_kolibrios_path;
|
2020-05-20 21:34:09 +02:00
|
|
|
}
|
|
|
|
|
2016-02-13 12:00:14 +01:00
|
|
|
//===================================================//
|
|
|
|
// //
|
|
|
|
// EVENTS //
|
|
|
|
// //
|
|
|
|
//===================================================//
|
2013-10-24 00:05:17 +02:00
|
|
|
|
2020-05-10 14:49:02 +02:00
|
|
|
void EventTabSkinsClick()
|
2013-10-24 23:45:17 +02:00
|
|
|
{
|
2020-05-10 14:49:02 +02:00
|
|
|
active_wallpaper = select_list.cur_y;
|
2021-12-22 02:26:10 +01:00
|
|
|
miniprintf(#folder_path, "%s/res/skins", GetRealKolibriosPath());
|
2020-05-20 21:34:09 +02:00
|
|
|
ActivateTab(active_skin);
|
2020-05-10 14:49:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void EventTabWallpappersClick()
|
|
|
|
{
|
|
|
|
active_skin = select_list.cur_y;
|
2021-12-22 02:26:10 +01:00
|
|
|
if (opendir_path) {
|
|
|
|
strcpy(#folder_path, #opendir_path);
|
|
|
|
} else {
|
|
|
|
miniprintf(#folder_path, "%s/res/wallpapers", GetRealKolibriosPath());
|
|
|
|
}
|
2020-05-20 21:34:09 +02:00
|
|
|
ActivateTab(active_wallpaper);
|
2016-02-13 12:00:14 +01:00
|
|
|
}
|
2013-10-24 23:45:17 +02:00
|
|
|
|
2021-12-21 18:22:15 +01:00
|
|
|
void EventTabScreensaverClick()
|
|
|
|
{
|
2021-12-23 13:27:15 +01:00
|
|
|
ini.section = "screensaver";
|
|
|
|
ss_settings.timeout = ini.GetInt("timeout", 10);
|
|
|
|
ini.GetString("title", #ss_settings.program, sizeof(ss_settings.program), 0);
|
|
|
|
ini.GetString("available", #ss_settings.available, sizeof(ss_settings.available), 0);
|
2021-12-21 18:22:15 +01:00
|
|
|
ActivateTab(active_screensaver);
|
|
|
|
}
|
|
|
|
|
2016-02-13 12:00:14 +01:00
|
|
|
void EventDeleteFile()
|
|
|
|
{
|
|
|
|
io.del(#cur_file_path);
|
|
|
|
Open_Dir();
|
|
|
|
EventApply();
|
|
|
|
}
|
2013-10-24 23:45:17 +02:00
|
|
|
|
2018-09-11 23:09:14 +02:00
|
|
|
void EventSetNewCurrent()
|
|
|
|
{
|
2021-12-21 18:22:15 +01:00
|
|
|
miniprintf(#cur_file_path,"%s/",#folder_path);
|
2021-12-23 13:27:15 +01:00
|
|
|
strcat(#cur_file_path, io.dir.position(files_mas[calc(select_list.cur_y)]));
|
2018-09-11 23:09:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void EventSelectWallpFolder()
|
|
|
|
{
|
|
|
|
OpenDialog_start stdcall (#o_dialog);
|
2021-12-22 02:26:10 +01:00
|
|
|
if (o_dialog.status) EventTabWallpappersClick();
|
2018-09-11 23:09:14 +02:00
|
|
|
}
|
|
|
|
|
2019-03-15 13:19:45 +01:00
|
|
|
void EventSetWallpMode_Stretch()
|
|
|
|
{
|
|
|
|
optionbox_tiled.checked = false;
|
|
|
|
optionbox_tiled.redraw();
|
|
|
|
EventApply();
|
|
|
|
}
|
|
|
|
|
|
|
|
void EventSetWallpMode_Tiled()
|
|
|
|
{
|
|
|
|
optionbox_stretch.checked = false;
|
|
|
|
optionbox_stretch.redraw();
|
|
|
|
EventApply();
|
|
|
|
}
|
|
|
|
|
2016-02-13 12:00:14 +01:00
|
|
|
void EventApply()
|
|
|
|
{
|
2018-09-11 23:09:14 +02:00
|
|
|
char kivpath[4096+10];
|
|
|
|
EventSetNewCurrent();
|
2021-12-23 13:27:15 +01:00
|
|
|
if (tabs.active_tab==TAB_SKINS)
|
2016-02-13 12:00:14 +01:00
|
|
|
{
|
|
|
|
SetSystemSkin(#cur_file_path);
|
2019-03-15 15:05:59 +01:00
|
|
|
SelectList_Draw();
|
2018-11-12 17:27:48 +01:00
|
|
|
strcpy(#cur_skin_path, #cur_file_path);
|
2019-03-15 15:05:59 +01:00
|
|
|
EventUpdateDocky();
|
2016-02-13 12:00:14 +01:00
|
|
|
}
|
2021-12-23 13:27:15 +01:00
|
|
|
if (tabs.active_tab==TAB_WALLPAPERS)
|
2016-02-13 12:00:14 +01:00
|
|
|
{
|
2018-11-12 17:27:48 +01:00
|
|
|
SelectList_Draw();
|
2021-12-21 18:22:15 +01:00
|
|
|
if (optionbox_stretch.checked) miniprintf(#kivpath, "\\S__%s", #cur_file_path);
|
|
|
|
if (optionbox_tiled.checked) miniprintf(#kivpath, "\\T__%s", #cur_file_path);
|
2018-09-11 23:09:14 +02:00
|
|
|
RunProgram("/sys/media/kiv", #kivpath);
|
2016-02-13 12:00:14 +01:00
|
|
|
}
|
2013-10-24 23:45:17 +02:00
|
|
|
}
|
2013-10-24 00:05:17 +02:00
|
|
|
|
2019-03-15 15:05:59 +01:00
|
|
|
void EventUpdateDocky()
|
|
|
|
{
|
|
|
|
if (!update_docky.checked) return;
|
|
|
|
KillProcessByName("@docky", MULTIPLE);
|
|
|
|
RunProgram("/sys/@docky",NULL);
|
|
|
|
pause(50);
|
2021-12-23 13:27:15 +01:00
|
|
|
ActivateWindow_Self();
|
2019-03-15 15:05:59 +01:00
|
|
|
}
|
|
|
|
|
2016-02-13 12:00:14 +01:00
|
|
|
void EventOpenFile()
|
|
|
|
{
|
2021-12-23 13:27:15 +01:00
|
|
|
if (tabs.active_tab==TAB_SKINS) RunProgram("/sys/skincfg", #cur_file_path);
|
|
|
|
if (tabs.active_tab==TAB_WALLPAPERS) RunProgram("/sys/media/kiv", #cur_file_path);
|
2016-02-13 12:00:14 +01:00
|
|
|
}
|
2013-10-24 00:05:17 +02:00
|
|
|
|
2018-11-12 17:27:48 +01:00
|
|
|
void EventExit()
|
|
|
|
{
|
2021-12-22 02:26:10 +01:00
|
|
|
if (cur_skin_path) {
|
|
|
|
ini.section = "style";
|
|
|
|
ini.SetString("skin", #cur_skin_path, strlen(#cur_skin_path));
|
|
|
|
}
|
2018-11-12 17:27:48 +01:00
|
|
|
ExitProcess();
|
|
|
|
}
|
|
|
|
|
2013-10-24 00:05:17 +02:00
|
|
|
stop:
|