From 0abbdc38caad36cbe62afeaaad18c6289b26e93a Mon Sep 17 00:00:00 2001 From: ycastonguay Date: Sun, 18 Aug 2013 02:58:09 -0400 Subject: [PATCH] Linux: Fixed all bugs in Sync and SyncMenu; these screens are as functional as on Windows and Mac! Added a Resource folder with embedded images; ResourceHelper extracts these images and turn them into Gdk.PIxbuf to load into buttons, tree views, etc. Added icons from other desktop platforms. Related to issue #382. --- .../Classes/Helpers/ResourceHelper.cs | 48 ++++ ...Manipulation.cs => SystemDrawingHelper.cs} | 4 +- MPfm/MPfm.GTK/MPfm.GTK.csproj | 37 +-- MPfm/MPfm.GTK/{ => Resources}/black.png | Bin MPfm/MPfm.GTK/{ => Resources}/icon48.png | Bin MPfm/MPfm.GTK/Resources/icon_android.png | Bin 0 -> 1122 bytes MPfm/MPfm.GTK/Resources/icon_artists.png | Bin 0 -> 1157 bytes MPfm/MPfm.GTK/Resources/icon_linux.png | Bin 0 -> 1240 bytes MPfm/MPfm.GTK/Resources/icon_osx.png | Bin 0 -> 1121 bytes MPfm/MPfm.GTK/Resources/icon_phone.png | Bin 0 -> 1080 bytes MPfm/MPfm.GTK/Resources/icon_song.png | Bin 0 -> 1113 bytes MPfm/MPfm.GTK/Resources/icon_tablet.png | Bin 0 -> 1023 bytes MPfm/MPfm.GTK/Resources/icon_user.png | Bin 0 -> 1095 bytes MPfm/MPfm.GTK/Resources/icon_vinyl.png | Bin 0 -> 1214 bytes MPfm/MPfm.GTK/Resources/icon_windows.png | Bin 0 -> 1061 bytes .../{Splash.png => Resources/splash.png} | Bin MPfm/MPfm.GTK/Windows/MainWindow.cs | 7 +- MPfm/MPfm.GTK/Windows/SplashWindow.cs | 3 +- MPfm/MPfm.GTK/Windows/SyncMenuWindow.cs | 130 ++++++++-- MPfm/MPfm.GTK/Windows/SyncWindow.cs | 31 ++- MPfm/MPfm.GTK/android.png | Bin 260 -> 0 bytes .../gtk-gui/MPfm.GTK.SyncMenuWindow.cs | 236 +++++++++++++----- MPfm/MPfm.GTK/gtk-gui/MPfm.GTK.SyncWindow.cs | 79 ++++-- MPfm/MPfm.GTK/gtk-gui/gui.stetic | 213 +++++++++++++--- 24 files changed, 606 insertions(+), 182 deletions(-) create mode 100644 MPfm/MPfm.GTK/Classes/Helpers/ResourceHelper.cs rename MPfm/MPfm.GTK/Classes/Helpers/{ImageManipulation.cs => SystemDrawingHelper.cs} (93%) rename MPfm/MPfm.GTK/{ => Resources}/black.png (100%) rename MPfm/MPfm.GTK/{ => Resources}/icon48.png (100%) create mode 100755 MPfm/MPfm.GTK/Resources/icon_android.png create mode 100755 MPfm/MPfm.GTK/Resources/icon_artists.png create mode 100755 MPfm/MPfm.GTK/Resources/icon_linux.png create mode 100755 MPfm/MPfm.GTK/Resources/icon_osx.png create mode 100755 MPfm/MPfm.GTK/Resources/icon_phone.png create mode 100755 MPfm/MPfm.GTK/Resources/icon_song.png create mode 100755 MPfm/MPfm.GTK/Resources/icon_tablet.png create mode 100755 MPfm/MPfm.GTK/Resources/icon_user.png create mode 100755 MPfm/MPfm.GTK/Resources/icon_vinyl.png create mode 100755 MPfm/MPfm.GTK/Resources/icon_windows.png rename MPfm/MPfm.GTK/{Splash.png => Resources/splash.png} (100%) delete mode 100755 MPfm/MPfm.GTK/android.png diff --git a/MPfm/MPfm.GTK/Classes/Helpers/ResourceHelper.cs b/MPfm/MPfm.GTK/Classes/Helpers/ResourceHelper.cs new file mode 100644 index 00000000..963f2aa3 --- /dev/null +++ b/MPfm/MPfm.GTK/Classes/Helpers/ResourceHelper.cs @@ -0,0 +1,48 @@ +// Copyright © 2011-2013 Yanick Castonguay +// +// This file is part of MPfm. +// +// MPfm is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// MPfm is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MPfm. If not, see . + +using System; +using System.Reflection; + +namespace MPfm.GTK.Helpers +{ + public static class ResourceHelper + { +// public static void TestLoadResources() +// { +// var names = Assembly.GetExecutingAssembly().GetManifestResourceNames(); +// foreach(var name in names) +// { +// var info = Assembly.GetExecutingAssembly().GetManifestResourceInfo(name); +// Console.WriteLine("Assembly Resource - name: {0} fileName: {1}", name, info.FileName); +// } +// } + /// + /// Gets an embedded image resource in the current executing assembly. + /// + /// + /// Embedded image + /// + /// + /// Image name (example: 'icon_linux.png' will load 'MPfm.GTK.Resources.icon_linux.png') + /// + public static Gdk.Pixbuf GetEmbeddedImageResource(string name) + { + return new Gdk.Pixbuf(Assembly.GetExecutingAssembly().GetManifestResourceStream("MPfm.GTK.Resources." + name)); + } + } +} diff --git a/MPfm/MPfm.GTK/Classes/Helpers/ImageManipulation.cs b/MPfm/MPfm.GTK/Classes/Helpers/SystemDrawingHelper.cs similarity index 93% rename from MPfm/MPfm.GTK/Classes/Helpers/ImageManipulation.cs rename to MPfm/MPfm.GTK/Classes/Helpers/SystemDrawingHelper.cs index fbc329dc..d59c23ea 100644 --- a/MPfm/MPfm.GTK/Classes/Helpers/ImageManipulation.cs +++ b/MPfm/MPfm.GTK/Classes/Helpers/SystemDrawingHelper.cs @@ -22,9 +22,9 @@ namespace MPfm.GTK.Helpers { /// - /// The ImageManipulation class contains static functions for manipulating images. + /// The SystemDrawingHelper class contains static functions for manipulating images with System.Drawing. /// - public class ImageManipulation + public class SystemDrawingHelper { /// /// The ResizeImage static function resizes images to a desired width and height, with the highest quality possible. diff --git a/MPfm/MPfm.GTK/MPfm.GTK.csproj b/MPfm/MPfm.GTK/MPfm.GTK.csproj index db5de6f1..9be4f89b 100644 --- a/MPfm/MPfm.GTK/MPfm.GTK.csproj +++ b/MPfm/MPfm.GTK/MPfm.GTK.csproj @@ -78,6 +78,26 @@ gui.stetic + + + + + + + + + + + + PreserveNewest + + + true + PreserveNewest + + + PreserveNewest + @@ -90,7 +110,6 @@ - @@ -105,6 +124,8 @@ + + @@ -165,18 +186,6 @@ - - - - true - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - + \ No newline at end of file diff --git a/MPfm/MPfm.GTK/black.png b/MPfm/MPfm.GTK/Resources/black.png similarity index 100% rename from MPfm/MPfm.GTK/black.png rename to MPfm/MPfm.GTK/Resources/black.png diff --git a/MPfm/MPfm.GTK/icon48.png b/MPfm/MPfm.GTK/Resources/icon48.png similarity index 100% rename from MPfm/MPfm.GTK/icon48.png rename to MPfm/MPfm.GTK/Resources/icon48.png diff --git a/MPfm/MPfm.GTK/Resources/icon_android.png b/MPfm/MPfm.GTK/Resources/icon_android.png new file mode 100755 index 0000000000000000000000000000000000000000..cdadefbd3f20010bad7cacfe942feff08a9563cc GIT binary patch literal 1122 zcmaJ=O=uHA7+o8GYHT%vh_*tfYeB(gf14&*8rw8UHQ22s4Ol_2o84);w!5?LPR+KL zHXfuZB6?C0?a7lAEFJ_wMdCpZq9CGP6cukG)k_eu&eo=SFfPo_5AVJ2ecya@y1#E< zy}!XvQB-|;e=xD^N-&#|1q@|`e_$Y!8}#%+~c-0)5>lqDr>s93c z65~QhjHh}Mkx-;v5co)in?&lk0Zm-tYJa$qs$8!T42wigLR&upwH_N8U@2iqukIyO zRd1QARrk_fmCF({taq({U32A#^p3Y&X>XGH z#viA*s6!8%Z}>|2Vp$AK73a?tFI_HD@2K~myM6>_rl^If-9OiqHch)t0q27_yKZKx zyZ%^@K(##ek3Vlaa^>}`zpG)6z7;R;2^>8&A7?&vzpS;tHiDNYzhB>Wv!=ur-Ce$m zM-NPw*$a18e`?rD=hm>`uuraw)Rw*!%l`G>=Mui3wezzrncJHmKDpC-t)}#Ly4;j) zZhf(scy!OVumcRYd@P;qms4F=H^8?y(qR5wptG)Y=Gl>Q<4kAGLi3n^RZShW*m!Vj T>%z0W-m6ci`jT_qLnnU$VNGts literal 0 HcmV?d00001 diff --git a/MPfm/MPfm.GTK/Resources/icon_artists.png b/MPfm/MPfm.GTK/Resources/icon_artists.png new file mode 100755 index 0000000000000000000000000000000000000000..3690daf794279c75f52567ba68b5a612b46ae8da GIT binary patch literal 1157 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*9U+m=!WZB1$5BeXNr6bM+EIYV;~{3xK*A7;Nk-3KEmEQ%e+* zQqwc@Y?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxKsVXI%s|1+P|wiV z#N6CmN5ROz&_Lh7NZ-&%*U;R`*vQJjKmiJrfVLH-q*(>IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8EkR}&8R-I5=oVMzl_XZ^<`pZ$OmImpPAEg{v+u2}(t{7puX=A(aKG z`a!A1`K3k4z=%sz23b{L#IF^~DAqysu8XNwoa88IdWE2Jr> z9I#S3`@A87uj9RP=UwOTLc+5c>nGgEZnR+S5S?&Dq|rilK4YuHAMsOl%tt0g#B^R~ z^>3^&n(~*S!?nQ0*pFFaVO@H|ub<*#%o{ozdA*n(MSC!AlkZ4f@Q_LPckkKg1y{-> zy#F+Buom!ldF1bK{R|UtuC&QVeg_-Q4t?g07L$Hdt}y?v{QIVqmvZxMhd1m;o;s}Q zQDgVIclUzJH}U8S4~CD1GI37F)E8tK9!OL&IsAdqP3Phd@$TsbjrSQC*%*ALgz~<9 SS^gSSFnGH9xvXc-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxKsVXI%s|1+P|wiV z#N6CmN5ROz&_Lh7NZ-&%*U;R`*vQJjKmiJrfVLH-q*(>IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8EkR}&8R-I5=oVMzl_XZ^<`pZ$OmImpPAEg{v+u2}(t{7puX=A(aKG z`a!A1`K3k4z=%sz23b{LATTyJ3`6ci>lW!9wDDM4X5I%}5XwDAU>I%a>se!+wz zO*a>Iv@V*UqQ61gS-E5h5!68KPCU;dZxdYYS#HHK6Y~c{pPmQoiS*egSXEiUAr?8yXQW+_e1Pg z!Me4(gkN0yY_^9bHzlXh{mMel*jZb;xOx=%H#;_R-#)~As-Q`z*EU&(`^AxoJN54$ z7th>1Rm)=e;#J2Q=IsuZZerrReTY$SrK*I?*>K&-LmY@$2FR(L1m4ntDnm{ Hr-UW|N&mba literal 0 HcmV?d00001 diff --git a/MPfm/MPfm.GTK/Resources/icon_osx.png b/MPfm/MPfm.GTK/Resources/icon_osx.png new file mode 100755 index 0000000000000000000000000000000000000000..799cc41ae62fc8fc0651c2dd0404585e3a68cb25 GIT binary patch literal 1121 zcmaJ=TWHfz7>=uM?k4SC#zgTDoru`vBweiy>uycw3TBM1U>`)5CTDAy$%)CC&4v$k zf>wM{pTq}2(N|$ZP*9x0Kt%>Bf*^t-L-0XVyfE-#p3HUnU=5s{3*Yzs-~XTgoEaM2 z-`uddfnk{D^nje9bI>0fYw3U6*JYJXZ6uW=!+4YwRR=M>I?f}IHq|kdL8?A^^fBsW zm;f-cIg(QjNE$Xd)yHt2X;U`Cbas2Ts*NK8@@UMk66~itb1X3Q1bZ;5K*dg?f-x}V zpy8>(tTr{S#dWs33v_xC6)+J|foC4ET**tYE4mV0`^P*BRv=_N!TvUtQ-(kiI|xKM z7}nrk2=)q`5b21;VtarH1;|5@7sRj-lOm!7Az1xb8qLv1rHtIa8jJ1{Y=ID4;`w5+ z$Q2_TcE)%i9*_GPq8O%#usdlH)eBqh_KJdxT+K0TVqgpSifSHDkOWJe{!YQP*JLes zwM?{Nyrip-v`aGRkKca^yV*$_@fqae2}h$BH@e*qWlKp1sRTP& zjE_{RI8?v{y9I26Z{oM0)RGYnly2{EBVi1xy$*eeLB zNM9-<_r*G3GMS8~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 0 HcmV?d00001 diff --git a/MPfm/MPfm.GTK/Resources/icon_vinyl.png b/MPfm/MPfm.GTK/Resources/icon_vinyl.png new file mode 100755 index 0000000000000000000000000000000000000000..6a34d906fc963aa65ab1115f93836dc1e2fa90af GIT binary patch literal 1214 zcmbVMU1$_n6rMG4710f(oT?mZDFJ)|bW~Y_+NBL)G{oQSxAe`c$ftLi-TZJ4rVB5G-_H=Kh`U z`_4J{oH^dr*|uiYhpQ-xT9a;E~B(&_LJX z^v+O*%~%pF=>laNsUrhwOrx8dKx0WH1O~(kC>evMBbMUy9Ir^`?lwb%ITJh( zr{|sO$#ek;*${*RtY2lrEC_P}P6$RKkp{rC9Lumg!|{GDA_~07vS8t%iJGnD#jM=A zphZ@3x`44IGEA{p3>1X`vilh>7K^zYJnttKerMRkO380Jz6yg39o5z?tRoY+j7lFG z!f~2-Iv;{zWipGzrn8VJk}{^GSPU0n8N+bnnzMFr7QS_3NoyxJY(XXq9W-RC*P|DK^dt-1~hS6j??5Mpy`?z5~L6>hoY@fDVgFqE+)uwl1;|A zL{N?-T2mE{rLdB~%1KF%u^~RmaVa4oNl_^(unC?`@ew&u!KO_IE2au7x;oKaz((JT z6(t)g7}+_51}hcNRX`Xy1!MuKI|O#>riO}+dpYy5%Fx#LK&{nA2AIpPs4t=Z-%-zF zwf~bbhB(8xrSVRwRJKU{xzokMCyT|_fhOq}n>5A`vnThGrh1W<6S>l(zTTgzAGBPn zJy!2|*}U}t^~+3o@|0)oW6$(QEwlA&y>;Og$3`#eO^FtPZ~D?4x7P=6z1a6nelH)q zb#dE<6YaM@0H6G!tp4Y(sr--oXSPU%uG$OMcF#IyBIEu1)z>xUqrJ}0e(zvs)uYu9 z{+@k!`5^l2hWGOGsVhf*FYoS{oEjUiUYB2Xzrzaq?)-c3E7RWB5j?u-JNo9O(Z}KO z^6ANI9{$Oz>sNcv9llxJ)=*x*@vv|CM4@Kp*N^!ildM^B05r87dbZ)-le=Yed>0*L u#?IE&MU&1`_4_|(SAIKoeqv))^=8Uf_3X@^>8GE%f0T5pQ@)VwJ@f|1*_HzU literal 0 HcmV?d00001 diff --git a/MPfm/MPfm.GTK/Resources/icon_windows.png b/MPfm/MPfm.GTK/Resources/icon_windows.png new file mode 100755 index 0000000000000000000000000000000000000000..b43087096a0906430b8f3c58da54e85443e74513 GIT binary patch literal 1061 zcmaJ=O-vI(7+um(5JkC26fg{nL``V-r?jOTDzx1qO(-^{LK6?N-5p>9yR+^NcHtmJ z3_^?v#zf=Kfuo7W$k~HYIbgy?Pev~WPM(B#Au&;Bfr1C?CbRRC_uluuZ@yVb^WS9P?az}=ufgqBL+v+o+%Ud zPxWQwsWCaE(4FT&hb<5R4Ppt{+PH2Bc9`DL70B8-W@xYj!DC^1*Hku{0x@Jl;P)})Rl+oM~}MFkOBvZ)$aMLKX4r5u{TVVXGIO+hpEWp!(> zOr&6pEg1~wWu26Yz-03OP)*xMTR065{Qgte%1j!NNka=wm@>Jz;bte4A;e55VPs|y z8ZTBcHHt8@Mv(zx{eCd0>I%wRJLqImNaz-pbQvbZFirSgRaJzTkN3Cx10w6^BODj^ zh1fVBiv-)-0%9P-xA}@(5y=x8)Nzrk9B|_$xlSW!28k>}Q@sY2ZWC!>Ct*P??Il`L zZ;z{#_7W?}Wr!KZxz@j~xp+i+$64+-E!ph1J=96Bo203)NKJL*K|D@~k&OL0r+}j` zUCUK9&tl7UM|||Tbt=~a2Iki9bv<{j9Pes9wzBrAcereQHgzZ6wRZFL1J}yOROkt% z6i&Iy3kx$*cGF#WyHtCt;cTrvvt8fhy1udavtng>YxUim>4x_D`7fKRvs>(Z`C?hH zuwBve;priNPu-)9p@-kxnP0A&!(aKr-JaXx(%iGCdSbv`$x;{ZH(tJUW^2}YxQTe5 J_#!%V;}1)*QAz*+ literal 0 HcmV?d00001 diff --git a/MPfm/MPfm.GTK/Splash.png b/MPfm/MPfm.GTK/Resources/splash.png similarity index 100% rename from MPfm/MPfm.GTK/Splash.png rename to MPfm/MPfm.GTK/Resources/splash.png diff --git a/MPfm/MPfm.GTK/Windows/MainWindow.cs b/MPfm/MPfm.GTK/Windows/MainWindow.cs index 2112fbfb..f6e1290a 100644 --- a/MPfm/MPfm.GTK/Windows/MainWindow.cs +++ b/MPfm/MPfm.GTK/Windows/MainWindow.cs @@ -58,7 +58,8 @@ public MainWindow(Action onViewReady): base (Gtk.WindowType.Toplevel, Title = "MPfm: Music Player for Musicians - " + Assembly.GetExecutingAssembly().GetName().Version.ToString() + " ALPHA"; // Set application icon (for some reason it is not visible on Unity) - SetIconFromFile("icon48.png"); + //SetIconFromFile(ResourceHelper.GetEmbeddedImageResource("icon48.png")); + Icon = ResourceHelper.GetEmbeddedImageResource("icon48.png"); SetFontProperties(); InitializeSongBrowser(); @@ -715,7 +716,7 @@ public void RefreshSongInformation(AudioFile audioFile, long lengthBytes, int pl if(drawingImage != null) { // Resize image and set cover - drawingImage = ImageManipulation.ResizeImage(drawingImage, 150, 150); + drawingImage = SystemDrawingHelper.ResizeImage(drawingImage, 150, 150); imageAlbumCover.Pixbuf = ImageToPixbuf(drawingImage); } else @@ -769,7 +770,7 @@ public void RefreshSongInformation(AudioFile audioFile, long lengthBytes, int pl // Check if image cover is still empty if(imageAlbumCover.Pixbuf == null) { - Pixbuf imageCover = new Pixbuf("black.png"); + Pixbuf imageCover = ResourceHelper.GetEmbeddedImageResource("black.png"); imageCover = imageCover.ScaleSimple(150, 150, InterpType.Bilinear); imageAlbumCover.Pixbuf = imageCover; } diff --git a/MPfm/MPfm.GTK/Windows/SplashWindow.cs b/MPfm/MPfm.GTK/Windows/SplashWindow.cs index 43a35c18..3472c2e8 100644 --- a/MPfm/MPfm.GTK/Windows/SplashWindow.cs +++ b/MPfm/MPfm.GTK/Windows/SplashWindow.cs @@ -19,6 +19,7 @@ using Gdk; using MPfm.MVP; using MPfm.MVP.Views; +using MPfm.GTK.Helpers; namespace MPfm.GTK.Windows { @@ -39,7 +40,7 @@ private void Initialize() this.lblStatus.ModifyFg(Gtk.StateType.Normal, new Color(255, 255, 255)); // Set image background - Pixbuf imageCover = new Pixbuf("Splash.png"); + Pixbuf imageCover = ResourceHelper.GetEmbeddedImageResource("splash.png"); imageBackground.Pixbuf = imageCover; //splashPresenter.BindView(this); diff --git a/MPfm/MPfm.GTK/Windows/SyncMenuWindow.cs b/MPfm/MPfm.GTK/Windows/SyncMenuWindow.cs index 0fef7b4a..788b29fb 100644 --- a/MPfm/MPfm.GTK/Windows/SyncMenuWindow.cs +++ b/MPfm/MPfm.GTK/Windows/SyncMenuWindow.cs @@ -25,12 +25,14 @@ using System.Text; using Gtk; using MPfm.Sound.AudioFiles; +using MPfm.GTK.Helpers; namespace MPfm.GTK { public partial class SyncMenuWindow : BaseWindow, ISyncMenuView { Gtk.TreeStore _storeItems; + Gtk.TreeStore _storeSelection; public SyncMenuWindow(Action onViewReady) : base(Gtk.WindowType.Toplevel, onViewReady) @@ -39,8 +41,9 @@ public partial class SyncMenuWindow : BaseWindow, ISyncMenuView Title = "Sync Library With"; InitializeTreeView(); + InitializeSelectionTreeView(); - btnSelectAll.GrabFocus(); // the list view changes color when focused by default. it annoys me! + btnSync.GrabFocus(); // the list view changes color when focused by default. it annoys me! this.Center(); this.Show(); onViewReady(this); @@ -50,27 +53,31 @@ private void InitializeTreeView() { _storeItems = new Gtk.TreeStore(typeof(SyncMenuItemEntity)); treeView.HeadersVisible = false; - - // Create title column + treeView.Selection.Mode = SelectionMode.Multiple; Gtk.TreeViewColumn colTitle = new Gtk.TreeViewColumn(); Gtk.CellRendererText cellTitle = new Gtk.CellRendererText(); Gtk.CellRendererPixbuf cellPixbuf = new Gtk.CellRendererPixbuf(); - Gtk.CellRendererToggle cellToggle = new Gtk.CellRendererToggle(); - cellToggle.Activatable = true; - cellToggle.Toggled += (o, args) => { - var cellRendererToggle = (Gtk.CellRendererToggle)o; - //cellRendererToggle.Active = !cellRendererToggle.Active; - Console.WriteLine("******* Toggle {0}", cellRendererToggle.Data["itemType"]); - }; colTitle.PackStart(cellPixbuf, false); colTitle.PackStart(cellTitle, true); - colTitle.PackStart(cellToggle, false); colTitle.SetCellDataFunc(cellPixbuf, new Gtk.TreeCellDataFunc(RenderCell)); colTitle.SetCellDataFunc(cellTitle, new Gtk.TreeCellDataFunc(RenderCell)); - colTitle.SetCellDataFunc(cellToggle, new Gtk.TreeCellDataFunc(RenderCell)); treeView.AppendColumn(colTitle); } + private void InitializeSelectionTreeView() + { + _storeSelection = new Gtk.TreeStore(typeof(AudioFile)); + treeViewSelection.ShowExpanders = false; + treeViewSelection.HeadersVisible = false; + treeViewSelection.Selection.Mode = SelectionMode.Multiple; + + Gtk.TreeViewColumn colTitle = new Gtk.TreeViewColumn(); + Gtk.CellRendererText cellTitle = new Gtk.CellRendererText(); + colTitle.PackStart(cellTitle, true); + colTitle.SetCellDataFunc(cellTitle, new Gtk.TreeCellDataFunc(RenderSelectionCell)); + treeViewSelection.AppendColumn(colTitle); + } + private void RenderCell(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { //Console.WriteLine("SyncMenuWindow - RenderCell"); @@ -98,17 +105,34 @@ private void RenderCell(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.Tr else if (cell is Gtk.CellRendererPixbuf) { var cellPixbuf = (Gtk.CellRendererPixbuf)cell; - var pixbuf = new Gdk.Pixbuf("android.png"); - cellPixbuf.Pixbuf = pixbuf; - } - else if (cell is Gtk.CellRendererToggle) - { - var cellToggle = (Gtk.CellRendererToggle)cell; - cellToggle.Data.Clear(); - cellToggle.Data.Add("itemType", entity.ItemType.ToString()); + + Gdk.Pixbuf pixbuf = null; + switch (entity.ItemType) + { + case SyncMenuItemEntityType.Artist: + pixbuf = ResourceHelper.GetEmbeddedImageResource("icon_user.png"); + break; + case SyncMenuItemEntityType.Album: + pixbuf = ResourceHelper.GetEmbeddedImageResource("icon_vinyl.png"); + break; + case SyncMenuItemEntityType.Song: + pixbuf = ResourceHelper.GetEmbeddedImageResource("icon_song.png"); + break; + } + + if(pixbuf != null) + cellPixbuf.Pixbuf = pixbuf; } } + private void RenderSelectionCell(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) + { + //Console.WriteLine("SyncMenuWindow - RenderSelectionCell"); + AudioFile audioFile = (AudioFile)model.GetValue(iter, 0); + string title = string.Format("{0} / {1} / {2}. {3}", audioFile.ArtistName, audioFile.AlbumTitle, audioFile.TrackNumber, audioFile.Title); + (cell as Gtk.CellRendererText).Text = title; + } + protected void OnTreeViewRowExpanded(object o, RowExpandedArgs args) { Console.WriteLine(">>>>> SyncMenuWindow - OnTreeViewRowExpanded"); @@ -121,10 +145,55 @@ protected void OnTreeViewRowExpanded(object o, RowExpandedArgs args) if (entityChild.ArtistName == "dummy" && entityChild.AlbumTitle == "dummy") { Console.WriteLine("SyncMenuWindow - OnTreeViewRowExpanded -- Expanding node..."); - OnExpandItem(entity, null); + OnExpandItem(entity, args.Iter); } } + protected void OnClickSync(object sender, EventArgs e) + { + OnSync(); + } + + protected void OnClickAdd(object sender, EventArgs e) + { + TreeIter iter; + var treePaths = treeView.Selection.GetSelectedRows(); + List items = new List(); + foreach (var treePath in treePaths) + { + _storeItems.GetIter(out iter, treePath); + var entity = (SyncMenuItemEntity)_storeItems.GetValue(iter, 0); + items.Add(entity); + } + + OnSelectItems(items); + } + + protected void OnClickRemove(object sender, EventArgs e) + { + TreeIter iter; + var treePaths = treeViewSelection.Selection.GetSelectedRows(); + List audioFiles = new List(); + foreach (var treePath in treePaths) + { + _storeSelection.GetIter(out iter, treePath); + var audioFile = (AudioFile)_storeSelection.GetValue(iter, 0); + audioFiles.Add(audioFile); + } + + OnRemoveItems(audioFiles); + } + + protected void OnClickAddAll(object sender, EventArgs e) + { + OnSelectAll(); + } + + protected void OnClickRemoveAll(object sender, EventArgs e) + { + OnRemoveAll(); + } + #region ISyncMenuView implementation public System.Action OnExpandItem { get; set; } @@ -209,6 +278,15 @@ public void RefreshItems(List items) public void RefreshSelection(List audioFiles) { + Gtk.Application.Invoke(delegate{ + Console.WriteLine("SyncMenuWindow - RefreshSelection"); + + _storeSelection.Clear(); + foreach(AudioFile audioFile in audioFiles) + _storeSelection.AppendValues(audioFile); + + treeViewSelection.Model = _storeSelection; + }); } public void RefreshSyncTotal(string title, string subtitle, bool enoughFreeSpace) @@ -223,14 +301,14 @@ public void InsertItems(int index, SyncMenuItemEntity parentItem, List. using System; -using MPfm.MVP.Views; using System.Collections.Generic; -using MPfm.MVP.Models; +using System.Text; +using MPfm.GTK.Helpers; using MPfm.GTK.Windows; using MPfm.Library.Objects; -using System.Reflection; -using System.Text; +using MPfm.MVP.Views; using Gtk; namespace MPfm.GTK @@ -95,8 +94,28 @@ private void RenderDeviceCell(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, else if (cell is Gtk.CellRendererPixbuf) { var cellPixbuf = (Gtk.CellRendererPixbuf)cell; - var pixbuf = new Gdk.Pixbuf("android.png"); - cellPixbuf.Pixbuf = pixbuf; + Gdk.Pixbuf pixbuf = null; + switch (device.DeviceType) + { + case SyncDeviceType.Linux: + pixbuf = ResourceHelper.GetEmbeddedImageResource("icon_linux.png"); + break; + case SyncDeviceType.OSX: + pixbuf = ResourceHelper.GetEmbeddedImageResource("icon_osx.png"); + break; + case SyncDeviceType.Windows: + pixbuf = ResourceHelper.GetEmbeddedImageResource("icon_windows.png"); + break; + case SyncDeviceType.iOS: + pixbuf = ResourceHelper.GetEmbeddedImageResource("icon_phone.png"); + break; + case SyncDeviceType.Android: + pixbuf = ResourceHelper.GetEmbeddedImageResource("icon_android.png"); + break; + } + + if(pixbuf != null) + cellPixbuf.Pixbuf = pixbuf; } } diff --git a/MPfm/MPfm.GTK/android.png b/MPfm/MPfm.GTK/android.png deleted file mode 100755 index f924826d479149e6b14620548767d5ba7be3ac04..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 260 zcmV+f0sH=mP)0@wiVp}KNii+u2hrBj^rd~q&mHOXVA z<)izwR({T?RkAqM+Fqb&F5J4}gT`m%M*)g2LM_Z3`L6sStfEL1Xhqlxi*9E`=)mS2 z3r-(V0J0U)z6I;duR;?AIO|E+2&qxNK>2`A2egD~n8a8L<1w~>BH&HI%u-->Z+g7O zSE*Xx2Q}G4`gRi^=i@ubHnmRJz~>`w_A^2HS%4=?ECrvBI(P%6TQm`RV$;e10000< KMNUMnLSTZuDQcqt diff --git a/MPfm/MPfm.GTK/gtk-gui/MPfm.GTK.SyncMenuWindow.cs b/MPfm/MPfm.GTK/gtk-gui/MPfm.GTK.SyncMenuWindow.cs index 3198972b..3bfa8ba5 100644 --- a/MPfm/MPfm.GTK/gtk-gui/MPfm.GTK.SyncMenuWindow.cs +++ b/MPfm/MPfm.GTK/gtk-gui/MPfm.GTK.SyncMenuWindow.cs @@ -9,16 +9,27 @@ public partial class SyncMenuWindow private global::Gtk.VBox vbox4; private global::Gtk.Label lblTitle; private global::Gtk.Label lblSubtitle; - private global::Gtk.Button btnSync; private global::Gtk.Label lblLoading; private global::Gtk.ProgressBar progressBar; + private global::Gtk.HPaned hpaned1; private global::Gtk.ScrolledWindow GtkScrolledWindow; private global::Gtk.TreeView treeView; + private global::Gtk.HBox hbox1; + private global::Gtk.VBox vbox1; + private global::Gtk.Alignment alignment2; + private global::Gtk.Button btnAdd; + private global::Gtk.Button btnRemove; + private global::Gtk.Button btnAddAll; + private global::Gtk.Button btnRemoveAll; + private global::Gtk.Alignment alignment3; + private global::Gtk.Alignment alignment4; + private global::Gtk.ScrolledWindow GtkScrolledWindow1; + private global::Gtk.TreeView treeViewSelection; private global::Gtk.HBox hbox2; private global::Gtk.VBox vbox3; private global::Gtk.Label lblTotal; private global::Gtk.Label lblFreeSpace; - private global::Gtk.Button btnSelectAll; + private global::Gtk.Button btnSync; protected virtual void Build () { @@ -63,55 +74,34 @@ protected virtual void Build () this.hbox3.Add (this.vbox4); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.vbox4])); w3.Position = 0; - // Container child hbox3.Gtk.Box+BoxChild - this.btnSync = new global::Gtk.Button (); - this.btnSync.CanFocus = true; - this.btnSync.Name = "btnSync"; - this.btnSync.UseUnderline = true; - // Container child btnSync.Gtk.Container+ContainerChild - global::Gtk.Alignment w4 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w5 = new global::Gtk.HBox (); - w5.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w6 = new global::Gtk.Image (); - w6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-forward", global::Gtk.IconSize.Menu); - w5.Add (w6); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w8 = new global::Gtk.Label (); - w8.LabelProp = global::Mono.Unix.Catalog.GetString ("Sync"); - w8.UseUnderline = true; - w5.Add (w8); - w4.Add (w5); - this.btnSync.Add (w4); - this.hbox3.Add (this.btnSync); - global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnSync])); - w12.Position = 1; - w12.Expand = false; - w12.Fill = false; this.vbox2.Add (this.hbox3); - global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox3])); - w13.Position = 0; - w13.Expand = false; - w13.Fill = false; + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox3])); + w4.Position = 0; + w4.Expand = false; + w4.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.lblLoading = new global::Gtk.Label (); this.lblLoading.Name = "lblLoading"; this.lblLoading.LabelProp = global::Mono.Unix.Catalog.GetString ("Loading..."); this.vbox2.Add (this.lblLoading); - global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.lblLoading])); - w14.Position = 1; - w14.Expand = false; - w14.Fill = false; + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.lblLoading])); + w5.Position = 1; + w5.Expand = false; + w5.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.progressBar = new global::Gtk.ProgressBar (); this.progressBar.Name = "progressBar"; this.vbox2.Add (this.progressBar); - global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.progressBar])); - w15.Position = 2; - w15.Expand = false; - w15.Fill = false; + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.progressBar])); + w6.Position = 2; + w6.Expand = false; + w6.Fill = false; // Container child vbox2.Gtk.Box+BoxChild + this.hpaned1 = new global::Gtk.HPaned (); + this.hpaned1.CanFocus = true; + this.hpaned1.Name = "hpaned1"; + this.hpaned1.Position = 331; + // Container child hpaned1.Gtk.Paned+PanedChild this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); this.GtkScrolledWindow.Name = "GtkScrolledWindow"; this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); @@ -120,9 +110,98 @@ protected virtual void Build () this.treeView.CanFocus = true; this.treeView.Name = "treeView"; this.GtkScrolledWindow.Add (this.treeView); - this.vbox2.Add (this.GtkScrolledWindow); - global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow])); - w17.Position = 3; + this.hpaned1.Add (this.GtkScrolledWindow); + global::Gtk.Paned.PanedChild w8 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.GtkScrolledWindow])); + w8.Resize = false; + // Container child hpaned1.Gtk.Paned+PanedChild + this.hbox1 = new global::Gtk.HBox (); + this.hbox1.Name = "hbox1"; + this.hbox1.Spacing = 6; + // Container child hbox1.Gtk.Box+BoxChild + this.vbox1 = new global::Gtk.VBox (); + this.vbox1.Name = "vbox1"; + this.vbox1.Spacing = 6; + // Container child vbox1.Gtk.Box+BoxChild + this.alignment2 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); + this.alignment2.Name = "alignment2"; + this.vbox1.Add (this.alignment2); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment2])); + w9.Position = 0; + // Container child vbox1.Gtk.Box+BoxChild + this.btnAdd = new global::Gtk.Button (); + this.btnAdd.CanFocus = true; + this.btnAdd.Name = "btnAdd"; + this.btnAdd.UseUnderline = true; + this.btnAdd.Label = global::Mono.Unix.Catalog.GetString (">"); + this.vbox1.Add (this.btnAdd); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.btnAdd])); + w10.Position = 1; + w10.Expand = false; + w10.Fill = false; + // Container child vbox1.Gtk.Box+BoxChild + this.btnRemove = new global::Gtk.Button (); + this.btnRemove.CanFocus = true; + this.btnRemove.Name = "btnRemove"; + this.btnRemove.UseUnderline = true; + this.btnRemove.Label = global::Mono.Unix.Catalog.GetString ("<"); + this.vbox1.Add (this.btnRemove); + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.btnRemove])); + w11.Position = 2; + w11.Expand = false; + w11.Fill = false; + // Container child vbox1.Gtk.Box+BoxChild + this.btnAddAll = new global::Gtk.Button (); + this.btnAddAll.CanFocus = true; + this.btnAddAll.Name = "btnAddAll"; + this.btnAddAll.UseUnderline = true; + this.btnAddAll.Label = global::Mono.Unix.Catalog.GetString (">>"); + this.vbox1.Add (this.btnAddAll); + global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.btnAddAll])); + w12.Position = 3; + w12.Expand = false; + w12.Fill = false; + // Container child vbox1.Gtk.Box+BoxChild + this.btnRemoveAll = new global::Gtk.Button (); + this.btnRemoveAll.CanFocus = true; + this.btnRemoveAll.Name = "btnRemoveAll"; + this.btnRemoveAll.UseUnderline = true; + this.btnRemoveAll.Label = global::Mono.Unix.Catalog.GetString ("<<"); + this.vbox1.Add (this.btnRemoveAll); + global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.btnRemoveAll])); + w13.Position = 4; + w13.Expand = false; + w13.Fill = false; + // Container child vbox1.Gtk.Box+BoxChild + this.alignment3 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); + this.alignment3.Name = "alignment3"; + // Container child alignment3.Gtk.Container+ContainerChild + this.alignment4 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); + this.alignment4.Name = "alignment4"; + this.alignment3.Add (this.alignment4); + this.vbox1.Add (this.alignment3); + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment3])); + w15.Position = 5; + this.hbox1.Add (this.vbox1); + global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox1])); + w16.Position = 0; + w16.Expand = false; + w16.Fill = false; + // Container child hbox1.Gtk.Box+BoxChild + this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow1.Name = "GtkScrolledWindow1"; + this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1)); + // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild + this.treeViewSelection = new global::Gtk.TreeView (); + this.treeViewSelection.CanFocus = true; + this.treeViewSelection.Name = "treeViewSelection"; + this.GtkScrolledWindow1.Add (this.treeViewSelection); + this.hbox1.Add (this.GtkScrolledWindow1); + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.GtkScrolledWindow1])); + w18.Position = 1; + this.hpaned1.Add (this.hbox1); + this.vbox2.Add (this.hpaned1); + global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hpaned1])); + w20.Position = 3; // Container child vbox2.Gtk.Box+BoxChild this.hbox2 = new global::Gtk.HBox (); this.hbox2.Name = "hbox2"; @@ -137,47 +216,68 @@ protected virtual void Build () this.lblTotal.Xalign = 0F; this.lblTotal.LabelProp = global::Mono.Unix.Catalog.GetString ("Total: 0 files (0.0 MB)"); this.vbox3.Add (this.lblTotal); - global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.lblTotal])); - w18.Position = 0; - w18.Expand = false; - w18.Fill = false; + global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.lblTotal])); + w21.Position = 0; + w21.Expand = false; + w21.Fill = false; // Container child vbox3.Gtk.Box+BoxChild this.lblFreeSpace = new global::Gtk.Label (); this.lblFreeSpace.Name = "lblFreeSpace"; this.lblFreeSpace.Xalign = 0F; this.lblFreeSpace.LabelProp = global::Mono.Unix.Catalog.GetString ("Free space: 3204.3 MB"); this.vbox3.Add (this.lblFreeSpace); - global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.lblFreeSpace])); - w19.Position = 1; - w19.Expand = false; - w19.Fill = false; + global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.lblFreeSpace])); + w22.Position = 1; + w22.Expand = false; + w22.Fill = false; this.hbox2.Add (this.vbox3); - global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vbox3])); - w20.Position = 0; + global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vbox3])); + w23.Position = 0; // Container child hbox2.Gtk.Box+BoxChild - this.btnSelectAll = new global::Gtk.Button (); - this.btnSelectAll.CanFocus = true; - this.btnSelectAll.Name = "btnSelectAll"; - this.btnSelectAll.UseUnderline = true; - this.btnSelectAll.Label = global::Mono.Unix.Catalog.GetString ("Select all"); - this.hbox2.Add (this.btnSelectAll); - global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.btnSelectAll])); - w21.Position = 1; - w21.Expand = false; - w21.Fill = false; + this.btnSync = new global::Gtk.Button (); + this.btnSync.CanFocus = true; + this.btnSync.Name = "btnSync"; + this.btnSync.UseUnderline = true; + // Container child btnSync.Gtk.Container+ContainerChild + global::Gtk.Alignment w24 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); + // Container child GtkAlignment.Gtk.Container+ContainerChild + global::Gtk.HBox w25 = new global::Gtk.HBox (); + w25.Spacing = 2; + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Image w26 = new global::Gtk.Image (); + w26.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-forward", global::Gtk.IconSize.Menu); + w25.Add (w26); + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Label w28 = new global::Gtk.Label (); + w28.LabelProp = global::Mono.Unix.Catalog.GetString ("Sync"); + w28.UseUnderline = true; + w25.Add (w28); + w24.Add (w25); + this.btnSync.Add (w24); + this.hbox2.Add (this.btnSync); + global::Gtk.Box.BoxChild w32 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.btnSync])); + w32.Position = 1; + w32.Expand = false; + w32.Fill = false; this.vbox2.Add (this.hbox2); - global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox2])); - w22.Position = 4; - w22.Expand = false; - w22.Fill = false; + global::Gtk.Box.BoxChild w33 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox2])); + w33.Position = 4; + w33.Expand = false; + w33.Fill = false; this.Add (this.vbox2); if ((this.Child != null)) { this.Child.ShowAll (); } this.DefaultWidth = 640; - this.DefaultHeight = 475; + this.DefaultHeight = 485; this.Show (); this.treeView.RowExpanded += new global::Gtk.RowExpandedHandler (this.OnTreeViewRowExpanded); + this.btnAdd.Clicked += new global::System.EventHandler (this.OnClickAdd); + this.btnRemove.Clicked += new global::System.EventHandler (this.OnClickRemove); + this.btnAddAll.Clicked += new global::System.EventHandler (this.OnClickAddAll); + this.btnRemoveAll.Clicked += new global::System.EventHandler (this.OnClickRemoveAll); + this.treeViewSelection.RowExpanded += new global::Gtk.RowExpandedHandler (this.OnTreeViewRowExpanded); + this.btnSync.Clicked += new global::System.EventHandler (this.OnClickSync); } } } diff --git a/MPfm/MPfm.GTK/gtk-gui/MPfm.GTK.SyncWindow.cs b/MPfm/MPfm.GTK/gtk-gui/MPfm.GTK.SyncWindow.cs index b6c575fe..fd0449b1 100644 --- a/MPfm/MPfm.GTK/gtk-gui/MPfm.GTK.SyncWindow.cs +++ b/MPfm/MPfm.GTK/gtk-gui/MPfm.GTK.SyncWindow.cs @@ -9,12 +9,13 @@ public partial class SyncWindow private global::Gtk.VBox vbox2; private global::Gtk.Label lblTitle; private global::Gtk.Label lblSubtitle; - private global::Gtk.Button btnConnectManual; + private global::Gtk.ProgressBar progressBar; private global::Gtk.ScrolledWindow GtkScrolledWindow; private global::Gtk.TreeView treeViewDevices; private global::Gtk.HBox hbox1; private global::Gtk.Button btnRefreshDeviceList; - private global::Gtk.ProgressBar progressBar; + private global::Gtk.Alignment alignment1; + private global::Gtk.Button btnConnectManual; private global::Gtk.Button btnSyncLibraryWithDevice; protected virtual void Build () @@ -61,13 +62,10 @@ protected virtual void Build () global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vbox2])); w3.Position = 0; // Container child hbox2.Gtk.Box+BoxChild - this.btnConnectManual = new global::Gtk.Button (); - this.btnConnectManual.CanFocus = true; - this.btnConnectManual.Name = "btnConnectManual"; - this.btnConnectManual.UseUnderline = true; - this.btnConnectManual.Label = global::Mono.Unix.Catalog.GetString ("Connect manually to a device"); - this.hbox2.Add (this.btnConnectManual); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.btnConnectManual])); + this.progressBar = new global::Gtk.ProgressBar (); + this.progressBar.Name = "progressBar"; + this.hbox2.Add (this.progressBar); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.progressBar])); w4.Position = 1; w4.Expand = false; w4.Fill = false; @@ -119,17 +117,17 @@ protected virtual void Build () w16.Expand = false; w16.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.progressBar = new global::Gtk.ProgressBar (); - this.progressBar.Name = "progressBar"; - this.hbox1.Add (this.progressBar); - global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.progressBar])); + this.alignment1 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F); + this.alignment1.Name = "alignment1"; + this.hbox1.Add (this.alignment1); + global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.alignment1])); w17.Position = 1; // Container child hbox1.Gtk.Box+BoxChild - this.btnSyncLibraryWithDevice = new global::Gtk.Button (); - this.btnSyncLibraryWithDevice.CanFocus = true; - this.btnSyncLibraryWithDevice.Name = "btnSyncLibraryWithDevice"; - this.btnSyncLibraryWithDevice.UseUnderline = true; - // Container child btnSyncLibraryWithDevice.Gtk.Container+ContainerChild + this.btnConnectManual = new global::Gtk.Button (); + this.btnConnectManual.CanFocus = true; + this.btnConnectManual.Name = "btnConnectManual"; + this.btnConnectManual.UseUnderline = true; + // Container child btnConnectManual.Gtk.Container+ContainerChild global::Gtk.Alignment w18 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); // Container child GtkAlignment.Gtk.Container+ContainerChild global::Gtk.HBox w19 = new global::Gtk.HBox (); @@ -140,28 +138,55 @@ protected virtual void Build () w19.Add (w20); // Container child GtkHBox.Gtk.Container+ContainerChild global::Gtk.Label w22 = new global::Gtk.Label (); - w22.LabelProp = global::Mono.Unix.Catalog.GetString ("Connect to device"); + w22.LabelProp = global::Mono.Unix.Catalog.GetString ("Connect manually to a device"); w22.UseUnderline = true; w19.Add (w22); w18.Add (w19); - this.btnSyncLibraryWithDevice.Add (w18); - this.hbox1.Add (this.btnSyncLibraryWithDevice); - global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnSyncLibraryWithDevice])); + this.btnConnectManual.Add (w18); + this.hbox1.Add (this.btnConnectManual); + global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnConnectManual])); w26.Position = 2; w26.Expand = false; w26.Fill = false; + // Container child hbox1.Gtk.Box+BoxChild + this.btnSyncLibraryWithDevice = new global::Gtk.Button (); + this.btnSyncLibraryWithDevice.CanFocus = true; + this.btnSyncLibraryWithDevice.Name = "btnSyncLibraryWithDevice"; + this.btnSyncLibraryWithDevice.UseUnderline = true; + // Container child btnSyncLibraryWithDevice.Gtk.Container+ContainerChild + global::Gtk.Alignment w27 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); + // Container child GtkAlignment.Gtk.Container+ContainerChild + global::Gtk.HBox w28 = new global::Gtk.HBox (); + w28.Spacing = 2; + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Image w29 = new global::Gtk.Image (); + w29.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-forward", global::Gtk.IconSize.Menu); + w28.Add (w29); + // Container child GtkHBox.Gtk.Container+ContainerChild + global::Gtk.Label w31 = new global::Gtk.Label (); + w31.LabelProp = global::Mono.Unix.Catalog.GetString ("Connect to device"); + w31.UseUnderline = true; + w28.Add (w31); + w27.Add (w28); + this.btnSyncLibraryWithDevice.Add (w27); + this.hbox1.Add (this.btnSyncLibraryWithDevice); + global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnSyncLibraryWithDevice])); + w35.Position = 3; + w35.Expand = false; + w35.Fill = false; this.vbox1.Add (this.hbox1); - global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1])); - w27.Position = 2; - w27.Expand = false; - w27.Fill = false; + global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1])); + w36.Position = 2; + w36.Expand = false; + w36.Fill = false; this.Add (this.vbox1); if ((this.Child != null)) { this.Child.ShowAll (); } - this.DefaultWidth = 558; + this.DefaultWidth = 604; this.DefaultHeight = 363; this.Show (); + this.btnRefreshDeviceList.Clicked += new global::System.EventHandler (this.OnClickRefreshDeviceList); this.btnConnectManual.Clicked += new global::System.EventHandler (this.OnClickConnectManual); this.btnSyncLibraryWithDevice.Clicked += new global::System.EventHandler (this.OnClickConnect); } diff --git a/MPfm/MPfm.GTK/gtk-gui/gui.stetic b/MPfm/MPfm.GTK/gtk-gui/gui.stetic index 6300be79..127b79eb 100644 --- a/MPfm/MPfm.GTK/gtk-gui/gui.stetic +++ b/MPfm/MPfm.GTK/gtk-gui/gui.stetic @@ -3253,7 +3253,6 @@ Update Library Center True - @@ -3464,7 +3463,7 @@ - + SyncWindow CenterOnParent @@ -3514,17 +3513,12 @@ - + - True - TextOnly - Connect manually to a device - True - 1 - True + False False False @@ -3566,6 +3560,7 @@ stock:gtk-cancel Menu Cancel refresh True + 0 @@ -3575,12 +3570,32 @@ - + + + + 1 + False + + + + + + True + TextAndIcon + stock:gtk-go-forward Menu + Connect manually to a device + True + + + + 2 True + False + False @@ -3594,7 +3609,7 @@ - 2 + 3 True False False @@ -3611,7 +3626,7 @@ - + SyncMenuWindow CenterOnParent @@ -3661,20 +3676,7 @@ - - - True - TextAndIcon - stock:gtk-go-forward Menu - Sync - True - - - 1 - True - False - False - + @@ -3708,15 +3710,154 @@ - + - In + True + 331 - + - True - True - + In + + + + True + True + + + + + + False + + + + + + 6 + + + + 6 + + + + + + + + + 0 + False + + + + + + True + TextOnly + > + True + + + + 1 + True + False + False + + + + + + True + TextOnly + < + True + + + + 2 + True + False + False + + + + + + True + TextOnly + >> + True + + + + 3 + True + False + False + + + + + + True + TextOnly + << + True + + + + 4 + True + False + False + + + + + + + + + + + + + + + + 5 + True + + + + + 0 + True + False + False + + + + + + In + + + + True + True + + + + + + 1 + True + + @@ -3766,12 +3907,14 @@ - + True - TextOnly - Select all + TextAndIcon + stock:gtk-go-forward Menu + Sync True + 1