From 3013ef1ee65a58f3a842b24e1a155cdecf3591b5 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Thu, 13 Sep 2012 18:31:56 +0100 Subject: [PATCH] windows statusicon: new icons --- SparkleShare/Linux/SparkleSetup.cs | 2 +- SparkleShare/SparkleStatusIconController.cs | 10 --- .../Windows/Pixmaps/process-syncing-down.png | Bin 0 -> 701 bytes ...syncing-i.png => process-syncing-idle.png} | Bin .../Windows/Pixmaps/process-syncing-ii.png | Bin 527 -> 0 bytes .../Windows/Pixmaps/process-syncing-iii.png | Bin 518 -> 0 bytes .../Windows/Pixmaps/process-syncing-iiii.png | Bin 509 -> 0 bytes .../Windows/Pixmaps/process-syncing-iiiii.png | Bin 534 -> 0 bytes .../Windows/Pixmaps/process-syncing-up.png | Bin 0 -> 695 bytes .../Windows/Pixmaps/process-syncing.png | Bin 0 -> 634 bytes SparkleShare/Windows/SparkleShare.csproj | 13 ++-- SparkleShare/Windows/SparkleStatusIcon.cs | 67 ++++++++++-------- 12 files changed, 45 insertions(+), 47 deletions(-) create mode 100644 SparkleShare/Windows/Pixmaps/process-syncing-down.png rename SparkleShare/Windows/Pixmaps/{process-syncing-i.png => process-syncing-idle.png} (100%) delete mode 100644 SparkleShare/Windows/Pixmaps/process-syncing-ii.png delete mode 100644 SparkleShare/Windows/Pixmaps/process-syncing-iii.png delete mode 100644 SparkleShare/Windows/Pixmaps/process-syncing-iiii.png delete mode 100644 SparkleShare/Windows/Pixmaps/process-syncing-iiiii.png create mode 100644 SparkleShare/Windows/Pixmaps/process-syncing-up.png create mode 100644 SparkleShare/Windows/Pixmaps/process-syncing.png diff --git a/SparkleShare/Linux/SparkleSetup.cs b/SparkleShare/Linux/SparkleSetup.cs index 932d3323..f92edcec 100755 --- a/SparkleShare/Linux/SparkleSetup.cs +++ b/SparkleShare/Linux/SparkleSetup.cs @@ -109,7 +109,7 @@ namespace SparkleShare { Sensitive = false }; - continue_button.Clicked += delegate (object o, EventArgs args) { + continue_button.Clicked += delegate { Controller.SetupPageCompleted (name_entry.Text, email_entry.Text); }; diff --git a/SparkleShare/SparkleStatusIconController.cs b/SparkleShare/SparkleStatusIconController.cs index 6277c624..f508eaa3 100755 --- a/SparkleShare/SparkleStatusIconController.cs +++ b/SparkleShare/SparkleStatusIconController.cs @@ -153,8 +153,6 @@ namespace SparkleShare { UpdateMenuEvent (CurrentState); }; - int periods = 3; - Program.Controller.OnSyncing += delegate { int repos_syncing_up = 0; int repos_syncing_down = 0; @@ -182,14 +180,6 @@ namespace SparkleShare { StateText = "Receiving changes"; } - periods++; - - for (int i = 0; i < periods; i++) - StateText += "."; - - if (periods == 3) - periods = 0; - StateText += " " + ProgressPercentage + "% " + ProgressSpeed; UpdateIconEvent (CurrentState); diff --git a/SparkleShare/Windows/Pixmaps/process-syncing-down.png b/SparkleShare/Windows/Pixmaps/process-syncing-down.png new file mode 100644 index 0000000000000000000000000000000000000000..6115d9f66c66fac7e912742bb5f3a74adbdf7f44 GIT binary patch literal 701 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4oq%*UsPYKihVm-}3aj{r@wHi#JBtus0tpUwWmvL#K>U zWP;D~%g;APym4~b;-Da~W9`+f_0?Q9OfkCCPmBNDJ?+3&eh#U&!X5d?i=84S0#akd}cayys7r6p{&tBI8A zRIk5$3@6ey^Rzqfx~n(Wul;0-liK8)qO1>!%w~Vxw*O{^iO})FB>@^IDr~Opdst&v z&nVN7vNB}XN1OM#)>qztPc@LpXb)d~b;-qyD~-ZOpL;K1khZvS`}1y_2b??pGrZIN Wbo)!_n?hjRGI+ZBxvXDu}w!g)YP(f{3V?Q8F_t5y72;k08Vcj=0o_ zB0f-jpOggy19nfyfzyk=U0>Hdb?*&;8`3+nKz4}u3BRo;{SDI$mIbEC6h_0)oKKTK@0|i ztMw~Dx7&qYujhhjGzzEFiRpBTTrP)jIQ(xwB9TBgn?!{NYiI1~q@QYi!i0qk}=m`o--Jlx^_ z{wKdLm&-UD4!o^at0fMgX~1r`qf{!PR;%Im_6Gs(;PH4k#MNpAl}g2DL=;f3*P+wt z&~CTka=Bo!Sm5<~Ig5Ba4y{&;OeQ0pfz@h7uh+w5GQoDc#rb?jEEYqdP=MR*elbLD zU!&1*27bSvJMsB^9N>67=J66x6!3-q)&Ys`0~(D6n$0F=vl)-oX0!1`j7B4#i*k6R zS{>g7YTbW2o&G>X)oK-?P>4tRBWF0{Ij9&0hwdvsxWV Rwr>Cc002ovPDHLkV1j(d>0bZ< diff --git a/SparkleShare/Windows/Pixmaps/process-syncing-iii.png b/SparkleShare/Windows/Pixmaps/process-syncing-iii.png deleted file mode 100644 index 724486a12e69e65888eb7a8ce39db07d3dca5c65..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 518 zcmV+h0{Q)kP)9GwJ1DtYtva+P z5r1e2FwS*4oop}|px5hFv|6oq>_mgVSwPzF_b>Q=?1cz_pg_G|hu7;xx7)>byG1-6 zhsWbVtJP8|s06scX0sue%fab%!elZ*mSxmxHAs?#YPI^kK(SavAP@irisf>N$z+20 ze2(#Wj7TJcQmOR4K)>II!{PYn-7){$#{JH zi*!1LMx()QL^f`>8?)I=EwETDI4r@@XhZ@b+~3FP)Ccetm&;{wfZcBAK-B`_a2T;z zOxQ0J3dm-&Fq_S6Ut}_!PLauE*u~c^B$G*DKN^jS^aIf&wZ5(`K`I#wVmwDfoOoR4Nq_+$Zo`d7)afcndT%w}->w z6$;RJb1UK+o6RN^;4t54Uj9(+1q+-Ke-W=$k42j|#4F<2JLj>pk}4I}y#N3J07*qo IM6N<$g2j37+5i9m diff --git a/SparkleShare/Windows/Pixmaps/process-syncing-iiii.png b/SparkleShare/Windows/Pixmaps/process-syncing-iiii.png deleted file mode 100644 index dc62753d49d631d02be76e9f0a5781ef04397566..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 509 zcmVN&Tl2TkL-TrU6CKA#VR!2pMl z6-cF0kR%C(LIF0L4OXiaq9`I548rYp|1A&-g^Fhm&-*ixC6ajkN5WkqR|MiTdfv%;P?B<&8fh0xrD`HL8H;YYPG_6JVq{; zgV}6GBoaYBpQkhQb*Pzq2DMs^f}-v``D(SwGwAhtJlI$)MonY{WI!Sm808@d0>a@i zlF1~x-R?;S56toxj$kkt&~CRWRNnm<>-D2w-8osMktU=Kj` zl>M2n?CuQ-oH1TAipR^MR;ynWmWWpWj`89fxFxegAqq&A00000NkvXXu0mjfCRyff diff --git a/SparkleShare/Windows/Pixmaps/process-syncing-iiiii.png b/SparkleShare/Windows/Pixmaps/process-syncing-iiiii.png deleted file mode 100644 index 559dd3e03ee0bd2d34c818659b01475338f3ddc4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 534 zcmV+x0_pvUP)hy)iez91*tk-KCYd)X1 z*gJvgQVPK1i%cd9DV0hn6p9mRG@2-{L_$9~K-g}#BF@Baw$8Ga2d*=z=n$AfaYj9RTm&$(O< z^?Ducb{jgK?mS?%TES+sL8VghY?R&UbkcpJ(Lg?*=N9PwcsxD@Y&ILPNl?aaw@alz zJlx~)F$1&Nj83P6Y&Hw4)k=*$Yr*Amp<1m{)8g?sVzC%9nL9i`KVdK!&{#*Kk#rAQ ztri49;91CTu~_8)0SpEMn$0Hcb~`m!3UC-zGMPjm5I`!G;(n>*;c!ScwOTFu{r<;e z4243dR4UYuNF)NeTn@cn4~N4+HbhZ;1Gru;mw%4|(P$LGV34NZcDup$geqVb3Ce=+ zipb9XqFpc=jlWr$!&gAB*F!iQMyXUfbo`yoe_pTm4?Fvf13oc*WzwB2i==4ve=vRi Y4-b^Hn_~xpjsO4v07*qoM6N<$g8!83asU7T diff --git a/SparkleShare/Windows/Pixmaps/process-syncing-up.png b/SparkleShare/Windows/Pixmaps/process-syncing-up.png new file mode 100644 index 0000000000000000000000000000000000000000..1a1e1ebdd711f91228ec2cf5a6e96b30429cf9f6 GIT binary patch literal 695 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4D;RVJUD;I}+;Yg9z`clIr}bA>utZstsj(QAKRSzru=?4=W76vdlXu1lpeED5lwfElp1_K_+{^L_lKYbsyG$_$%ra)U_O4sZavQIz% zd|xlXvS{nQPaEPM@BfnDz`aLTtlLpX%=%u=k;jEyN0k`%y?<2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR42h4RsE*N zJE@~T;jGytk8Kfa-_$Zm39VRh;1v4;6_unK#^lDY`x*pKyqS@`P;u7X*4E2s&f9)J zJ@aIbkl>V{(g#chC$hAZCeNv5xO4ww&BlnBUF)hpZJ)91Nb!@lCv4FK<@>X-tRXaAMH&|!CjVYVX`cAvyxy8A{i<0Ii7+1Wx_`|=o;bzXZ zdE0O2PCK1i=`cy9$8GV~TT$NkSf4ZX7=HO(+hgeZ(2Tk5u%hRrl%7HvV+o#Z%u#E_ z?&g^%f2o~sz_XqC(~_-fT}oT7{brnXR&C#V@oV{EtFPW(cm9HeF?*gYgW$zpx5plu zr4ecqJ8HgE?LGdn!Y1&~pA*Il_++LqGQ=O?Hu%ft*nix5lQbtV(J(N0y85}Sb4q9e E0D3|A&Hw-a literal 0 HcmV?d00001 diff --git a/SparkleShare/Windows/SparkleShare.csproj b/SparkleShare/Windows/SparkleShare.csproj index ecb3561e..0e68038f 100644 --- a/SparkleShare/Windows/SparkleShare.csproj +++ b/SparkleShare/Windows/SparkleShare.csproj @@ -34,7 +34,7 @@ none - false + False ..\..\bin prompt 4 @@ -103,7 +103,7 @@ - + @@ -206,6 +206,10 @@ Pixmaps\process-working-22.png + + + + @@ -260,11 +264,6 @@ - - - - - diff --git a/SparkleShare/Windows/SparkleStatusIcon.cs b/SparkleShare/Windows/SparkleStatusIcon.cs index abbd730b..8986bdcb 100644 --- a/SparkleShare/Windows/SparkleStatusIcon.cs +++ b/SparkleShare/Windows/SparkleStatusIcon.cs @@ -32,9 +32,12 @@ namespace SparkleShare { public class SparkleStatusIcon : Control { public SparkleStatusIconController Controller = new SparkleStatusIconController(); - - private Drawing.Bitmap [] animation_frames; - private Drawing.Bitmap error_icon; + + private Drawing.Bitmap syncing_idle_image; + private Drawing.Bitmap syncing_up_image; + private Drawing.Bitmap syncing_down_image; + private Drawing.Bitmap syncing_image; + private Drawing.Bitmap syncing_error_image; private ContextMenu context_menu; @@ -45,25 +48,45 @@ namespace SparkleShare { private SparkleNotifyIcon notify_icon = new SparkleNotifyIcon (); - - + public SparkleStatusIcon () { - CreateAnimationFrames (); - - this.notify_icon.Icon = animation_frames [0]; + this.syncing_idle_image = SparkleUIHelpers.GetBitmap ("process-syncing-idle"), + this.syncing_up_image = SparkleUIHelpers.GetBitmap ("process-syncing-up"), + this.syncing_down_image = SparkleUIHelpers.GetBitmap ("process-syncing-down"), + this.syncing_image = SparkleUIHelpers.GetBitmap ("process-syncing"), + this.syncing_error_image = SparkleUIHelpers.GetBitmap ("process-syncing-error") + + this.notify_icon.Icon = this.syncing_idle_image; this.notify_icon.HeaderText = "SparkleShare"; CreateMenu (); - - Controller.UpdateIconEvent += delegate (int icon_frame) { + Controller.UpdateIconEvent += delegate (IconState state) { Dispatcher.BeginInvoke ((Action) delegate { - if (icon_frame > -1) - this.notify_icon.Icon = animation_frames [icon_frame]; - else - this.notify_icon.Icon = this.error_icon; - }); + switch (state) { + case IconState.Idle: { + this.notify_icon.Icon = this.syncing_idle_image; + break; + } + case IconState.SyncingUp: { + this.notify_icon.Icon = this.syncing_up_image; + break; + } + case IconState.SyncingDown: { + this.notify_icon.Icon = this.syncing_down_image; + break; + } + case IconState.Syncing: { + this.notify_icon.Icon = this.syncing_image_image; + break; + } + case IconState.Error: { + this.notify_icon.Icon = this.syncing_error_image; + break; + } + } + }); }; Controller.UpdateStatusItemEvent += delegate (string state_text) { @@ -277,20 +300,6 @@ namespace SparkleShare { { this.notify_icon.Dispose (); } - - - private void CreateAnimationFrames () - { - this.animation_frames = new Drawing.Bitmap [] { - SparkleUIHelpers.GetBitmap ("process-syncing-i"), - SparkleUIHelpers.GetBitmap ("process-syncing-ii"), - SparkleUIHelpers.GetBitmap ("process-syncing-iii"), - SparkleUIHelpers.GetBitmap ("process-syncing-iiii"), - SparkleUIHelpers.GetBitmap ("process-syncing-iiiii") - }; - - this.error_icon = SparkleUIHelpers.GetBitmap ("process-syncing-error"); - } // A method reference that makes sure that opening the