From 5ee14dabdd3a2697b7f0b5d5f0147842216b075d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 17 Jul 2014 14:32:44 +0400 Subject: [PATCH] merge neutrino-mp menu/buttons/icons changes, (C) martii Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cf91f2eccbbbd95234c3feeb6aa5eab64ab6456b Author: [CST] Focus Date: 2014-07-17 (Thu, 17 Jul 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/icons/0-green.png | Bin 0 -> 316 bytes data/icons/0-red.png | Bin 0 -> 316 bytes data/icons/1-green.png | Bin 0 -> 310 bytes data/icons/1-red.png | Bin 0 -> 310 bytes data/icons/2-green.png | Bin 0 -> 318 bytes data/icons/2-red.png | Bin 0 -> 318 bytes data/icons/3-green.png | Bin 0 -> 324 bytes data/icons/3-red.png | Bin 0 -> 324 bytes data/icons/4-green.png | Bin 0 -> 318 bytes data/icons/4-red.png | Bin 0 -> 318 bytes data/icons/5-green.png | Bin 0 -> 316 bytes data/icons/5-red.png | Bin 0 -> 316 bytes data/icons/6-green.png | Bin 0 -> 316 bytes data/icons/6-red.png | Bin 0 -> 316 bytes data/icons/7-green.png | Bin 0 -> 321 bytes data/icons/7-red.png | Bin 0 -> 321 bytes data/icons/8-green.png | Bin 0 -> 318 bytes data/icons/8-red.png | Bin 0 -> 318 bytes data/icons/9-green.png | Bin 0 -> 310 bytes data/icons/9-red.png | Bin 0 -> 310 bytes data/icons/hint_nkplay.png | Bin 0 -> 4072 bytes data/icons/hint_rass.png | Bin 0 -> 1107 bytes data/icons/hint_spark.png | Bin 0 -> 6572 bytes data/icons/icon_nkplay.png | Bin 0 -> 2884 bytes data/icons/icon_ytplay.png | Bin 0 -> 2001 bytes data/icons/longpress.png | Bin 0 -> 545 bytes data/icons/mp_play_repeat_all.png | Bin 0 -> 3395 bytes data/icons/mp_play_repeat_track.png | Bin 0 -> 3400 bytes data/icons/rass.png | Bin 0 -> 3058 bytes data/icons/warning.png | Bin 0 -> 286 bytes src/driver/display.h | 7 + src/driver/record.cpp | 2 +- src/gui/audio_setup.cpp | 2 +- src/gui/audioplayer_setup.cpp | 2 +- src/gui/keybind_setup.cpp | 2 +- src/gui/luainstance.cpp | 25 +- src/gui/miscsettings_menu.cpp | 2 +- src/gui/network_service.cpp | 12 +- src/gui/personalize.cpp | 6 +- src/gui/scan_setup.cpp | 12 +- src/gui/timerlist.cpp | 2 +- src/gui/vfd_setup.cpp | 8 +- src/gui/widget/buttons.cpp | 319 ++++++- src/gui/widget/buttons.h | 63 +- src/gui/widget/icons.h | 36 +- src/gui/widget/menue.cpp | 1214 +++++++++++++++------------ src/gui/widget/menue.h | 529 +++++------- src/system/helpers.h | 12 + 48 files changed, 1285 insertions(+), 970 deletions(-) create mode 100644 data/icons/0-green.png create mode 100644 data/icons/0-red.png create mode 100644 data/icons/1-green.png create mode 100644 data/icons/1-red.png create mode 100644 data/icons/2-green.png create mode 100644 data/icons/2-red.png create mode 100644 data/icons/3-green.png create mode 100644 data/icons/3-red.png create mode 100644 data/icons/4-green.png create mode 100644 data/icons/4-red.png create mode 100644 data/icons/5-green.png create mode 100644 data/icons/5-red.png create mode 100644 data/icons/6-green.png create mode 100644 data/icons/6-red.png create mode 100644 data/icons/7-green.png create mode 100644 data/icons/7-red.png create mode 100644 data/icons/8-green.png create mode 100644 data/icons/8-red.png create mode 100644 data/icons/9-green.png create mode 100644 data/icons/9-red.png create mode 100644 data/icons/hint_nkplay.png create mode 100644 data/icons/hint_rass.png create mode 100644 data/icons/hint_spark.png create mode 100644 data/icons/icon_nkplay.png create mode 100644 data/icons/icon_ytplay.png create mode 100644 data/icons/longpress.png create mode 100644 data/icons/mp_play_repeat_all.png create mode 100644 data/icons/mp_play_repeat_track.png create mode 100644 data/icons/rass.png create mode 100644 data/icons/warning.png create mode 100644 src/driver/display.h diff --git a/data/icons/0-green.png b/data/icons/0-green.png new file mode 100644 index 0000000000000000000000000000000000000000..716637c7a22655441b04c1e5d775c1ebe57d2ed0 GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl42u{T*E2G1 zWn?_c$atNR@h&6dTSm5jY%>33jQ$x}{j>7<=X3k!?dlIqvw(USOM?7@862M7NCR<_ zyxm;OkH}&M25w;xW@MN(M*?I;iKnkC`(0LHZYF~dP5JYILam-Ijv*Y^ zlM_Tlgjkpu*}iTsZ+sA^*c?;o8ujx`Xum|tCGUU#&(A5H;Ao}$Z}tE0k+U6o@_*h> zJ0vMBx#ZBF{Y;YFl3Seq?myNn5w!4I{GmdKI;Vst0HL03 A4*&oF literal 0 HcmV?d00001 diff --git a/data/icons/0-red.png b/data/icons/0-red.png new file mode 100644 index 0000000000000000000000000000000000000000..a99393a3fb50dfedd557701bf888c0c18947d926 GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=4*CA(I%w7BPfuU~t>U z;CYNe^#%j$JqCt%3=IES1^-J2{x_`uZ`twRd&TXWxA_GU`ha>EOM?7@862M7NCR<_ zyxm;OkH}&M25w;xW@MN(M*=9wUgGKN%6^wsNK};h$<<__2t%usx6WTA4a>@JO|MPQ7CpcQ^{#*V3d*p0~p8TKp z(+){WOD;L|XFro9x8xS5zx$6hO9UnY@6iw*x&WMWo<-&HcudlDGtIL7S&CviDBCYeSBpMSI0v*i2;OXk;vd$@?2>@6C BZhim& literal 0 HcmV?d00001 diff --git a/data/icons/1-green.png b/data/icons/1-green.png new file mode 100644 index 0000000000000000000000000000000000000000..1ad8fee1b98f8bfd7995f961d4572e93c37c69d9 GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl3`-aoH!?CF zWn{e0$at5L@hv0EKNhZkTyp>9jQ$x}{j>7<=X3k!?Q$cQD?mMrB|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8H#48c59d;#P`#&%V+hCf z8T}WYECE!PkZ)%?c&c0%_SM9{;!vnm2Tvzw{Vs} zbD@a$4g3MgPlM{5MSeZ<+DmyXp4L+u73MGl6;-OM?7@862M7NCR<_ zyxm;OkH}&M25w;xW@MN(M*=9wUgGKN%6^wsNL1MDi4DV2pisT1i(?4K z_2dK*kq{9eND!#57Uy`UYII`h(&?!sXKGF;2v2+Vf9>MW3e6=Mr~a>(m6dMfskd;J zKXajo_v8PliyJ36o-)1iKfCg%6PvGi_<#MEqQa6Y4n12wxhWhz`p-MUYR1DyQnT1n uW;947_VOq_O?~?G>B~MIhxCR928R3I#v6K_Q`CV@VeoYIb6Mw<&;$V60cZRG literal 0 HcmV?d00001 diff --git a/data/icons/2-green.png b/data/icons/2-green.png new file mode 100644 index 0000000000000000000000000000000000000000..3679e751183dcb16798d9813bbd7dba244002215 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl3`-ao*E2G1 zWn?_c$atNR@h&6dTSm5jY;ynPjQ$x}{j>7<=X3k!ZH-@SeLy{oB|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8H?xqgTe~DWM4f DHmYph literal 0 HcmV?d00001 diff --git a/data/icons/2-red.png b/data/icons/2-red.png new file mode 100644 index 0000000000000000000000000000000000000000..05845207e8c557efe0a983d9c938da0272245be4 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=4*CA(I%wmN0~FU~t>U z;CYNe^#%j$JqCt%3=IESx&O;r{5MSeZ<+DmyXp4L+o|{Yn}B*4OM?7@862M7NCR<_ zyxm;OkH}&M25w;xW@MN(M*=9wUgGKN%6^wsNK`~?f6XafpisM~i(?4K z_2h&Q5f(;9wvXG(8z00eHpf)DM*TVy$}gF6$@|~`^D(6p9IbT!cmMw$Dc#t!rRPt+ z@xh*=dI4uG9o?t(N6xhJ1TD<`7O&;NbN#{pXHR9hB~@bI+V5Nz?vpa1WaIz;|D|U< z%*hc7<4c*bqor->QvVczxfk!nUA!oG;=qa(EM;sA8&u7^4H!JX1D(X+>FVdQ&MBb@ E06~{7<=X3k!?NZe(96&vcB|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8HU z;CX^U?FIwuJqCt%3=IESx&O;r{5MSeZ<+DmyXp4L+geQ}Hb6a$B|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLNg-FY)wsWxvZRBr2@j`S6J!P^j0_#W95A zdUAq@h)4(!CkWJ6i*vjaH99f1e96-DF<&P*s_lL9|Nog#cF84|KkfffKYy#>2@mhj z|Lug&ocN#5nBvj8bm`6d**hmVYMJQj{=0p~)xpgp;?MSTtvr*~{hR-Gf2mK(gp$I4 z|L?D5I#OV2=Bv$a7~^#K(j|4Hj&mzsym+yKCk1G`5Q`Ec!^(r^QB{w))&d>I;OXk; Jvd$@?2>>{qbCv)A literal 0 HcmV?d00001 diff --git a/data/icons/4-green.png b/data/icons/4-green.png new file mode 100644 index 0000000000000000000000000000000000000000..4b690273d06e7bb13a914630f208aebabc811425 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl3=0?-*E2G1 zWn?_g$atNR@h&6dTSm5jY%>33jQ$x}{j>7<=X3k!?b`Xi;Xpl%B|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8H#6t9IoGZMh1xw`978y+ zCnt!6h_Em*vVGiM-uNI+u{oy7-Tmj9P=3jjOWINY!_QfrP?#Gw@4tQVH8%z2yZ`H- z`3NX~HJ+h3b=sew^~cV%@&qORJNDn!fhYX;|Nr|-^-?C3@D~2dzh^kn@sg^^llltQ zj)zjOCWY}O?PzIRy3{{KAUFSgM*e%AlmrnLW>$tfvn^!f{(gxAI*Gy4)z4*}Q$iB} DrRr?T literal 0 HcmV?d00001 diff --git a/data/icons/4-red.png b/data/icons/4-red.png new file mode 100644 index 0000000000000000000000000000000000000000..c2508e59e0a01e10d7e7347216edbfac970f515e GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=4*CA(I%w7BB>FU~t>U z;CX^U?FIwuJqCt%3=IESx&KRB|2IthZ<+DmyXp4L+s9Vvo&@S)ED7=pW^j0RBMrn! z@^*J&=wOxg0CG4BJR*x37`TN&n2}-D90{Nxdx@v7EBjqmAyH8Uw@pGtK%sU|7sn8e z>&XcsAtEeHjBFpbmp49$Q*4f@a(Dl^CX`IpA{r~^|QoWQ3CA@|I^6wc=biAZ$@}$0k zwd0}Gt4U#eNjqBFmM-;A5y;JdpOOEbCnZ6Ig_)J%&TI?WxW8ZGfKFoYboFyt=akR{ E0MP?(egFUf literal 0 HcmV?d00001 diff --git a/data/icons/5-green.png b/data/icons/5-green.png new file mode 100644 index 0000000000000000000000000000000000000000..bf74eeed9285c8feea992a4f5b3fb6c81ab4adec GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl3=0?-*E2G1 zWn?_g$atNR@h&6dTSm5jY%>33jQ$x}{j>7<=X3k!?b`Xi;Xpl%B|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8H?x@al-tTcp;k{9#}JO| z$q6DX%&cr5x0g3Qh*NBisdSI3dcMk?$0#%P|Ns9pN+&p4t$ngT`stZo2e&`Zx6Djv z0}2Z|w1v$2pZ+`FSlq~?b!p4dX32$$c^~gvi5q3KH7(InGxFGF@&A85TiOnZ-Akr2 zORDKDOw4>KEa|eme9HFl5*8x^F0RHoiVO^5wH6(EH{x#r9mL@2>gTe~DWM4ffYE5J literal 0 HcmV?d00001 diff --git a/data/icons/5-red.png b/data/icons/5-red.png new file mode 100644 index 0000000000000000000000000000000000000000..cc9963238c72592ee7f0ada34864083ad56ba34c GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=4*C`jZ$87BDz$U~t>U z;CX^U?FIwuJqCt%3=IESx&KRB|2IthZ<+DmyXp4L+YPrLUIpr5ED7=pW^j0RBMrn! z@^*J&=wOxg0CG4BJR*x37`TN&n2}-D90{Nxdx@v7EBjqmAyE-lk+t7TfI_XFE{-7_ z*OL=OSeRMaK5j2>d=RJD98>8YRrP$8JC9Lj>i_@$XOvEGv|9UQfArHcy$)`Fo^P3% z&;}G1bZ85i^*{Z0zOlHGN9)p-qs@{F74tscw-PtXXlq)crDo)@%i{n4e73Y561$g7 zWtLRaTbP*nQdrVudHIy>;Uz3a23%Z?a}*gE#A+=%^lrr80y>Dn)78&qol`;+0PNvx AW&i*H literal 0 HcmV?d00001 diff --git a/data/icons/6-green.png b/data/icons/6-green.png new file mode 100644 index 0000000000000000000000000000000000000000..b8376864a256d448dfaff1a8770968e04fbd90ba GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8%T>?}Pj3=0?-S2HrM zXJp*Z$as;F@h&6ddq$>zOcMVjwEk&X{Il@-=XK@U75&A^tUx`CB|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8HnAvF+p~CY&9znSJVq~{e*AA7E}JsJ&->@A|H;qX6qNsYXQ|D2 z`2T;s$^^x!V*hXczkQ~aCurfn_{R%-^grIW5;yYLb*p~c|7(U59WNdI`M-WMm%!np zH%->coG{?z=Fb2JqFef3~c`y+5d~{{@3*RZ=Uwwv+>HcD;rL8DgyN|mIV0)GdMiEkp|)< zdAqwXbg;^L06Clm9+AZi4BWyX%*Zfnjs#GUy~NYkmHjTOkf?~MQOWTeK%rJo7sn8e z>&XcsLM)7oY#(9jQ$x}{j>7<=X3k!?Q$cQD?mMrB|(0{3=Yq3q=7g| z-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLT9a#M9T6{VuC8H#5U|hrA-7P?x8RV+hCf z;IsO8z(rPGQILI+j4^9%SWH?o9s4g3MgPlM{5MSeZ<+DmyXp4L+u73MGl6;-OM?7@862M7NCR<_ zyxm;OkH}&M25w;xW@MN(M*=9wUgGKN%6^wsNK{0o;8^??piq~mi(?4K z_2h&Qkq{9eND!#57H1KXd~zwsIaoW*E@c8|@Bjb*f1hdQxwLTM!f*Gj%$Xz;SN^xP zGHY~k`sZGflQMye_v`$;$?wjmQQfhAN{#<{3!zVX3P61_I z*&_vpg}lDZ#xYLLhovN4PF+5I`m~meq{LK*bpj#`3`-1+)vwf9KLNUm!PC{xWt~$( F698WBYK;H@ literal 0 HcmV?d00001 diff --git a/data/icons/8-green.png b/data/icons/8-green.png new file mode 100644 index 0000000000000000000000000000000000000000..a87ae15c01f40e44f8c2597846b821683476be59 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl42u{T*E2G1 zWn?_c$atNR@h&6dTSm5jY%>33jQ$x}{j>7<=X3k!?dlIqvw(USOM?7@862M7NCR<_ zyxm;OkH}&M25w;xW@MN(M*?I;iKnkC`(0LHZf2Gfx~sB*LhYU|jv*Y^ zlM_T(m>JnVZZB_q5U1E2Q|TJ@YfUJ>WXdJ)fB(Jm?T)AP%|NpvadPx(wzW&eopZm;-O*8!e`j7Xm#Em?5-C}mtQUlT!|NrN+rL|b> zUN)UsQcZ7RX68#_Ntg5~2*o+LgxEkj&GUU&;V!3Ab{S(kh44$rjF6*2UngFC$ BYRLcq literal 0 HcmV?d00001 diff --git a/data/icons/8-red.png b/data/icons/8-red.png new file mode 100644 index 0000000000000000000000000000000000000000..000fc524b538da27651be556bf74a196dedc05b0 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=4*CA(I%w7BPfuU~t>U z;CYNe^#%j$JqCt%3=IESx&KRB|2IthZ<+DmyXp4L+jkNeKzbQVg8YIR9G=}s196hP z-CYDqW*~tqJ9qOu6L!@BjIj(g}`My8pBPe4i=Z*z+U*=Y549 z{eKFAD>p3p|6eyvFKGhT*Z(>HbDue}X@>t_|M9++xRJ-MTg5@LBd`o!=n~?z*SL0kphWy!9EZ6M5e*!v*!PC{xWt~$(699oC BY;*ts literal 0 HcmV?d00001 diff --git a/data/icons/9-green.png b/data/icons/9-green.png new file mode 100644 index 0000000000000000000000000000000000000000..8959902e80ef43a794685cd8e778ddfa35fea911 GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFP2=EDU1=8&8?9Bbl42u{T*E2G1 zWn?_c$atNR@h&6dTSm5jYzqGrjQ$x}{j>7<=X3k!?fk^JYM>s*k|4ie28U-i(mD&3=gtqJ9qOu6L!@BjIj(g}`My8pfZe4i=Z*z+U*=lugb z^&HMxXZ~;gzkMdRTFuB~m&O18lj0bYc1Y}A vI<;AHVP@t_VaX8dQ`Wa`TQf^0oMT`}dTH7HB{+W>&?yX_u6{1-oD!MU z;CYNe^#%j$JqCt%3=IESx&O;s{x?kgZ<+DmyXp4L+e;@{F#+{3mIV0)GdMiEkp|)< zdAqwXbg;^L06Clm9+AZi4BWyX%*Zfnjs#GUy~NYkmHjTOkf^Ax1#{kcpisT1i(?4K z_2dK*7G_4akK4-|AH*p($5gsU{aO>sFPU=5```cbF{Kk6t#to;|M@;sy0Pa+{?Gdd zcx1`)4EU;Yw0D#R_ zmc;$wh}mc`KCnLsSxEo~=y79PV*t3GCb&x41b)kTTJE<6fCyy(V4nhj@8A@B8UR8- z;>TkEfX@K{amK|4M?)~cN8V>a1lBj+qNegJa0bq>JRA%F>WUkUhgG^a6aWM*t%%0X z-os6~`~19K9&V2r!A%Xj*}wL`=O4E8?OV&!3#3dNv@#@nlZmBVx+V;M9VQ7yN$O@K zq7WIZ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J#8Hl4y&t1reLUl_!OtBNm0|+_QL4t ZV{kYv9qr@kh;C38urjkFR+}7)`zH{j;G_Tm literal 0 HcmV?d00001 diff --git a/data/icons/hint_rass.png b/data/icons/hint_rass.png new file mode 100644 index 0000000000000000000000000000000000000000..e9f5462da6ebce7bd745de379fedd90109714901 GIT binary patch literal 1107 zcmV-Z1g!gsP)aD9<0oV9-N4ftSBL4By2E(ia`u2h@wQO ztRb!JqR>pKjWeU?*F*me%k4QnR7@}59}esL_FCV%?X}k4N2*YvLWK$yDpaUYp~8Ow z;B4Sq{>C4`N5J(!Y9N0KupD>|=mE9>%YgR(D}Zb5e2rtVppcsctOX8JAKgI5NITyO zJOT^=-vj-@!L>jFMmxg?3Wo>1V?)3puPq&7kkllpN7A~K(pw=3<0LKd z>tRW?e~`$OQo{C0DN*ur!tL|1yI|S|Y;q=#6n*g<@M!qvB-63LyI}`zZ{(nNJJqX# zsI$TMEhj7^)7ikD;LMQe9^j^|C>nAZW$XsdD9W?tM8<>dNx+N1QsC4Ww4ZMPo&zoe z+K$VP>HVSBhlBHT&2I;q!*`Fn`7`c}!=bRz4ovrNR9J5_eIw|3rr^ye#{BGh&Y$L) z9y8w$%&(KRt6ge?!Dwg5R%_6C7q9_%2lxVb9hhSNXw!Q`+4ccf#!~e+aa2#P7r+t= z42J*~nl}|#=#0My>@CLWx}4R#L%=HFGvHt$`!z5<*uNC`H3V=7I63Ia!R68Z{BgYk zOa!)CAkXuA{QCs>#zxA6?nmIZV64SwMpqqKtfLErYF{fP}>`VY&<0QS?&kF4>*9_Zx2W3 zCxk2j>;ldOE^-g#vdS5K+tZ~zOp09dD~fBzVxR-q0rUcEfQiBOg}~>Qy&U*CRKYpG z9e&^L0khxlFU0^Bhb^iBD?$Ta2Rv0|rysbcsP|0Y4{|HLwjiv18X7nEUI%capLbjC zAaH@#E(R_E=7az?##`mCVBpmThtGImXOP>%7?RX4X`7_gzBryIsaMhgUn2KPdLgCMUHt{EP@zJF3Kc3;s8Hcw Z;V(60pCpW5G5Y`j002ovPDHLkV1hve4m|(> literal 0 HcmV?d00001 diff --git a/data/icons/hint_spark.png b/data/icons/hint_spark.png new file mode 100644 index 0000000000000000000000000000000000000000..f10fca62e25289fa96331a9be3f8ff2bff00311a GIT binary patch literal 6572 zcmV;d8B^woP)H z0=h0sk8Wyh&7ga7GLtw0fuTQ>mB{3?=`JbBsZ3rr0E=h-EE#ca>7pWAnp#_08k!lI zeo?6Zy7)IG?(HJI3i#YJh}QRq?XUb&>HuKOifXg#4_nNB06Mk;Ab0-{o8}<^Bt?B| zzwyO+XySQ^7YI^qjEyrhGmW?$mXWxizw3WG{0)8aJtOgUzn6#Z%86wPlLT~e-B>9} zDMCIyJ(bDg&<+1Q#Q!+(uk%&0*raG}W_n!s*`>t?__>spaFD&Aut10z!o?HH?RWufnX30)&drY2g!gB zGC?lb3<^LI*ah~2N>BspK_h4ZCqM@{4K9Go;5xVo?tlki1dM~{UdP zU)xj{ZqAQTQoLvauf5<ZgZNI6o6v>;tbFLDbRL8g&+C=7~%qN5B^wkS_j2#SSD zLv276qbgBHQSGQ6)GgE~Y6kTQO-3uB4bV1dFZ3#O96A$SfG$Tjpxe-w(09<|=rSYbRd;g|%>I!rO<0Hzgl9y5R$!^~o_Sb3}g)(-23Wnu-`0_=Y5G3+_)Aa)%4 z7DvRX;>>XFxCk5%mxn9IHQ~!?W?(_!4|Qz6*Z?KaQU#NE37j zc7$L;0%0?ug3v;^M0iMeMI;i{iPppbBA2*{SV25ayh0o$z9Y$y^hqwHNRp7WlXQf1 zo^+4&icBVJlO4$sWC3|6xsiO4{FwY!f+Arg;U&SA*eFpY(JnD4@j?SR-`K0DzX#{6;CMMSAv!Fl>(L4DIHeoQ<_y)QT9+yRo<_B zQF&U0rsAlQpi-uCR%J?+qH3?oRV`CJr}~U8OLw9t(JSaZ^cgiJHBU96TCG~Y+Pu1s zdWd?SdaL>)4T1(kBUYnKqg!J}Q&rPfGgq@&^S%~di=h>-wNI;8Yff87J4}0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+B@vVuhL35duY2asv*nW;5jaom~R7E1K(vG*W(4ma*{IbkzQO>kCysZJ<}4_U zCo-;m?^AMFt)`AA^1{Pr6@#JPY)z~LzTj&Jg=STE=1<`UGxcTqID_62Tmk<_f^zCnsUCLx$;{?8+iU! z9YHiE(@H;KJ|=jneEDksv=mhq39pLq>hqN+%+!Y|lKJX%%dO?A$uR6(o^Q0GD7@LY z``E|9XSsLY%no&pisZ{QXAsr(y@ZGU`p1$d4&EOYy?}$l9*nP`YyB<8lIdk$2~pt0 zUL0@7=Ei*7)NCR^Ek(91*$rs<&!ki~&a+1w9xm)#E}EFHYDbu`4J#wpVH+}>AKx2y zFZ@U@8d(MwuM3HSq({HvpRlw(bR8;Lz`EA1*gstX4TJLw6Lw^K3r+)v*BudZbAUvd zUdh7UpIw`ss-)lNALv)Am;_d2?kkZ$vo_xzgnn`Qe0v{0ox*1jXkiR!0!%TW85%T2 zV{jgzDFMV2%yGsTkbuF=Di7EHgAmH0vzXEUCYW0MPQZPD*+B%=)g5RACMPVE!UtHP zlpux)pT%VA#ag#Pakx0nh+;7bcAOASm^+t3V*sF1p`-&8M6Ly0SW%1+A0jK1!RE0z zY`_eIvA>!l^>2*tUl>z7ZXIVMu>+tw)3?_ljp@l;tdwDV@dArZ;0AN} z99}SoOQ2xzG%85Nqp37YIvNBSrf8}Kj)|t@K~o$P$HZ9BsRQb6O^__%FIg6w$EUDq z3`jOS9Mbzkh4Lkp{s9v$NJU+&BJK!*62c9p0O4#3j|U|M9S1#qi&QNHQCfpA*mM?! z4TSQj9^vtPD74z&RrYELp$vW)iw3yuv8_cpJpPAz7$=g4<}$+2JP5)COhMdwl{^Fl z*|Mh2<1qP=lrRQhBW?}K<e?G-onp;rtAQnw!V3@!A6puA!pmFAO cj3o|($D3K02W2VuK(c^?y%Vv*Ht@)Q0ogdO)&Kwi literal 0 HcmV?d00001 diff --git a/data/icons/icon_ytplay.png b/data/icons/icon_ytplay.png new file mode 100644 index 0000000000000000000000000000000000000000..858f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-4wkN8$I9X& zqGAcfN(FZp7I5k8S**;><-WSUnQwe42T}+Cco06_yGavM6;s7ft%hv}4@z7vV`6$* zY;6tuCMTslHin&(lj0i#Z=6|^c`16oF&6X13Xpbg-R zlK%iO)LX)@=nw!+03Qj^`Y%Sl`vR<;Q-lBj03~!qSaf7zbY(hYa%Ew3WdJfTF*7YN zHZ3tXR53X^H8MIeG%GMNIxsL77GC$ zL{5{t&tAP;C<5S$?|a0UZeK6nF16^)yfS`SNkojBlQ)psZS4HEvew(WCuRMuZ#)M8 zZEWIN`Oe)b;;u_XMEQK4HrDGDg$cc_R>HIAE|S@0jmU#`!ES6f`bI}CKvH!4M-stx zIZotGvVp!+*rDrF^1-%4Z4^gR`bayXFa!VyAuvBT2g7KA%2XUpABL)`mYfI?aL(cT zK9VGY&jZXpokgiMk6LXRkO0r+h@*(h>#ILL|K8l%s#MC*G=?DHV2t73^fV@mMf`D` zr22jluIIi001ViLM}^@tRDSb1^4tc+QApl)gPdPK#mvk@%J$?a-QICr0)XyJwl&eT zC%X*ee8C<<#_Ry+9MyMASX^3$-}J{^cT~cJ_mdex|CFBKR jumDK+*S>%K2mt>8kf7t~GR@s100000NkvXXu0mjfPk;P^ literal 0 HcmV?d00001 diff --git a/data/icons/mp_play_repeat_all.png b/data/icons/mp_play_repeat_all.png new file mode 100644 index 0000000000000000000000000000000000000000..415c530b9a08bc256bc9061f7b325b9cf1026c33 GIT binary patch literal 3395 zcmV-J4ZQM+P)!1`!wjU?-^%N1+@;VdAnw zib}-8Dr|xcDNJFUIIhG>uu0h!n};cfvMUBD0b^uG(E}*NTe~Z1AKICn-JSQ$y?t+Y zKHNLAvtngOCdmFkPuBpd>!*{1F(O=@6qtG zuz?!jLd=P=P$*C|1q2|mDN!LMy72H#dK5|Goo%Un-U! z0V+V@=k@OuLY#Tdxo1E7v2EA-KYHpv^xRzDD5cElZc4c(o6DLffAH`6W81Fv&pG$( zXN3@F0=*~mKqoM;apT6XUv~MWAGr6Pdn2}Olg(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DvHI z-5b@O>$=r?y*{m!njl#6oYL;JQc8^}rN)BF0{mtGAexb!aqb||YK5v-L<*apScd*s zhTY@)dGxjCgY+PP98@2x#;5wGE>o^53=R%#y<^86A4#QBtq9L%vo9*84!;}Q>x=C> z2rkDU;b?i5LZiY!YzSivNxO@I*dV))zQFfh+p}o=o4^A>oXyS6?JAecXL+9IRw}jE z*KJt)*%O4yFV#+Mv+5k~q8l7nk*gP3-?f5FVi1AN?xQdAqQ zwx?7oA8;MFkjv$Mb~1|m{~z)-PhEWIh{hP|?560}n5&k5uJI?H48>xxvpPCD21}*V zo4)T)o!(>Covp=H;C#WN@vi`X_v?B}+1|EeSP9K@GqS+lzna7Dch)}o?jPj6*M6Pb Z{{k8W3;Ycwf2IHc002ovPDHLkV1f;ki$?$e literal 0 HcmV?d00001 diff --git a/data/icons/mp_play_repeat_track.png b/data/icons/mp_play_repeat_track.png new file mode 100644 index 0000000000000000000000000000000000000000..04a8f71bd7fd09f256394697077472caad65f7c4 GIT binary patch literal 3400 zcmV-O4Y%@%P))@Il-gD#e1M$HIx&gzvfDePoEVr!uYtGA_%UCVPgFC*> zD@V6M^!S2!-$8UL^{f!$N>MHc_dSRq0TC<0Pp^K2%Li9ep+W~qDqfAX|Mg{l_V#lS zJANSK+!LdaXk;?Wbvk{I5aP<_g+Ij55m4vi!IfMzxRPULgrb>d!i-_t7C*TBU%2|@ zE5Qk$`3~kc4ZxmzVnI4x!@O(UPHdnCxDazcEF3<0K zA@Ib57;dKfSJ2G_WW^1SUk<>0l1Rj_R>L0b30|4Y<@s4@19ejic_x>sacipwVNvDlTr;Sp|9B)y|HM#Me zdHR|E(4V{RTK~+m&UjG>aT3t;ULHsS{imIF+IKEpb;)J--g9rHbLa#B_H5pSQZCvU zjPK)XjWHVSYkXrc+6M%dC6Us?vMi(}v8071CDO8x(n3m!B_%=#lyY%h7uQv|t`mfv z03ifI2yELXlgThNbRwQoth-~K+PrDY3w!tOy%CrIs&lhYZ!(!&bL#1*tiEgg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OJ&1%MW(iAuk2ZvT=bc0 kzyMp74QvyA*~m}!1cGwM30G^4r2qf`07*qoM6N<$f~^30g8%>k literal 0 HcmV?d00001 diff --git a/src/driver/display.h b/src/driver/display.h new file mode 100644 index 000000000..e80049a46 --- /dev/null +++ b/src/driver/display.h @@ -0,0 +1,7 @@ +/* helper for different display CVFD implementations */ +#if HAVE_COOL_HARDWARE +#include +#endif +#if HAVE_TRIPLEDRAGON || HAVE_SPARK_HARDWARE || HAVE_AZBOX_HARDWARE || HAVE_GENERIC_HARDWARE +#include +#endif diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 5c2eae786..836632b71 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1414,7 +1414,7 @@ bool CRecordManager::ShowMenu(void) sprintf(cnt, "%d", i); //define stop key if only one record is running, otherwise define shortcuts neutrino_msg_t rc_key = CRCInput::convertDigitToKey(shortcut++); - std::string btn_icon = NEUTRINO_ICON_BUTTON_OKAY; + const char * btn_icon = NEUTRINO_ICON_BUTTON_OKAY; if (rec_count == 1){ rc_key = CRCInput::RC_stop; btn_icon = NEUTRINO_ICON_BUTTON_STOP; diff --git a/src/gui/audio_setup.cpp b/src/gui/audio_setup.cpp index 5b854d798..22290473a 100644 --- a/src/gui/audio_setup.cpp +++ b/src/gui/audio_setup.cpp @@ -160,7 +160,7 @@ int CAudioSetup::showAudioSetup() as_oj_vsteps = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUME_STEP, (int *)&g_settings.current_volume_step, true, 1, 25, NULL); as_oj_vsteps->setHint("", LOCALE_MENU_HINT_AUDIO_VOLSTEP); - st = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUME_START, &g_settings.start_volume, true, -1, 100, NULL, 0, -1, LOCALE_OPTIONS_OFF); + st = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUME_START, &g_settings.start_volume, true, -1, 100, NULL, CRCInput::RC_nokey, NULL, 0, -1, LOCALE_OPTIONS_OFF); st->setHint("", LOCALE_MENU_HINT_AUDIO_VOLSTART); //clock rec //CMenuOptionChooser * as_oj_clockrec new CMenuOptionChooser(LOCALE_AUDIOMENU_CLOCKREC, &g_settings.clockrec, AUDIOMENU_CLOCKREC_OPTIONS, AUDIOMENU_CLOCKREC_OPTION_COUNT, true, audioSetupNotifier); diff --git a/src/gui/audioplayer_setup.cpp b/src/gui/audioplayer_setup.cpp index 74dbcc725..b95433215 100644 --- a/src/gui/audioplayer_setup.cpp +++ b/src/gui/audioplayer_setup.cpp @@ -125,7 +125,7 @@ int CAudioPlayerSetup::showAudioPlayerSetup() mc->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_PLAYLIST); audioplayerSetup->addItem(mc); - CMenuOptionNumberChooser *cc = new CMenuOptionNumberChooser(LOCALE_AUDIOPLAYER_SCREENSAVER_TIMEOUT, &g_settings.audioplayer_screensaver, true, 0, 999, NULL, 0, 0, LOCALE_OPTIONS_OFF); + CMenuOptionNumberChooser *cc = new CMenuOptionNumberChooser(LOCALE_AUDIOPLAYER_SCREENSAVER_TIMEOUT, &g_settings.audioplayer_screensaver, true, 0, 999, NULL, CRCInput::RC_nokey, NULL, 0, 0, LOCALE_OPTIONS_OFF); cc->setNumberFormat(std::string("%d ") + g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE)); cc->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_SCREENSAVER); audioplayerSetup->addItem(cc); diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index 94598bdfa..fcb675f72 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -261,7 +261,7 @@ int CKeybindSetup::showKeySetup() CMenuOptionNumberChooser *cc; cc = new CMenuOptionNumberChooser(LOCALE_KEYBINDINGMENU_LONGKEYPRESS_DURATION, - &g_settings.longkeypress_duration, true, LONGKEYPRESS_OFF, 9999, NULL, 0, LONGKEYPRESS_OFF, LOCALE_OPTIONS_OFF); + &g_settings.longkeypress_duration, true, LONGKEYPRESS_OFF, 9999, NULL, CRCInput::convertDigitToKey(shortcut++), NULL, 0, LONGKEYPRESS_OFF, LOCALE_OPTIONS_OFF); cc->setNumberFormat(ms_number_format); cc->setNumericInput(true); cc->setHint("", LOCALE_MENU_HINT_LONGKEYPRESS_DURATION); diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 70b549038..5946f78d3 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -1086,13 +1086,24 @@ int CLuaInstance::MenuAddItem(lua_State *L) } else m->m->addItem(GenericMenuSeparatorLine); } else { - std::string right_icon; tableLookup(L, "right_icon", right_icon); + std::string right_icon_str; tableLookup(L, "right_icon", right_icon_str); std::string action; tableLookup(L, "action", action); std::string value; tableLookup(L, "value", value); std::string hint; tableLookup(L, "hint", hint); - std::string hint_icon; tableLookup(L, "hint_icon", hint_icon); + std::string hint_icon_str; tableLookup(L, "hint_icon", hint_icon_str); std::string id; tableLookup(L, "id", id); std::string tmp; + char *right_icon = NULL; + if (!right_icon_str.empty()) { + right_icon = strdup(right_icon_str.c_str()); + m->tofree.push_back(right_icon); + } + char *hint_icon = NULL; + if (!hint_icon_str.empty()) { + hint_icon = strdup(hint_icon_str.c_str()); + m->tofree.push_back(hint_icon); + } + int directkey = CRCInput::RC_nokey; tableLookup(L, "directkey", directkey); int pulldown = false; tableLookup(L, "pulldown", pulldown); tmp = "true"; @@ -1107,8 +1118,8 @@ int CLuaInstance::MenuAddItem(lua_State *L) if (type == "forwarder") { b->str_val = value; CLuaMenuForwarder *forwarder = new CLuaMenuForwarder(L, action, id); - mi = new CMenuForwarder(b->name, enabled, b->str_val, forwarder, NULL/*ActionKey*/, directkey, icon.c_str(), right_icon.c_str()); - if (!hint.empty() || !hint_icon.empty()) + mi = new CMenuForwarder(b->name, enabled, b->str_val, forwarder, NULL/*ActionKey*/, directkey, icon.c_str(), right_icon); + if (!hint.empty() || hint_icon) mi->setHint(hint_icon, hint); m->targets.push_back(forwarder); } else if (type == "chooser") { @@ -1161,7 +1172,7 @@ int CLuaInstance::MenuAddItem(lua_State *L) int sms = 0; tableLookup(L, "sms", sms); int size = 30; tableLookup(L, "size", size); CLuaMenuStringinput *stringinput = new CLuaMenuStringinput(L, action, id, b->name.c_str(), &b->str_val, size, valid_chars, m->observ, icon.c_str(), sms); - mi = new CMenuForwarder(b->name, enabled, b->str_val, stringinput, NULL/*ActionKey*/, directkey, icon.c_str(), right_icon.c_str()); + mi = new CMenuForwarder(b->name, enabled, b->str_val, stringinput, NULL/*ActionKey*/, directkey, icon.c_str(), right_icon); m->targets.push_back(stringinput); } else if (type == "filebrowser") { b->str_val = value; @@ -1177,12 +1188,12 @@ int CLuaInstance::MenuAddItem(lua_State *L) } lua_pop(L, 1); - mi = new CMenuForwarder(b->name, enabled, b->str_val, filebrowser, NULL/*ActionKey*/, directkey, icon.c_str(), right_icon.c_str()); + mi = new CMenuForwarder(b->name, enabled, b->str_val, filebrowser, NULL/*ActionKey*/, directkey, icon.c_str(), right_icon); m->targets.push_back(filebrowser); } if (mi) { mi->setLua(L, action, id); - if (!hint.empty() || !hint_icon.empty()) + if (!hint.empty() || hint_icon) mi->setHint(hint_icon, hint); m->m->addItem(mi); } diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 3c23a55e5..0271ada8c 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -337,7 +337,7 @@ void CMiscMenue::showMiscSettingsMenuGeneral(CMenuWidget *ms_general) //fan speed if (g_info.has_fan) { - CMenuOptionNumberChooser * mn = new CMenuOptionNumberChooser(LOCALE_FAN_SPEED, &g_settings.fan_speed, true, 1, 14, fanNotifier, 0, 0, LOCALE_OPTIONS_OFF); + CMenuOptionNumberChooser * mn = new CMenuOptionNumberChooser(LOCALE_FAN_SPEED, &g_settings.fan_speed, true, 1, 14, fanNotifier, CRCInput::RC_nokey, NULL, 0, 0, LOCALE_OPTIONS_OFF); mn->setHint("", LOCALE_MENU_HINT_FAN_SPEED); ms_general->addItem(mn); } diff --git a/src/gui/network_service.cpp b/src/gui/network_service.cpp index 15ff33e8b..7decd099f 100644 --- a/src/gui/network_service.cpp +++ b/src/gui/network_service.cpp @@ -46,18 +46,18 @@ struct network_service std::string cmd; std::string options; neutrino_locale_t hint; - std::string icon; + const char * icon; int enabled; }; static struct network_service services[] = { - { "FTP", "vsftpd", "", LOCALE_MENU_HINT_NET_FTPD, "", 0 }, - { "Telnet", "telnetd", "-l/bin/login", LOCALE_MENU_HINT_NET_TELNET, "", 0 }, + { "FTP", "vsftpd", "", LOCALE_MENU_HINT_NET_FTPD, NULL, 0 }, + { "Telnet", "telnetd", "-l/bin/login", LOCALE_MENU_HINT_NET_TELNET, NULL, 0 }, { "DjMount", "djmount", "-o iocharset=UTF-8 /media/00upnp/", LOCALE_MENU_HINT_NET_DJMOUNT, "", 0 }, - { "uShare", "ushare", "-D -n `cat /etc/hostname`", LOCALE_MENU_HINT_NET_USHARE, "", 0 }, - { "xupnpd", "xupnpd", "", LOCALE_MENU_HINT_NET_XUPNPD, "", 0 }, - { "Dropbear", "dropbear", "-B", LOCALE_MENU_HINT_NET_DROPBEAR, "", 0 }, + { "uShare", "ushare", "-D -n `cat /etc/hostname`", LOCALE_MENU_HINT_NET_USHARE, NULL, 0 }, + { "xupnpd", "xupnpd", "", LOCALE_MENU_HINT_NET_XUPNPD, NULL, 0 }, + { "Dropbear", "dropbear", "-B", LOCALE_MENU_HINT_NET_DROPBEAR, NULL, 0 }, }; #define SERVICE_COUNT (sizeof(services)/sizeof(struct network_service)) diff --git a/src/gui/personalize.cpp b/src/gui/personalize.cpp index e9b1e6050..1f1eea012 100644 --- a/src/gui/personalize.cpp +++ b/src/gui/personalize.cpp @@ -295,7 +295,7 @@ int CPersonalizeGui::ShowPersonalizationMenu() if (g_settings.easymenu) { int count = 0; for (uint j = 0; jgetName().c_str()); + printf("v_item[i].widget [%s]\n", v_item[j].widget->getName()); //pin protected items only if (v_item[j].item_mode == PERSONALIZE_SHOW_AS_ACCESS_OPTION) { @@ -853,7 +853,7 @@ void CPersonalizeGui::addPersonalizedItems() bool add_shortcut = false; //get shortcut - if (fw->iconName.empty() && fw->active ) //if no icon is defined and item is active, allow to generate a shortcut, + if (d_key == CRCInput::RC_nokey && fw->active ) //if no icon is defined and item is active, allow to generate a shortcut, { add_shortcut = true; d_key = getShortcut(short_cut); @@ -875,7 +875,7 @@ void CPersonalizeGui::addPersonalizedItems() //convert item to locked forwarder and use generated pin mode for usage as ask parameter v_item[i].menuItem = new CLockedMenuForwarder(fw->getTextLocale(), g_settings.easymenu ? g_settings.parentallock_pincode : g_settings.personalize_pincode, - use_pin, fw->active, NULL, fw->getTarget(), fw->getActionKey(), d_key, fw->iconName.c_str(), lock_icon); + use_pin, fw->active, NULL, fw->getTarget(), fw->getActionKey(), d_key, NULL, lock_icon); v_item[i].menuItem->hintIcon = fw->hintIcon; v_item[i].menuItem->hint = fw->hint; //add item if it's set to visible or pin protected and allow to add an forwarder as next diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 7728fbf56..03ba13859 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -659,7 +659,7 @@ int CScanSetup::showScanMenuFrontendSetup() mf->setHint("", LOCALE_MENU_HINT_SCAN_LONGITUDE); rotorMenu->addItem(mf); - nc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_USALS_REPEAT, (int *)&zapitCfg.repeatUsals, true, 0, 10, NULL, 0, 0, LOCALE_OPTIONS_OFF); + nc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_USALS_REPEAT, (int *)&zapitCfg.repeatUsals, true, 0, 10, NULL, CRCInput::convertDigitToKey(shortcut++), NULL, 0, 0, LOCALE_OPTIONS_OFF); nc->setHint("", LOCALE_MENU_HINT_SCAN_USALS_REPEAT); rotorMenu->addItem(nc); @@ -1142,13 +1142,13 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon bool unicable = (dmode == DISEQC_UNICABLE); if (!unicable) { - diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, this, 1, -1, LOCALE_OPTIONS_OFF); + diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, this, CRCInput::RC_nokey, NULL, 1, -1, LOCALE_OPTIONS_OFF); diseqc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQC); - comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); + comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, CRCInput::RC_nokey, NULL, 1, -1, LOCALE_OPTIONS_OFF); comm->setHint("", LOCALE_MENU_HINT_SCAN_COMMITED); - uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); + uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, CRCInput::RC_nokey, NULL, 1, -1, LOCALE_OPTIONS_OFF); uncomm->setHint("", LOCALE_MENU_HINT_SCAN_UNCOMMITED); - motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, this, 0, 0, LOCALE_OPTIONS_OFF); + motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, this, CRCInput::RC_nokey, NULL, 0, 0, LOCALE_OPTIONS_OFF); motor->setHint("", LOCALE_MENU_HINT_SCAN_MOTORPOS); usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/); usals->setHint("", LOCALE_MENU_HINT_SCAN_USEUSALS); @@ -1336,7 +1336,7 @@ int CScanSetup::showFastscanDiseqcSetup() continue; std::string satname = CServiceManager::getInstance()->GetSatelliteName(sit->first); - CMenuOptionNumberChooser *diseqc = new CMenuOptionNumberChooser(satname, &sit->second.diseqc, true, -1, 15, this, 1, -1, LOCALE_OPTIONS_OFF); + CMenuOptionNumberChooser *diseqc = new CMenuOptionNumberChooser(satname, &sit->second.diseqc, true, -1, 15, this, CRCInput::RC_nokey, NULL, 1, -1, LOCALE_OPTIONS_OFF); sat_setup->addItem(diseqc); } sat_setup->addItem(GenericMenuSeparatorLine); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index dbbe7eff6..8209599d2 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -448,7 +448,7 @@ void CTimerList::updateEvents(void) theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); //get footerHeight from paintButtons - footerHeight = ::paintButtons(0, 0, 0, TimerListButtonsCount, TimerListButtons, 0, 0, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 0, false); + footerHeight = ::paintButtons(TimerListButtons, TimerListButtonsCount, 0, 0, 0, 0, 0, false); width = w_max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth()*56, 20); height = frameBuffer->getScreenHeight() - (2*theight); // max height diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp index c170778eb..09d1259b0 100644 --- a/src/gui/vfd_setup.cpp +++ b/src/gui/vfd_setup.cpp @@ -169,20 +169,20 @@ void CVfdSetup::showBrightnessSetup(CMenuWidget *mn_widget) brightnessstandby = CVFD::getInstance()->getBrightnessStandby(); brightnessdeepstandby = CVFD::getInstance()->getBrightnessDeepStandby(); - nc = new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESS, &brightness, true, 0, 15, this, 0, 0, NONEXISTANT_LOCALE, true); + nc = new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESS, &brightness, true, 0, 15, this, CRCInput::RC_nokey, NULL, 0, 0, NONEXISTANT_LOCALE, true); nc->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESS); mn_widget->addItem(nc); - nc = new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY, &brightnessstandby, true, 0, 15, this, 0, 0, NONEXISTANT_LOCALE, true); + nc = new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY, &brightnessstandby, true, 0, 15, this, CRCInput::RC_nokey, NULL, 0, 0, NONEXISTANT_LOCALE, true); nc->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESSSTANDBY); mn_widget->addItem(nc); if(cs_get_revision() > 7) { - nc = new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESSDEEPSTANDBY, &brightnessdeepstandby, true, 0, 15, this, 0, 0, NONEXISTANT_LOCALE, true); + nc = new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESSDEEPSTANDBY, &brightnessdeepstandby, true, 0, 15, this, CRCInput::RC_nokey, NULL, 0, 0, NONEXISTANT_LOCALE, true); nc->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESSDEEPSTANDBY); mn_widget->addItem(nc); } - nc = new CMenuOptionNumberChooser(LOCALE_LCDMENU_DIM_BRIGHTNESS, &g_settings.lcd_setting_dim_brightness, vfd_enabled, -1, 15, NULL, 0, -1, LOCALE_OPTIONS_OFF, true); + nc = new CMenuOptionNumberChooser(LOCALE_LCDMENU_DIM_BRIGHTNESS, &g_settings.lcd_setting_dim_brightness, vfd_enabled, -1, 15, NULL, CRCInput::RC_nokey, NULL, 0, -1, LOCALE_OPTIONS_OFF, true); nc->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESSDIM); mn_widget->addItem(nc); diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 9843b48f5..4134eb0a8 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -30,7 +30,7 @@ #include #include #include -//#include +// #include @@ -50,33 +50,55 @@ * maxwidth maximum horizontal space for the buttons * footerheight set height of buttonbar as similar to footer, value 0 (default) means: value calculates automaticly depends of maximal height of icon and caption - - * stuff below here was obviously not tested recently - * vertical_paint optional, default value is false (horizontal) sets direction of painted buttons - * fcolor optional, default value is COL_INFOBAR_SHADOW_TEXT, use it to render font with other color - * alt_buttontext optional, default NULL, overwrites button caption at definied buttonlabel id (see parameter alt_buttontext_id) with this text - * alt_buttontext_id optional, default 0, means id from buttonlable struct which text you will change - * show optional, default value is true (show button), if false, then no show and return the height of the button. + * show optional, default value is true (show button), if false, then no show and return the height of the button. */ -int paintButtons( const int &x, +int paintButtons( const int &x, + const int &y, + const int &footerwidth, + const int &count, + const button_label * const content, + const int &maxwidth, + const int &footerheight) { + return paintButtons(content, count, x, y, footerwidth, footerheight, maxwidth, true, NULL, NULL); +}; + +int paintButtons( const button_label * const content, + const int &count, + const int &x, const int &y, const int &footerwidth, - const uint &count, - const struct button_label * const content, - const int &maxwidth, const int &footerheight, - std::string /* just to make sure nobody uses anything below */, - bool vertical_paint, - const uint32_t fcolor, - const char * alt_buttontext, - const uint &buttontext_id, + const int &maxwidth, bool show, - const std::vector& /*all_buttontext_id*/) + int *wantedwidth, + int *wantedheight) +{ + button_label_ext content_ext[count]; + for (int i = 0; i < count; i++) { + content_ext[i].button = content[i].button; + content_ext[i].locale = content[i].locale; + content_ext[i].text = NULL; + content_ext[i].width = 0; + content_ext[i].maximize = false; + } + return paintButtons(content_ext, count, x, y, footerwidth, footerheight, maxwidth, show, wantedwidth, wantedheight); +} + +int paintButtons( const button_label_ext * const content, + const int &count, + const int &x, + const int &y, + const int &footerwidth, + const int &footerheight, + const int &maxwidth, + bool show, + int *wantedwidth, + int *wantedheight) { CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; - uint cnt = count; + int cnt = count; int x_footer = x; int y_footer = y; int w_footer = footerwidth; @@ -107,6 +129,211 @@ int paintButtons( const int &x, int fwidth[16]; const char *buttontext[16]; + /* sanity check... */ + if (count > 16 || count == 0) + { + fprintf(stderr, "paintButtons does only support max 16 buttons yet (%d)\n", count); +// print_stacktrace(); + return 0; + } + if (maxwidth < 200 && show) + { + fprintf(stderr, "paintButtons: maxwidth very small\n"); + fprintf(stderr, " x: %d y: %d footw: %d count: %d maxw: %d footh: %d\n ", + x, y, footerwidth, count, maxwidth, footerheight); +// print_stacktrace(); + } + + bool maximize = false; + for (int i = 0; i < cnt; i++) + maximize |= content[i].maximize; + + for (int i = 0; i < cnt; i++) + { + //icon + int w = 0; + int h = 0; + frameBuffer->getIconSize(content[i].button, &w, &h); + iconw[i] = w; + iconh[i] = h; + h_max_icon = std::max(h_max_icon, h); + w_icons += w; + if (w) + count_icons++; + + if (content[i].text) { + buttontext[i] = content[i].text; + fwidth[i] = std::max(content[i].width, font->getRenderWidth(buttontext[i])); + w_text += fwidth[i]; + count_labels++; + } else if (content[i].locale) { + buttontext[i] = g_Locale->getText(content[i].locale); + fwidth[i] = std::max(content[i].width, font->getRenderWidth(buttontext[i])); + w_text += fwidth[i]; + count_labels++; + } else { + buttontext[i] = ""; + fwidth[i] = 0; + } + if (maximize && i < cnt - 1) + fwidth[i] += w, w_text += w; + } + + //calculate button heigth + h_button = std::max(h_max_icon, h_max_text); //calculate optimal button height + + //calculate footer heigth + h_footer = footerheight == 0 ? (h_button + 2*h_space) : footerheight; + + if (!show) { + if (wantedheight) + *wantedheight = h_button + 2*h_space; + if (wantedwidth) + *wantedwidth = w_space * 2 + w_text + w_icons + (count_icons + count_labels - 1) * h_space; + return h_footer; + } + + //paint footer + if (w_footer > 0) + frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round + + + //baseline + int y_base = y_footer + h_footer/2; + int spacing = maxwidth - w_space * 2 - w_text - w_icons - (count_icons + count_labels - 1) * h_space; +#if 0 + /* debug */ + fprintf(stderr, "PB: sp %d mw %d w_t %d w_i %d w_s %d c_i %d\n", + spacing, maxwidth, w_text, w_icons, w_space, count_items); +#endif + if (fwidth[cnt - 1] == 0) /* divisor needs to be labels+1 unless rightmost icon has a label */ + count_labels++; /* side effect: we don't try to divide by 0 :-) */ + + if (maximize) { + while (spacing > 0) { + for (int i = 0; i < cnt && spacing > 0; i++) { + if (content[i].maximize) { + fwidth[i]++; + spacing--; + } + } + } + } + + if (spacing >= 0) + { /* add half of the inter-object space to the */ + spacing /= count_labels; /* left and right (this might break vertical */ + x_button += spacing / 2; /* alignment, but nobody is using this (yet) */ + } /* and I'm don't know how it should work. */ + else + { + /* shorten captions relative to their length */ + for (int i = 0; i < cnt; i++) + fwidth[i] = (fwidth[i] * (w_text + spacing)) / w_text; /* spacing is negative...*/ + spacing = 0; + } + + for (int j = 0; j < cnt; j++) + { + const char * caption = NULL; + //set caption... + caption = buttontext[j]; + + const char * icon = content[j].button ? content[j].button : ""; + + // calculate baseline startposition of icon and text in y + int y_caption = y_base + h_max_text/2+1; + + // paint icon and text + frameBuffer->paintIcon(icon, x_button , y_base - iconh[j]/2); + x_caption = x_button + iconw[j] + h_space; + font->RenderString(x_caption, y_caption, fwidth[j], caption, COL_INFOBAR_SHADOW_TEXT); + + /* set next startposition x, if text is length=0 then offset is =renderwidth of icon, + * for generating buttons without captions, + */ + + /* increase x position */ + x_button = x_caption; + if (fwidth[j]) + x_button += fwidth[j] + spacing + h_space; + } + + return h_footer; +} + +/* paintButtons usage, + use this function for painting icons with captions in horizontal or vertical direction. + Icons automatically use the available maxwidth. + If not enough space is available, captions are shortened. + If there is extra space, space between icons is increased. + + * x set horizontal startposition + * y set vertical startposition + * footerwidth set width of buttonbar as similar to footer, value 0 (default) means: do nothing, + then paint it extra + * count set count of buttons + * content set struct buttonlabel with iconfile and locales, for an empty text let locale + constant empty, so you can paint icons without captions, + * maxwidth maximum horizontal space for the buttons + * footerheight set height of buttonbar as similar to footer, value 0 (default) means: + value calculates automaticly depends of maximal height of icon and caption + + * stuff below here was obviously not tested recently + * vertical_paint optional, default value is false (horizontal) sets direction of painted buttons + * fcolor optional, default value is COL_INFOBAR_SHADOW_TEXT, use it to render font with other color + * alt_buttontext optional, default NULL, overwrites button caption at definied buttonlabel id (see parameter alt_buttontext_id) with this text + * alt_buttontext_id optional, default 0, means id from buttonlable struct which text you will change + * show optional, default value is true (show button), if false, then no show and return the height of the button. + */ + +int paintButtons( const int &x, + const int &y, + const int &footerwidth, + const uint &count, + const struct button_label * const content, + const int &maxwidth, + const int &footerheight, + std::string /* just to make sure nobody uses anything below */, + bool vertical_paint, + const uint32_t fcolor, + const char * alt_buttontext, + const uint &buttontext_id, + bool show, + const std::vector& /*all_buttontext_id*/) +{ + CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); + Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; + uint cnt = count; + int x_footer = x; + int y_footer = y; + int w_footer = footerwidth; + int h_footer = 0; + + int w_space = 10; //minimal space between buttons + int h_space = 4; //minimal space between caption and/or icon and border + int x_icon = x_footer + w_space; + int x_caption = 0; + + int x_button = x_icon; + int h_button = 0; + + //calculate max of h + w + //icon + int h_max_icon = 0; + int w_icons = 0; + + //text + int w_text = 0; + int h_max_text = font->getHeight(); + int count_icons = 0; + int count_labels = 0; + /* more than 16 buttons? noooooo*/ + int iconw[16]; + int iconh[16]; + int fwidth[16]; + const char *buttontext[16]; + /* sanity check... */ if (count > 16 || count == 0) { @@ -139,7 +366,7 @@ int paintButtons( const int &x, if (content[i].locale) { buttontext[i] = g_Locale->getText(content[i].locale); //text width - if (alt_buttontext != NULL && i == buttontext_id) + if (alt_buttontext != NULL && i == buttontext_id) fwidth[i] = font->getRenderWidth(alt_buttontext); //...with an alternate buttontext else fwidth[i] = font->getRenderWidth(buttontext[i]); @@ -153,7 +380,7 @@ int paintButtons( const int &x, //calculate button heigth h_button = std::max(h_max_icon, h_max_text); //calculate optimal button height - + //calculate footer heigth h_footer = footerheight == 0 ? (h_button + 2*h_space) : footerheight; @@ -164,22 +391,22 @@ int paintButtons( const int &x, if (w_footer > 0) frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round - + //baseline int y_base = y_footer + h_footer/2; int spacing = maxwidth - w_space * 2 - w_text - w_icons - (count_icons + count_labels - 1) * h_space; #if 0 /* debug */ fprintf(stderr, "PB: sp %d mw %d w_t %d w_i %d w_s %d c_i %d\n", - spacing, maxwidth, w_text, w_icons, w_space, count_items); + spacing, maxwidth, w_text, w_icons, w_space, count_items); #endif if (fwidth[cnt - 1] == 0) /* divisor needs to be labels+1 unless rightmost icon has a label */ count_labels++; /* side effect: we don't try to divide by 0 :-) */ if (spacing >= 0) - { /* add half of the inter-object space to the */ + { /* add half of the inter-object space to the */ spacing /= count_labels; /* left and right (this might break vertical */ x_button += spacing / 2; /* alignment, but nobody is using this (yet) */ - } /* and I'm don't know how it should work. */ + } /* and I'm don't know how it should work. */ else { /* shorten captions relative to their length */ @@ -192,7 +419,7 @@ int paintButtons( const int &x, { const char * caption = NULL; //set caption... - if (alt_buttontext != NULL && j == buttontext_id) + if (alt_buttontext != NULL && j == buttontext_id) caption = alt_buttontext; //...with an alternate buttontext else caption = buttontext[j]; @@ -200,30 +427,30 @@ int paintButtons( const int &x, const char * icon = content[j].button ? content[j].button : ""; // calculate baseline startposition of icon and text in y - int y_caption = y_base + h_max_text/2+1; - + int y_caption = y_base + h_max_text/2+1; + // paint icon and text frameBuffer->paintIcon(icon, x_button , y_base - iconh[j]/2); x_caption = x_button + iconw[j] + h_space; font->RenderString(x_caption, y_caption, fwidth[j], caption, fcolor); - - /* set next startposition x, if text is length=0 then offset is =renderwidth of icon, - * for generating buttons without captions, - */ - - int lentext = strlen(caption); - if (vertical_paint) - // set x_icon for painting buttons with vertical arrangement + + /* set next startposition x, if text is length=0 then offset is =renderwidth of icon, + * for generating buttons without captions, + */ + + int lentext = strlen(caption); + if (vertical_paint) + // set x_icon for painting buttons with vertical arrangement { - if (lentext !=0) - { - x_button = x; - y_base += h_footer; - } - else - { - x_button = x_caption; - } + if (lentext !=0) + { + x_button = x; + y_base += h_footer; + } + else + { + x_button = x_caption; + } } else { @@ -231,7 +458,7 @@ int paintButtons( const int &x, x_button = x_caption; if (fwidth[j]) x_button += fwidth[j] + spacing + h_space; - } + } } return h_footer; diff --git a/src/gui/widget/buttons.h b/src/gui/widget/buttons.h index f988dcfae..ad52669b2 100644 --- a/src/gui/widget/buttons.h +++ b/src/gui/widget/buttons.h @@ -29,25 +29,64 @@ #include -typedef struct button_label +struct button_label { const char * button; neutrino_locale_t locale; -} button_label_struct; +}; + +struct button_label_ext +{ + const char * button; + neutrino_locale_t locale; + const char * text; + int width; + bool maximize; +}; + +int paintButtons( const button_label * const content, + const int &count, + const int &x, + const int &y, + const int &footerheight, + const int &footerwidth, + const int &maxwidth, + bool show = true, + int *wantedwidth = NULL, + int *wantedheight = NULL); + +int paintButtons( const button_label_ext * const content, + const int &count, + const int &x, + const int &y, + const int &footerheight, + const int &footerwidth, + const int &maxwidth, + bool show = true, + int *wantedwidth = NULL, + int *wantedheight = NULL); int paintButtons( const int &x, const int &y, const int &footerwidth, - const uint &count, - const struct button_label * const content, + const int &count, + const button_label * const content, const int &maxwidth, - const int &footerheight = 0, - std::string tmp = "", /* just to make sure compilation breaks */ - bool vertical_paint = false, - const uint32_t fcolor = COL_INFOBAR_SHADOW_TEXT, - const char * alt_buttontext = NULL, - const uint &buttontext_id = 0, - bool show = true, - const std::vector& all_buttontext_id = std::vector()); + const int &footerheight = 0); + +int paintButtons( const int &x, + const int &y, + const int &footerwidth, + const uint &count, + const struct button_label * const content, + const int &maxwidth, + const int &footerheight = 0, + std::string tmp = "", /* just to make sure compilation breaks */ + bool vertical_paint = false, + const uint32_t fcolor = COL_INFOBAR_SHADOW_TEXT, + const char * alt_buttontext = NULL, + const uint &buttontext_id = 0, + bool show = true, + const std::vector& all_buttontext_id = std::vector()); #endif /* __gui_widget_buttons_h__ */ diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 1f7115bf6..6a9be6880 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -104,9 +104,13 @@ #define NEUTRINO_ICON_MP3 "mp3" #define NEUTRINO_ICON_MULTIMEDIA "multimedia" #define NEUTRINO_ICON_MOVIEPLAYER "icon_movieplayer" +#define NEUTRINO_ICON_NKPLAY "icon_nkplay" +#define NEUTRINO_ICON_YTPLAY "icon_ytplay" #define NEUTRINO_ICON_NOT_MOUNTED "not_mounted" #define NEUTRINO_ICON_PAUSE "mp_pause" #define NEUTRINO_ICON_PLAY "mp_play" +#define NEUTRINO_ICON_PLAY_REPEAT_ALL "mp_play_repeat_all" +#define NEUTRINO_ICON_PLAY_REPEAT_TRACK "mp_play_repeat_track" #define NEUTRINO_ICON_REW "mp_b-skip" #define NEUTRINO_ICON_FF "mp_f-skip" #define NEUTRINO_ICON_PROTECTING "protecting" @@ -223,6 +227,7 @@ #define NEUTRINO_ICON_HINT_HDD "hint_hdd" #define NEUTRINO_ICON_HINT_KEYS "hint_keys" #define NEUTRINO_ICON_HINT_A_PIC "hint_a_pic" +#define NEUTRINO_ICON_HINT_RASS "hint_rass" #define NEUTRINO_ICON_HINT_COLORS "hint_colors" #define NEUTRINO_ICON_HINT_FONTS "hint_fonts" @@ -249,14 +254,41 @@ #define NEUTRINO_ICON_HINT_FACTORY "hint_factory" /* opkg manager */ -#define NEUTRINO_ICON_CHECKMARK "checkmark" -#define NEUTRINO_ICON_WARNING "warning" +#define NEUTRINO_ICON_CHECKMARK "checkmark" +#define NEUTRINO_ICON_WARNING "warning" + +/* RASS */ +#define NEUTRINO_ICON_RED_0 "0-red" +#define NEUTRINO_ICON_RED_1 "1-red" +#define NEUTRINO_ICON_RED_2 "2-red" +#define NEUTRINO_ICON_RED_3 "3-red" +#define NEUTRINO_ICON_RED_4 "4-red" +#define NEUTRINO_ICON_RED_5 "5-red" +#define NEUTRINO_ICON_RED_6 "6-red" +#define NEUTRINO_ICON_RED_7 "7-red" +#define NEUTRINO_ICON_RED_8 "8-red" +#define NEUTRINO_ICON_RED_9 "9-red" + +#define NEUTRINO_ICON_GREEN_0 "0-green" +#define NEUTRINO_ICON_GREEN_1 "1-green" +#define NEUTRINO_ICON_GREEN_2 "2-green" +#define NEUTRINO_ICON_GREEN_3 "3-green" +#define NEUTRINO_ICON_GREEN_4 "4-green" +#define NEUTRINO_ICON_GREEN_5 "5-green" +#define NEUTRINO_ICON_GREEN_6 "6-green" +#define NEUTRINO_ICON_GREEN_7 "7-green" +#define NEUTRINO_ICON_GREEN_8 "8-green" +#define NEUTRINO_ICON_GREEN_9 "9-green" /* misc */ +#define NEUTRINO_ICON_HINT_NKPLAY "hint_nkplay" #define NEUTRINO_ICON_HINT_YTPLAY "hint_ytplay" +#define NEUTRINO_ICON_HINT_SPARK "hint_spark" #define NEUTRINO_ICON_EPG "epg" +#define NEUTRINO_ICON_BUTTON_LONGPRESS "longpress" + #define NEUTRINO_ICON_VARPATH "/var/share/tuxbox/neutrino/icons/" //alternatively path for user-defined icons #endif /* __gui_widget_icons_h__ */ diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index c0a1c6599..a890e7129 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -55,20 +56,37 @@ CMenuForwarder * const GenericMenuBack = &CGenericMenuBack; CMenuForwarder * const GenericMenuCancel = &CGenericMenuCancel; CMenuForwarder * const GenericMenuNext = &CGenericMenuNext; -CMenuItem::CMenuItem() +CMenuItem::CMenuItem(bool Active, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) { + active = Active; + directKey = DirectKey; + isStatic = IsStatic; + + if (IconName && *IconName) + iconName = IconName; + else + setIconName(); + + if (IconName_Info_right && *IconName_Info_right) + iconName_Info_right = IconName_Info_right; + else + iconName_Info_right = NULL; + + hintIcon = NULL; + x = -1; - directKey = CRCInput::RC_nokey; - iconName = ""; - iconName_Info_right = ""; used = false; icon_frame_w = 10; hint = NONEXISTANT_LOCALE; name = NONEXISTANT_LOCALE; nameString = ""; - isStatic = false; + desc = NONEXISTANT_LOCALE; + descString = ""; marked = false; inert = false; + directKeyOK = true; + selected_iconName = NULL; + height = 0; } void CMenuItem::init(const int X, const int Y, const int DX, const int OFFX) @@ -106,7 +124,7 @@ void CMenuItem::setInert(const bool Inert) paint(); } -void CMenuItem::setItemButton(const std::string& icon_Name, const bool is_select_button) +void CMenuItem::setItemButton(const char * const icon_Name, const bool is_select_button) { if (is_select_button) selected_iconName = icon_Name; @@ -138,14 +156,19 @@ void CMenuItem::initItemColors(const bool select_mode) } } -void CMenuItem::paintItemCaption(const bool select_mode, const int &item_height, const char * left_text, const char * right_text, const fb_pixel_t right_bgcol) +void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text, const fb_pixel_t right_bgcol) { + int item_height = height; + const char *left_text = getName(); + const char *desc_text = getDescription(); + if (select_mode) { - if (right_text != NULL) + if (right_text && *right_text) { - char str[256]; - snprintf(str, 255, "%s %s", left_text, right_text); + ssize_t len = strlen(left_text) + strlen(right_text) + 2; + char str[len]; + snprintf(str, len, "%s %s", left_text, right_text); CVFD::getInstance()->showMenuText(0, str, -1, true); } else @@ -156,18 +179,28 @@ void CMenuItem::paintItemCaption(const bool select_mode, const int &item_height, int _dx = dx; int icon_w = 0; int icon_h = 0; - if (!iconName_Info_right.empty()) { - CFrameBuffer::getInstance()->getIconSize(iconName_Info_right.c_str(), &icon_w, &icon_h); + if (iconName_Info_right) { + CFrameBuffer::getInstance()->getIconSize(iconName_Info_right, &icon_w, &icon_h); if (icon_w) _dx -= icon_frame_w + icon_w; } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(name_start_x, y+ item_height, _dx- (name_start_x - x), left_text, item_color); + + int desc_height = 0; + if (desc_text && *desc_text) + desc_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]->getHeight(); + + if (*left_text) + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(name_start_x, y+ item_height - desc_height, _dx- (name_start_x - x), left_text, item_color); //right text if (right_text && (*right_text || right_bgcol)) { int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(right_text); - int stringstartposOption = std::max(name_start_x + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text) + icon_frame_w, x + dx - stringwidth - icon_frame_w); //+ offx + int stringstartposOption; + if (*left_text) + stringstartposOption = std::max(name_start_x + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text) + icon_frame_w, x + dx - stringwidth - icon_frame_w); //+ offx + else + stringstartposOption = name_start_x; if (right_bgcol) { if (!*right_text) stringstartposOption -= 60; @@ -187,9 +220,11 @@ void CMenuItem::paintItemCaption(const bool select_mode, const int &item_height, } if (*right_text) { stringstartposOption -= (icon_w == 0 ? 0 : icon_w + icon_frame_w); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposOption, y+item_height,dx- (stringstartposOption- x), right_text, item_color); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposOption, y+item_height - desc_height, dx- (stringstartposOption- x), right_text, item_color); } } + if (desc_text && *desc_text) + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]->RenderString(name_start_x + 10, y+ item_height, _dx- 10 - (name_start_x - x), desc_text, item_color); } void CMenuItem::prepareItem(const bool select_mode, const int &item_height) @@ -198,7 +233,8 @@ void CMenuItem::prepareItem(const bool select_mode, const int &item_height) initItemColors(select_mode); //paint item background - CFrameBuffer::getInstance()->paintBoxRel(x, y, dx, item_height, item_bgcolor, RADIUS_LARGE); + CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); + frameBuffer->paintBoxRel(x, y, dx, item_height, item_bgcolor, RADIUS_LARGE); } void CMenuItem::paintItemSlider( const bool select_mode, const int &item_height, const int &optionvalue, const int &factor, const char * left_text, const char * right_text) @@ -210,14 +246,13 @@ void CMenuItem::paintItemSlider( const bool select_mode, const int &item_height, return; int stringwidth = 0; if (right_text != NULL) { - stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("U999") ; + stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("U999"); } int stringwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text); int maxspace = dx - stringwidth - icon_frame_w - stringwidth2 - 10; - if(maxspace < slider_lenght){ + if(maxspace < slider_lenght) return ; - } int stringstartposOption = x + dx - stringwidth - slider_lenght; int optionV = (optionvalue < 0) ? 0 : optionvalue; @@ -226,54 +261,60 @@ void CMenuItem::paintItemSlider( const bool select_mode, const int &item_height, frameBuffer->paintIcon(select_mode ? NEUTRINO_ICON_VOLUMESLIDER2BLUE : NEUTRINO_ICON_VOLUMESLIDER2, (stringstartposOption + (optionV * 100 / factor)), y+item_height/4); } -void CMenuItem::paintItemButton(const bool select_mode, const int &item_height, const std::string &icon_Name) +void CMenuItem::paintItemButton(const bool select_mode, int item_height, const char * const icon_Name) { + item_height -= getDescriptionHeight(); + CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); bool selected = select_mode; bool icon_painted = false; - std::string icon_name = iconName; + const char *icon_name = iconName; int icon_w = 0; int icon_h = 0; //define icon name depends of numeric value - if (icon_name.empty() && CRCInput::isNumeric(directKey)) - { - char i_name[6]; /* X +'\0' */ - snprintf(i_name, 6, "%d", CRCInput::getNumericValue(directKey)); - i_name[5] = '\0'; /* even if snprintf truncated the string, ensure termination */ - icon_name = i_name; - } - + bool isNumeric = CRCInput::isNumeric(directKey); +#if 0 + if (isNumeric && !g_settings.menu_numbers_as_icons) + icon_name = NULL; +#endif //define select icon - if (selected && offx > 0) + if (selected && offx > 0) { - if (!selected_iconName.empty()) + if (selected_iconName) icon_name = selected_iconName; - else if (icon_name.empty() && !CRCInput::isNumeric(directKey)) + else if (!(icon_name && *icon_name) && !isNumeric) icon_name = icon_Name; } - int icon_x = 0; int icon_start_x = x+icon_frame_w; //start of icon space int icon_space_x = name_start_x - icon_frame_w - icon_start_x; //size of space where to paint icon int icon_space_mid = icon_start_x + icon_space_x/2; //get data of number icon and paint - if (!icon_name.empty()) + if (icon_name && *icon_name) { - frameBuffer->getIconSize(icon_name.c_str(), &icon_w, &icon_h); + frameBuffer->getIconSize(icon_name, &icon_w, &icon_h); - if (active && icon_w>0 && icon_h>0 && icon_space_x >= icon_w) + if (/*active &&*/ icon_w>0 && icon_h>0 && icon_space_x >= icon_w) { - icon_x = icon_space_mid - (icon_w/2); - - icon_painted = frameBuffer->paintIcon(icon_name, icon_x, y+ ((item_height/2- icon_h/2)) ); + int icon_x = icon_space_mid - icon_w/2; + int icon_y = y + item_height/2 - icon_h/2; + icon_painted = frameBuffer->paintIcon(icon_name, icon_x, icon_y); + if (icon_painted && (directKey != CRCInput::RC_nokey) && (directKey & CRCInput::RC_Repeat)) { + static int longpress_icon_w = 0, longpress_icon_h = 0; + if (!longpress_icon_w) + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_LONGPRESS, &longpress_icon_w, &longpress_icon_h); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_LONGPRESS, + std::min(icon_x + icon_w - longpress_icon_w/2, name_start_x - longpress_icon_w), + std::min(icon_y + icon_h - longpress_icon_h/2, y + item_height - longpress_icon_h)); + } } } //paint only number if no icon was painted and keyval is numeric - if (active && CRCInput::isNumeric(directKey) && !icon_painted) + if (active && isNumeric && !icon_painted) { int number_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(CRCInput::getKeyName(directKey)); @@ -283,15 +324,94 @@ void CMenuItem::paintItemButton(const bool select_mode, const int &item_height, } //get data of number right info icon and paint - if (!iconName_Info_right.empty()) + if (iconName_Info_right) { - frameBuffer->getIconSize(iconName_Info_right.c_str(), &icon_w, &icon_h); + frameBuffer->getIconSize(iconName_Info_right, &icon_w, &icon_h); - if (/* active && */ icon_w>0 && icon_h>0) + if (icon_w>0 && icon_h>0) + { icon_painted = frameBuffer->paintIcon(iconName_Info_right, dx + icon_start_x - (icon_w + 20), y+ ((item_height/2- icon_h/2)) ); + } } } +void CMenuItem::setIconName() +{ + iconName = NULL; + + switch (directKey & ~CRCInput::RC_Repeat) { + case CRCInput::RC_red: + iconName = NEUTRINO_ICON_BUTTON_RED; + break; + case CRCInput::RC_green: + iconName = NEUTRINO_ICON_BUTTON_GREEN; + break; + case CRCInput::RC_yellow: + iconName = NEUTRINO_ICON_BUTTON_YELLOW; + break; + case CRCInput::RC_blue: + iconName = NEUTRINO_ICON_BUTTON_BLUE; + break; + case CRCInput::RC_standby: + iconName = NEUTRINO_ICON_BUTTON_POWER; + break; + case CRCInput::RC_setup: + iconName = NEUTRINO_ICON_BUTTON_MENU_SMALL; + break; + case CRCInput::RC_help: + iconName = NEUTRINO_ICON_BUTTON_HELP_SMALL; + break; + case CRCInput::RC_info: + iconName = NEUTRINO_ICON_BUTTON_INFO_SMALL; + break; + case CRCInput::RC_stop: + iconName = NEUTRINO_ICON_BUTTON_STOP; + break; + case CRCInput::RC_0: + iconName = NEUTRINO_ICON_BUTTON_0; + break; + case CRCInput::RC_1: + iconName = NEUTRINO_ICON_BUTTON_1; + break; + case CRCInput::RC_2: + iconName = NEUTRINO_ICON_BUTTON_2; + break; + case CRCInput::RC_3: + iconName = NEUTRINO_ICON_BUTTON_3; + break; + case CRCInput::RC_4: + iconName = NEUTRINO_ICON_BUTTON_4; + break; + case CRCInput::RC_5: + iconName = NEUTRINO_ICON_BUTTON_5; + break; + case CRCInput::RC_6: + iconName = NEUTRINO_ICON_BUTTON_6; + break; + case CRCInput::RC_7: + iconName = NEUTRINO_ICON_BUTTON_7; + break; + case CRCInput::RC_8: + iconName = NEUTRINO_ICON_BUTTON_8; + break; + case CRCInput::RC_9: + iconName = NEUTRINO_ICON_BUTTON_9; + break; + } +} + +void CMenuItem::setName(const std::string& t) +{ + name = NONEXISTANT_LOCALE; + nameString = t; +} + +void CMenuItem::setName(const neutrino_locale_t t) +{ + name = t; + nameString = ""; +} + const char *CMenuItem::getName(void) { if (name != NONEXISTANT_LOCALE) @@ -299,6 +419,40 @@ const char *CMenuItem::getName(void) return nameString.c_str(); } +void CMenuItem::setDescription(const std::string& t) +{ + desc = NONEXISTANT_LOCALE; + descString = t; + getHeight(); +} + +void CMenuItem::setDescription(const neutrino_locale_t t) +{ + desc = t; + descString = ""; + getHeight(); +} + +const char *CMenuItem::getDescription(void) +{ + if (desc != NONEXISTANT_LOCALE) + return g_Locale->getText(desc); + return descString.c_str(); +} + +int CMenuItem::getDescriptionHeight(void) +{ + if (*getDescription()) + return g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]->getHeight(); + return 0; +} + +int CMenuItem::getHeight(void) +{ + height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight() + getDescriptionHeight(); + return height; +} + //small helper class to manage values e.g.: handling needed but deallocated widget objects CMenuGlobal::CMenuGlobal() { @@ -325,45 +479,44 @@ CMenuGlobal* CMenuGlobal::getInstance() CMenuWidget::CMenuWidget() { - nameString = g_Locale->getText(NONEXISTANT_LOCALE); + nameString = g_Locale->getText(NONEXISTANT_LOCALE); name = NONEXISTANT_LOCALE; - iconfile = ""; - selected = -1; - iconOffset = 0; + iconfile = ""; + selected = -1; + iconOffset = 0; offx = offy = 0; from_wizard = false; fade = true; sb_width = 0; - sb_height = 0; savescreen = false; background = NULL; preselected = -1; - details_line = NULL; - info_box = NULL; + details_line = NULL; + info_box = NULL; show_details_line = true; } CMenuWidget::CMenuWidget(const neutrino_locale_t Name, const std::string & Icon, const int mwidth, const mn_widget_id_t &w_index) { name = Name; - nameString = g_Locale->getText(Name); + nameString = g_Locale->getText(Name); preselected = -1; Init(Icon, mwidth, w_index); } -CMenuWidget::CMenuWidget(const char* Name, const std::string & Icon, const int mwidth, const mn_widget_id_t &w_index) +CMenuWidget::CMenuWidget(const std::string &Name, const std::string & Icon, const int mwidth, const mn_widget_id_t &w_index) { name = NONEXISTANT_LOCALE; - nameString = Name; + nameString = Name; preselected = -1; Init(Icon, mwidth, w_index); } -void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widget_id_t &w_index) +void CMenuWidget::Init(const std::string &Icon, const int mwidth, const mn_widget_id_t &w_index) { mglobal = CMenuGlobal::getInstance(); //create CMenuGlobal instance only here - frameBuffer = CFrameBuffer::getInstance(); - iconfile = Icon; + frameBuffer = CFrameBuffer::getInstance(); + iconfile = Icon; details_line = new CComponentsDetailLine(); show_details_line = true; info_box = new CComponentsInfoBox(); @@ -379,9 +532,6 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg widget_index = w_index; } - //set default preselected if value = -1 (no selected). If value has changed, e.g. with setSelected(), then use current value - preselected = preselected != -1 ? preselected : -1; - //overwrite preselected value with global select value selected = (widget_index == NO_WIDGET_ID ? preselected : mglobal->v_selected[widget_index]); @@ -401,7 +551,7 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg min_width = frameBuffer->getScreenWidth(); } - current_page = 0; + current_page = 0; offx = offy = 0; from_wizard = false; fade = true; @@ -410,9 +560,9 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg has_hints = false; hint_painted = false; hint_height = 0; - hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fbutton_count = 0; fbutton_labels = NULL; + fbutton_width = 0; fbutton_height = 0; } @@ -450,10 +600,8 @@ void CMenuWidget::resetWidget(bool delete_items) { for(unsigned int count=0;countisStatic && delete_items) { + if (delete_items && !item->isStatic) delete item; - item = NULL; - } } items.clear(); @@ -469,6 +617,10 @@ void CMenuWidget::insertItem(const uint& item_id, CMenuItem* menuItem) void CMenuWidget::removeItem(const uint& item_id) { items.erase(items.begin()+item_id); + if ((unsigned int) selected >= items.size()) + selected = items.size() - 1; + while (selected > 0 && !items[selected]->active) + selected--; } bool CMenuWidget::hasItem() @@ -479,35 +631,29 @@ bool CMenuWidget::hasItem() int CMenuWidget::getItemId(CMenuItem* menuItem) { for (uint i= 0; i< items.size(); i++) - { if (items[i] == menuItem) return i; - } - return -1; } CMenuItem* CMenuWidget::getItem(const uint& item_id) { for (uint i= 0; i< items.size(); i++) - { if (i == item_id) return items[i]; - } - return NULL; } -std::string CMenuWidget::getName() +const char *CMenuWidget::getName() { if (name != NONEXISTANT_LOCALE) - nameString = g_Locale->getText(name); - return nameString; + return g_Locale->getText(name); + return nameString.c_str(); } int CMenuWidget::exec(CMenuTarget* parent, const std::string &) { - neutrino_msg_t msg; + neutrino_msg_t msg; neutrino_msg_data_t data; bool bAllowRepeatLR = false; CVFD::MODES oldLcdMode = CVFD::getInstance()->getMode(); @@ -515,9 +661,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) int pos = 0; if (selected > 0 && selected < (int)items.size()) pos = selected; - else if (selected >= (int)items.size()) + else selected = -1; - exit_pressed = false; frameBuffer->Lock(); @@ -550,12 +695,16 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) saveScreen(); } paint(); + frameBuffer->blit(); + int retval = menu_return::RETURN_REPAINT; uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); + bool bAllowRepeatLR_override = keyActionMap.find(CRCInput::RC_left) != keyActionMap.end() || keyActionMap.find(CRCInput::RC_right) != keyActionMap.end(); do { if(hasItem() && selected >= 0 && (int)items.size() > selected ) bAllowRepeatLR = items[selected]->isMenueOptionChooser(); + bAllowRepeatLR |= bAllowRepeatLR_override; g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd, bAllowRepeatLR); @@ -592,7 +741,10 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) selected= i; paintHint(selected); pos = selected; - msg= CRCInput::RC_ok; + if (titem->directKeyOK) + msg = CRCInput::RC_ok; + else + msg = CRCInput::RC_nokey; } else { // swallow-key... handled= true; @@ -601,9 +753,9 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) } } #if 0 - if (msg == (uint32_t) g_settings.key_channelList_pageup) + if (msg == (uint32_t) g_settings.key_pageup) msg = CRCInput::RC_page_up; - else if (msg == (uint32_t) g_settings.key_channelList_pagedown) + else if (msg == (uint32_t) g_settings.key_pagedown) msg = CRCInput::RC_page_down; #endif } @@ -627,6 +779,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) case CRCInput::RC_page_down: case CRCInput::RC_up: case CRCInput::RC_down: + case CRCInput::RC_nokey: { /* dir and wrap are used when searching for a selectable item: * if the item is not selectable, try the previous (dir = -1) or @@ -635,6 +788,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) int dir = 1; bool wrap = false; switch (msg) { + case CRCInput::RC_nokey: + break; case CRCInput::RC_page_up: if (current_page) { pos = page_start[current_page] - 1; @@ -657,6 +812,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) pos -= dir * items.size(); wrap = true; } + if (pos >= (int)items.size()) + pos = (int)items.size() - 1; do { CMenuItem* item = items[pos]; if (item->isSelectable()) { @@ -769,11 +926,14 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) // recalculate timeout for RC-keys timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); } + frameBuffer->blit(); } while ( msg!=CRCInput::RC_timeout ); hide(); - delete[] background; - background = NULL; + if (background) { + delete[] background; + background = NULL; + } fader.StopFade(); @@ -801,10 +961,11 @@ void CMenuWidget::hide() if(savescreen && background) restoreScreen();//FIXME else { - frameBuffer->paintBackgroundBoxRel(x, y, full_width, full_height); + frameBuffer->paintBackgroundBoxRel(x, y, full_width, full_height + fbutton_height); //paintHint(-1); } paintHint(-1); + frameBuffer->blit(); /* setActive() paints item for hidden parent menu, if called from child menu */ for (unsigned int count = 0; count < items.size(); count++) @@ -817,7 +978,7 @@ void CMenuWidget::checkHints() { GenericMenuBack->setHint("", NONEXISTANT_LOCALE); for (unsigned int i= 0; i< items.size(); i++) { - if(!items[i]->hintIcon.empty() || items[i]->hint != NONEXISTANT_LOCALE || !items[i]->hintText.empty()) { + if(items[i]->hintIcon || items[i]->hint != NONEXISTANT_LOCALE || !items[i]->hintText.empty()) { has_hints = true; break; } @@ -828,16 +989,13 @@ void CMenuWidget::checkHints() void CMenuWidget::calcSize() { - if (name != NONEXISTANT_LOCALE) - nameString = g_Locale->getText(name); - width = min_width; int wi, hi; for (unsigned int i= 0; i< items.size(); i++) { wi = 0; - if (!items[i]->iconName_Info_right.empty()) { - frameBuffer->getIconSize(items[i]->iconName_Info_right.c_str(), &wi, &hi); + if (items[i]->iconName_Info_right) { + frameBuffer->getIconSize(items[i]->iconName_Info_right, &wi, &hi); if ((wi > 0) && (hi > 0)) wi += 10; else @@ -860,16 +1018,15 @@ void CMenuWidget::calcSize() } /* set the max height to 9/10 of usable screen height debatable, if the callers need a possibility to set this */ - height = (frameBuffer->getScreenHeight() - hint_height) / 20 * 18; /* make sure its a multiple of 2 */ + height = (frameBuffer->getScreenHeight() - fbutton_height - hint_height) / 20 * 18; /* make sure its a multiple of 2 */ if(height > ((int)frameBuffer->getScreenHeight() - 10)) height = frameBuffer->getScreenHeight() - 10; - int neededWidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(nameString); + int neededWidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(getName()); if (neededWidth > width-48) { width= neededWidth+ 49; } - //reinit header height, 1st init happens in Init() hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); int itemHeightTotal=0; @@ -877,49 +1034,53 @@ void CMenuWidget::calcSize() page_start.clear(); page_start.push_back(0); total_pages=1; + for (unsigned int i= 0; i< items.size(); i++) { int item_height=items[i]->getHeight(); heightCurrPage+=item_height; - if(heightCurrPage > (height-hheight-fbutton_height)) { + if(heightCurrPage > (height-hheight)) { page_start.push_back(i); total_pages++; heightCurrPage=item_height; } - if (heightCurrPage > itemHeightTotal) - itemHeightTotal = heightCurrPage; + if(total_pages == 1) + itemHeightTotal+=item_height; } page_start.push_back(items.size()); iconOffset= 0; - for (unsigned int i= 0; i< items.size(); i++) { - if ((!(items[i]->iconName.empty())) || CRCInput::isNumeric(items[i]->directKey)) + for (unsigned int i= 0; i< items.size(); i++) + if (items[i]->iconName && (/*!g_settings.menu_numbers_as_icons ||*/ !CRCInput::isNumeric(items[i]->directKey))) { - const char *tmp; - if (items[i]->iconName.empty()) - tmp = CRCInput::getKeyName(items[i]->directKey).c_str(); - else - tmp = items[i]->iconName.c_str(); int w, h; - frameBuffer->getIconSize(tmp, &w, &h); + frameBuffer->getIconSize(items[i]->iconName, &w, &h); if (w > iconOffset) iconOffset = w; } - } iconOffset += 10; width += iconOffset; + + int maxItemHeight = 0; + if (total_pages > 1) { + for (unsigned int i= 0; i< items.size(); i++) + maxItemHeight = std::max(maxItemHeight, items[i]->getHeight()); + itemHeightTotal = items.size() * maxItemHeight; + } + if (fbutton_count) + width = std::max(width, fbutton_width); + if (width > (int)frameBuffer->getScreenWidth()) width = frameBuffer->getScreenWidth(); // shrink menu if less items - if (hheight + itemHeightTotal + fbutton_height < height) - height = hheight + itemHeightTotal + fbutton_height; + if(hheight+itemHeightTotal < height) + height=hheight+itemHeightTotal; - //scrollbar + //scrollbar width sb_width=0; if(total_pages > 1) sb_width=15; - sb_height=itemHeightTotal; full_width = /*ConnectLineBox_Width+*/width+sb_width+SHADOW_OFFSET; full_height = height+RADIUS_LARGE+SHADOW_OFFSET*2 /*+hint_height+INFO_BOX_Y_OFFSET*/; @@ -934,7 +1095,7 @@ void CMenuWidget::calcSize() full_width = max_possible + center_offset; /* symmetry in MENU_POS_CENTER case */ } - setMenuPos(width + sb_width); + setMenuPos(full_width); } void CMenuWidget::paint() @@ -943,26 +1104,21 @@ void CMenuWidget::paint() CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8 /*, nameString.c_str()*/); // paint head - CComponentsHeader header(x, y, width + sb_width, hheight, nameString, iconfile); + CComponentsHeader header(x, y, width + sb_width, hheight, getName(), iconfile); header.setShadowOnOff(CC_SHADOW_ON); header.setOffset(10); header.paint(CC_SAVE_SCREEN_NO); // paint body shadow - frameBuffer->paintBoxRel(x+SHADOW_OFFSET, y + hheight + SHADOW_OFFSET, width + sb_width, height - hheight + RADIUS_LARGE, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x+SHADOW_OFFSET, y + hheight + SHADOW_OFFSET, width + sb_width, height - hheight + (fbutton_count ? fbutton_height : RADIUS_LARGE), COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); // paint body background - frameBuffer->paintBoxRel(x, y + hheight, width + sb_width, height - hheight + RADIUS_LARGE - fbutton_height, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, (fbutton_count ? 0 /*CORNER_NONE*/ : CORNER_BOTTOM)); + frameBuffer->paintBoxRel(x, y+hheight, width + sb_width, height-hheight + RADIUS_LARGE, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); item_start_y = y+hheight; paintItems(); washidden = false; - if (fbutton_count){ - int y_footer = y + height + RADIUS_LARGE - fbutton_height; - int w_footer = width + sb_width; - CComponentsFooter footer(x, y_footer, w_footer, fbutton_height); - footer.setButtonLabels(fbutton_labels, fbutton_count, 0, (w_footer/max(fbutton_count, 4)+2)-20); - footer.paint(CC_SAVE_SCREEN_NO); - } + if (fbutton_count) + ::paintButtons(x, y + height, width + sb_width, fbutton_count, fbutton_labels, width, fbutton_height); } void CMenuWidget::setMenuPos(const int& menu_width) @@ -972,7 +1128,7 @@ void CMenuWidget::setMenuPos(const int& menu_width) int scr_w = frameBuffer->getScreenWidth(); int scr_h = frameBuffer->getScreenHeight(); - int real_h = full_height + hint_height; + int real_h = full_height + fbutton_height + hint_height; //configured positions switch(g_settings.menu_pos) @@ -980,26 +1136,29 @@ void CMenuWidget::setMenuPos(const int& menu_width) case MENU_POS_CENTER: x = offx + scr_x + ((scr_w - menu_width ) >> 1 ); y = offy + scr_y + ((scr_h - real_h) >> 1 ); + x += ConnectLineBox_Width; break; case MENU_POS_TOP_LEFT: y = offy + scr_y + 10; x = offx + scr_x + 10; + x += ConnectLineBox_Width; break; case MENU_POS_TOP_RIGHT: y = offy + scr_y + 10; - x = offx + scr_x + scr_w - menu_width - 10; + x = /*offx +*/ scr_x + scr_w - menu_width - 10; break; case MENU_POS_BOTTOM_LEFT: - y = offy + scr_y + scr_h - real_h - 10; + y = /*offy +*/ scr_y + scr_h - real_h - 10; x = offx + scr_x + 10; + x += ConnectLineBox_Width; break; case MENU_POS_BOTTOM_RIGHT: - y = offy + scr_y + scr_h - real_h - 10; - x = offx + scr_x + scr_w - menu_width - 10; + y = /*offy +*/ scr_y + scr_h - real_h - 10; + x = /*offx +*/ scr_x + scr_w - menu_width - 10; break; } } @@ -1018,11 +1177,12 @@ void CMenuWidget::paintItems() // Scrollbar if(total_pages>1) { - frameBuffer->paintBoxRel(x+ width,item_start_y, sb_width, sb_height, COL_MENUCONTENT_PLUS_1, RADIUS_MIN); - frameBuffer->paintBoxRel(x+ width +2, item_start_y+ 2+ current_page*(sb_height-4)/total_pages, sb_width-4, (sb_height-4)/total_pages, COL_MENUCONTENT_PLUS_3, RADIUS_MIN); + int item_height=height-(item_start_y-y); + frameBuffer->paintBoxRel(x+ width,item_start_y, 15, item_height, COL_MENUCONTENT_PLUS_1, RADIUS_MIN); + frameBuffer->paintBoxRel(x+ width +2, item_start_y+ 2+ current_page*(item_height-4)/total_pages, 11, (item_height-4)/total_pages, COL_MENUCONTENT_PLUS_3, RADIUS_MIN); /* background of menu items, paint every time because different items can have * different height and this might leave artifacts otherwise after changing pages */ - frameBuffer->paintBoxRel(x,item_start_y, width, sb_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x,item_start_y, width,item_height, COL_MENUCONTENT_PLUS_0); } int ypos=item_start_y; for (int count = 0; count < (int)items.size(); count++) @@ -1063,21 +1223,17 @@ void CMenuWidget::addIntroItems(neutrino_locale_t subhead_text, neutrino_locale_ addItem(GenericMenuSeparator); - if (buttontype != BTN_TYPE_NO) - { - switch (buttontype) - { - case BTN_TYPE_BACK: - GenericMenuBack->setItemButton(!g_settings.menu_left_exit ? NEUTRINO_ICON_BUTTON_HOME : NEUTRINO_ICON_BUTTON_LEFT); - addItem(GenericMenuBack); - break; - case BTN_TYPE_CANCEL: - addItem(GenericMenuCancel); - break; - case BTN_TYPE_NEXT: - addItem(GenericMenuNext); - break; - } + switch (buttontype) { + case BTN_TYPE_BACK: + GenericMenuBack->setItemButton(!g_settings.menu_left_exit ? NEUTRINO_ICON_BUTTON_HOME : NEUTRINO_ICON_BUTTON_LEFT); + addItem(GenericMenuBack); + break; + case BTN_TYPE_CANCEL: + addItem(GenericMenuCancel); + break; + case BTN_TYPE_NEXT: + addItem(GenericMenuNext); + break; } if (section_text != NONEXISTANT_LOCALE) @@ -1095,14 +1251,14 @@ void CMenuWidget::saveScreen() background = new fb_pixel_t [full_width * full_height]; if(background) - frameBuffer->SaveScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height, background); + frameBuffer->SaveScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height + fbutton_height, background); } void CMenuWidget::restoreScreen() { if(background) { if(savescreen) - frameBuffer->RestoreScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height, background); + frameBuffer->RestoreScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height + fbutton_height, background); } } @@ -1137,7 +1293,7 @@ void CMenuWidget::paintHint(int pos) CMenuItem* item = items[pos]; - if (item->hintIcon.empty() && item->hint == NONEXISTANT_LOCALE && item->hintText.empty()) { + if (!item->hintIcon && item->hint == NONEXISTANT_LOCALE && item->hintText.empty()) { if (info_box) { savescreen ? info_box->hide(false) : info_box->kill(); hint_painted = false; @@ -1151,7 +1307,7 @@ void CMenuWidget::paintHint(int pos) int iheight = item->getHeight(); int rad = RADIUS_LARGE; int xpos = x - ConnectLineBox_Width; - int ypos2 = y + height + rad + SHADOW_OFFSET + INFO_BOX_Y_OFFSET; + int ypos2 = y + height + fbutton_height + rad + SHADOW_OFFSET + INFO_BOX_Y_OFFSET; int iwidth = width+sb_width; //init details line and infobox dimensions @@ -1182,7 +1338,7 @@ void CMenuWidget::paintHint(int pos) info_box->syncSysColors(); info_box->setColorBody(COL_MENUCONTENTDARK_PLUS_0); info_box->setShadowOnOff(CC_SHADOW_ON); - info_box->setPicture(item->hintIcon); + info_box->setPicture(item->hintIcon ? item->hintIcon : ""); } //paint result @@ -1203,70 +1359,72 @@ void CMenuWidget::setFooter(const struct button_label *_fbutton_labels, const in { fbutton_count = _fbutton_count; fbutton_labels = _fbutton_labels; - fbutton_height = hheight;//g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; // init min buttonbar height + fbutton_width = 0; + fbutton_height = 0; + if (fbutton_count) + paintButtons(fbutton_labels, fbutton_count, 0, 0, 0, 0, 0, false, &fbutton_width, &fbutton_height); if (repaint) paint(); } //------------------------------------------------------------------------------------------------------------------------------- -CMenuOptionNumberChooser::CMenuOptionNumberChooser( const neutrino_locale_t Name, - int * const OptionValue, - const bool Active, - const int min_value, - const int max_value, - CChangeObserver * const Observ, - const int print_offset, - const int special_value, - const neutrino_locale_t special_value_name, - bool sliderOn) +CMenuOptionNumberChooser::CMenuOptionNumberChooser(const neutrino_locale_t Name, int * const OptionValue, const bool Active, + const int min_value, const int max_value, + CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const char * const IconName, + const int print_offset, const int special_value, const neutrino_locale_t special_value_name, bool sliderOn) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - initMenuOptionNumberChooser("", Name, OptionValue, Active, min_value, max_value, Observ, print_offset, special_value, special_value_name, sliderOn); + name = Name; + optionValue = OptionValue; + + lower_bound = min_value; + upper_bound = max_value; + + display_offset = print_offset; + + localized_value = special_value; + localized_value_name = special_value_name; + + display_offset = print_offset; + nameString = ""; + numberFormat = "%d"; + numberFormatFunction = NULL; + observ = Observ; + slider_on = sliderOn; + + numeric_input = false; + + directKeyOK = false; } -CMenuOptionNumberChooser::CMenuOptionNumberChooser( const std::string &Name, - int * const OptionValue, - const bool Active, - const int min_value, - const int max_value, - CChangeObserver * const Observ, - const int print_offset, - const int special_value, - const neutrino_locale_t special_value_name, - bool sliderOn) +CMenuOptionNumberChooser::CMenuOptionNumberChooser(const std::string &Name, int * const OptionValue, const bool Active, + const int min_value, const int max_value, + CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const char * const IconName, + const int print_offset, const int special_value, const neutrino_locale_t special_value_name, bool sliderOn) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - initMenuOptionNumberChooser(Name, NONEXISTANT_LOCALE, OptionValue, Active, min_value, max_value, Observ, print_offset, special_value, special_value_name, sliderOn); -} + name = NONEXISTANT_LOCALE; + optionValue = OptionValue; -void CMenuOptionNumberChooser::initMenuOptionNumberChooser( const std::string &s_name, - const neutrino_locale_t l_name, - int * const OptionValue, - const bool Active, - const int min_value, - const int max_value, - CChangeObserver * const Observ, - const int print_offset, - const int special_value, - const neutrino_locale_t special_value_name, - bool sliderOn) -{ - height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - nameString = s_name; - name = l_name; - optionValue = OptionValue; - active = Active; - lower_bound = min_value; - upper_bound = max_value; - observ = Observ; - display_offset = print_offset; - localized_value = special_value; - localized_value_name = special_value_name; - slider_on = sliderOn; + lower_bound = min_value; + upper_bound = max_value; - numberFormat = "%d"; - numberFormatFunction = NULL; - numeric_input = false; + display_offset = print_offset; + + localized_value = special_value; + localized_value_name = special_value_name; + + nameString = Name; + numberFormat = "%d"; + numberFormatFunction = NULL; + observ = Observ; + slider_on = sliderOn; + + numeric_input = false; + + directKeyOK = false; } int CMenuOptionNumberChooser::exec(CMenuTarget*) @@ -1301,18 +1459,20 @@ int CMenuOptionNumberChooser::exec(CMenuTarget*) else (*optionValue)++; } -#if ENABLE_LUA + + bool wantsRepaint = false; if(observ && !luaAction.empty()) { // optionValue is int* - observ->changeNotify(luaState, luaAction, luaId, (void *) to_string(*optionValue).c_str()); - } else -#endif - if(observ) - observ->changeNotify(name, optionValue); + wantsRepaint = observ->changeNotify(luaState, luaAction, luaId, (void *) to_string(*optionValue).c_str()); + } else if(observ) + wantsRepaint = observ->changeNotify(name, optionValue); // give the observer a chance to modify the value paint(true); + if (wantsRepaint) + res = menu_return::RETURN_REPAINT; + return res; } @@ -1325,7 +1485,7 @@ int CMenuOptionNumberChooser::paint(bool selected) { if (numberFormatFunction) { std::string s = numberFormatFunction(*optionValue + display_offset); - strncpy(option_value, s.c_str(), s.length()); + strncpy(option_value, s.c_str(), sizeof(option_value)); } else sprintf(option_value, numberFormat.c_str(), *optionValue + display_offset); l_option = option_value; @@ -1339,9 +1499,9 @@ int CMenuOptionNumberChooser::paint(bool selected) //paint item icon paintItemButton(selected, height, NEUTRINO_ICON_BUTTON_OKAY); if(slider_on) - paintItemSlider( selected, height, *optionValue, (upper_bound - lower_bound) , getName(), l_option); + paintItemSlider(selected, height, *optionValue, (upper_bound - lower_bound), getName(), l_option); //paint text - paintItemCaption(selected, height , getName(), l_option); + paintItemCaption(selected, l_option); return y+height; } @@ -1380,26 +1540,25 @@ int CMenuOptionNumberChooser::getWidth(void) width += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(format) - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("0"); } - return width + 10; /* min 10 pixels between option name and value. enough? */ + width += 10; /* min 10 pixels between option name and value. enough? */ + + const char *desc_text = getDescription(); + if (*desc_text) + width = std::max(width, 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(desc_text)); + return width; } -//------------------------------------------------------------------------------------------------------------------------------- - -CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, - int * const OptionValue, - const struct keyval * const Options, - const unsigned Number_Of_Options, - const bool Active, - CChangeObserver * const Observ, - const neutrino_msg_t DirectKey, - const std::string & IconName, - bool Pulldown, - bool OptionsSort) +CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, int * const OptionValue, const struct keyval * const Options, const unsigned Number_Of_Options, + const bool Active, CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - initVarOptionChooser("", OptionName, OptionValue, Active, Observ, DirectKey, IconName, Pulldown, OptionsSort); - + nameString = ""; + name = OptionName; + optionValue = OptionValue; number_of_options = Number_Of_Options; - + observ = Observ; + pulldown = Pulldown; + optionsSort = OptionsSort; for (unsigned int i = 0; i < number_of_options; i++) { struct keyval_ext opt; @@ -1408,21 +1567,17 @@ CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, } } -CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, - int * const OptionValue, - const struct keyval * const Options, - const unsigned Number_Of_Options, - const bool Active, - CChangeObserver * const Observ, - neutrino_msg_t DirectKey, - const std::string & IconName, - bool Pulldown, - bool OptionsSort) +CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, int * const OptionValue, const struct keyval * const Options, const unsigned Number_Of_Options, + const bool Active, CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - initVarOptionChooser(OptionName, NONEXISTANT_LOCALE, OptionValue, Active, Observ, DirectKey, IconName, Pulldown, OptionsSort); - + nameString = OptionName; + name = NONEXISTANT_LOCALE; + optionValue = OptionValue; number_of_options = Number_Of_Options; - + observ = Observ; + pulldown = Pulldown; + optionsSort = OptionsSort; for (unsigned int i = 0; i < number_of_options; i++) { struct keyval_ext opt; @@ -1431,94 +1586,66 @@ CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, } } -CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, - int * const OptionValue, - const struct keyval_ext * const Options, - const unsigned Number_Of_Options, - const bool Active, - CChangeObserver * const Observ, - const neutrino_msg_t DirectKey, - const std::string & IconName, - bool Pulldown, - bool OptionsSort) +CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, int * const OptionValue, const struct keyval_ext * const Options, + const unsigned Number_Of_Options, const bool Active, CChangeObserver * const Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - initVarOptionChooser("", OptionName, OptionValue, Active, Observ, DirectKey, IconName, Pulldown, OptionsSort); - + nameString = ""; + name = OptionName; + optionValue = OptionValue; number_of_options = Number_Of_Options; - + observ = Observ; + pulldown = Pulldown; + optionsSort = OptionsSort; for (unsigned int i = 0; i < number_of_options; i++) options.push_back(Options[i]); } -CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, - int * const OptionValue, - const struct keyval_ext * const Options, - const unsigned Number_Of_Options, - const bool Active, - CChangeObserver * const Observ, - const neutrino_msg_t DirectKey, - const std::string & IconName, - bool Pulldown, - bool OptionsSort) +CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, int * const OptionValue, const struct keyval_ext * const Options, + const unsigned Number_Of_Options, const bool Active, CChangeObserver * const Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - initVarOptionChooser(OptionName, NONEXISTANT_LOCALE, OptionValue, Active, Observ, DirectKey, IconName, Pulldown, OptionsSort); - + nameString = OptionName; + name = NONEXISTANT_LOCALE; + optionValue = OptionValue; number_of_options = Number_Of_Options; - + observ = Observ; + pulldown = Pulldown; + optionsSort = OptionsSort; for (unsigned int i = 0; i < number_of_options; i++) options.push_back(Options[i]); } -CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, - int * const OptionValue, - std::vector &Options, - const bool Active, - CChangeObserver * const Observ, - const neutrino_msg_t DirectKey, - const std::string & IconName, - bool Pulldown, - bool OptionsSort) +CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, int * const OptionValue, std::vector &Options, + const bool Active, CChangeObserver * const Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - initVarOptionChooser("", OptionName, OptionValue, Active, Observ, DirectKey, IconName, Pulldown, OptionsSort); - - options = Options; + nameString = ""; + name = OptionName; + optionValue = OptionValue; + options = Options; + number_of_options = options.size(); + observ = Observ; + pulldown = Pulldown; + optionsSort = OptionsSort; } -CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, - int * const OptionValue, - std::vector &Options, - const bool Active, - CChangeObserver * const Observ, - const neutrino_msg_t DirectKey, - const std::string & IconName, - bool Pulldown, - bool OptionsSort) +CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, int * const OptionValue, std::vector &Options, + const bool Active, CChangeObserver * const Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown, bool OptionsSort) + : CAbstractMenuOptionChooser(Active, DirectKey, IconName) { - initVarOptionChooser(OptionName, NONEXISTANT_LOCALE, OptionValue, Active, Observ, DirectKey, IconName, Pulldown, OptionsSort); - - options = Options; -} - -void CMenuOptionChooser::initVarOptionChooser( const std::string &OptionName, - const neutrino_locale_t Name, - int * const OptionValue, - const bool Active, - CChangeObserver * const Observ, - neutrino_msg_t DirectKey, - const std::string & IconName, - bool Pulldown, - bool OptionsSort) -{ - height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - nameString = OptionName; - name = Name; - optionValue = OptionValue; - active = Active; - observ = Observ; - directKey = DirectKey; - iconName = IconName; - pulldown = Pulldown; - optionsSort = OptionsSort; + nameString = OptionName; + name = NONEXISTANT_LOCALE; + optionValue = OptionValue; + options = Options; + number_of_options = options.size(); + observ = Observ; + pulldown = Pulldown; + optionsSort = OptionsSort; } CMenuOptionChooser::~CMenuOptionChooser() @@ -1526,6 +1653,36 @@ CMenuOptionChooser::~CMenuOptionChooser() clearChooserOptions(); } +void CMenuOptionChooser::initVarOptionChooser( const std::string &OptionName, + const neutrino_locale_t Name, + int * const OptionValue, + const bool Active, + CChangeObserver * const Observ, + neutrino_msg_t DirectKey, + const char * IconName, + bool Pulldown, + bool OptionsSort) +{ + height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + nameString = OptionName; + name = Name; + optionValue = OptionValue; + active = Active; + observ = Observ; + directKey = DirectKey; + iconName = IconName; + pulldown = Pulldown; + optionsSort = OptionsSort; +} + +void CMenuOptionChooser::clearChooserOptions() +{ + for (std::vector::iterator it = option_chooser_options_v.begin(); it != option_chooser_options_v.end(); ++it) + delete *it; + + option_chooser_options_v.clear(); +} + void CMenuOptionChooser::setOptions(const struct keyval * const Options, const unsigned Number_Of_Options) { options.clear(); @@ -1560,26 +1717,18 @@ int CMenuOptionChooser::getOption(void) const return *optionValue; } -void CMenuOptionChooser::clearChooserOptions() -{ - for (std::vector::iterator it = option_chooser_options_v.begin(); it != option_chooser_options_v.end(); ++it) - delete *it; - - option_chooser_options_v.clear(); -} int CMenuOptionChooser::exec(CMenuTarget*) { bool wantsRepaint = false; int ret = menu_return::RETURN_NONE; -#if ENABLE_LUA char *optionValname = NULL; -#endif + if (optionsSort) { optionsSort = false; clearChooserOptions(); unsigned int i1; - for (i1 = 0; i1 < number_of_options; i1++) + for (i1 = 0; i1 < number_of_options; i1++) { CMenuOptionChooserOptions* co = new CMenuOptionChooserOptions(); co->key = options[i1].key; @@ -1602,10 +1751,11 @@ int CMenuOptionChooser::exec(CMenuTarget*) if((msg == CRCInput::RC_ok) && pulldown) { int select = -1; CMenuWidget* menu = new CMenuWidget(getName(), NEUTRINO_ICON_SETTINGS); + menu->enableFade(false); /* FIXME: BACK button with hints enabled - parent menu getting holes, possible solution * to hide parent, or add hints ? */ menu->addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); -// menu->move(20, 0); + // menu->move(20, 0); CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); for(unsigned int count = 0; count < number_of_options; count++) { @@ -1627,9 +1777,7 @@ int CMenuOptionChooser::exec(CMenuTarget*) if(select >= 0) { *optionValue = options[select].key; -#if ENABLE_LUA optionValname = (char *) options[select].valname; -#endif } delete menu; delete selector; @@ -1638,35 +1786,26 @@ int CMenuOptionChooser::exec(CMenuTarget*) if (options[count].key == (*optionValue)) { if(msg == CRCInput::RC_left) { if(count > 0) -#if ENABLE_LUA optionValname = (char *) options[(count-1) % number_of_options].valname, -#endif - *optionValue = options[(count-1) % number_of_options].key; + *optionValue = options[(count-1) % number_of_options].key; else -#if ENABLE_LUA optionValname = (char *) options[number_of_options-1].valname, -#endif - *optionValue = options[number_of_options-1].key; + *optionValue = options[number_of_options-1].key; } else -#if ENABLE_LUA optionValname = (char *) options[(count+1) % number_of_options].valname, -#endif - *optionValue = options[(count+1) % number_of_options].key; + *optionValue = options[(count+1) % number_of_options].key; break; } } } paint(true); -#if ENABLE_LUA if(observ && !luaAction.empty()) { if (optionValname) wantsRepaint = observ->changeNotify(luaState, luaAction, luaId, optionValname); - } else -#endif - if(observ) - wantsRepaint = observ->changeNotify(name, optionValue); + } else if(observ) + wantsRepaint = observ->changeNotify(name, optionValue); - if ( wantsRepaint ) + if (wantsRepaint) ret = menu_return::RETURN_REPAINT; return ret; @@ -1705,7 +1844,7 @@ int CMenuOptionChooser::paint( bool selected) paintItemButton(selected, height, NEUTRINO_ICON_BUTTON_OKAY); //paint text - paintItemCaption(selected, height , getName(), l_option); + paintItemCaption(selected, l_option); return y+height; } @@ -1719,59 +1858,43 @@ int CMenuOptionChooser::getWidth(void) for(unsigned int count = 0; count < options.size(); count++) { ow = 0; if (options[count].valname) - ow = g_Font[SNeutrinoSettings::FONT_TYPE_MENU] - ->getRenderWidth(options[count].valname); + ow = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(options[count].valname); else - ow = g_Font[SNeutrinoSettings::FONT_TYPE_MENU] - ->getRenderWidth(g_Locale->getText(options[count].value)); + ow = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(options[count].value)); if (tw + ow > width) width = tw + ow; } - return width + 10; /* min 10 pixels between option name and value. enough? */ + width += 10; /* min 10 pixels between option name and value. enough? */ + const char *desc_text = getDescription(); + if (*desc_text) + width = std::max(width, 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(desc_text)); + return width; } //------------------------------------------------------------------------------------------------------------------------------- -CMenuOptionStringChooser::CMenuOptionStringChooser(const neutrino_locale_t OptionName, - std::string* OptionValue, - bool Active, CChangeObserver* Observ, - const neutrino_msg_t DirectKey, - const std::string & IconName, - bool Pulldown) +CMenuOptionStringChooser::CMenuOptionStringChooser(const neutrino_locale_t OptionName, std::string* OptionValue, bool Active, CChangeObserver* Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown) + : CMenuItem(Active, DirectKey, IconName) { - initVarMenuOptionStringChooser("", OptionName, OptionValue, Active, Observ, DirectKey, IconName, Pulldown); + nameString = ""; + name = OptionName; + optionValuePtr = OptionValue ? OptionValue : &optionValue; + observ = Observ; + pulldown = Pulldown; } -CMenuOptionStringChooser::CMenuOptionStringChooser(const std::string &OptionName, - std::string* OptionValue, - bool Active, CChangeObserver* Observ, - const neutrino_msg_t DirectKey, - const std::string & IconName, - bool Pulldown) +CMenuOptionStringChooser::CMenuOptionStringChooser(const std::string &OptionName, std::string* OptionValue, bool Active, CChangeObserver* Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown) + : CMenuItem(Active, DirectKey, IconName) { - initVarMenuOptionStringChooser(OptionName, NONEXISTANT_LOCALE, OptionValue, Active, Observ, DirectKey, IconName, Pulldown); -} - -void CMenuOptionStringChooser::initVarMenuOptionStringChooser( const std::string &string_Name, - const neutrino_locale_t locale_Name, - std::string* OptionValue, - bool Active, - CChangeObserver* Observ, - const neutrino_msg_t DirectKey, - const std::string & IconName, - bool Pulldown) -{ - height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - nameString = string_Name; - name = locale_Name; - active = Active; - optionValueString = OptionValue; - observ = Observ; - directKey = DirectKey; - iconName = IconName; - pulldown = Pulldown; + nameString = OptionName; + name = NONEXISTANT_LOCALE; + optionValuePtr = OptionValue ? OptionValue : &optionValue; + observ = Observ; + pulldown = Pulldown; } @@ -1780,6 +1903,16 @@ CMenuOptionStringChooser::~CMenuOptionStringChooser() options.clear(); } +void CMenuOptionStringChooser::setTitle(std::string &Title) +{ + title = Title; +} + +void CMenuOptionStringChooser::setTitle(const neutrino_locale_t Title) +{ + title = g_Locale->getText(Title); +} + void CMenuOptionStringChooser::addOption(const std::string &value) { options.push_back(value); @@ -1801,35 +1934,36 @@ int CMenuOptionStringChooser::exec(CMenuTarget* parent) if (parent) parent->hide(); - const char *l_name = (name == NONEXISTANT_LOCALE) ? nameString.c_str() : g_Locale->getText(name); - CMenuWidget* menu = new CMenuWidget(l_name, NEUTRINO_ICON_SETTINGS); + std::string title_str = title.empty() ? getName() : title; + + CMenuWidget* menu = new CMenuWidget(title_str, NEUTRINO_ICON_SETTINGS); menu->addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL); //if(parent) menu->move(20, 0); CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); for(unsigned int count = 0; count < options.size(); count++) { - bool selected = optionValueString && (options[count] == *optionValueString); + bool selected = optionValuePtr && (options[count] == *optionValuePtr); CMenuForwarder *mn_option = new CMenuForwarder(options[count], true, NULL, selector, to_string(count).c_str()); mn_option->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true /*for selected item*/); menu->addItem(mn_option, selected); } menu->exec(NULL, ""); ret = menu_return::RETURN_REPAINT; - if(select >= 0 && optionValueString) - *optionValueString = options[select]; + if(select >= 0 && optionValuePtr) + *optionValuePtr = options[select]; delete menu; delete selector; } else { //select next value for(unsigned int count = 0; count < options.size(); count++) { - if (optionValueString && (options[count] == *optionValueString)) { + if (optionValuePtr && (options[count] == *optionValuePtr)) { if(msg == CRCInput::RC_left) { if(count > 0) - *optionValueString = options[(count - 1) % options.size()]; + *optionValuePtr = options[(count - 1) % options.size()]; else - *optionValueString = options[options.size() - 1]; + *optionValuePtr = options[options.size() - 1]; } else - *optionValueString = options[(count + 1) % options.size()]; + *optionValuePtr = options[(count + 1) % options.size()]; //wantsRepaint = true; break; } @@ -1837,13 +1971,10 @@ int CMenuOptionStringChooser::exec(CMenuTarget* parent) paint(true); } -#if ENABLE_LUA if(observ && !luaAction.empty()) - wantsRepaint = observ->changeNotify(luaState, luaAction, luaId, (void *)(optionValueString ? optionValueString->c_str() : "")); - else -#endif - if(observ) { - wantsRepaint = observ->changeNotify(name, (void *)(optionValueString ? optionValueString->c_str() : "")); + wantsRepaint = observ->changeNotify(luaState, luaAction, luaId, (void *)(optionValuePtr ? optionValuePtr->c_str() : "")); + else if(observ) { + wantsRepaint = observ->changeNotify(name, (void *)(optionValuePtr ? optionValuePtr->c_str() : "")); } if (wantsRepaint) ret = menu_return::RETURN_REPAINT; @@ -1853,8 +1984,6 @@ int CMenuOptionStringChooser::exec(CMenuTarget* parent) int CMenuOptionStringChooser::paint( bool selected ) { - const char *l_name = (name == NONEXISTANT_LOCALE) ? nameString.c_str() : g_Locale->getText(name); - //paint item prepareItem(selected, height); @@ -1862,127 +1991,66 @@ int CMenuOptionStringChooser::paint( bool selected ) paintItemButton(selected, height, NEUTRINO_ICON_BUTTON_OKAY); //paint text - paintItemCaption(selected, height , l_name, optionValueString->c_str()); + paintItemCaption(selected, optionValuePtr->c_str()); return y+height; } //------------------------------------------------------------------------------------------------------------------------------- - -CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, - const bool Active, - const std::string &Option, - CMenuTarget* Target, - const char * const ActionKey, - neutrino_msg_t DirectKey, - const char * const IconName, - const char * const IconName_Info_right, - bool IsStatic) +CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, + neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) + : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic) { - initVarMenuForwarder("", Text, Active, &Option, NULL, Target, ActionKey, DirectKey, IconName, IconName_Info_right, IsStatic); -} - -CMenuForwarder::CMenuForwarder(const std::string& Text, - const bool Active, - const std::string &Option, - CMenuTarget* Target, - const char * const ActionKey, - neutrino_msg_t DirectKey, - const char * const IconName, - const char * const IconName_Info_right, - bool IsStatic) -{ - initVarMenuForwarder(Text, NONEXISTANT_LOCALE, Active, &Option, NULL, Target, ActionKey, DirectKey, IconName, IconName_Info_right, IsStatic); -} - -CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, - const bool Active, - const char * const Option, - CMenuTarget* Target, - const char * const ActionKey, - neutrino_msg_t DirectKey, - const char * const IconName, - const char * const IconName_Info_right, - bool IsStatic) -{ - initVarMenuForwarder("", Text, Active, NULL, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right, IsStatic); -} - -CMenuForwarder::CMenuForwarder(const std::string& Text, - const bool Active, - const char * const Option, - CMenuTarget* Target, - const char * const ActionKey, - neutrino_msg_t DirectKey, - const char * const IconName, - const char * const IconName_Info_right, - bool IsStatic) -{ - initVarMenuForwarder(Text, NONEXISTANT_LOCALE, Active, NULL, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right, IsStatic); -} - -void CMenuForwarder::initVarMenuForwarder( const std::string& string_text, - const neutrino_locale_t& locale_text, - const bool Active, - const std::string * Option_string, - const char * const Option_cstring, - CMenuTarget* Target, - const char * const ActionKey, - neutrino_msg_t DirectKey, - const char * const IconName, - const char * const IconName_Info_right, - bool IsStatic) -{ - name = locale_text; - nameString = string_text; - active = Active; - option_string = Option_string; - option = Option_cstring; - jumpTarget = Target; - actionKey = ActionKey ? ActionKey : ""; - directKey = DirectKey; - iconName = IconName ? IconName : ""; - iconName_Info_right = IconName_Info_right ? IconName_Info_right : ""; - isStatic = IsStatic; -} - -void CMenuForwarder::setName(const std::string& t) -{ - name = NONEXISTANT_LOCALE; - nameString = t; -} - -void CMenuForwarder::setName(const neutrino_locale_t t) -{ - name = t; + option_string_ptr = &Option; + name = Text; nameString = ""; + jumpTarget = Target; + actionKey = ActionKey ? ActionKey : ""; } -void CMenuForwarder::setOption(const char * const Option) +CMenuForwarder::CMenuForwarder(const std::string& Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, + neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) + : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic) { - option = Option; - option_string = NULL; - if (used && x != -1) - paint(); + option_string_ptr = &Option; + name = NONEXISTANT_LOCALE; + nameString = Text; + jumpTarget = Target; + actionKey = ActionKey ? ActionKey : ""; +} + +CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, + neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) + : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic) +{ + option_string = Option ? Option : ""; + option_string_ptr = &option_string; + name = Text; + nameString = ""; + jumpTarget = Target; + actionKey = ActionKey ? ActionKey : ""; +} + +CMenuForwarder::CMenuForwarder(const std::string& Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, + neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) + : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic) +{ + option_string = Option ? Option : ""; + option_string_ptr = &option_string; + name = NONEXISTANT_LOCALE; + nameString = Text; + jumpTarget = Target; + actionKey = ActionKey ? ActionKey : ""; } void CMenuForwarder::setOption(const std::string &Option) { - option = NULL; - option_string = &Option; - if (used && x != -1) - paint(); -} - -int CMenuForwarder::getHeight(void) const -{ - return g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + option_string = Option; } int CMenuForwarder::getWidth(void) { - const char *_name = (name == NONEXISTANT_LOCALE) ? nameString.c_str() : g_Locale->getText(name); - int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(_name); + int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(getName()); fb_pixel_t bgcol = 0; std::string option_name = getOption(); @@ -1994,38 +2062,31 @@ int CMenuForwarder::getWidth(void) else if (bgcol) tw += 10 + 60; + const char *desc_text = getDescription(); + if (*desc_text) + tw = std::max(tw, 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(desc_text)); return tw; } int CMenuForwarder::exec(CMenuTarget* parent) { if(jumpTarget) - { return jumpTarget->exec(parent, actionKey); - } - else - { - return menu_return::RETURN_EXIT; - } + return menu_return::RETURN_EXIT; } std::string CMenuForwarder::getOption(void) { - if (option) - return (std::string)option; - else if (option_string) - return *option_string; - else if (jumpTarget) + if (!option_string_ptr->empty()) + return *option_string_ptr; + if (jumpTarget) return jumpTarget->getValue(); return ""; } int CMenuForwarder::paint(bool selected) { - int height = getHeight(); - const char * l_name = getName(); - - std::string option_name = getOption(); + std::string option_name = getOption(); fb_pixel_t bgcol = 0; if (jumpTarget) bgcol = jumpTarget->getColor(); @@ -2037,52 +2098,34 @@ int CMenuForwarder::paint(bool selected) paintItemButton(selected, height); //caption - paintItemCaption(selected, height, l_name, option_name.c_str(), bgcol); + paintItemCaption(selected, option_name.c_str(), bgcol); return y+ height; } //------------------------------------------------------------------------------------------------------------------------------- -CMenuSeparator::CMenuSeparator(const int Type, const neutrino_locale_t Text, bool IsStatic) -{ - initVarMenuSeparator(Type, "", Text, IsStatic); -} - -CMenuSeparator::CMenuSeparator(const int Type, const std::string& Text, bool IsStatic) -{ - initVarMenuSeparator(Type, Text, NONEXISTANT_LOCALE, IsStatic); -} - -void CMenuSeparator::initVarMenuSeparator(const int Type, const std::string& string_Text, const neutrino_locale_t locale_Text, bool IsStatic) +CMenuSeparator::CMenuSeparator(const int Type, const neutrino_locale_t Text, bool IsStatic) : CMenuItem(false, CRCInput::RC_nokey, NULL, NULL, IsStatic) { type = Type; - name = locale_Text; - nameString = string_Text; - isStatic = IsStatic; - - directKey = CRCInput::RC_nokey; - iconName = ""; + name = Text; + nameString = ""; } -int CMenuSeparator::getHeight(void) const +CMenuSeparator::CMenuSeparator(const int Type, const std::string Text, bool IsStatic) : CMenuItem(false, CRCInput::RC_nokey, NULL, NULL, IsStatic) +{ + type = Type; + name = NONEXISTANT_LOCALE; + nameString = Text; +} + + +int CMenuSeparator::getHeight(void) { if (nameString.empty() && name == NONEXISTANT_LOCALE) return 10; return g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); } -void CMenuSeparator::setName(const std::string& t) -{ - name = NONEXISTANT_LOCALE; - nameString = t; -} - -void CMenuSeparator::setName(const neutrino_locale_t t) -{ - name = t; - nameString = ""; -} - int CMenuSeparator::getWidth(void) { int w = 0; @@ -2096,7 +2139,7 @@ int CMenuSeparator::getWidth(void) int CMenuSeparator::paint(bool selected) { - int height = getHeight(); + height = getHeight(); CFrameBuffer * frameBuffer = CFrameBuffer::getInstance(); if ((type & SUB_HEAD)) @@ -2122,7 +2165,7 @@ int CMenuSeparator::paint(bool selected) if (*l_name) { - int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_name); + int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_name); // UTF-8 /* if no alignment is specified, align centered */ if (type & ALIGN_LEFT) @@ -2134,7 +2177,7 @@ int CMenuSeparator::paint(bool selected) frameBuffer->paintBoxRel(name_start_x-5, y, stringwidth+10, height, item_bgcolor); - paintItemCaption(selected, height, l_name); + paintItemCaption(selected); } } return y+ height; @@ -2155,6 +2198,7 @@ bool CPINProtection::check() return (cPIN == *validPIN); } + bool CZapProtection::check() { hint = NONEXISTANT_LOCALE; @@ -2168,7 +2212,10 @@ bool CZapProtection::check() res = PINInput->exec(getParent(), ""); delete PINInput; - + if (!access(CONFIGDIR "/pinentered.sh", X_OK)) { + std::string systemstr = CONFIGDIR "/pinentered.sh " + cPIN; + system(systemstr.c_str()); + } hint = LOCALE_PINPROTECTION_WRONGCODE; } while ( (cPIN != *validPIN) && !cPIN.empty() && ( res == menu_return::RETURN_REPAINT ) && @@ -2193,10 +2240,77 @@ int CLockedMenuForwarder::exec(CMenuTarget* parent) int CMenuSelectorTarget::exec(CMenuTarget* /*parent*/, const std::string & actionKey) { - if (actionKey != "") - *m_select = atoi(actionKey.c_str()); - else - *m_select = -1; - return menu_return::RETURN_EXIT; + if (actionKey != "") + *m_select = atoi(actionKey); + else + *m_select = -1; + return menu_return::RETURN_EXIT; } +CMenuProgressbar::CMenuProgressbar(const neutrino_locale_t Text) : CMenuItem(true, CRCInput::RC_nokey, NULL, NULL, false) +{ + init(Text, ""); +} + +CMenuProgressbar::CMenuProgressbar(const std::string &Text) : CMenuItem(true, CRCInput::RC_nokey, NULL, NULL, false) +{ + init(NONEXISTANT_LOCALE, Text); +} + +void CMenuProgressbar::init(const neutrino_locale_t Loc, const std::string &Text) +{ + name = Loc; + nameString = Text; + scale.setDimensionsAll(0, 0, 100, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight()/2); + scale.setValue(100); +} + +int CMenuProgressbar::paint(bool selected) +{ + //paint item + prepareItem(selected, height); + + //left text + const char *left_text = getName(); + int _dx = dx; + + if (*left_text) + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(name_start_x, y + height, _dx- (name_start_x - x), left_text, item_color); + + //progress bar + int pb_x; + if (*left_text) + pb_x = std::max(name_start_x + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text) + icon_frame_w, x + dx - scale.getWidth() - icon_frame_w); + else + pb_x = name_start_x; + + scale.setPos(pb_x, y + (height - scale.getHeight())/2); + scale.reset(); + scale.paint(); + + return y + height; +} + +int CMenuProgressbar::getHeight(void) +{ + return std::max(CMenuItem::getHeight(), scale.getHeight()); +} + +int CMenuProgressbar::getWidth(void) +{ + int width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(getName()); + if (width) + width += 10; + return width + scale.getWidth(); +} + +int CMenuProgressbar::exec(CMenuTarget*) +{ + int val = /*scale.getValue()*/ + 25; + if (val > 100) + val = 0; + scale.setValue(val); + scale.reset(); + scale.paint(); + return menu_return::RETURN_NONE; +} diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index e518034f8..30eda797b 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -39,12 +39,12 @@ #include #include #include +#include #include #include #include #include #include - #if ENABLE_LUA extern "C" { #include @@ -73,7 +73,7 @@ class CChangeObserver { public: virtual ~CChangeObserver(){} - virtual bool changeNotify(const neutrino_locale_t /*OptionName*/, void */*Data*/) + virtual bool changeNotify(const neutrino_locale_t /*OptionName*/, void * /*Data*/) { return false; } @@ -101,6 +101,8 @@ class CMenuTarget class CMenuItem { + private: + void setIconName(); protected: int x, y, dx, offx, name_start_x, icon_frame_w; bool used; @@ -108,28 +110,32 @@ class CMenuItem void initItemColors(const bool select_mode); #if ENABLE_LUA - lua_State *luaState; - std::string luaAction; - std::string luaId; + lua_State *luaState; + std::string luaAction; + std::string luaId; #endif - neutrino_locale_t name; - std::string nameString; - + neutrino_locale_t name; + std::string nameString; + neutrino_locale_t desc; + std::string descString; public: - bool active; - bool marked; + int height; + bool active; + bool marked; bool inert; bool isStatic; + bool directKeyOK; neutrino_msg_t directKey; neutrino_msg_t msg; - std::string iconName; - std::string selected_iconName; - std::string iconName_Info_right; - std::string hintIcon; + const char * iconName; + const char * selected_iconName; + const char * iconName_Info_right; + const char * hintIcon; std::string hintText; neutrino_locale_t hint; - CMenuItem(); + CMenuItem(bool Active = true, neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName= NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false); + virtual ~CMenuItem(){} virtual void isUsed(void) @@ -140,17 +146,14 @@ class CMenuItem virtual void init(const int X, const int Y, const int DX, const int OFFX); virtual int paint (bool selected = false) = 0; - virtual int getHeight(void) const = 0; + virtual int getHeight(void); virtual int getWidth(void) { return 0; } virtual int getYPosition(void) const { return y; } - virtual bool isSelectable(void) const - { - return false; - } + virtual bool isSelectable(void) const { return active; } virtual int exec(CMenuTarget* /*parent*/) { @@ -160,34 +163,35 @@ class CMenuItem virtual void setMarked(const bool Marked); virtual void setInert(const bool Inert); - virtual void paintItemButton(const bool select_mode, const int &item_height, const std::string& icon_Name = NEUTRINO_ICON_BUTTON_RIGHT); + virtual void paintItemButton(const bool select_mode, int item_height, const char * const icon_Name = NEUTRINO_ICON_BUTTON_RIGHT); virtual void prepareItem(const bool select_mode, const int &item_height); - virtual void setItemButton(const std::string& icon_Name, const bool is_select_button = false); + virtual void setItemButton(const char * const icon_Name, const bool is_select_button = false); - virtual void paintItemCaption(const bool select_mode, const int &item_height, const char * left_text=NULL, const char * right_text=NULL, const fb_pixel_t right_bgcol=0); + virtual void paintItemCaption(const bool select_mode, const char * right_text=NULL, const fb_pixel_t right_bgcol=0); virtual void paintItemSlider( const bool select_mode, const int &item_height, const int &optionvalue, const int &factor, const char * left_text=NULL, const char * right_text=NULL); virtual int isMenueOptionChooser(void) const{return 0;} - void setHint(const std::string icon, const neutrino_locale_t text) { hintIcon = icon; hint = text; } - void setHint(const std::string icon, const std::string text) { hintIcon = icon; hintText = text; } - + void setHint(const char * const icon, const neutrino_locale_t text) { hintIcon = (icon && *icon) ? icon : NULL; hint = text; } + void setHint(const char * const icon, const std::string text) { hintIcon = (icon && *icon) ? icon : NULL; hintText = text; } #if ENABLE_LUA void setLua(lua_State *_luaState, std::string &_luaAction, std::string &_luaId) { luaState = _luaState; luaAction = _luaAction; luaId = _luaId; }; #endif virtual const char *getName(); + virtual void setName(const std::string& text); + virtual void setName(const neutrino_locale_t text); + + virtual const char *getDescription(); + virtual void setDescription(const std::string& text); + virtual void setDescription(const neutrino_locale_t text); + virtual int getDescriptionHeight(void); }; class CMenuSeparator : public CMenuItem { - private: int type; - void initVarMenuSeparator( const int Type, - const std::string& string_Text, - const neutrino_locale_t locale_Text, - bool IsStatic); public: @@ -204,15 +208,14 @@ class CMenuSeparator : public CMenuItem CMenuSeparator(const int Type = 0, const neutrino_locale_t Text = NONEXISTANT_LOCALE, bool IsStatic = false); - CMenuSeparator(const int Type, const std::string& Text, bool IsStatic = false); + CMenuSeparator(const int Type, const std::string Text, bool IsStatic = false); virtual ~CMenuSeparator(){} int paint(bool selected=false); - int getHeight(void) const; + int getHeight(void); int getWidth(void); - void setName(const std::string& text); - void setName(const neutrino_locale_t text); + bool isSelectable(void) const { return false; } }; class CMenuForwarder : public CMenuItem @@ -220,125 +223,57 @@ class CMenuForwarder : public CMenuItem std::string actionKey; protected: - const char * option; - const std::string * option_string; + std::string option_string; + const std::string * option_string_ptr; CMenuTarget * jumpTarget; virtual std::string getOption(void); - void initVarMenuForwarder( const std::string& string_text, - const neutrino_locale_t& locale_text, - const bool Active, - const std::string * Option_string, - const char * const Option_cstring, - CMenuTarget* Target, - const char * const ActionKey, - neutrino_msg_t DirectKey, - const char * const IconName, - const char * const IconName_Info_right, - bool IsStatic); - public: - CMenuForwarder( const neutrino_locale_t Text, - const bool Active, - const std::string &Option, - CMenuTarget* Target=NULL, - const char * const ActionKey = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const char * const IconName = NULL, - const char * const IconName_Info_right = NULL, - bool IsStatic = false); - - CMenuForwarder( const std::string& Text, - const bool Active, - const std::string &Option, - CMenuTarget* Target=NULL, - const char * const ActionKey = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const char * const IconName = NULL, - const char * const IconName_Info_right = NULL, - bool IsStatic = false); - - CMenuForwarder( const neutrino_locale_t Text, - const bool Active = true, - const char * const Option=NULL, - CMenuTarget* Target=NULL, - const char * const ActionKey = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const char * const IconName = NULL, - const char * const IconName_Info_right = NULL, - bool IsStatic = false); - - CMenuForwarder( const std::string& Text, - const bool Active = true, - const char * const Option=NULL, - CMenuTarget* Target=NULL, - const char * const ActionKey = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const char * const IconName = NULL, - const char * const IconName_Info_right = NULL, - bool IsStatic = false); - + CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option, + CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, + const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false); + CMenuForwarder(const std::string & Text, const bool Active, const std::string &Option, + CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, + const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false); + CMenuForwarder(const neutrino_locale_t Text, const bool Active = true, const char * const Option=NULL, + CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, + const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false); + CMenuForwarder(const std::string & Text, const bool Active = true, const char * const Option=NULL, + CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, + const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false); virtual ~CMenuForwarder(){} int paint(bool selected=false); - int getHeight(void) const; int getWidth(void); neutrino_locale_t getTextLocale() const {return name;} CMenuTarget* getTarget() const {return jumpTarget;} const char *getActionKey(){return actionKey.c_str();} int exec(CMenuTarget* parent); - bool isSelectable(void) const { return active; } void setOption(const std::string &Option); - void setOption(const char * const Option); - void setName(const std::string& text); - void setName(const neutrino_locale_t text); }; class CMenuDForwarder : public CMenuForwarder { public: - CMenuDForwarder(const neutrino_locale_t Text, - const bool Active, - const std::string &Option, - CMenuTarget* Target=NULL, - const char * const ActionKey = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const char * const IconName = NULL, - const char * const IconName_Info_right = NULL) + CMenuDForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option, + CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, + const char * const IconName = NULL, const char * const IconName_Info_right = NULL) : CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) { }; - - CMenuDForwarder(const std::string& Text, - const bool Active, - const std::string &Option, - CMenuTarget* Target=NULL, - const char * const ActionKey = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const char * const IconName = NULL, - const char * const IconName_Info_right = NULL) + CMenuDForwarder(const std::string & Text, const bool Active, const std::string &Option, + CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, + const char * const IconName = NULL, const char * const IconName_Info_right = NULL) : CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) { }; - - CMenuDForwarder(const neutrino_locale_t Text, - const bool Active=true, - const char * const Option=NULL, - CMenuTarget* Target=NULL, - const char * const ActionKey = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const char * const IconName = NULL, - const char * const IconName_Info_right = NULL) + CMenuDForwarder(const neutrino_locale_t Text, const bool Active=true, const char * const Option=NULL, + CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, + const char * const IconName = NULL, const char * const IconName_Info_right = NULL) : CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) { }; - - CMenuDForwarder(const std::string& Text, - bool Active=true, - const char * const Option=NULL, - CMenuTarget* Target=NULL, - const char * const ActionKey = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const char * const IconName = NULL, - const char * const IconName_Info_right = NULL) + CMenuDForwarder(const std::string & Text, const bool Active=true, const char * const Option=NULL, + CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, + const char * const IconName = NULL, const char * const IconName_Info_right = NULL) : CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) { }; ~CMenuDForwarder() { delete jumpTarget; } @@ -347,17 +282,11 @@ class CMenuDForwarder : public CMenuForwarder class CAbstractMenuOptionChooser : public CMenuItem { protected: - int height; int * optionValue; - int getHeight(void) const{return height;} - - bool isSelectable(void) const{return active;} public: - CAbstractMenuOptionChooser() + CAbstractMenuOptionChooser(bool Active, const neutrino_msg_t DirectKey, const char * const IconName, const char *const IconName_Info_right = NULL, bool IsStatic = false) : CMenuItem(Active, DirectKey, IconName, IconName_Info_right, IsStatic) { - name = NONEXISTANT_LOCALE; - height = 0; optionValue = NULL; } ~CAbstractMenuOptionChooser(){} @@ -380,40 +309,17 @@ private: std::string numberFormat; std::string (*numberFormatFunction)(int num); - void initMenuOptionNumberChooser( const std::string &s_name, - const neutrino_locale_t l_name, - int * const OptionValue, - const bool Active, - const int min_value, - const int max_value, - CChangeObserver * const Observ, - const int print_offset, - const int special_value, - const neutrino_locale_t special_value_name, - bool sliderOn); - public: - CMenuOptionNumberChooser(const neutrino_locale_t name, - int * const OptionValue, - const bool Active, - const int min_value, - const int max_value, - CChangeObserver * const Observ = NULL, - const int print_offset = 0, - const int special_value = 0, - const neutrino_locale_t special_value_name = NONEXISTANT_LOCALE, - bool sliderOn = false ); - - CMenuOptionNumberChooser(const std::string &name, - int * const OptionValue, - const bool Active, - const int min_value, - const int max_value, - CChangeObserver * const Observ = NULL, - const int print_offset = 0, - const int special_value = 0, - const neutrino_locale_t special_value_name = NONEXISTANT_LOCALE, - bool sliderOn = false ); + CMenuOptionNumberChooser(const neutrino_locale_t name, int * const OptionValue, const bool Active, + const int min_value, const int max_value, CChangeObserver * const Observ = NULL, + const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, + const int print_offset = 0, + const int special_value = 0, const neutrino_locale_t special_value_name = NONEXISTANT_LOCALE, bool sliderOn = false ); + CMenuOptionNumberChooser(const std::string &name, int * const OptionValue, const bool Active, + const int min_value, const int max_value, CChangeObserver * const Observ = NULL, + const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, + const int print_offset = 0, + const int special_value = 0, const neutrino_locale_t special_value_name = NONEXISTANT_LOCALE, bool sliderOn = false ); int paint(bool selected); @@ -426,7 +332,7 @@ private: }; class CMenuOptionChooserOptions -{ +{ public: int key; std::string valname; @@ -447,168 +353,119 @@ struct CMenuOptionChooserCompareItem: public std::binary_function options; - std::vector option_chooser_options_v; - unsigned number_of_options; - CChangeObserver * observ; - bool pulldown; - bool optionsSort; + private: + std::vector options; + std::vector option_chooser_options_v; + unsigned number_of_options; + CChangeObserver * observ; + bool pulldown; + bool optionsSort; - void clearChooserOptions(); - void initVarOptionChooser( const std::string &OptionName, - const neutrino_locale_t Name, - int * const OptionValue, - const bool Active, - CChangeObserver * const Observ, - neutrino_msg_t DirectKey, - const std::string & IconName, - bool Pulldown, - bool OptionsSort + void clearChooserOptions(); + void initVarOptionChooser( const std::string &OptionName, + const neutrino_locale_t Name, + int * const OptionValue, + const bool Active, + CChangeObserver * const Observ, + neutrino_msg_t DirectKey, + const char * IconName, + bool Pulldown, + bool OptionsSort ); - public: - CMenuOptionChooser( const neutrino_locale_t Name, - int * const OptionValue, - const struct keyval * const Options, - const unsigned Number_Of_Options, - const bool Active = false, - CChangeObserver * const Observ = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const std::string & IconName= "", + + public: + CMenuOptionChooser(const neutrino_locale_t Name, int * const OptionValue, const struct keyval * const Options, + const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, + const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, bool Pulldown = false, bool OptionsSort = false); + CMenuOptionChooser(const neutrino_locale_t Name, int * const OptionValue, const struct keyval_ext * const Options, + const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, + const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, + bool Pulldown = false, bool OptionsSort = false); + CMenuOptionChooser(const std::string &Name, int * const OptionValue, const struct keyval * const Options, + const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, + const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, + bool Pulldown = false, bool OptionsSort = false); + CMenuOptionChooser(const std::string &Name, int * const OptionValue, const struct keyval_ext * const Options, + const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, + const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, + bool Pulldown = false, bool OptionsSort = false); + CMenuOptionChooser(const neutrino_locale_t Name, int * const OptionValue, std::vector &Options, + const bool Active = false, CChangeObserver * const Observ = NULL, + const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, + bool Pulldown = false, bool OptionsSort = false); + CMenuOptionChooser(const std::string &Name, int * const OptionValue, std::vector &Options, + const bool Active = false, CChangeObserver * const Observ = NULL, + const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, + bool Pulldown = false, bool OptionsSort = false); + ~CMenuOptionChooser(); - CMenuOptionChooser( const neutrino_locale_t Name, - int * const OptionValue, - const struct keyval_ext * const Options, - const unsigned Number_Of_Options, - const bool Active = false, - CChangeObserver * const Observ = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const std::string & IconName= "", - bool Pulldown = false, - bool OptionsSort = false); + void setOption(const int newvalue); + int getOption(void) const; + int getWidth(void); + void setOptions(const struct keyval * const Options, const unsigned Number_Of_Options); + void setOptions(const struct keyval_ext * const Options, const unsigned Number_Of_Options); - CMenuOptionChooser( const std::string &Name, - int * const OptionValue, const struct keyval * const Options, - const unsigned Number_Of_Options, - const bool Active = false, - CChangeObserver * const Observ = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const std::string & IconName= "", - bool Pulldown = false, - bool OptionsSort = false); + int paint(bool selected); - CMenuOptionChooser( const std::string &Name, - int * const OptionValue, - const struct keyval_ext * const Options, - const unsigned Number_Of_Options, - const bool Active = false, - CChangeObserver * const Observ = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const std::string & IconName= "", - bool Pulldown = false, - bool OptionsSort = false); - - CMenuOptionChooser( const neutrino_locale_t Name, - int * const OptionValue, - std::vector &Options, - const bool Active = false, - CChangeObserver * const Observ = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const std::string & IconName= "", - bool Pulldown = false, - bool OptionsSort = false); - - CMenuOptionChooser( const std::string &Name, - int * const OptionValue, - std::vector &Options, - const bool Active = false, - CChangeObserver * const Observ = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const std::string & IconName= "", - bool Pulldown = false, - bool OptionsSort = false); - - ~CMenuOptionChooser(); - - void setOption(const int newvalue); - int getOption(void) const; - int getWidth(void); - void setOptions(const struct keyval * const Options, const unsigned Number_Of_Options); - void setOptions(const struct keyval_ext * const Options, const unsigned Number_Of_Options); - - int paint(bool selected); - - int exec(CMenuTarget* parent); - int isMenueOptionChooser(void) const{return 1;} + int exec(CMenuTarget* parent); + int isMenueOptionChooser(void) const{return 1;} }; class CMenuOptionStringChooser : public CMenuItem { - private: - int height; - std::string * optionValueString; + std::string * optionValuePtr; + std::string title; + std::string optionValue; std::vector options; CChangeObserver * observ; bool pulldown; - void initVarMenuOptionStringChooser( const std::string &string_Name, - const neutrino_locale_t locale_Name, - std::string* OptionValue, - bool Active, - CChangeObserver* Observ, - const neutrino_msg_t DirectKey, - const std::string & IconName, - bool Pulldown); public: - CMenuOptionStringChooser( const neutrino_locale_t Name, - std::string* OptionValue, - bool Active = false, - CChangeObserver* Observ = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const std::string & IconName= "", - bool Pulldown = false); - - CMenuOptionStringChooser( const std::string &Name, - std::string* OptionValue, - bool Active = false, - CChangeObserver* Observ = NULL, - const neutrino_msg_t DirectKey = CRCInput::RC_nokey, - const std::string & IconName= "", - bool Pulldown = false); + CMenuOptionStringChooser(const neutrino_locale_t Name, std::string* OptionValue, bool Active = false, + CChangeObserver* Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, + const char * const IconName = NULL, bool Pulldown = false); + CMenuOptionStringChooser(const std::string &Name, std::string* OptionValue, bool Active = false, + CChangeObserver* Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, + const char * const IconName = NULL, bool Pulldown = false); ~CMenuOptionStringChooser(); void addOption(const std::string &value); - void removeOptions(){options.clear();}; + void removeOptions(){options.clear();} + void setOptions(std::vector &vec) { options = vec; } + void setTitle(std::string &Title); + void setTitle(const neutrino_locale_t Title); int paint(bool selected); - int getHeight(void) const { return height; } - bool isSelectable(void) const { return active; } void sortOptions(); int exec(CMenuTarget* parent); int isMenueOptionChooser(void) const{return 1;} + void setOptionValue(std::string &val) { + if (!optionValuePtr) optionValuePtr = &optionValue; + *optionValuePtr = val; + } + std::string getOptionValue() { return *optionValuePtr; } }; class CMenuGlobal @@ -633,7 +490,7 @@ class CMenuWidget : public CMenuTarget bool show_details_line; protected: std::string nameString; - neutrino_locale_t name; + neutrino_locale_t name; CFrameBuffer *frameBuffer; std::vector items; std::vector page_start; @@ -652,24 +509,24 @@ class CMenuWidget : public CMenuTarget int selected; int iconOffset; int sb_width; - int sb_height; fb_pixel_t *background; int full_width, full_height; bool savescreen; bool has_hints; // is any items has hints bool hint_painted; // is hint painted + int fbutton_width; int fbutton_height; int fbutton_count; const struct button_label *fbutton_labels; - unsigned int item_start_y; - unsigned int current_page; - unsigned int total_pages; - bool exit_pressed; - bool from_wizard; - bool fade; - bool washidden; + unsigned int item_start_y; + unsigned int current_page; + unsigned int total_pages; + bool exit_pressed; + bool from_wizard; + bool fade; + bool washidden; void Init(const std::string & Icon, const int mwidth, const mn_widget_id_t &w_index); virtual void paintItems(); @@ -682,7 +539,7 @@ class CMenuWidget : public CMenuTarget public: CMenuWidget(); /* mwidth (minimum width) in percent of screen width */ - CMenuWidget(const char* Name, const std::string & Icon = "", const int mwidth = 30, const mn_widget_id_t &w_index = NO_WIDGET_ID); + CMenuWidget(const std::string &Name, const std::string & Icon = "", const int mwidth = 30, const mn_widget_id_t &w_index = NO_WIDGET_ID); CMenuWidget(const neutrino_locale_t Name, const std::string & Icon = "", const int mwidth = 30, const mn_widget_id_t &w_index = NO_WIDGET_ID); ~CMenuWidget(); @@ -690,10 +547,10 @@ class CMenuWidget : public CMenuTarget enum { - BTN_TYPE_BACK = 0, - BTN_TYPE_CANCEL = 1, - BTN_TYPE_NEXT = 3, - BTN_TYPE_NO = -1 + BTN_TYPE_BACK = 0, + BTN_TYPE_CANCEL = 1, + BTN_TYPE_NEXT = 3, + BTN_TYPE_NO = -1 }; virtual void addIntroItems(neutrino_locale_t subhead_text = NONEXISTANT_LOCALE, neutrino_locale_t section_text = NONEXISTANT_LOCALE, int buttontype = BTN_TYPE_BACK ); bool hasItem(); @@ -706,7 +563,7 @@ class CMenuWidget : public CMenuTarget virtual void paint(); virtual void hide(); virtual int exec(CMenuTarget* parent, const std::string & actionKey); - virtual std::string getName(); + virtual const char *getName(); void setSelected(const int &Preselected){ preselected = Preselected; }; int getSelected()const { return selected; }; void move(int xoff, int yoff); @@ -782,8 +639,6 @@ class CLockedMenuForwarder : public CMenuForwarder, public CPINProtection //but use always an info icon if defined in parameter 'IconName_Info_right' if (IconName_Info_right || ask) iconName_Info_right = IconName_Info_right ? IconName_Info_right : NEUTRINO_ICON_LOCK; - else - iconName_Info_right = ""; }; virtual int exec(CMenuTarget* parent); @@ -791,12 +646,30 @@ class CLockedMenuForwarder : public CMenuForwarder, public CPINProtection class CMenuSelectorTarget : public CMenuTarget { - public: - CMenuSelectorTarget(int *select) {m_select = select;}; - int exec(CMenuTarget* parent, const std::string & actionKey); + public: + CMenuSelectorTarget(int *select) {m_select = select;}; + int exec(CMenuTarget* parent, const std::string & actionKey); - private: - int *m_select; + private: + int *m_select; +}; + +class CMenuProgressbar : public CMenuItem +{ + private: + CProgressBar scale; + void init (const neutrino_locale_t Loc, const std::string & Text); + public: + + CMenuProgressbar(const neutrino_locale_t Text); + CMenuProgressbar(const std::string & Text); + virtual ~CMenuProgressbar(){} + + int paint(bool selected=false); + int getWidth(void); + int getHeight(void); + int exec(CMenuTarget *parent); + CProgressBar *getScale() { return &scale; } }; extern CMenuSeparator * const GenericMenuSeparator; diff --git a/src/system/helpers.h b/src/system/helpers.h index 8f1a13bbf..9d5874cf2 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -22,10 +22,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include +#include +#include #include #include #include #include +#include +#include +#include #include int my_system(const char * cmd); @@ -88,4 +94,10 @@ template std::string to_string(C i) inline void cstrncpy(char *dest, const char * const src, size_t n) { n--; strncpy(dest, src, n); dest[n] = 0; } inline void cstrncpy(char *dest, const std::string &src, size_t n) { n--; strncpy(dest, src.c_str(), n); dest[n] = 0; } bool split_config_string(const std::string &str, std::map &smap); + +inline int atoi(std::string &s) { return atoi(s.c_str()); } +inline int atoi(const std::string &s) { return atoi(s.c_str()); } +inline int access(std::string &s, int mode) { return access(s.c_str(), mode); } +inline int access(const std::string &s, int mode) { return access(s.c_str(), mode); } + #endif