public CS_AlbumListView(CueSheetsView view) : base()
 {
     _view = view;
     //_gridEnabled=base.GetAlbumGrid();
     //Hyena.Log.Information ("grid enabled="+_gridEnabled);
     EnableGrid();
 }
        public CS_TrackListView(CueSheetsView view) : base()
        {
            _view = view;
            Hyena.Log.Information("view=" + _view);

            _nr = new CS_Column("tracknr", "Nr", new ColumnCellText("TrackNumber", true), 1.0);
            column_controller.Add(_nr);

            _track = new CS_Column("track", "Track", new ColumnCellText("TrackTitle", true), 1.0);
            column_controller.Add(_track);

            _piece = new CS_Column("piece", "Piece", new ColumnCellText("Piece", true), 1.0);
            column_controller.Add(_piece);

            _artist = new CS_Column("artist", "Artist", new ColumnCellText("ArtistName", true), 1.0);
            column_controller.Add(_artist);

            _composer = new CS_Column("composer", "Composer", new ColumnCellText("Composer", true), 1.0);
            column_controller.Add(_composer);

            _length = new CS_Column("length", "Length", new ColumnCellText("Length", true), 1.0);
            column_controller.Add(_length);

            ColumnController   = column_controller;
            base.HeaderVisible = true;
        }
 public CS_AlbumListView(CueSheetsView view)
     : base()
 {
     _view=view;
     //_gridEnabled=base.GetAlbumGrid();
     //Hyena.Log.Information ("grid enabled="+_gridEnabled);
     EnableGrid ();
 }
		public CS_CollectionSearchEntry (CueSheetsView view) : base() {
			_view=view;
			Hyena.Log.Information (_view.ToString ());
			base.TextInserted+=delegate(object sender,Gtk.TextInsertedArgs args) {
				Console.WriteLine (base.Text);
			};
			base.TextDeleted+=delegate(object sender,Gtk.TextDeletedArgs args) {
				Console.WriteLine (base.Text);
			};
		}
Exemplo n.º 5
0
 public CS_CollectionSearchEntry(CueSheetsView view) : base()
 {
     _view = view;
     Hyena.Log.Information(_view.ToString());
     base.TextInserted += delegate(object sender, Gtk.TextInsertedArgs args) {
         Console.WriteLine(base.Text);
     };
     base.TextDeleted += delegate(object sender, Gtk.TextDeletedArgs args) {
         Console.WriteLine(base.Text);
     };
 }
        public CueSheetsSource() : base(AddinManager.CurrentLocalizer.GetString("CueSheets"),
                                        AddinManager.CurrentLocalizer.GetString("CueSheets"),
                                                    //"cuesheets",
                                        sort_order) //,
            //"hod-cuesheets-2013-01-06")
        {
            Hyena.Log.Information("CueSheetsSouce init");

            DbConnection = ServiceManager.DbConnection;
            TM_Provider  = DatabaseTrackInfo.Provider;

            _track_info_db = new CS_TrackInfoDb(DbConnection);

            _sheet  = new CueSheet();
            _sheets = new CueSheetCollection();

            _view = new CueSheetsView(this);

            Properties.Set <ISourceContents> ("Nereid.SourceContents", _view);
            Properties.SetString("Icon.Name", "cueplay");
            Hyena.Log.Information("CueSheets source has been instantiated.");

            Properties.Set <string> ("SearchEntryDescription", Catalog.GetString("Search albums and tracks"));

            try {
                Properties.SetString("GtkActionPath", "/CueSheetsPopup");
                _actions = new CS_Actions(this);
                Hyena.Log.Information(_actions.ToString());
            } catch (System.Exception ex) {
                Hyena.Log.Information(ex.ToString());
            }

            InterfaceActionService action_service = ServiceManager.Get <InterfaceActionService> ();

            try {
                _track_search          = new Gtk.CheckButton("Search Tracks");
                _track_search.Clicked += delegate(object sender, EventArgs args) {
                    this.DoFilter();
                };
                Gtk.Toolbar header_toolbar = (Gtk.Toolbar)action_service.UIManager.GetWidget("/HeaderToolbar");
                int         i, N, k;
                for (i = 0, k = -1, N = header_toolbar.NItems; i < N; i++)
                {
                    Gtk.Widget w = header_toolbar.GetNthItem(i).Child;
                    if (w != null)
                    {
                        if (w.GetType() == typeof(Banshee.Gui.Widgets.ConnectedVolumeButton))
                        {
                            k = i;
                        }
                    }
                }
                if (k >= 0)
                {
                    Hyena.Log.Information("Toolitem itm");
                    Gtk.ToolItem itm = new Gtk.ToolItem();
                    Hyena.Log.Information("Add cbk");
                    itm.Add(_track_search);
                    Hyena.Log.Information("Insert cbk");
                    header_toolbar.Insert(itm, k);
                    itm.Show();
                }
            } catch (System.Exception ex) {
                Hyena.Log.Error(ex.ToString());
            }
            Gtk.Menu viewMenu = (action_service.UIManager.GetWidget("/MainMenu/ViewMenu") as Gtk.MenuItem).Submenu as Gtk.Menu;
            _menuItem            = new Gtk.MenuItem(Catalog.GetString("_Change Album View"));
            _menuItem.Activated += delegate {
                _view.ToggleGrid();
            };
            viewMenu.Insert(_menuItem, 2);
            _sep = new Gtk.SeparatorMenuItem();
            viewMenu.Insert(_sep, 3);
        }
        //,
        //"hod-cuesheets-2013-01-06")
        public CueSheetsSource()
            : base(AddinManager.CurrentLocalizer.GetString ("CueSheets"),
                                          AddinManager.CurrentLocalizer.GetString ("CueSheets"),
		                                  //"cuesheets",
		                                  sort_order)
        {
            Hyena.Log.Information ("CueSheetsSouce init");

            DbConnection=ServiceManager.DbConnection;
            TM_Provider=DatabaseTrackInfo.Provider;

            _track_info_db=new CS_TrackInfoDb(DbConnection);

            _sheet=new CueSheet();
            _sheets=new CueSheetCollection();

            _view=new CueSheetsView(this);

            Properties.Set<ISourceContents> ("Nereid.SourceContents", _view);
            Properties.SetString ("Icon.Name", "cueplay");
            Hyena.Log.Information ("CueSheets source has been instantiated.");

            Properties.Set<string> ("SearchEntryDescription", Catalog.GetString ("Search albums and tracks"));

            try {
                Properties.SetString("GtkActionPath","/CueSheetsPopup");
                _actions = new CS_Actions (this);
                Hyena.Log.Information(_actions.ToString());
            } catch (System.Exception ex) {
                Hyena.Log.Information(ex.ToString ());
            }

            InterfaceActionService action_service = ServiceManager.Get<InterfaceActionService> ();
            try {
                _track_search=new Gtk.CheckButton("Search Tracks");
                _track_search.Clicked+=delegate(object sender,EventArgs args) {
                    this.DoFilter();
                };
                Gtk.Toolbar header_toolbar = (Gtk.Toolbar) action_service.UIManager.GetWidget ("/HeaderToolbar");
                int i,N,k;
                for(i=0,k=-1,N=header_toolbar.NItems;i<N;i++) {
                    Gtk.Widget w=header_toolbar.GetNthItem(i).Child;
                    if (w!=null) {
                        if (w.GetType()==typeof(Banshee.Gui.Widgets.ConnectedVolumeButton)) {
                            k=i;
                        }
                    }
                }
                if (k>=0) {
                    Hyena.Log.Information("Toolitem itm");
                    Gtk.ToolItem itm=new Gtk.ToolItem();
                    Hyena.Log.Information ("Add cbk");
                    itm.Add (_track_search);
                    Hyena.Log.Information ("Insert cbk");
                    header_toolbar.Insert (itm,k);
                    itm.Show ();
                }
            } catch (System.Exception ex) {
                Hyena.Log.Error (ex.ToString ());
            }
            Gtk.Menu viewMenu = (action_service.UIManager.GetWidget ("/MainMenu/ViewMenu") as Gtk.MenuItem).Submenu as Gtk.Menu;
            _menuItem = new Gtk.MenuItem (Catalog.GetString ("_Change Album View"));
            _menuItem.Activated += delegate {
                _view.ToggleGrid();
            };
            viewMenu.Insert (_menuItem, 2);
            _sep=new Gtk.SeparatorMenuItem();
            viewMenu.Insert (_sep,3);
        }
 public CS_PlayListsView(CueSheetsView view) : base()
 {
     _view = view;
     column_controller.Add(new Column("Playlist", new ColumnCellText("PlsName", true), 1.0));
     ColumnController = column_controller;
 }