From 7222c02378288bfb844e5b1a86e9b0f322b2f030 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 2 May 2010 00:34:46 +0100 Subject: [PATCH] use a 32x32 avatar in people list --- README | 2 +- .../hicolor/32x32/status/avatar-default.png | Bin 0 -> 2024 bytes src/SparklePony.cs | 67 +++++++----------- 3 files changed, 27 insertions(+), 42 deletions(-) create mode 100644 data/icons/hicolor/32x32/status/avatar-default.png diff --git a/README b/README index ba67e6d9..2fcee6f3 100644 --- a/README +++ b/README @@ -33,7 +33,7 @@ SparklePony currently requires (in alphabetical order): Installing dependencies on Fedora: # yum install git gtk-sharp2 gtk-sharp2-devel mono-core notify-sharp \ - notify-sharp-devel + notify-sharp-devel ndesk-dbus-devel You can build and install SparklePony like this: $ make diff --git a/data/icons/hicolor/32x32/status/avatar-default.png b/data/icons/hicolor/32x32/status/avatar-default.png new file mode 100644 index 0000000000000000000000000000000000000000..14226486dcf82e2a7163ea8f883bb59b7ca3a6cf GIT binary patch literal 2024 zcmVP)AW3d!Z|pJm-v9sr7j#8fbU}4=Xm4@= zOkr?uAVXnnVQpbZYiu1y703Vc*vEa?i7nfqeg!uU zHc6W{c3MFdB88UJfhh<% zP8FvOavo0X#BV!^P3_osckk}b?hGIH?s8468)8^#w0n1F&iTzbXU;j7D5Y>eSNGBG zcB=5CrfHuE!(bNxFviadA^su>{@8J#s_4T#stl4od`6U5*dR}SbjJ??2zALr7ybMAJfFlFbv@PJ|asA1VIP@ z*ic>$&-Wi&w*_p+sZXU+$meqif*{$kQVL-hfKpnpKokR!dm;$VInwD2@_DCz-2gIF zGq!CvbFM=v1>g6fRHTqG20~~7C=S8^Lik{efpZO(l|v}y%(?+Q&mCM`{II#Yx(ZT8 z$2mF$!I}U{DKN&s7=y0sn3%-ozCWj&sZ=r|UeJOm+R)f~=s zOij-)Wi#&+~ES%s?1;&gpdn96NSwGH2xu z_4fAK>2!7t#adyk1~JVvPM$hxyI%g#i4!L$*9`ywljGAzE?vHId+_{umC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MdA_Ywe4Ddm>}*r;jR=B6!8&!ki4_Dm+* zN+~G=AtoV2S4wGw5DKNJiegBSC|iYya=ZZGL8-h{YT0p|%bw?77`s09yL>*sR1)An zFA~`~1t1L|10Y+trwi{j00DqJ0K0Iv3ePqG4?w6&DESwBY9~#yv}}?90000People"); + PeopleLabel.UseMarkup = true; + PeopleLabel.SetAlignment (0, 0); - Label PeopleLabel = new Label ("People"); - PeopleLabel.UseMarkup = true; - PeopleLabel.SetAlignment (0, 0); - - LayoutVerticalRight.PackStart (PeopleLabel, false, false, 0); - - LayoutVerticalRight.PackStart (CreatePeopleList (Repositories [1]), true, true, 12); + LayoutVerticalRight.PackStart (PeopleLabel, false, false, 0); + LayoutVerticalRight.PackStart (CreatePeopleList (Repositories [1]), true, true, 12); LayoutHorizontal.PackStart (LayoutVerticalLeft, false, false, 0); LayoutHorizontal.PackStart (LayoutVerticalRight, true, true, 12); @@ -713,29 +704,29 @@ public class SparklePonyWindow : Window { } // Creates the detailed view - public VBox CreateDetailsView () { + public VBox CreateDetailedView (Repository Repository) { Label Label1 = new Label ("Remote URL: "); - Label1.UseMarkup = true; Label1.SetAlignment (0, 0); - Label Label2 = new Label ("ssh://git@github.com/hbons/Dedsfdsfsal.git"); + Label Label2 = new Label ("" + Repository.RemoteOriginUrl + ""); Label2.UseMarkup = true; Label2.SetAlignment (0, 0); Label Label5 = new Label ("Path:"); - Label5.UseMarkup = true; Label5.SetAlignment (0, 0); - Label Label6 = new Label ("~/SparklePony/Deal "); + Label Label6 = new Label ("" + Repository.RepoPath + " "); Label6.UseMarkup = true; Label6.SetAlignment (0, 0); - Button NotificationsCheckButton = + CheckButton NotificationsCheckButton = new CheckButton ("Notify me when something changes"); + NotificationsCheckButton.Active = true; - Button ChangesCheckButton = + CheckButton ChangesCheckButton = new CheckButton ("Synchronize my changes"); + ChangesCheckButton.Active = true; Table Table = new Table(7, 2, false); Table.RowSpacing = 6; @@ -754,10 +745,6 @@ public class SparklePonyWindow : Window { } - public void UpdateRepoList() { - - } - public ScrolledWindow CreateEventLog() { ListStore LogStore = new ListStore (typeof (Gdk.Pixbuf), @@ -844,10 +831,6 @@ public class SparklePonyWindow : Window { } - public void UpdateEventLog() { - - } - // Creates a visual list of people working in the repo public ScrolledWindow CreatePeopleList (Repository Repository) { @@ -868,7 +851,6 @@ public class SparklePonyWindow : Window { string [] Lines = Regex.Split (Output, "\n"); ListStore PeopleStore = new ListStore (typeof (Gdk.Pixbuf), - typeof (string), typeof (string)); TreeIter PeopleIter; @@ -890,22 +872,21 @@ public class SparklePonyWindow : Window { // Actually add to the list PeopleIter = PeopleStore.Prepend (); - PeopleStore.SetValue (PeopleIter, 0, new Gdk.Pixbuf (SparklePonyHelpers.SparklePonyHelpers.GetAvatarFileName (UserEmail, 24))); - PeopleStore.SetValue (PeopleIter, 1, UserName + " "); - PeopleStore.SetValue (PeopleIter, 2, UserEmail + " "); - - + PeopleStore.SetValue (PeopleIter, 0, new Gdk.Pixbuf (SparklePonyHelpers.SparklePonyHelpers.GetAvatarFileName (UserEmail, 32))); + PeopleStore.SetValue (PeopleIter, 1, UserName + "\n" + UserEmail); } + i++; + } TreeView PeopleView = new TreeView (PeopleStore); PeopleView.AppendColumn ("", new CellRendererPixbuf () , "pixbuf", 0); PeopleView.AppendColumn ("", new Gtk.CellRendererText (), "text", 1); - PeopleView.AppendColumn ("", new Gtk.CellRendererText (), "text", 2); TreeViewColumn [] PeopleViewColumns = PeopleView.Columns; - PeopleViewColumns [0].MinWidth = 32; + PeopleViewColumns [0].MinWidth = 48; + PeopleViewColumns [1].Expand = true; PeopleView.HeadersVisible = false; @@ -940,8 +921,8 @@ public class SparklePonyWindow : Window { namespace SparklePonyHelpers { - - // Helper that returns a user's avatar + // Helper that returns a user's avatar, + // either from a file or the web class SparklePonyHelpers { public static string GetAvatarFileName (string Email, int Size) { @@ -950,6 +931,11 @@ namespace SparklePonyHelpers { "/.config/sparklepony/avatars/" + Size + "x" + Size + "/"; + if (!Directory.Exists (AvatarPath)) { + Directory.CreateDirectory (AvatarPath); + Console.WriteLine ("[Config] Created '" + AvatarPath + "'"); + + } string AvatarFile = AvatarPath + Email; if (File.Exists (AvatarFile)) @@ -1001,5 +987,4 @@ namespace SparklePonyHelpers { } - }