forked from enlightenment/edi
debugpanel: update icons if process is resumed from the "console"
Reviewers: ajwillia.ms Reviewed By: ajwillia.ms Differential Revision: https://phab.enlightenment.org/D4843
This commit is contained in:
parent
11f6f5871e
commit
e62a297610
|
@ -262,30 +262,37 @@ _edi_debugpanel_bt_sigterm_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUS
|
|||
}
|
||||
|
||||
static void
|
||||
_edi_debugpanel_bt_sigint_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
|
||||
_edi_debugpanel_icons_update(int state)
|
||||
{
|
||||
pid_t pid;
|
||||
int state;
|
||||
Evas_Object *ico_int;
|
||||
|
||||
pid = _edi_debug_process_id(&state);
|
||||
if (pid <= 0) return;
|
||||
|
||||
ico_int = elm_icon_add(_button_int);
|
||||
|
||||
if (state == DEBUG_PROCESS_ACTIVE)
|
||||
{
|
||||
kill(pid, SIGINT);
|
||||
elm_icon_standard_set(ico_int, "media-playback-start");
|
||||
}
|
||||
else
|
||||
{
|
||||
ecore_exe_send(_debug_exe, "c\n", 2);
|
||||
elm_icon_standard_set(ico_int, "media-playback-pause");
|
||||
}
|
||||
else
|
||||
elm_icon_standard_set(ico_int, "media-playback-start");
|
||||
|
||||
elm_object_part_content_set(_button_int, "icon", ico_int);
|
||||
}
|
||||
|
||||
static void
|
||||
_edi_debugpanel_bt_sigint_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
|
||||
{
|
||||
pid_t pid;
|
||||
int state;
|
||||
|
||||
pid = _edi_debug_process_id(&state);
|
||||
if (pid <= 0) return;
|
||||
|
||||
if (state == DEBUG_PROCESS_ACTIVE)
|
||||
kill(pid, SIGINT);
|
||||
else
|
||||
ecore_exe_send(_debug_exe, "c\n", 2);
|
||||
|
||||
_edi_debugpanel_icons_update(state);
|
||||
}
|
||||
|
||||
static void
|
||||
_edi_debugpanel_button_quit_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
|
||||
{
|
||||
|
@ -301,7 +308,8 @@ _edi_debugpanel_button_start_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UN
|
|||
static Eina_Bool
|
||||
_edi_debug_active_check_cb(void *data EINA_UNUSED)
|
||||
{
|
||||
int pid = ecore_exe_pid_get(_debug_exe);
|
||||
int state, pid = ecore_exe_pid_get(_debug_exe);
|
||||
|
||||
if (pid == -1)
|
||||
{
|
||||
if (_debug_exe) ecore_exe_free(_debug_exe);
|
||||
|
@ -311,6 +319,12 @@ _edi_debug_active_check_cb(void *data EINA_UNUSED)
|
|||
elm_object_disabled_set(_button_int, EINA_TRUE);
|
||||
elm_object_disabled_set(_button_term, EINA_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_edi_debug_process_id(&state) > 0)
|
||||
_edi_debugpanel_icons_update(state);
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue