From 18f871122381c1071bfa66bdec1630ba576e7821 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 7 Oct 2012 17:57:56 +0200 Subject: [PATCH] new default user icon --- SparkleShare/Common/HTML/event-entry.html | 2 +- SparkleShare/Common/Pixmaps/Makefile.am | 12 +- .../Common/Pixmaps/Sources/avatars.svg | 676 ------------------ .../Pixmaps/Sources/user-icon-default.svg | 263 +++++++ SparkleShare/Common/Pixmaps/avatar-a.png | Bin 309 -> 0 bytes SparkleShare/Common/Pixmaps/avatar-b.png | Bin 349 -> 0 bytes SparkleShare/Common/Pixmaps/avatar-c.png | Bin 436 -> 0 bytes SparkleShare/Common/Pixmaps/avatar-d.png | Bin 355 -> 0 bytes SparkleShare/Common/Pixmaps/avatar-e.png | Bin 347 -> 0 bytes SparkleShare/Common/Pixmaps/avatar-f.png | Bin 377 -> 0 bytes SparkleShare/Common/Pixmaps/avatar-g.png | Bin 346 -> 0 bytes SparkleShare/Common/Pixmaps/avatar-h.png | Bin 358 -> 0 bytes SparkleShare/Common/Pixmaps/avatar-i.png | Bin 316 -> 0 bytes SparkleShare/Common/Pixmaps/avatar-j.png | Bin 329 -> 0 bytes SparkleShare/Common/Pixmaps/avatar-k.png | Bin 318 -> 0 bytes .../Common/Pixmaps/user-icon-default.png | Bin 0 -> 1073 bytes SparkleShare/Mac/SparkleShare.csproj | 36 +- SparkleShare/SparkleControllerBase.cs | 11 - SparkleShare/SparkleEventLogController.cs | 10 +- SparkleShare/Windows/SparkleEventLog.cs | 30 +- SparkleShare/Windows/SparkleShare.csproj | 34 +- 21 files changed, 286 insertions(+), 788 deletions(-) delete mode 100644 SparkleShare/Common/Pixmaps/Sources/avatars.svg create mode 100644 SparkleShare/Common/Pixmaps/Sources/user-icon-default.svg delete mode 100644 SparkleShare/Common/Pixmaps/avatar-a.png delete mode 100644 SparkleShare/Common/Pixmaps/avatar-b.png delete mode 100644 SparkleShare/Common/Pixmaps/avatar-c.png delete mode 100644 SparkleShare/Common/Pixmaps/avatar-d.png delete mode 100644 SparkleShare/Common/Pixmaps/avatar-e.png delete mode 100644 SparkleShare/Common/Pixmaps/avatar-f.png delete mode 100644 SparkleShare/Common/Pixmaps/avatar-g.png delete mode 100644 SparkleShare/Common/Pixmaps/avatar-h.png delete mode 100644 SparkleShare/Common/Pixmaps/avatar-i.png delete mode 100644 SparkleShare/Common/Pixmaps/avatar-j.png delete mode 100644 SparkleShare/Common/Pixmaps/avatar-k.png create mode 100644 SparkleShare/Common/Pixmaps/user-icon-default.png diff --git a/SparkleShare/Common/HTML/event-entry.html b/SparkleShare/Common/HTML/event-entry.html index d4f45d9a..00cffea3 100755 --- a/SparkleShare/Common/HTML/event-entry.html +++ b/SparkleShare/Common/HTML/event-entry.html @@ -1,5 +1,5 @@
-
+
Show all diff --git a/SparkleShare/Common/Pixmaps/Makefile.am b/SparkleShare/Common/Pixmaps/Makefile.am index 4b8fec4c..c4073c15 100644 --- a/SparkleShare/Common/Pixmaps/Makefile.am +++ b/SparkleShare/Common/Pixmaps/Makefile.am @@ -1,17 +1,7 @@ dist_pixmaps_DATA = \ tutorial-slide-4.png \ side-splash.png \ - avatar-a.png \ - avatar-b.png \ - avatar-c.png \ - avatar-d.png \ - avatar-e.png \ - avatar-f.png \ - avatar-g.png \ - avatar-h.png \ - avatar-i.png \ - avatar-j.png \ - avatar-k.png \ + user-icon-default.png \ about.png pixmapsdir = $(pkgdatadir)/pixmaps/ diff --git a/SparkleShare/Common/Pixmaps/Sources/avatars.svg b/SparkleShare/Common/Pixmaps/Sources/avatars.svg deleted file mode 100644 index 1fcc93a6..00000000 --- a/SparkleShare/Common/Pixmaps/Sources/avatars.svg +++ /dev/null @@ -1,676 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/SparkleShare/Common/Pixmaps/Sources/user-icon-default.svg b/SparkleShare/Common/Pixmaps/Sources/user-icon-default.svg new file mode 100644 index 00000000..60067dd1 --- /dev/null +++ b/SparkleShare/Common/Pixmaps/Sources/user-icon-default.svg @@ -0,0 +1,263 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/SparkleShare/Common/Pixmaps/avatar-a.png b/SparkleShare/Common/Pixmaps/avatar-a.png deleted file mode 100644 index dae5a1a006a8af20c35b8c8e586e0ce7d64a2a5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 309 zcmV-50m}Y~P)6m&YeuoSNk6D0^8H@G(*?O6l2pHus$Y6?ElMGk|EQ3J>1IT3sWKgOo0<55l zT>yIpy($2L*Mkr6f2V2z7C^E<5I_K{d;=Sp%{MUHAPKL{Zu|#Ea3XvFNZ^&O0u%Vr z-&Q+8S3I7la%AX_CW7w5F#R?JA8^a@Qf_R5D%`SMb+AOSMFTA=HS65>-}|uXU<>|2 v{!(ZGyaS46`}_Cz_wVoT^78We`T6kh@bU5S`1tts_4V}h^!obx{QUg$^Yixh z_6@c*0RR92Hc3Q5RCr$H(%EXoFbo9H8OiIC_5VM%klv8RxpwGl&!b?>2n+w6EN(Kk zj2^qNMl+Wo<54jD7_do}A5l<|!h=l!2IY<>;4bpa2u5DqYc0GgUU@O&!YglP-Z-2M z?9!(VjIuJ@&oJS{{Pu=r#R1FKZ^S`JS`T~)0ONfLIV%g$QQMOFDOKeiy e1-ALW27Un39tvx9sdE4T0000{Q3F$`1ttu_xJYp_VDoV^z`)m`}_6v z_2j(JsQ>@~>M=zplUo6$%o50W1`i zp9N=%lY%omgg$C741mkXzDgR{R;}r*Y7F+d522UC{zl3%7WPWtw#ibZ{eh!M_nrouEaR=QK(dStT6D|%n6Q7_+F3B#IEcN;F4bo z*rzj~&>_kD=$c+bTbdLDnU7|iFyWCH&P?L8cUj{u8!o9?NcLQDoh8F%8q-}=oT_2v z!5YTBmX$Bo1+I;6ZEyrS0zO@cgg3O))zvR_y_9f3oQ3llo=qH@oCS3iJexT*|2Xgk XJi`cGU;VN`00000NkvXXu0mjfY?Q#w diff --git a/SparkleShare/Common/Pixmaps/avatar-g.png b/SparkleShare/Common/Pixmaps/avatar-g.png deleted file mode 100644 index f3947896faaf613de66aface44726a1d449d9bf5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 346 zcmV-g0j2(lP){rdX)@$vEa`1tbj^6>ER`T6jkF1qU3BL=X+ANpt8 ziJ$Nbxf#ON!n=zj=$iOYR)pO6B`pY;`Q(Q0SmlcunrFVL24PBUWEa=No-|?L;J|f| z1`ZwlGzh(%*j;Cr*&Z;E`7T2-wxCRGtq`0ogHrSvTAf>hw0B-vt9-RVgC{;q9xAlx zs18+igzPnuEOkemFOD#qmQRxf#+fsp(0P9IaK~#8N-IU3W!yphusb*ho|Nqa9qM67-j48-5@BT#7OQ|oW>=y+inly>FiNC<+wl_I92%cWg=JrKw z-b0a25FTh*x~VBnxlXh^T(;VaQNEI+0W}r6$3Sq1088B=2!R0 z;E{jlr!5|_nis^25=;oh`}_O%_xJVn z_0565t^fc4zDYzuRCr$P)Xi=KF$jgxdjZ??pQP{qu-#PERM=o;)kV(!laVFBM`@m6 z$b=nr!AN75U}R^X{)^xf7zP%0Ju!5$LspFGmkS!4_>CPQae*LW^blF;T?i;WL*#IQ zy!lJ>YrP=0@vjpJt-Py>%yKVkK~A5)!KRqfwo3BY8s=$HOtZE8SPiMR3vXm^h+INP zE(|@`^~kQq?A8?y6?E9ap~Lcl@}VjN6^=5b*`3Vy=*7@0-e&K7JNO2ol?OyhqLhyS O00007Wec~l94m`)BYU=-)RZc zO5K(_y{C0xLhXEMt3ex$XI`OHMrxVjjCg!opjN**gB4P}lxzlV2`g)vS9z+ze2d1b z2Bk29G8i2Yj8TEIiyeM{B^}orw9c~y8tj}UHv}rMp7EL8`NVFRQoEDfd&NA-&bRg=2AUqqDL4Y7WHF@-^c`)KHhs;} b@^irhMSKQjx(|ih00000NkvXXu0mjf;-{z4 diff --git a/SparkleShare/Common/Pixmaps/avatar-k.png b/SparkleShare/Common/Pixmaps/avatar-k.png deleted file mode 100644 index 2c9fa4374817f5e0b4bd53a1f0c8002675f81b8a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcmV-E0m1%>P)q)<^G3dL6J%fb|fgP{{53;OO83St1Gf8 zBulg4=HOB6Q=lR|!#V*191AMQ@S0TswE;AeL4vU)1IIv=0W#1;a06cd4(Lz99}m4S zu*jg}0I(ambpY9D#TVd>8inHkWG1q02d$X7sMO%XTFg21oTA%{DR%|r216|ifIRTP z(M#&JcI>t)2qZTB2Gj-r-@oXJT{m46v1rv6 z(mpX2#HAr$J*E!L2*Y4kf5Z7AQz+Jb4+bvid>qzh2eKSahS!lqFP zpuV#pS>RMJH7mz8@YA`T^FFPoL|SRIOXz5=VXcMM8URq&HOjI?UDure$Lz#Hsdeyt ze}8WzzyZKo3u`S4s4PpAWhnyR$4=--eUe5)z=6LWtLqxe-!E>@k# zsJJ?(^VN3PG%D@zTf||CQl&Gq+wA}xV$~N{=X7Eswd2N4InRWE`;zB5uCK2#pU(lH zwfLOQXf%or*vF2)7o1?-ZnurE$jN@cM^#mr&1P)-^Yb&ZEW^dcMU=p~c3L~OBOrf_^MC;JW$chS*)g(E>brsVSS5=Bv9wOYX#17pm|U|MS!b2zm;JUn1L9*Z9U zxI6I)R(h213HZu>n?Kmo(-S^FKXG$&a{{ueD!jeDVZB~sHk)BOokl^2@FdSdQW7yj zA0Hohd3iye=Z6c2)@YgrlgR{=$)vT@N^D1UHk(Z&ee3KKw@uSPYu))yL2q8MF^nsu z-YuO``kexB4(Qkzv`y0v62^VgtVATB{nrUir`iYkm0+d9J*S+6r{56j_?=|@@j@g3 za;5bDlMOxTIT`w*&p9Xt+?5RnFh(RcpcCl>u0&EZVW{Va^7^^q7IRiBgrqwkmzReM zqg43#b##re1UP`PC+}3>lx|AL_d5MGzLErxWF{nginKjM00_(g2Qao4hDx!a*r&g~ rBZFBe1T1t$Irm>muAT$#Z?t~^ztu}^RC_PE00000NkvXXu0mjf&B*L~ literal 0 HcmV?d00001 diff --git a/SparkleShare/Mac/SparkleShare.csproj b/SparkleShare/Mac/SparkleShare.csproj index 600a6628..735c27e3 100644 --- a/SparkleShare/Mac/SparkleShare.csproj +++ b/SparkleShare/Mac/SparkleShare.csproj @@ -190,39 +190,6 @@ Plugins\own-server.png - - Pixmaps\avatar-a.png - - - Pixmaps\avatar-b.png - - - Pixmaps\avatar-c.png - - - Pixmaps\avatar-d.png - - - Pixmaps\avatar-e.png - - - Pixmaps\avatar-f.png - - - Pixmaps\avatar-g.png - - - Pixmaps\avatar-h.png - - - Pixmaps\avatar-i.png - - - Pixmaps\avatar-j.png - - - Pixmaps\avatar-k.png - Plugins\ssnet.png @@ -240,6 +207,9 @@ + + Pixmaps\user-icon-default.png + diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs index d6ddcea2..7e3eec39 100644 --- a/SparkleShare/SparkleControllerBase.cs +++ b/SparkleShare/SparkleControllerBase.cs @@ -742,17 +742,6 @@ namespace SparkleShare { } - public string AssignAvatar (string s) - { - string hash = "0" + s.MD5 ().Substring (0, 8); - string numbers = Regex.Replace (hash, "[a-z]", ""); - int number = int.Parse (numbers); - string letters = "abcdefghijklmnopqrstuvwxyz"; - - return "avatar-" + letters [(number % 11)] + ".png"; - } - - // Format a file size nicely with small caps. // Example: 1048576 becomes "1 ᴍʙ" public string FormatSize (double byte_count) diff --git a/SparkleShare/SparkleEventLogController.cs b/SparkleShare/SparkleEventLogController.cs index 2f5a4334..e6b7d5e7 100755 --- a/SparkleShare/SparkleEventLogController.cs +++ b/SparkleShare/SparkleEventLogController.cs @@ -323,13 +323,10 @@ namespace SparkleShare { string change_set_avatar = Program.Controller.GetAvatar (change_set.User.Email, 48); - if (change_set_avatar != null) { + if (change_set_avatar != null) change_set_avatar = "file://" + change_set_avatar.Replace ("\\", "/"); - - } else { - change_set_avatar = "file:///" + - Program.Controller.AssignAvatar (change_set.User.Email); - } + else + change_set_avatar = "file:///user-icon-default.png"; event_entry += ""; @@ -343,6 +340,7 @@ namespace SparkleShare { event_entries += event_entry_html.Replace ("", event_entry) .Replace ("", change_set.User.Name) + .Replace ("", change_set.User.Email) .Replace ("", change_set_avatar) .Replace ("", change_set.RemoteUrl.ToString ()) .Replace ("", change_set.Revision); diff --git a/SparkleShare/Windows/SparkleEventLog.cs b/SparkleShare/Windows/SparkleEventLog.cs index 67a0d69c..5cb4268a 100644 --- a/SparkleShare/Windows/SparkleEventLog.cs +++ b/SparkleShare/Windows/SparkleEventLog.cs @@ -308,28 +308,22 @@ namespace SparkleShare { File.SetAttributes (tmp_path, File.GetAttributes (tmp_path) | FileAttributes.Hidden); } - - char [] letters = new char [] {'a', 'b', 'c', - 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k'}; - - foreach (char letter in letters) { - BitmapSource image = SparkleUIHelpers.GetImageSource ("avatar-" + letter); - string file_path = Path.Combine (pixmaps_path, "avatar-" + letter + ".png"); - - using (FileStream stream = new FileStream (file_path, FileMode.Create)) - { - BitmapEncoder encoder = new PngBitmapEncoder (); - encoder.Frames.Add (BitmapFrame.Create (image)); - encoder.Save (stream); - } + + BitmapSource image = SparkleUIHelpers.GetImageSource ("user-icon-default"); + string file_path = Path.Combine (pixmaps_path, "user-icon-default.png"); + + using (FileStream stream = new FileStream (file_path, FileMode.Create)) + { + BitmapEncoder encoder = new PngBitmapEncoder (); + encoder.Frames.Add (BitmapFrame.Create (image)); + encoder.Save (stream); } - - string [] actions = new string [] {"added", - "deleted", "edited", "moved"}; + + string [] actions = new string [] {"added", "deleted", "edited", "moved"}; foreach (string action in actions) { BitmapSource image = SparkleUIHelpers.GetImageSource ("document-" + action + "-12"); - string file_path = Path.Combine (pixmaps_path, "document-" + action + "-12.png"); + string file_path = Path.Combine (pixmaps_path, "document-" + action + "-12.png"); using (FileStream stream = new FileStream (file_path, FileMode.Create)) { diff --git a/SparkleShare/Windows/SparkleShare.csproj b/SparkleShare/Windows/SparkleShare.csproj index 0e68038f..957a1f76 100644 --- a/SparkleShare/Windows/SparkleShare.csproj +++ b/SparkleShare/Windows/SparkleShare.csproj @@ -158,38 +158,8 @@ HTML\jquery.js - - Pixmaps\avatar-a.png - - - Pixmaps\avatar-b.png - - - Pixmaps\avatar-c.png - - - Pixmaps\avatar-d.png - - - Pixmaps\avatar-e.png - - - Pixmaps\avatar-f.png - - - Pixmaps\avatar-g.png - - - Pixmaps\avatar-h.png - - - Pixmaps\avatar-i.png - - - Pixmaps\avatar-j.png - - - Pixmaps\avatar-k.png + + Pixmaps\user-icon-default.png Pixmaps\document-added-12.png