forked from enlightenment/enlightenment
parent
c9a8d12b08
commit
4e1e51af46
|
@ -199,12 +199,10 @@ e_init_done(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
e_init_icons_app_add(E_App *app)
|
e_init_icons_desktop_add(Efreet_Desktop *desktop)
|
||||||
{
|
{
|
||||||
Evas_Object *o;
|
Evas_Object *o;
|
||||||
|
char buf[128];
|
||||||
E_OBJECT_CHECK(app);
|
|
||||||
E_OBJECT_TYPE_CHECK(app, E_APP_TYPE);
|
|
||||||
|
|
||||||
if (!_e_init_evas) return;
|
if (!_e_init_evas) return;
|
||||||
|
|
||||||
|
@ -231,17 +229,21 @@ e_init_icons_app_add(E_App *app)
|
||||||
evas_object_show(o);
|
evas_object_show(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
o = e_app_icon_add(app, _e_init_evas);
|
snprintf(buf, sizeof(buf), "%dx%d", _e_init_icon_size, _e_init_icon_size);
|
||||||
evas_object_resize(o, _e_init_icon_size, _e_init_icon_size);
|
o = e_util_desktop_icon_add(desktop, buf, _e_init_evas);
|
||||||
e_box_pack_end(_e_init_icon_box, o);
|
if (o)
|
||||||
e_box_pack_options_set(o,
|
{
|
||||||
0, 0,
|
evas_object_resize(o, _e_init_icon_size, _e_init_icon_size);
|
||||||
0, 0,
|
e_box_pack_end(_e_init_icon_box, o);
|
||||||
0.5, 0.5,
|
e_box_pack_options_set(o,
|
||||||
_e_init_icon_size, _e_init_icon_size,
|
0, 0,
|
||||||
_e_init_icon_size, _e_init_icon_size);
|
0, 0,
|
||||||
evas_object_show(o);
|
0.5, 0.5,
|
||||||
_e_init_icon_list = evas_list_append(_e_init_icon_list, o);
|
_e_init_icon_size, _e_init_icon_size,
|
||||||
|
_e_init_icon_size, _e_init_icon_size);
|
||||||
|
evas_object_show(o);
|
||||||
|
_e_init_icon_list = evas_list_append(_e_init_icon_list, o);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -16,7 +16,7 @@ EAPI void e_init_status_set(const char *str);
|
||||||
EAPI Ecore_X_Window e_init_window_get(void);
|
EAPI Ecore_X_Window e_init_window_get(void);
|
||||||
EAPI void e_init_done(void);
|
EAPI void e_init_done(void);
|
||||||
|
|
||||||
EAPI void e_init_icons_app_add(E_App *app);
|
EAPI void e_init_icons_desktop_add(Efreet_Desktop *desktop);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -43,7 +43,7 @@ e_order_new(const char *path)
|
||||||
{
|
{
|
||||||
Efreet_Desktop *desktop;
|
Efreet_Desktop *desktop;
|
||||||
desktop = efreet_util_desktop_by_file_id_get(buf);
|
desktop = efreet_util_desktop_by_file_id_get(buf);
|
||||||
if (desktop) evas_list_append(eo->desktops, desktop);
|
if (desktop) eo->desktops = evas_list_append(eo->desktops, desktop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,18 +3,18 @@
|
||||||
*/
|
*/
|
||||||
#include "e.h"
|
#include "e.h"
|
||||||
|
|
||||||
|
/* TODO:
|
||||||
|
* - Need some kind of "wait for exit" system, maybe register with
|
||||||
|
* e_config? startup and restart apps could also be in e_config
|
||||||
|
*/
|
||||||
|
|
||||||
/* local subsystem functions */
|
/* local subsystem functions */
|
||||||
static void _e_startup(void);
|
static void _e_startup(void);
|
||||||
static int _e_startup_timeout_cb(void *data);
|
static void _e_startup_next_cb(void *data);
|
||||||
static int _e_startup_next_cb(void *data);
|
|
||||||
static void _e_startup_app_exit_cb(void *data, E_App *a, E_App_Change ch);
|
|
||||||
|
|
||||||
/* local subsystem globals */
|
/* local subsystem globals */
|
||||||
static E_App *startup_apps = NULL;
|
static E_Order *startup_apps = NULL;
|
||||||
static int start_app_pos = -1;
|
static int start_app_pos = -1;
|
||||||
static Ecore_Timer *next_timer = NULL;
|
|
||||||
static Ecore_Timer *timeout_timer = NULL;
|
|
||||||
static E_App *waiting_app = NULL;
|
|
||||||
|
|
||||||
/* externally accessible functions */
|
/* externally accessible functions */
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -25,16 +25,15 @@ e_startup(E_Startup_Mode mode)
|
||||||
|
|
||||||
homedir = e_user_homedir_get();
|
homedir = e_user_homedir_get();
|
||||||
if (mode == E_STARTUP_START)
|
if (mode == E_STARTUP_START)
|
||||||
snprintf(buf, sizeof(buf), "%s/.e/e/applications/startup", homedir);
|
snprintf(buf, sizeof(buf), "%s/.e/e/applications/startup/.order", homedir);
|
||||||
else if (mode == E_STARTUP_RESTART)
|
else if (mode == E_STARTUP_RESTART)
|
||||||
snprintf(buf, sizeof(buf), "%s/.e/e/applications/restart", homedir);
|
snprintf(buf, sizeof(buf), "%s/.e/e/applications/restart/.order", homedir);
|
||||||
startup_apps = e_app_new(buf, 1);
|
startup_apps = e_order_new(buf);
|
||||||
if (!startup_apps)
|
if (!startup_apps)
|
||||||
{
|
{
|
||||||
// e_init_hide();
|
// e_init_hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
e_app_change_callback_add(_e_startup_app_exit_cb, NULL);
|
|
||||||
start_app_pos = 0;
|
start_app_pos = 0;
|
||||||
_e_startup();
|
_e_startup();
|
||||||
}
|
}
|
||||||
|
@ -43,7 +42,7 @@ e_startup(E_Startup_Mode mode)
|
||||||
static void
|
static void
|
||||||
_e_startup(void)
|
_e_startup(void)
|
||||||
{
|
{
|
||||||
E_App *a;
|
Efreet_Desktop *desktop;
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
|
||||||
if (!startup_apps)
|
if (!startup_apps)
|
||||||
|
@ -51,66 +50,25 @@ _e_startup(void)
|
||||||
e_init_done();
|
e_init_done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
a = evas_list_nth(startup_apps->subapps, start_app_pos);
|
desktop = evas_list_nth(startup_apps->desktops, start_app_pos);
|
||||||
start_app_pos++;
|
start_app_pos++;
|
||||||
if (!a)
|
if (!desktop)
|
||||||
{
|
{
|
||||||
e_object_unref(E_OBJECT(startup_apps));
|
e_object_del(E_OBJECT(startup_apps));
|
||||||
startup_apps = NULL;
|
startup_apps = NULL;
|
||||||
start_app_pos = -1;
|
start_app_pos = -1;
|
||||||
waiting_app = NULL;
|
|
||||||
e_app_change_callback_del(_e_startup_app_exit_cb, NULL);
|
|
||||||
e_init_done();
|
e_init_done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
e_app_exec(NULL, a, NULL, NULL, NULL);
|
e_exec(NULL, desktop, NULL, NULL, NULL);
|
||||||
snprintf(buf, sizeof(buf), _("Starting %s"), a->name);
|
snprintf(buf, sizeof(buf), _("Starting %s"), desktop->name);
|
||||||
e_init_status_set(buf);
|
e_init_status_set(buf);
|
||||||
e_init_icons_app_add(a);
|
e_init_icons_desktop_add(desktop);
|
||||||
if (a->wait_exit)
|
ecore_job_add(_e_startup_next_cb, NULL);
|
||||||
{
|
|
||||||
timeout_timer = ecore_timer_add(10.0, _e_startup_timeout_cb, NULL);
|
|
||||||
waiting_app = a;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
timeout_timer = ecore_timer_add(0.0, _e_startup_next_cb, NULL);
|
|
||||||
waiting_app = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
_e_startup_timeout_cb(void *data)
|
|
||||||
{
|
|
||||||
timeout_timer = NULL;
|
|
||||||
waiting_app = NULL;
|
|
||||||
/* FIXME: error dialog or log etc..... */
|
|
||||||
_e_startup();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
_e_startup_next_cb(void *data)
|
|
||||||
{
|
|
||||||
next_timer = NULL;
|
|
||||||
_e_startup();
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_e_startup_app_exit_cb(void *data, E_App *a, E_App_Change ch)
|
_e_startup_next_cb(void *data)
|
||||||
{
|
{
|
||||||
if (ch == E_APP_EXIT)
|
_e_startup();
|
||||||
{
|
|
||||||
if (a == waiting_app)
|
|
||||||
{
|
|
||||||
waiting_app = NULL;
|
|
||||||
if (timeout_timer)
|
|
||||||
{
|
|
||||||
ecore_timer_del(timeout_timer);
|
|
||||||
timeout_timer = NULL;
|
|
||||||
}
|
|
||||||
_e_startup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue