예제 #1
0
        public void Purchase(MusicStoreTrackInfo track)
        {
            // FIXME: Login shouldnt be here
            if (!Login())
            {
                return;
            }

            string message = String.Format(Catalog.GetString("You are about to purchase the song <i>{0}</i> from <i>{1}</i>, " +
                                                             "by <i>{2}</i>. Your account will be charged a fee of {3}."),
                                           track.Title,
                                           track.Album,
                                           track.Artist,
                                           track.DisplayPrice);

            ResponseType response = HigMessageDialog.RunHigMessageDialog(null,
                                                                         0,
                                                                         MessageType.Info,
                                                                         ButtonsType.OkCancel,
                                                                         "Purchase Song",
                                                                         message);

            if (response != ResponseType.Ok)
            {
                return;
            }

            MusicStorePurchaseTransaction trans = new MusicStorePurchaseTransaction(this, track);

            trans.Run();
        }
        private void TitleCellDataFunc(TreeViewColumn column,
                                       CellRenderer renderer,
                                       TreeModel model,
                                       TreeIter iter)
        {
            MusicStoreTrackInfo track = (MusicStoreTrackInfo)model.GetValue(iter, 0);

            ((CellRendererText)renderer).Text = track.Title;
        }
예제 #3
0
 public static string GetLibraryPathForTrack(MusicStoreTrackInfo track)
 {
     // FIXME: Subdirectories
     return(Path.Combine(Globals.Library.Location, String.Format("{0}-{1}-{2}.m4a", track.Artist, track.Album, track.Title)));
 }
        // --------------------------------------------------------------- //

        private void OnRowActivated(object o, RowActivatedArgs args)
        {
            MusicStoreTrackInfo track = GetSelectedTrack();

            plugin.Purchase(track);
        }
 public void AddTrack(MusicStoreTrackInfo track)
 {
     ((ListStore)Model).AppendValues(track);
 }
		public MusicStorePurchaseTransaction (MusicStorePlugin plugin, MusicStoreTrackInfo track)
		{
			this.plugin = plugin;
			this.track = track;
		}
        public void Purchase(MusicStoreTrackInfo track)
        {
            // FIXME: Login shouldnt be here
            if (!Login ())
                return;

                        string message = String.Format (Catalog.GetString ("You are about to purchase the song <i>{0}</i> from <i>{1}</i>, " +
                                                                           "by <i>{2}</i>. Your account will be charged a fee of {3}."),
                            track.Title,
                            track.Album,
                            track.Artist,
                            track.DisplayPrice);

                        ResponseType response = HigMessageDialog.RunHigMessageDialog (null,
                                                                                      0,
                                                                                      MessageType.Info,
                                                                                      ButtonsType.OkCancel,
                                                                                      "Purchase Song",
                                                                                      message);

                        if (response != ResponseType.Ok)
                                return;

            MusicStorePurchaseTransaction trans = new MusicStorePurchaseTransaction (this, track);
            trans.Run ();
        }
 public static string GetLibraryPathForTrack(MusicStoreTrackInfo track)
 {
     // FIXME: Subdirectories
     return Path.Combine (Globals.Library.Location, String.Format ("{0}-{1}-{2}.m4a", track.Artist, track.Album, track.Title));
 }
 public void AddTrack(MusicStoreTrackInfo track)
 {
     ((ListStore)Model).AppendValues (track);
 }
 public MusicStorePurchaseTransaction(MusicStorePlugin plugin, MusicStoreTrackInfo track)
 {
     this.plugin = plugin;
     this.track = track;
 }