On Tuesday den 17. July 2012 at 04.12, Timo Dörr wrote:
Using the GTK dialog means it's not consistent with other apps on OS Xor Windows, but at least Banshee is consistent with itself. I guess anative file dialog would look different from all dialogs in Banshee:theme, buttons, icons, etc. Wouldn't that be weird, like the filedialog doesn't belong with Banshee ?I can't tell about the quality of the Gtk Chooser on Windows, since Inever used it.As for Linux, the GTK file chooser IS the native chooser for all gnomeusers. It shows your bookmarked folders, external connected drives,network shares/mounts and so on, just perfectly as one would want to.On OS X, the gtk chooser is poorly integrated into the OS, and it does notdisplay any of them (no bookmarks besides the one you add from within gtkchooser, no external/mounted media, no network shares). So it not only acosmectic enancement, but a functional one.For comparisson I created screenshots of how the file open dialogs look onOS X:(I dont have a usb drive connected but 2 internal harddrives, and as onesees the 2nd harddrive is not shown in GTK).Right now, if a User wants to import media from external hdd drive, he/shehas to know the underlying mountpoint, which is /Volumes/ on the root (ormain harddisk). This somehow corresponds to the /mnt/ oder /media folderon linux. But in contrast to linux, Mac OS X always "hides" the /Volumesfolder away from the user. It is not displayed if you select your harddrive in Finder, and even if you want to, there is no way of getting intothe /Volumes/ folder from within the OS X native file chooser - the UI isjust not meant to get there.Here is a screenshot of how OS X displays your / (root) folder from withinthe UI:Not only is /Volumes/ hidden, but the /opt, /var, /usr/ etc. that arepresent on OS X, but always and consistently get hidden throughout theGUI. Knowing that your drives are mounted in /Volumes/ is something onlypro users know, that use the terminal. So at the moment, with the gtkchooser the user has to navigate to Filesystem->Volumes to get yourexternal/network media, while a user will certainly never have navigatedthere before when using only OS X interfaces.Althogh there a very few OS X questions on the mailing list, we had thatvery same problem by a user who couldn't access his usb drive, see thisI'm also wondering about how the various features of the GTK filechooser dialog would be "translated" into the native dialog: theaction (open, save, select folder, create folder), the shortcuts, thefile filters (see ImageFileChooserDialog), adding an extra widget inthe dialog (see PlaylistExportDialog), maybe some other stuff I'mforgetting, and not counting the different API semantics betweenplatforms.That is indeed a problem which I did not see on my original post. I havecurrently a patch that is very non-intrusive on current code, but onlyprovides a native chooser for Media->Import Local file/Import localFolder. For other Dialogs (like the ImageFileChooser) theFileChooserDialog from Gtk is used as a fallback. I'm still havingproblems integrating with the Mono.Addins, but once the patch is readyI'll post to discuss on that when having the code.If we use the native OSX file selection dialog, would this bring otherbenefits than cross-OS consistency ? Thinking about the Windows filedialog, which I'm more familiar with, I can't see anything other itwould bring.As I said its not only about consistency, but the gtk chooser lacks veryimportant functionality on OS X.
Related question: Does MonoDevelop use the native file dialog on OS X? On Windows, it uses the GTK dialog.On OS X, it uses the native OS X dialogs which have been added in MD 2.6:Then finally, using native file dialogs would be our first step awayfrom using GTK for all UI stuff, and towards having platform specificUI. But maybe that's just me being old and afraid of change :)I am 100% commited to sticking with GTK and introduce as few platformspecific UI as possible. All Widgets should be platform independent andall platforms should share the same GUI. Just the parts that introduceserious drawbacks should be done natively.
GreetzTimoSo I'd be happy to hear more about this, and maybe be convinced tochange my mind...--BertrandAm 06.07.2012, 16:46 Uhr, schrieb David Nielsen <gnomeuser gmail com>:I admit my preference is for option 3, it seems the most in line withhowBanshee is generally designed.- DavidSendt fra min iPadDen 06/07/2012 kl. 11:10 skrev Timo Dörr <timo latecrew de>:Hi all,I was just playing around with implementing native OS X "file open"dialogs in banshee. I am somewhat unsure of what is the best designdecisionof implementing that.Right now, (all (or at least the most) platform-specific code goesintoits according backends which are Banshee.Osx, Banshee.Unix andBanshee.Windows. This works for the HardwareManager and otherplattformspecific code very well. The FileChooserDialog.cs resides in theBanshee.Gui.Dialogs within Banshee.ThickClient, and is compiled onallplattforms atm.I see a bunch of possibilities of how I could implement the nativeFileChooser:(1): Create a OsxFileChooser.cs within Banshee.Gui.Dialogs and haveitcompletely surrounded by #if PLATFORM_DARWIN compile conditionals.Thiswould require changes to the autofoo scripts. Same could be donewith afuture possible WindowsFileChooserDialog.cs. CurrentFileChooserDialog.cs ismoved into GtkFileChooser.cs and the FileChooser.cs (and its class)arereplaced by a bridge class (using the bridge design pattern), thatusesHyena.PlatformDetection to decide which of the classes is to beinstantiatedand returned. This would require compile conditionals #if in theFileChooserDialog.cs, to.(2): like (1), but without the bridge design pattern and without the#ifin the FileChooser.cs file. Instead, create an empty partial classFileChooserDialog, and the other implementations({Osx|Gtk|Win}FileChooserDialog) are also partial - again the #ifcompileconditionals surround each platform-specific version, and thusdecide whichclass is compiled into the actual FileChooser(3): Move the platform dependent {Osx|Gtk|Win}FileChooser (andpossiblyother dialogs) in the according Backends likeBanshee.{Osx|Windows|Unix}.Change the FileChooserDialog.cs to load the correct implementationviamono.addins as an ExtensionNode, depending onHyena.PlatformDetection. Thishas the advantage of not having to introduce preprocessorconditionals, asthe autofoo code for conditionally compile the correctOsx/Windows/Unixbackends is already in place. Disadvantage is, it is the solutionwhichchanges the most code and design change.Any suggestions or feedback which is the best way to go?GreetzTimo_______________________________________________banshee-list mailing listhttps://mail.gnome.org/mailman/listinfo/banshee-list (unsubscribe here)--Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/_______________________________________________banshee-list mailing listhttps://mail.gnome.org/mailman/listinfo/banshee-list (unsubscribe here)