~dobey/ubuntu/natty/banshee/fix-and-amz

« back to all changes in this revision

Viewing changes to src/Core/Banshee.ThickClient/Banshee.Library.Gui/FileImportSource.cs

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2008-07-30 12:37:28 UTC
  • mto: (1.2.3 upstream) (94.1.1 maverick)
  • mto: This revision was merged to the branch mainline in revision 70.
  • Revision ID: james.westby@ubuntu.com-20080730123728-8y78ip4btz99ri5h
Tags: upstream-1.2.0
Import upstream version 1.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
using Mono.Unix;
31
31
using Gtk;
32
32
 
 
33
using Banshee.ServiceStack;
 
34
 
33
35
namespace Banshee.Library.Gui
34
36
{
35
37
    public class FileImportSource : IImportSource
47
49
            
48
50
            chooser.AddButton (Stock.Cancel, ResponseType.Cancel);
49
51
            chooser.AddButton (Stock.Open, ResponseType.Ok);
50
 
            
 
52
            chooser.AddFilter (Hyena.Gui.GtkUtilities.GetFileFilter (Catalog.GetString ("Media Files"), Banshee.Collection.Database.DatabaseImportManager.WhiteListFileExtensions));
51
53
            chooser.SelectMultiple = true;
52
54
            chooser.DefaultResponse = ResponseType.Ok;
53
55
            
54
 
            if(chooser.Run() == (int)ResponseType.Ok) {
55
 
                Banshee.ServiceStack.ServiceManager.Get<LibraryImportManager> ("LibraryImportManager").QueueSource (
56
 
                    chooser.Uris);   
 
56
            SetChooserShortcuts (chooser);
 
57
            
 
58
            if (chooser.Run () == (int)ResponseType.Ok) {
 
59
                Banshee.ServiceStack.ServiceManager.Get<LibraryImportManager> ().Enqueue (chooser.Uris);
57
60
            }
58
61
            
59
62
            chooser.Destroy ();
70
73
        public bool CanImport {
71
74
            get { return true; }
72
75
        }
 
76
        
 
77
        public int SortOrder {
 
78
            get { return 5; }
 
79
        }
 
80
        
 
81
        public static void SetChooserShortcuts (Gtk.FileChooserDialog chooser)
 
82
        {
 
83
            Hyena.Gui.GtkUtilities.SetChooserShortcuts (chooser,
 
84
                ServiceManager.SourceManager.MusicLibrary.BaseDirectory,
 
85
                ServiceManager.SourceManager.VideoLibrary.BaseDirectory
 
86
            );
 
87
        }
73
88
    }
74
89
}