Пример #1
0
        public frmFileInfo(Track Track) : base(Track.ToShortString(), ButtonCreateType.OKOnly)
        {
            this.ClientSize = new System.Drawing.Size(550, 400);

            SPACING = 4;

            this.KeyPreview = true;

            btnOK.Text = Localization.Get(UI_Key.File_Info_Done);

            track = Track;
            track.Load();

            art = new Artwork();
            art.CurrentTrack = track;
            art.Size         = new Size(ART_SIZE, ART_SIZE);
            art.Location     = new Point(this.ClientRectangle.Width - ART_SIZE - MARGIN, MARGIN);
            this.Controls.Add(art);

            if (track.ConfirmExists)
            {
                btnEdit = new QButton(Localization.Get(UI_Key.File_Info_Edit), false, false);
                btnEdit.ButtonPressed += (s) => { edit(); };
                this.Controls.Add(btnEdit);
            }

            this.EditFile = false;
        }
Пример #2
0
        protected override void OnMouseEnter(EventArgs e)
        {
            base.OnMouseEnter(e);

            this.Opacity = OPAQUE;

            Track t = controller.PlayingTrack;

            if (t != null)
            {
                toolTipText = t.ToShortString();
                toolTip     = new QToolTip(this, toolTipText);
                toolTip.SetToolTip(this, toolTipText);
            }
            else
            {
                killToolTip();
            }
        }
Пример #3
0
        private void doBulkUpdate()
        {
            int i       = newPath.Length - 1;
            int lenDiff = newPath.Length - oldPath.Length;

            while (i >= lenDiff && newPath[i] == oldPath[i - lenDiff])
            {
                i--;
            }
            i++;
            string oldStart       = oldPath.Substring(0, i - lenDiff);
            string newStart       = newPath.Substring(0, i);
            int    oldStartLength = oldStart.Length;

            int count    = 0;
            int badCount = 0;

            List <Track> tracks = Database.LibrarySnapshot;

            for (int j = 0; j < tracks.Count; j++)
            {
                Track tt = tracks[j];

                if (tt.Exists != true && tt.FilePath.StartsWith(oldStart, StringComparison.OrdinalIgnoreCase) && !tt.ConfirmExists)
                {
                    string s = newStart + tt.FilePath.Substring(oldStartLength);
                    if (File.Exists(s))
                    {
                        tt.FilePath      = s;
                        tt.ConfirmExists = true;
                        count++;
                        Controller.ShowMessage(Localization.Get(UI_Key.Find_File_Message_Updating, count.ToString(), tt.ToShortString()));
                        Controller.GetInstance().Invalidate();
                    }
                    else
                    {
                        badCount++;
                    }
                }
                else
                {
                    badCount++;
                }
            }
            Database.IncrementDatabaseVersion(true);
        }