private void MovingPicturesConfig_FormClosing(object sender, FormClosedEventArgs e)
 {
     if (!DesignMode) {
         MovingPicturesCore.Importer.Stop();
         ProgressPopup popup = new ProgressPopup(new WorkerDelegate(movieManagerPane1.Commit));
         popup.Owner = this;
         popup.ShowDialog();
     }
 }
        private void MovingPicturesConfig_FormClosing(object sender, FormClosedEventArgs e)
        {
            if (!DesignMode) {
                MovingPicturesCore.Importer.Stop();
                ProgressPopup popup = new ProgressPopup(new WorkerDelegate(movieManagerPane1.Commit));
                popup.Owner = this;
                popup.ShowDialog();
            }

            MovingPicturesCore.Settings.ConfigScreenWidth = this.Width;
            MovingPicturesCore.Settings.ConfigScreenHeight = this.Height;
            MovingPicturesCore.Settings.ConfigScreenPositionX = this.Left;
            MovingPicturesCore.Settings.ConfigScreenPositionY = this.Top;
        }
        private void removeSourceButton_Click(object sender, EventArgs e)
        {
            if (pathBindingSource.Current != null) {
                DialogResult result = MessageBox.Show("This will remove from Moving Pictures all movies retrieved from this import path, are you sure?", "Warning!", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes) {
                    // stop the importer
                    MovingPicturesCore.Importer.Stop(); ;

                    // remove the import path
                    ((DBImportPath)pathBindingSource.Current).Delete();
                    pathBindingSource.RemoveCurrent();

                    // clean the database of the old movies using our progress bar popup
                    ProgressPopup progressPopup = new ProgressPopup(new WorkerDelegate(DatabaseMaintenanceManager.RemoveInvalidFiles));
                    DatabaseMaintenanceManager.MaintenanceProgress += new ProgressDelegate(progressPopup.Progress);
                    progressPopup.Owner = ParentForm;
                    progressPopup.Text = "Removing related movies...";
                    progressPopup.ShowDialog();

                    // restart the importer
                    MovingPicturesCore.Importer.RestartScanner();

                }
            }
        }
        // Renames files from remaining movies in the list.
        private void RenameRemainingMovies()
        {
            renamingAll = true;
            this.Visible = false;

            ProgressPopup popup = new ProgressPopup(new TrackableWorkerDelegate(RenameRemainingWorker));
            popup.Owner = this.Owner;
            popup.ShowDialog();
        }
        private void updateMediaInfoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            processingMovies = new List<DBMovieInfo>();
            foreach (ListViewItem currItem in movieListBox.SelectedItems)
                processingMovies.Add((DBMovieInfo)currItem.Tag);

            ProgressPopup popup = new ProgressPopup(new TrackableWorkerDelegate(updateMediaInfoWorker));
            popup.Owner = this.ParentForm;
            popup.ShowDialog();

            processingMovies.Clear();

            updateFilePanel();
        }
        private void updateDateSortingMenuItem_Click(object sender, EventArgs e)
        {
            ProgressPopup popup = new ProgressPopup(new TrackableWorkerDelegate(updateDateSortingWorker));
            popup.Owner = this.ParentForm;
            popup.ShowDialog();

            updateMoviePanel();
        }
        //medthod to undo a file name change processed by the MovieFileRenamer class.
        private void returnToOriginalFileNameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (CurrentMovie != null && !verifyAvailability())
                return;

            // If we made it this far all files are available and we can notify the user
            // about what the reassign process is going to do.
            DialogResult result = MessageBox.Show(
                    "You are about to revert the selected file or files to\n" +
                    "the original file and folder names.\n\n" +
                    "Are you sure you want to continue?",
                    "Rename Movie File", MessageBoxButtons.YesNo);

            if (result == System.Windows.Forms.DialogResult.Yes) {
                processingMovies = new List<DBMovieInfo>();
                foreach (ListViewItem currItem in movieListBox.SelectedItems)
                    processingMovies.Add((DBMovieInfo)currItem.Tag);

                ProgressPopup popup = new ProgressPopup(new TrackableWorkerDelegate(RevertRenamesWorker));
                popup.Owner = ParentForm;
                popup.ShowDialog();
            }
        }
        private void refreshMovieButton_Click(object sender, EventArgs e)
        {
            if (movieListBox.SelectedItems.Count == 0)
                return;

            if (sender is ToolStripMenuItem) {
                selectedSource = (DBSourceInfo)((ToolStripMenuItem)sender).Tag;
                translate = ((ToolStripMenuItem)sender).Name == "TranslateItem";
            }
            else
                selectedSource = null;

            DialogResult result =
                MessageBox.Show("This action will overwrite existing movie details, including any custom modifications.",
                                "Refresh Movie", MessageBoxButtons.OKCancel);

            if (result == System.Windows.Forms.DialogResult.OK) {
                processingMovies = new List<DBMovieInfo>();
                foreach (ListViewItem currItem in movieListBox.SelectedItems)
                    processingMovies.Add((DBMovieInfo)currItem.Tag);

                if (movieListBox.SelectedItems.Count == 1) {
                    ProgressPopup popup = new ProgressPopup(new WorkerDelegate(refreshMovies));
                    popup.Owner = this.ParentForm;
                    popup.ShowDialog();
                }
                else {
                    ProgressPopup popup = new ProgressPopup(new TrackableWorkerDelegate(refreshMovies));
                    popup.Owner = this.ParentForm;
                    popup.ShowDialog();
                }

                updateMoviePanel();
                processingMovies.Clear();
            }
        }
 private void Sync()
 {
     ProgressPopup popup = new ProgressPopup(new TrackableWorkerDelegate(MovingPicturesCore.Follwit.Synchronize));
     popup.Owner = this.ParentForm;
     popup.ShowDialog();
 }
Exemplo n.º 10
0
        private void reloadDefaultSourcesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            WorkerDelegate worker = new WorkerDelegate(MovingPicturesCore.DataProviderManager.LoadInternalProviders);
            ProgressPopup popup = new ProgressPopup(worker);
            popup.Owner = this.ParentForm;
            popup.ShowDialog();

            reloadList();
        }
Exemplo n.º 11
0
        /// <summary>
        /// Remove all artwork and entries from the DB
        /// Replace paths and rescan
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void deleteDataAndRescanToolStripMenuItem_Click(object sender, EventArgs ea)
        {
            DialogResult result = MessageBox.Show("This will remove all Import Paths and Remove all Videos and Artwork, are you sure?", "Warning!", MessageBoxButtons.YesNo);
              if (result == DialogResult.Yes)
              {
            // stop the importer
            mvCentralCore.Importer.Stop();

            try
            {
              System.IO.Directory.Delete(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Thumbs, "mvCentral\\Artists\\"), true);
              System.IO.Directory.Delete(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Thumbs, "mvCentral\\Albums\\"), true);
              System.IO.Directory.Delete(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Thumbs, "mvCentral\\Tracks\\"), true);
            }
            catch (Exception e)
            {
              logger.DebugException("Error in DeleteDB", e);
            }

            // Have we a path to clear?
            if (pathBindingSource.Count > 0)
            {
              // Delete all Import Paths
              pathBindingSource.MoveFirst();
              do
              {
            ((DBImportPath)pathBindingSource.Current).Delete();
            pathBindingSource.RemoveCurrent();
              }
              while (pathBindingSource.Count > 0);

              // clean the database of the old music videos using our progress bar popup
              ProgressPopup progressPopup = new ProgressPopup(new WorkerDelegate(DatabaseMaintenanceManager.RemoveInvalidFiles));
              DatabaseMaintenanceManager.MaintenanceProgress += new ProgressDelegate(progressPopup.Progress);
              progressPopup.Owner = ParentForm;
              progressPopup.Text = "Removing related music videos...";
              progressPopup.ShowDialog();
            }
            // Clear the Treeview
            mvLibraryTreeView.Nodes.Clear();
            // Put back the artwork folder structure
            mvCentralCore.initAdditionalSettings();

            // restart the importer
            mvCentralCore.Importer.RestartScanner();
              }
        }
        //remove selected movies from the ignore list.
        private void unignoreSelectedButton_Click(object sender, EventArgs e)
        {
            //prevent extra clicks by disabling buttons
            unignoreSelectedButton.Enabled = false;

            DialogResult result = MessageBox.Show(this,
                "This will remove the selected files from the ignored list, and restart\n" +
                "the Importer. This means all uncommitted matches from this\n" +
                "import session will have to be reapproved. Do you want to\n" +
                "continue?\n", "Warning", MessageBoxButtons.YesNo);

            //only process if there is at least one row selected
            if (result == DialogResult.Yes && ignoredMovieGrid.SelectedRows.Count > 0) {
                //process selected files
                ProgressPopup popup = new ProgressPopup(new WorkerDelegate(unignoreSelectedFiles));
                popup.Owner = this.ParentForm;
                popup.Show();
                this.DialogResult = DialogResult.OK;
            }
            else {
                if (ignoredMovieGrid.SelectedRows.Count == 0) MessageBox.Show(this, "No movies were selected.");
                //enable the unignore buttons in case user wants to unignore again
                unignoreSelectedButton.Enabled = true;
            }
        }
        private void movieListButton_Click(object sender, EventArgs e)
        {
            menuEditorPopup = new MenuEditorPopup();
            menuEditorPopup.MenuTree.FieldDisplaySettings.Table = typeof(DBMovieInfo);

            movieManagerFilterMenu = null;
            ProgressPopup loadingPopup = new ProgressPopup(new WorkerDelegate(LoadMovieManagerFiltersMenu));
            loadingPopup.Owner = FindForm();
            loadingPopup.Text = "Loading Menu...";
            loadingPopup.ShowDialog();

            menuEditorPopup.ShowMovieNodeSettings = false;
            menuEditorPopup.ShowDialog();
            menuEditorPopup = null;

            MovingPicturesCore.DatabaseManager.BeginTransaction();
            ProgressPopup savingPopup = new ProgressPopup(new WorkerDelegate(movieManagerFilterMenu.Commit));
            savingPopup.Owner = FindForm();
            savingPopup.Text = "Saving Menu...";
            savingPopup.ShowDialog();
            MovingPicturesCore.DatabaseManager.EndTransaction();

            // validate current selected filter node
            ValidateSelectedFilterNode();
        }
        private void categoriesMenuButton_Click(object sender, EventArgs e)
        {
            menuEditorPopup = new MenuEditorPopup();
            menuEditorPopup.MenuTree.FieldDisplaySettings.Table = typeof(DBMovieInfo);

            categoriesMenu = null;
            ProgressPopup loadingPopup = new ProgressPopup(new WorkerDelegate(loadCategoriesMenu));
            loadingPopup.Owner = FindForm();
            loadingPopup.Text = "Loading Menu...";
            loadingPopup.ShowDialog();

            menuEditorPopup.ShowDialog();
            menuEditorPopup = null;

            MovingPicturesCore.DatabaseManager.BeginTransaction();
            ProgressPopup savingPopup = new ProgressPopup(new WorkerDelegate(categoriesMenu.Commit));
            savingPopup.Owner = FindForm();
            savingPopup.Text = "Saving Menu...";
            savingPopup.ShowDialog();
            MovingPicturesCore.DatabaseManager.EndTransaction();
        }
Exemplo n.º 15
0
        private void TogglePrivateProfile()
        {
            if (updatingControls)
                return;

            ProgressPopup popup = new ProgressPopup(new WorkerDelegate(() => {
                MovingPicturesCore.Follwit.FollwitApi.UpdateUser("", "", !publicProfileCheckBox.Checked);
            }));

            popup.Owner = this.ParentForm;
            popup.ShowDialog();
        }
        private void refreshAllMoviesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result =
                MessageBox.Show("You are about to refresh all movie metadata, overwriting\n" +
                                "any custom modifications. This operation will be performed\n" +
                                "on ALL MOVIES IN YOUR DATABASE, and can be very time\n" +
                                "consuming. Are you sure you want to continue?",
                                "Refresh All Movies", MessageBoxButtons.OKCancel);

            if (result == System.Windows.Forms.DialogResult.OK) {

                // create movie list copy from dictionary
                processingMovies = listItems.Keys.ToList();

                ProgressPopup popup = new ProgressPopup(new TrackableWorkerDelegate(refreshMovies));
                popup.Owner = this.ParentForm;
                popup.ShowDialog();

                updateMoviePanel();
                processingMovies.Clear();
            }
        }
        private void unignoreAllFilesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result =  MessageBox.Show(
                "This will unignore ALL previously ignored files, and restart\n" +
                "the Importer. This means all uncommitted matches from this\n" +
                "import session will have to be reapproved. Do you want to\n" +
                "continue?\n", "Warning", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes) {
                ProgressPopup popup = new ProgressPopup(new WorkerDelegate(unignoreAllFiles));
                popup.Owner = this.ParentForm;
                popup.Show();
            }
        }
Exemplo n.º 18
0
        private void retryLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ProgressPopup popup = new ProgressPopup(new WorkerDelegate(delegate { MovingPicturesCore.Follwit.Reconnect(); }));
            UpdateControls();

            if (MovingPicturesCore.Follwit.FollwitApi == null) {
                MessageBox.Show(this, "Unable to reconnect to follw.it!", "Error");
            }
        }