From cd0fdfc3a7fad9b92398c5e856f0f6eba9536c1d Mon Sep 17 00:00:00 2001 From: Davide Andreoli Date: Wed, 28 Nov 2012 22:38:34 +0000 Subject: [PATCH] filema_opingo gadget: when an operation need attention show a red led with a strobe (similar to terminology). when the led is shown the user can press the notification to jump to the relative window. NOTE:Atm this is implemented only in the gadget, if no one object I will port also in the filman window. raster: hope your eagle-eye will like ;) SVN revision: 79792 --- data/themes/Makefile.am | 2 + data/themes/edc/fileman.edc | 89 +++++++++++++++++++++++- data/themes/img/led_red_light.png | Bin 0 -> 2095 bytes data/themes/img/led_strobe.png | Bin 0 -> 1277 bytes src/modules/fileman_opinfo/e_mod_main.c | 35 +++++++--- 5 files changed, 113 insertions(+), 13 deletions(-) create mode 100644 data/themes/img/led_red_light.png create mode 100644 data/themes/img/led_strobe.png diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am index ab98d33c5..e4dda27c3 100644 --- a/data/themes/Makefile.am +++ b/data/themes/Makefile.am @@ -200,6 +200,8 @@ img/knob_sz_22.png \ img/knob_sz_24.png \ img/led_dark.png \ img/led_light.png \ +img/led_red_light.png \ +img/led_strobe.png \ img/led_tiny_green.png \ img/led_tiny_orange.png \ img/led_square_base.png \ diff --git a/data/themes/edc/fileman.edc b/data/themes/edc/fileman.edc index 457a60cf2..028b11070 100644 --- a/data/themes/edc/fileman.edc +++ b/data/themes/edc/fileman.edc @@ -1657,6 +1657,8 @@ group { name: "e/fileman/default/progress"; images.image: "media_busy_progress.png" COMP; images.image: "sym_close_light_normal.png" COMP; images.image: "sym_close_light_selected.png" COMP; + images.image: "led_red_light.png" COMP; + images.image: "led_strobe.png" COMP; parts { part { name: "base"; type: SPACER; description { state: "default" 0.0; @@ -1708,6 +1710,19 @@ group { name: "e/fileman/default/progress"; visible: 1; } } + part { name: "led_clip"; type: RECT; + description { state: "default" 0.0; + rel1.offset: -20 -20; + rel2.offset: 19 19; + color: 255 255 255 0; + visible: 0; + } + description { state: "active" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + visible: 1; + } + } part { name: "knob"; mouse_events: 0; clip_to: "busy_clip"; description { state: "default" 0.0; @@ -1736,6 +1751,45 @@ group { name: "e/fileman/default/progress"; map.rotation.z: 360; } } + part { name: "attention_event"; mouse_events: 1; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + visible: 0; + } + description { state: "active" 0.0; + color: 0 0 0 0; + visible: 1; + } + } + part { name: "led"; mouse_events: 0; + clip_to: "led_clip"; + description { state: "default" 0.0; + image.normal: "led_red_light.png"; + min: 30 30; + max: 30 30; + fixed: 1 1; + align: 0.0 0.5; + } + } + part { name: "led_spinner"; mouse_events: 0; + clip_to: "led_clip"; + description { state: "default" 0.0; + rel1.to: "led"; + rel2.to: "led"; + min: 45 45; + max: 45 45; + fixed: 1 1; + image.normal: "led_strobe.png"; + map.on: 1; + map.smooth: 1; + map.rotation.center: "led"; + } + description { state: "spin" 0.0; + inherit: "default" 0.0; + map.rotation.z: 360; + } + } part { name: "close"; description { state: "default" 0.0; image.normal: "sym_close_light_normal.png"; @@ -1835,6 +1889,36 @@ group { name: "e/fileman/default/progress"; action: STATE_SET "default" 0.0; target: "knob_spinner"; } + program { + signal: "e,state,attention,start"; source: "e"; + action: STATE_SET "active" 0.0; + target: "led_clip"; + target: "attention_event"; + } + program { + signal: "e,state,attention,stop"; source: "e"; + action: STATE_SET "default" 0.0; + transition: SINUSOIDAL 0.6; + target: "led_clip"; + target: "attention_event"; + after: "led_stop_spin"; + } + program { name: "led_spin"; + signal: "e,state,attention,start"; source: "e"; + action: STATE_SET "spin" 0.0; + transition: LINEAR 0.6; + target: "led_spinner"; + after: "led_spin2"; + } + program { name: "led_spin2"; + action: STATE_SET "default" 0.0; + target: "led_spinner"; + after: "led_spin"; + } + program { name: "led_stop_spin"; + action: ACTION_STOP; + target: "led_spin"; + } program { signal: "mouse,down,1*"; source: "close_event"; action: STATE_SET "selected" 0.0; @@ -1849,10 +1933,11 @@ group { name: "e/fileman/default/progress"; signal: "mouse,clicked,1*"; source: "close_event"; action: SIGNAL_EMIT "e,fm,operation,abort" ""; } -/* XXX: implement these program { - signal: "e,action,set,need_attention"; source: "e"; + signal: "mouse,clicked,1*"; source: "attention_event"; + action: SIGNAL_EMIT "e,fm,window,jump" ""; } +/* XXX: implement these program { signal: "e,action,set,normal"; source: "e"; } diff --git a/data/themes/img/led_red_light.png b/data/themes/img/led_red_light.png new file mode 100644 index 0000000000000000000000000000000000000000..7d5c2dafaeb4e8681875021bb2db5e5e71655060 GIT binary patch literal 2095 zcmV+~2+;S5P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyxA z6(b93c324j00*y0L_t(o!=;x?lO$CYfWQ05M`gXbdb$UC7-xoIguyU?Q51Bc;R;=_ zVBtppfNou31V+FLBi!JUy<0cB0vALWil`9=_!<~zfTmwF{jNt=W!}6G7gg1r-SmJF z-iQ-fH}h7W@0>jM+;ar85kLU)lrX!B+FZ?KB{99vl`TY>k45b)mFC?Ego zyYIa7i^pKR4AnWXGt1qn9pOcQ=2-xH5Z#32tuH?M#JxwZzAANeJ%j+k6M)fZL}?5m z1Q3EqO0?D}DG5SAWj|P1`{c#%t*-v#IutXAGXYwF4AbD6Tdv=S^o?uRp4_{3?R6>S zvh|KbQxa`&^H3DC1Vm*?KAv!IGGX0T47y#~=g-rLB7~6m;CEJ5SAX>U+S+@kAdW!P z%aCxaT;`xQA^t0L?|kLP>q5v&m9>~9ZAC{wk3h>ivdWT-hV1R_ zVVg~~6o6>Q`!pvoXb$8it<)XR|8UB3$Pzo7YtXP^BkN%|dYE#}~W?r6j_ zQqcyIG$QS`i8~oOiAV@^%97>50O}|u&aEx>+DrHD{V4;xIJN!+z&r?L z4*Cu>{t9UODjG?==#j`??EiBMlS)#eJNV?P}>13!>BDF_gaYezxctYDc z-W!ie+HE2wu}Xi*3&`n$Q_}7q(k%<51QiEV3_7+X>6mtJk9KcJ*0CgQLEI8VnWPcHWoz-H z5v8s0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file mode 100644 index 0000000000000000000000000000000000000000..a6ae8ed22f550a634c7bf860e88b7c9a25c58cc4 GIT binary patch literal 1277 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyi1 z4>|#|R7Icw000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000D7Nkl7*_!V5bk$eL` zgObezA?QMgZp38i%jm@J>6w11_gi&u)pgOQ+S{G#HeL>zwERe_qc2d3e5_ zum901i8g(Yt~no-|2|NDPSB`=QwDqGO$4Hn*!hMPR?kW#fXApI37`d*RT9xP;I*)0 zERlzctIq`95}8SmqKSF{pJRbyZL79{b%F-km5WnNv$Cs*j&3GVep6&1ajfZBM`1hI zoMRF^UxnYYcBLNT0NTPfwoq!B*mY*#r2LvZdSJN`{D&fAHQSn6dK&r;?8+^1QcXj7 zUJt9IPwX4&ds_b3EPD5HB+8$PWD;WyZGEYGVqdki<+^s?N{RLiL; z#vv6M@^Ve!O2wuj^nFeHUT{axU46IRtM@eWJG%aE%fY4i_e3&Hsn;cbWaX|xA@kVK z)X1*FF-F1349jW_tn{%A_Hq?%G~uXkf#?`H8r8Au*($J7GBzm^qkK zHyqF2_HdHQ%DLQJF1L^e5h^NJWxN4=iG`(^xw)Clu$=m2p3C)Q?wd(J<;qlIvbyK5 zgLi!Jk5@g)CT22IGgEUjv-SI5i_lt#s^DvtIv0((QzMUzjXYe8{QBq*()@S28;Wpb zW$wgy^}fM;VdzCew~ZCX#-=7gh_Xr~R#hEX6Ig_U$1(@bjNEdl=_3#G1AT{9icjVL z2Ug{~PE9;;=3}S6?__vZwrcw!|tHu2bjx)X_^l|}Tk zYdYc+OA`a97EX*jb?V5M4Wu{>1mFc+?$`GrH# nO(XQ@nTVfdGJd}Pzt_J2ZD!bT_#{lz00000NkvXXu0mjffn{Si literal 0 HcmV?d00001 diff --git a/src/modules/fileman_opinfo/e_mod_main.c b/src/modules/fileman_opinfo/e_mod_main.c index e6d1ee494..f45e19021 100644 --- a/src/modules/fileman_opinfo/e_mod_main.c +++ b/src/modules/fileman_opinfo/e_mod_main.c @@ -58,7 +58,8 @@ _opinfo_op_registry_listener(void *data, const E_Fm2_Op_Registry_Entry *ere) if (!o || !ere) return; // Don't show if the operation keep less than 1 second - if (ere->start_time + 1.0 > ecore_loop_time_get()) return; + if (!ere->needs_attention && (ere->start_time + 1.0 > ecore_loop_time_get())) + return; // Update icon switch (ere->op) @@ -82,13 +83,7 @@ _opinfo_op_registry_listener(void *data, const E_Fm2_Op_Registry_Entry *ere) default: edje_object_signal_emit(o, "e,action,icon,unknown", "e"); } - - // Update has/none linked efm window - if (e_win_evas_object_win_get(ere->e_fm)) - edje_object_signal_emit(o, "state,set,window,exist", "fileman_opinfo"); - else - edje_object_signal_emit(o, "state,set,window,absent", "fileman_opinfo"); - + // Update information text switch (ere->status) { @@ -175,11 +170,27 @@ _opinfo_op_registry_listener(void *data, const E_Fm2_Op_Registry_Entry *ere) } } - // Update attention + // Show/hide the red attention led if (ere->needs_attention) - edje_object_signal_emit(o, "e,action,set,need_attention", "e"); + { + if (!evas_object_data_get(o, "attention_started")) + { + evas_object_data_set(o, "attention_started", o); + edje_object_signal_emit(o, "e,state,attention,start", "e"); + if (evas_object_data_get(o, "attention_stopped")) + evas_object_data_del(o, "attention_stopped"); + } + } else - edje_object_signal_emit(o, "e,action,set,normal", "e"); + { + if (!evas_object_data_get(o, "attention_stopped")) + { + evas_object_data_set(o, "attention_stopped", o); + edje_object_signal_emit(o, "e,state,attention,stop", "e"); + if (evas_object_data_get(o, "attention_started")) + evas_object_data_del(o, "attention_started"); + } + } // Update gauge edje_object_part_drag_size_set(o, "e.gauge.bar", @@ -276,6 +287,8 @@ _opinfo_op_registry_entry_add_cb(void *data, __UNUSED__ int type, void *event) e_theme_edje_object_set(o, "base/theme/fileman", "e/fileman/default/progress"); edje_object_signal_callback_add(o, "e,fm,operation,abort", "", _opinfo_op_registry_abort_cb, (void*)(long)ere->id); + edje_object_signal_callback_add(o, "e,fm,window,jump", "", + _opinfo_op_registry_window_jump_cb, (void*)(long)ere->id); e_box_pack_end(inst->o_box, o); e_fm2_op_registry_entry_listener_add(ere, _opinfo_op_registry_listener,