From 36f2c45412fad5b363213f26f47995190025ed7d Mon Sep 17 00:00:00 2001 From: Joachim Fritzsch Date: Sat, 18 May 2013 14:20:59 +0200 Subject: [PATCH] android: new Tasks tab icon android: moved run mode control from Status tab into menu --- .../drawable-hdpi/{chartb.png => cogsb.png} | Bin 4249 -> 4418 bytes android/BOINC/res/drawable-hdpi/cogsw.png | Bin 0 -> 3983 bytes .../drawable-hdpi/{chartw.png => playw.png} | Bin 3925 -> 3481 bytes android/BOINC/res/drawable-hdpi/stopw.png | Bin 0 -> 3103 bytes .../drawable-ldpi/{chartb.png => cogsb.png} | Bin 3767 -> 3653 bytes android/BOINC/res/drawable-ldpi/cogsw.png | Bin 0 -> 3299 bytes .../drawable-ldpi/{chartw.png => playw.png} | Bin 3467 -> 3255 bytes .../stopw24.png => drawable-ldpi/stopw.png} | Bin .../drawable-mdpi/{chartb.png => cogsb.png} | Bin 3933 -> 3858 bytes android/BOINC/res/drawable-mdpi/cogsw.png | Bin 0 -> 3498 bytes .../drawable-mdpi/{chartw.png => playw.png} | Bin 3615 -> 3319 bytes android/BOINC/res/drawable-mdpi/stopw.png | Bin 0 -> 3078 bytes android/BOINC/res/drawable/icon_tasks_tab.xml | 4 +- android/BOINC/res/drawable/pausew24.png | Bin 270 -> 3110 bytes android/BOINC/res/layout/status_layout.xml | 32 +-------- .../menu/{status_menu.xml => main_menu.xml} | 4 +- android/BOINC/res/values/strings.xml | 8 +-- .../src/edu/berkeley/boinc/BOINCActivity.java | 48 ++++++++++++- .../edu/berkeley/boinc/StatusActivity.java | 68 ++++++++---------- .../edu/berkeley/boinc/client/Monitor.java | 27 +------ 20 files changed, 88 insertions(+), 103 deletions(-) rename android/BOINC/res/drawable-hdpi/{chartb.png => cogsb.png} (54%) create mode 100644 android/BOINC/res/drawable-hdpi/cogsw.png rename android/BOINC/res/drawable-hdpi/{chartw.png => playw.png} (63%) create mode 100644 android/BOINC/res/drawable-hdpi/stopw.png rename android/BOINC/res/drawable-ldpi/{chartb.png => cogsb.png} (64%) create mode 100644 android/BOINC/res/drawable-ldpi/cogsw.png rename android/BOINC/res/drawable-ldpi/{chartw.png => playw.png} (72%) rename android/BOINC/res/{drawable/stopw24.png => drawable-ldpi/stopw.png} (100%) rename android/BOINC/res/drawable-mdpi/{chartb.png => cogsb.png} (61%) create mode 100644 android/BOINC/res/drawable-mdpi/cogsw.png rename android/BOINC/res/drawable-mdpi/{chartw.png => playw.png} (69%) create mode 100644 android/BOINC/res/drawable-mdpi/stopw.png rename android/BOINC/res/menu/{status_menu.xml => main_menu.xml} (72%) diff --git a/android/BOINC/res/drawable-hdpi/chartb.png b/android/BOINC/res/drawable-hdpi/cogsb.png similarity index 54% rename from android/BOINC/res/drawable-hdpi/chartb.png rename to android/BOINC/res/drawable-hdpi/cogsb.png index a84a332063d1fdb4ad4476f9aff77d4eeaa0fced..e68359517a0c7684bf42af09f4841c03d34a15c3 100644 GIT binary patch delta 1610 zcmV-Q2DSN_A;KcCcmn}6lX(Lr1~)-OH8ew$9|j+j!vh)yGBPznLpPHu1RImT0}7J} z1RMr3GBrX&H?t}PHUS1QGBrX&H~&aUG#>U1{B@_s7C#o2%OE&b9364@J3;6Yi z^Yinaj*bpl^zEM*$<58p-z$HmKtMD-ED<$u2^v{Inmxx%a1`8yxvGZI@$vC%!7Wr0 zYHMpN$>U8-Onim1Mt3H(y}hkg)P=^z#-#T4_K$!?0~h)g0{tNpUR+%K+t${W$Kz*i z`U7ATe9i#s<>lr5yIWv%bTnt;4w_5s?Ce-(T+m-zTy|S}*NF^nAd7!Vii5Nr1K?yW z=;e36#4M{?g-JUFs#;0}So}9Tsi+n4$jFGqqL$fs_k7^n-Q5jQVFvg_<$>S=5`;`x z&@UReO^Wdf67PzJ(c$4?a+#cg>nuT_h5h|~Ej$hl4N-MU5o<;aqkDUML4E?bGr;}A zteM4n#7r3MpJ7ojjs1UqV83KZ3WP!-5B{w=r$pB|w#^Cp5-{%c*CA-q*)dGWq zgE5@IN;&)zo5v3h4pNY-U|~t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)T#)GR+^_!Eua_`^LozKkLc)#kvFCePft%j zhYGr(YkEO53OQrioGO^Qjz&M~%p@vPr)@6QUl;|0QAO=?-ZwREFc{B+dGr7dJs zDRu^=?}qHGaW?S>vLVA_R-(90TZ0hNIn5R3(k@X=r1!VUxY^v=-19Q57@u1QT}L?@ zDT)b@)h!OHLE#uV-N+S+ zEn~_o7R{-tXLSS0C$?`k&4$mo<=ePXuc!c?C&V$U#gZ{wJyJYcC>)&wjMC9kt)^Fv zYF#hP7Hfr+dp)p2k-*s9c`)~rP$|T>+-<>#!bRn~ikx9q2e&Zwm|Tg9y6W<16b)S> zD%o@`zXSWtIk;_wE>~x26kD9EV>pGL7x)ZSIj3YT6o(Wa*2(7hRd2b zBQ6=mlA}0SS(Mc%Pn%ek9ow`;uz;pmF5z=omNUmeR2SIU7}+7?froeyxN8qfeGjVv_=6_c0+p$5iS*PT~Y9BwMrT{F?!{ST9Lu zmP<5>rI6~Sl@iKD9rnRf_8q3x=g+-G^z&CP}f=X?a7QXsDTq=;oSgvPloKoM8ev0+f8evDSu#`$Ln)q?(p zOvuTBkGDM5no3 z1f%eDyLI}?_wej{n$NB9rJ&6R7R5^RLX$?qn~@XzW|)Nz)8}mY;`~pTtvClO|%f8I;Lb@-dya$ ztq?-CSn+b6kl`P*FpKpXXHYk2d{kDu+oh#uZ` z`tgT;`n#vRJo(+;H#eUD{IyH&m8*{_%DYRw$}i4WSKqk#(T#T&U%c@4xzev+|M~ij z+NTGv-g;!>+M~BG6?RM%Rws5k*LUt&ISAhuFFx_%>`rI(y}fs;mwNLjW|k+E)zIIu aTY2*EGhbf+;jgCz|Hj-x{r%b1%l`lxFwnmM literal 0 HcmV?d00001 diff --git a/android/BOINC/res/drawable-ldpi/chartb.png b/android/BOINC/res/drawable-ldpi/cogsb.png similarity index 64% rename from android/BOINC/res/drawable-ldpi/chartb.png rename to android/BOINC/res/drawable-ldpi/cogsb.png index ca39518c4df20ebfc8e031d88c7b5639571a943c..ba5919a8d0d36bc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ff --git a/android/BOINC/res/drawable-ldpi/cogsw.png b/android/BOINC/res/drawable-ldpi/cogsw.png new file mode 100644 index 0000000000000000000000000000000000000000..3802711ed2c9d5cdf93fb22fa79e1a192c3d41cf GIT binary patch literal 3299 zcmb_f3vd%v6pcVDEw;koAmyXWQbCbqHz{q?B`KsyX#=K(G}2;K*zCTh+irH#-A$8J zVTz^r8AcfkDq}6E9bu4hWDu$#Q~8J}FjPwU|D<5S4_mf~fBHacGjlwm!?ieu>oBcOt<5CTbOeqgp&v9m5itmK8DY0f2?c{ABU&y=9s_HHdwSLO+{QhUV&9O(G&();0Bx|LN{%Uz11U86QGQ; zDiKdej#4~DiN>NWl&Ff>F(4k+E6&!=j`%~eUJ=N%3JOb?VK9W^9L*KZMY{xRB6@#4 zjBU2to4egHtVAid8tNL#QLh4uj(`VXb|CUzfdaYJP@>UFP)IG90K!HJl>kONLX0eZmf4J(v?dF#%SkuuqTDS!<&_f{cBk*my%1Ik!;$P=!N`S+ z82(n|Ns)8`2N2w%vJxz66DtKr!6D1Yl}xZC=YsoH)1Zv>vJ#qY762(R)c~GCx0~lg z#3V@qcPrDQv@XktL~NqK#D6ehI0*=f?!8GILGm)UXXE-e1BnzXBk7Fg5*&r4P}GZ7N>(n|VedSJ z|973oQZYpLWI~C>3uYc(HI!uK%6R1_iM3xd>3fHz^(o#l!YzXrBl6jSzT2z7J9 z>W1e$1RkY8xb7oGtVBbQ-rNdc5gXB7!yrNR!)OMqH~&~dX5JG}5>n{nz-^Cp4@$9) zcS9-`AxI1M9@yCP8Q3+1z<&@(xsM2#BG~JUs7O`=TIukxy9Sq-yS*bK2)=Rvp>Ka5 zMU1I(*q!C84U->B@^u!ffLl^?%T9y2v&1yH;2eA)!Iv2pd78mNa$NeU^3XxPYG8AF!gbHqjtbzv%HKc8IXrG0x8}`VU@+dl{H_ZbA39F`# zF6pwyzvUYB-dE1GJ3G%7KN5E;;n80<4td$K`qyj6+Pueyv=o{zH0EsIbEWfPZW_^g z=BdZ7#I?M4BCGxYeqWb;nf;{`wS8XPnl!B*@Vh5A?VB4ver>g8Vg5cghs(0# z-KLore5OhFepL19+RN>GY2DO$4}J0~=*b7YS4JPk*y9S1MyYm#2$kNX4x;Q_u1?IS8~Kj9_rLaNuaPRt;!Ujc5u{0Kx{@ z4E76+WesKx(oBkftY<%PZQSrj#%IQp-MP=sRx|Gw*(#P98oHG^<^aQto2*@n3L17j zocjD{o!5Tf?q+odQ-ji2>&R($FPU6@CY0gKs%Y*h)MMefKZ*9_%4$iwQ&-lYySB72j-xm>A$Jg9H|9=%rV0aayys}<3A>wn$UwkvQI~j}P)o&w)}9G@4r&>@80RfW zWlCte#CeOifz!kM1REo#Vx5Wz=SPm0-o!)UkqX4W+A$Q%nX6)T+vLGc5?mBFXWC)eLF27 zKq=Vc#9yZq7U}63#Z0m*zKKumI5qJ>-X39%FVT}!^qz4ueAPWYOHiR^--45J;#+s_ zU=M%L_t@srlLCtiZ~LC^y4>r2?62G6`iI5yJrC~uGq2Hyb9Q}Cg&f0$X>b4hbp2Gg zQ@82Igo$tF@74PD`>#OO1nr56duNBlmOO1X`gu0Z_(?@(WGBy2@BXb(YhUJVUo1A~ zdCiLdl7=_(wx_&5RT28G@x(oc2?d*PTFhXpvE9r#p&@z0hR>Y;MH{R-UuCVoo_*@h zV_oa)vhBBniw^vfzLM>z>cz}aFzfuwf}d8Y_hZ+Fao)eJy?DJ9^Q{vdR;hjuns%AI z*m>!@^HGIYC03GupB8zhZp{A~wt}gmP=>wc?=$}ut6ZkO{6D?%nxaIHqW`Y{S{G#A cL^m)pB=)~IcTT>uk^u-jUHx3vIVCg!0CwvUEC2ui diff --git a/android/BOINC/res/drawable/stopw24.png b/android/BOINC/res/drawable-ldpi/stopw.png similarity index 100% rename from android/BOINC/res/drawable/stopw24.png rename to android/BOINC/res/drawable-ldpi/stopw.png diff --git a/android/BOINC/res/drawable-mdpi/chartb.png b/android/BOINC/res/drawable-mdpi/cogsb.png similarity index 61% rename from android/BOINC/res/dr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^ZQ;U)_6LWxE1((#K z%(BFi%(B$t>bn~j05!U1hD4OOq!uR^WfqiV=H~&07|3(U9>E_{K)oIy13@m~f;a_a z9udxoXgbZxz`)e+>EaktaqCHVY~LaWfiUBX?28}e_k3he{&H0O826fL<~@va5{%Ug zEDoOIZL@8>lW<2^$A6!Mu#ZoVoARt5D{@3L=fts25xv>2`ZC~#{MXR%(E2S4FZ{1- zt=C+h;5_uk8tKL*+A=j^F>BF+M;)#?^pdhPf9aq!21NJW)Ii@zc z^UAhyJl5uUT4UG2b7JvD54Xj4^Hw{Yx;)vDWy98omJVvuE!rEvdw0{Pv9=&{yV##VadsqMGG!wn0zoRIIvfd&w%NN z*q>XhT!9-V&pJ3Ew?J#c{wuFbeSVjl&tKlOK_@$A<YyY-DP_ufp+$m#JEd+&F z*Ju5n(pa>!rmz0Z*)-$UGlnUxdz$Af9(>Kx-}q;jH|NWqhTi*}_m)nJJrYoHjbHVR zc(<$ej(@yX4_l@`|GaZ$%hI5elZA?|iCHUeuR5%g6ka@l(z@M?f zxNvXW>X#)_vYS5qVU_vEV$`Z+zTQXebCvh|IiDE))?anFlVfId*nnx>t2Z_6OJBU) zmA6VIq2d6KjjUJj$|=zdkIHsWoqX~MtEK1>dHI#uTor;2N)ruarUcx6Tc&k}+oeaY zSf~H^V{xw?_uq>em2ciuxmU(-yW-!TQ)T;VYxocNaVBq^A+EY-Jqsv0>{%V>aN15~ y_+DV1@bBUCa!aAa1s6ZCB(s>ftkTmGD>aAGadm@QucK9b6Mw<&;$Ti`?!1n diff --git a/android/BOINC/res/drawable-mdpi/cogsw.png b/android/BOINC/res/drawable-mdpi/cogsw.png new file mode 100644 index 0000000000000000000000000000000000000000..02faac134f89c49b0c8fc453634778a0d6ef9db3 GIT binary patch literal 3498 zcmb_f4OA4@6P!Wkl`71ddjuzW&C?SO4Ptr7v3F({JpX?H18&5fB zVc&cAe)oIdz3;w9<>s^v3j#v|B@)Sk35Woz00x33|Xbvw{OGR89eix=uDI%Kig=(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lQEjpA>jQEiLYdE%Ym<7LVj2y{EL;Gl%_kIxNGl!0J3V*MF0Q* literal 0 HcmV?d00001 diff --git a/android/BOINC/res/drawable-mdpi/chartw.png b/android/BOINC/res/drawable-mdpi/playw.png similarity index 69% rename from android/BOINC/res/drawable-mdpi/chartw.png rename to android/BOINC/res/drawable-mdpi/playw.png index 4375b7ce93c2b12b044c90f6929ec45ac96fc2ac..75fa515d44c9608518d08600642519165a758ee0 100644 GIT binary patch delta 449 zcmbO)^IdX-05hY>WI<+C4ogdCBR6w1)5&(s=Exl7$qSfekOd?+-({|4MHZ2rT+gWp zG-e@ZAB(lp)4!XIxl$PG8NEDR978H@y$QRW+2SA)tGHl6hepSy4y8xsmmIx3y*4!8 zta!A0sEPChOUk<$vE{$R6^U!p3z&9xc+GJDMF zZ+@|ImDFXi53)|amy2%6a!9mUzS@;E@4_|(r`ElH>*R$`9%vHqvy*NUyu|nL$>z*i z?bSYw{k7Y4w3pkq-FO~;d)wrz-w#Bx6>P9MUZ^yyo8x|!oS=Qob>3~+zuI`SA9^=1 ZGNjMkukOTt|c)I$ztaD0e0s!r)xcmSB delta 748 zcmew^IbUXj05hY-WI<+C4o4RYCr4v5i^+D(=Exl7$qSfekOd?+-({|4MHZ2rT+gWp zG-e@ZA4{I8;-AgNTq%t8Ohuk9jv*Dd-h@YYJ#rAay3n3Q&{%2T(Kx3n*2ixg$`isa zeBqk2WdG#r5K23jH zR-P-hW|@8VS(si$w~La#$<4g&Odii2+Y=6kMm?}hI56dFmF@#grvt?nGW#ML*e2iH z<0t()VQGfRs`X*3**dcGZ20TmeUvED5ev@T6r=a@<8AG4EzHZW&~drx$k<}PVGG2{Gm(FYpyn5x_NO;&uvduZMagJ6+;>T@czw&(DlNi$a8G|NLJ zWSiOs;jlebR)?i|{GI;A-QnE1)o9HlVecsY;vdJ0trw(`OCWO6%9xEo(k_ z8P(4W$uOGhXS!Vc@2P+%-aW!A5{qvtJr%md>wn{WcDa+~RIiyk4dwbz?sd_s@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04_G`)z0{bd+)vSl=8x% z1BEfV|Hkz{7k~cvr(WY`clL>A?jCylvuBkf_1p9BE_~i;pFjG0CI7tBy>;=oJ8vHU z;FR*%{v+?~yZTmc-~J=7UcUFy@n4>-e4*TU@oVL6_r~9^y?^J1pxJD+>z^!MzV;6{ C - - + diff --git a/android/BOINC/res/drawable/pausew24.png b/android/BOINC/res/drawable/pausew24.png index bbc8b81a139ff8c0394740db26b13631fdf2c2ac..faf9461371a95a8e19ffc0fc55a18be197b019be 100644 GIT binary patch literal 3110 zcmb_eO>7%Q6y7#!sZw%4NG0^bXnWv5?cH_iq+Z#nT-$9d#c7qgG~&{(cgOZL``4Lq z?34qg7sLTh2q7+1;()jyB*X!M1QHyIxKI(KsuBosf&&7HOVz3kZ)WZ7Zt4aa5jlxx z=DqKI^Sw83=JnG{C#NP4PAZBrRbQws!~bdVyKgW2{iR>JttgXwNppp-G!{)e@UoT@ zv~YIdg|MzD#bblevR5%jE!-h~N&WNlFI7aGl6o%R&>LX|cgezKiqBkLYTB1q?Si8o zo1ZKWOaSmOx6r_IeP#|ys>C(nyO`EgBu)5gNiBMW9Swif`AJlyPTO3ro)`v$QAzD`9-5lg@AtF)nQTBi zno%ee1V}EI0gDV<_qjF5`0S8?h%l;{*_4Ew1U?d&Rx9Z7lB&Ww8tudjmr19~SscP= zL(M=vZD56(k<~RSZM3APW5+IGkGhhRV{6#O9`-o{HzQ?V54n8=WE85zo=YY;*@C%M90(j}^io8HyYcUdtQnayd2{B-3%UX2GqP_q%(~CG<=ePkEvW#WCB!icwMy>9+-&}6E_bvB7=@#S zN<}Xl<*J@Lp0DH*?$yBVi3E<^oyT)O1(ia4%iR%-C|p#0pvYNfb#N0?kI9v&sLL*o zM$ynEqLNM5@;k8KjDy=&&*kcTg<^}7H4LZF^8%ltGUt@Edg3r-mI7Z)V`>x2MJ}ez4LryD%0(Ua@l*JJ*Lj*sG1-$%87rWb0InLF*Zp=NZ<4ePIZNGh z0fn0|ac6bn;?F|cRW-TK;;@^Wbq~(@5Imv4sP5w;meCLz=e7hzTvEq|L6Q0+w4yf7 zKTW6-gzGXPr}{qL_E>MBly=++sWd`F3wjSU_5}i6gRcJvf#iK;LW-c*l~iV}VMlg& z=&sQc+36h-BlNo%ptrw|Vq?1t-C101ns_XU>ugv752fazokqETllwPF3Kt4WcenG^_3P7DviCPPH>VaC7oYil)vvBYyw}VoOIv0RI600RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_ z000McNliru-2@L38w>8ycFO<&0GmlfK~zY`?UgYO0x=8(*G_(MJP*V}?h7a%8c7Llp<-2I`d z_m4M{oJkr<@5V^ZN!GLJGc_JEGbUsbh}P`aifU5P=6<(i>z-E)f @@ -94,36 +95,5 @@ android:textAppearance="?android:attr/textAppearanceSmall" /> - - - - - - - diff --git a/android/BOINC/res/menu/status_menu.xml b/android/BOINC/res/menu/main_menu.xml similarity index 72% rename from android/BOINC/res/menu/status_menu.xml rename to android/BOINC/res/menu/main_menu.xml index 67c06a33d1..30a858a303 100644 --- a/android/BOINC/res/menu/status_menu.xml +++ b/android/BOINC/res/menu/main_menu.xml @@ -5,5 +5,7 @@ android:visible="true" android:title="@string/menu_exit" android:icon="@drawable/offw"> - + \ No newline at end of file diff --git a/android/BOINC/res/values/strings.xml b/android/BOINC/res/values/strings.xml index 40010746e7..20c700f162 100644 --- a/android/BOINC/res/values/strings.xml +++ b/android/BOINC/res/values/strings.xml @@ -123,14 +123,12 @@ Computation suspended. Nothing to do Waiting for tasks… - Stopped - Allow computation to continue! + Disabled + Press play! Starting… Add a project! Closing… Benchmarking… - Stop computation - Allow computation Reading preferences… @@ -276,5 +274,7 @@ Email to… Send mail… Exit BOINC + Stop + Continue diff --git a/android/BOINC/src/edu/berkeley/boinc/BOINCActivity.java b/android/BOINC/src/edu/berkeley/boinc/BOINCActivity.java index 58c9664aab..7b56a75e58 100644 --- a/android/BOINC/src/edu/berkeley/boinc/BOINCActivity.java +++ b/android/BOINC/src/edu/berkeley/boinc/BOINCActivity.java @@ -20,6 +20,7 @@ package edu.berkeley.boinc; import edu.berkeley.boinc.client.ClientStatus; import edu.berkeley.boinc.client.Monitor; +import edu.berkeley.boinc.utils.BOINCDefs; import android.app.Service; import android.app.TabActivity; import android.content.BroadcastReceiver; @@ -292,10 +293,28 @@ public class BOINCActivity extends TabActivity { Log.d(TAG, "onCreateOptionsMenu()"); MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.status_menu, menu); + inflater.inflate(R.menu.main_menu, menu); return true; } + + @Override + public boolean onPrepareOptionsMenu(Menu menu) { + //customize run mode menu, according to current status + MenuItem item = menu.findItem(R.id.run_mode); + + if(Monitor.getClientStatus().computingStatus == ClientStatus.COMPUTING_STATUS_NEVER) { + // display play button + item.setTitle(R.string.menu_run_mode_enable); + item.setIcon(R.drawable.playw); + } else { + // display stop button + item.setTitle(R.string.menu_run_mode_disable); + item.setIcon(R.drawable.stopw); + } + + return super.onPrepareOptionsMenu(menu); + } @Override public boolean onOptionsItemSelected(MenuItem item) { @@ -306,11 +325,20 @@ public class BOINCActivity extends TabActivity { Log.d(TAG,"exit BOINC"); new QuitClientAsync().execute(); return true; + case R.id.run_mode: + if(item.getTitle().equals(getApplication().getString(R.string.menu_run_mode_disable))) { + Log.d(TAG,"run mode: disable"); + new WriteClientRunModeAsync().execute(BOINCDefs.RUN_MODE_NEVER); + } else if (item.getTitle().equals(getApplication().getString(R.string.menu_run_mode_enable))) { + Log.d(TAG,"run mode: enable"); + new WriteClientRunModeAsync().execute(BOINCDefs.RUN_MODE_AUTO); + } else Log.d(TAG,"run mode: unrecognized command"); + return true; default: return super.onOptionsItemSelected(item); } } - + // monitor.quitClient is blocking (Thread.sleep) // execute in AsyncTask to maintain UI responsiveness private final class QuitClientAsync extends AsyncTask { @@ -321,4 +349,20 @@ public class BOINCActivity extends TabActivity { return null; } } + + private final class WriteClientRunModeAsync extends AsyncTask { + + private final String TAG = "WriteClientRunModeAsync"; + + @Override + protected Boolean doInBackground(Integer... params) { + return monitor.setRunMode(params[0]); + } + + @Override + protected void onPostExecute(Boolean success) { + if(success) monitor.forceRefresh(); + else Log.w(TAG,"setting run mode failed"); + } + } } diff --git a/android/BOINC/src/edu/berkeley/boinc/StatusActivity.java b/android/BOINC/src/edu/berkeley/boinc/StatusActivity.java index 6ce537e404..877f328fbe 100644 --- a/android/BOINC/src/edu/berkeley/boinc/StatusActivity.java +++ b/android/BOINC/src/edu/berkeley/boinc/StatusActivity.java @@ -30,6 +30,7 @@ import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; import android.graphics.Bitmap; +import android.os.AsyncTask; import android.os.Bundle; import android.os.IBinder; import android.util.Log; @@ -37,6 +38,7 @@ import android.view.GestureDetector; import android.view.GestureDetector.SimpleOnGestureListener; import android.view.MotionEvent; import android.view.View; +import android.view.View.OnClickListener; import android.view.View.OnTouchListener; import android.view.ViewGroup.LayoutParams; import android.widget.ImageView; @@ -44,7 +46,7 @@ import android.widget.LinearLayout; import android.widget.TextView; import android.widget.ViewFlipper; -public class StatusActivity extends Activity { +public class StatusActivity extends Activity implements OnClickListener{ private final String TAG = "BOINC StatusActivity"; @@ -171,8 +173,6 @@ public class StatusActivity extends Activity { TextView statusHeader = (TextView) findViewById(R.id.status_header); ImageView statusImage = (ImageView) findViewById(R.id.status_image); TextView statusDescriptor = (TextView) findViewById(R.id.status_long); - ImageView changeRunmodeImage = (ImageView) findViewById(R.id.status_change_runmode_image); - TextView changeRunmodeDescriptor = (TextView) findViewById(R.id.status_change_runmode_long); imageFrame = (ViewFlipper) findViewById(R.id.slideshowFrame); // adapt to specific computing status @@ -180,25 +180,18 @@ public class StatusActivity extends Activity { case ClientStatus.COMPUTING_STATUS_NEVER: imageFrame.setVisibility(View.GONE); statusHeader.setText(R.string.status_computing_disabled); - statusImage.setImageResource(R.drawable.stopw48); + statusImage.setImageResource(R.drawable.playw48); statusImage.setContentDescription(getString(R.string.status_computing_disabled)); + statusImage.setClickable(true); + statusImage.setOnClickListener(this); statusDescriptor.setText(R.string.status_computing_disabled_long); - changeRunmodeImage.setImageResource(R.drawable.playw24); - changeRunmodeImage.setContentDescription(getString(R.string.enable_computation)); - changeRunmodeImage.setTag(true); - changeRunmodeDescriptor.setText(R.string.enable_computation); - changeRunmodeDescriptor.setTag(true); break; case ClientStatus.COMPUTING_STATUS_SUSPENDED: imageFrame.setVisibility(View.GONE); statusHeader.setText(R.string.status_paused); statusImage.setImageResource(R.drawable.pausew48); statusImage.setContentDescription(getString(R.string.status_paused)); - changeRunmodeImage.setImageResource(R.drawable.stopw24); - changeRunmodeImage.setContentDescription(getString(R.string.disable_computation)); - changeRunmodeImage.setTag(false); - changeRunmodeDescriptor.setText(R.string.disable_computation); - changeRunmodeDescriptor.setTag(false); + statusImage.setClickable(false); switch(status.computingSuspendReason) { case BOINCDefs.SUSPEND_REASON_BATTERIES: statusDescriptor.setText(R.string.suspend_batteries); @@ -271,11 +264,7 @@ public class StatusActivity extends Activity { statusHeader.setText(R.string.status_idle); statusImage.setImageResource(R.drawable.pausew48); statusImage.setContentDescription(getString(R.string.status_idle)); - changeRunmodeImage.setImageResource(R.drawable.stopw24); - changeRunmodeImage.setContentDescription(getString(R.string.disable_computation)); - changeRunmodeImage.setTag(false); - changeRunmodeDescriptor.setText(R.string.disable_computation); - changeRunmodeDescriptor.setTag(false); + statusImage.setClickable(false); Integer networkState = 0; try{ networkState = status.networkSuspendReason; @@ -292,15 +281,10 @@ public class StatusActivity extends Activity { if(!loadSlideshow()) { Log.d(TAG, "slideshow not available, load plain old status instead..."); statusHeader.setText(R.string.status_running); - statusImage.setImageResource(R.drawable.playw48); + statusImage.setImageResource(R.drawable.cogsw48); statusImage.setContentDescription(getString(R.string.status_running)); statusDescriptor.setText(R.string.status_running_long); } - changeRunmodeImage.setImageResource(R.drawable.stopw24); - changeRunmodeImage.setContentDescription(getString(R.string.disable_computation)); - changeRunmodeImage.setTag(false); - changeRunmodeDescriptor.setText(R.string.disable_computation); - changeRunmodeDescriptor.setTag(false); break; } computingStatus = status.computingStatus; //save new computing status @@ -311,19 +295,6 @@ public class StatusActivity extends Activity { } } - public void onClick (View v) { - Log.d(TAG,"onClick"); - if(!mIsBound) {Log.w(TAG,"not bound");return;} - try { - Boolean enable = (Boolean) v.getTag(); - if(enable) { - monitor.setRunMode(BOINCDefs.RUN_MODE_AUTO); - } else { - monitor.setRunMode(BOINCDefs.RUN_MODE_NEVER); - } - } catch (Exception e) {Log.e(TAG, "could not map status tag", e);} - } - private Boolean loadSlideshow() { // get slideshow images ArrayList images = Monitor.getClientStatus().getSlideshowImages(); @@ -356,4 +327,25 @@ public class StatusActivity extends Activity { return true; } + + @Override + public void onClick(View v) { + new WriteClientRunModeAsync().execute(BOINCDefs.RUN_MODE_AUTO); + } + + private final class WriteClientRunModeAsync extends AsyncTask { + + private final String TAG = "WriteClientRunModeAsync"; + + @Override + protected Boolean doInBackground(Integer... params) { + return monitor.setRunMode(params[0]); + } + + @Override + protected void onPostExecute(Boolean success) { + if(success) monitor.forceRefresh(); + else Log.w(TAG,"setting run mode failed"); + } + } } diff --git a/android/BOINC/src/edu/berkeley/boinc/client/Monitor.java b/android/BOINC/src/edu/berkeley/boinc/client/Monitor.java index e19b116101..ea188edda4 100644 --- a/android/BOINC/src/edu/berkeley/boinc/client/Monitor.java +++ b/android/BOINC/src/edu/berkeley/boinc/client/Monitor.java @@ -594,9 +594,8 @@ public class Monitor extends Service { stopSelf(); } - public void setRunMode(Integer mode) { - //execute in different thread, in order to avoid network communication in main thread and therefore ANR errors - (new WriteClientRunModeAsync()).execute(mode); + public Boolean setRunMode(Integer mode) { + return rpc.setRunMode(mode, 0); } // writes the given GlobalPreferences via RPC to the client @@ -1089,26 +1088,4 @@ public class Monitor extends Service { Log.d(TAG, "onProgressUpdate - " + arg0[0]); } } - - private final class WriteClientRunModeAsync extends AsyncTask { - - private final String TAG = "WriteClientRunModeAsync"; - - @Override - protected Boolean doInBackground(Integer... params) { - Boolean success = rpc.setRunMode(params[0], 0); - publishProgress("run mode set to " + params[0] + " returned " + success); - return success; - } - - @Override - protected void onPostExecute(Boolean success) { - forceRefresh(); - } - - @Override - protected void onProgressUpdate(String... arg0) { - Log.d(TAG, "onProgressUpdate - " + arg0[0]); - } - } }