Beispiel #1
0
        public void TestClone_CloneIgnore_Dashboard()
        {
            var mediaFileSet = new MediaFileSet();

            mediaFileSet.DocumentID = "1234567890";
            mediaFileSet.ParentID   = Guid.NewGuid();
            mediaFileSet.IsChanged  = true;
            var mediaFileSet2 = mediaFileSet.Clone();

            Assert.AreEqual(mediaFileSet.DocumentID, mediaFileSet2.DocumentID);
            Assert.AreEqual(mediaFileSet.ParentID, mediaFileSet2.ParentID);
            Assert.IsTrue(mediaFileSet2.IsChanged);
        }
Beispiel #2
0
        public void TestMediaFileSetPathModifiedDifferentReferenceReturnsTrue()
        {
            MediaFileSet mfs = new MediaFileSet();

            mfs.Add(new MediaFile {
                FilePath = "/videos/test.mp4"
            });

            MediaFileSet mfs2 = mfs.Clone();

            mfs2 [0].FilePath = "/videos/test2.mp4";

            Assert.IsTrue(mfs2.CheckMediaFilesModified(mfs));
            Assert.AreNotEqual(mfs [0].FilePath, mfs2 [0].FilePath);
            Assert.AreEqual(mfs.ID, mfs2.ID);
        }
Beispiel #3
0
        public override bool SelectMediaFiles(MediaFileSet fileSet)
        {
            bool ret = false;
            MediaFileSetSelection fileselector = new MediaFileSetSelection(false);

            Gtk.Dialog d = new Gtk.Dialog(Catalog.GetString("Select video files"),
                                          MainWindow.Toplevel as Gtk.Window,
                                          DialogFlags.Modal | DialogFlags.DestroyWithParent,
                                          Gtk.Stock.Cancel, ResponseType.Cancel,
                                          Gtk.Stock.Ok, ResponseType.Ok);
            fileselector.Show();
            fileselector.FileSet = fileSet.Clone();
            d.VBox.Add(fileselector);
            App.Current.Dialogs.WarningMessage(Catalog.GetString("Some video files are missing for this project"));
            while (d.Run() == (int)ResponseType.Ok)
            {
                if (!fileselector.FileSet.CheckFiles())
                {
                    App.Current.Dialogs.WarningMessage(Catalog.GetString("Some video files are still missing for this project."), d);
                    continue;
                }
                if (fileselector.FileSet.Count == 0)
                {
                    App.Current.Dialogs.WarningMessage(Catalog.GetString("You need at least 1 video file for the main angle"));
                    continue;
                }
                ret = true;
                break;
            }
            if (ret)
            {
                // We need to update the fileset as it might have changed. Indeed if multi camera is not supported
                // widget will propose only one media file selector and will return a smaller fileset than the
                // one provided originally.
                fileSet.Clear();
                for (int i = 0; i < fileselector.FileSet.Count; i++)
                {
                    fileSet.Add(fileselector.FileSet [i]);
                }
            }
            d.Destroy();
            return(ret);
        }