diff --git a/MyCBZ/Events/GlobalActionRequiredEvent.cs b/MyCBZ/Events/GlobalActionRequiredEvent.cs index a53fd7cc..dd95ee9e 100644 --- a/MyCBZ/Events/GlobalActionRequiredEvent.cs +++ b/MyCBZ/Events/GlobalActionRequiredEvent.cs @@ -11,12 +11,16 @@ internal class GlobalActionRequiredEvent { public const int MESSAGE_TYPE_INFO = 0; public const int MESSAGE_TYPE_WARNING = 1; - public const int MESSAGe_TYPE_ERROR = 2; + public const int MESSAGE_TYPE_ERROR = 2; + + public const string TASK_TYPE_INDEX_REBUILD = "REBUILD_INDEX"; + public const string TASK_TYPE_UPDATE_IMAGE_METADATA = "UPDATE_IMAGE_METADATA"; public ProjectModel ArchiveInfo { get; set; } public int Type { get; set; } + public string TaskType { get; set; } public Task Task { get; set; } @@ -33,13 +37,14 @@ public GlobalActionRequiredEvent(ProjectModel project, int type, String message, ButtonText = buttonText; } - public GlobalActionRequiredEvent(ProjectModel project, int type, String message, String buttonText, Task task) + public GlobalActionRequiredEvent(ProjectModel project, int type, String message, String buttonText, String taskType, Task task) { ArchiveInfo = project; Type = type; Message = message; - Task = task; ButtonText = buttonText; + TaskType = taskType; + Task = task; } } } diff --git a/MyCBZ/Forms/MainForm.Designer.cs b/MyCBZ/Forms/MainForm.Designer.cs index 1ae912de..a767cde2 100644 --- a/MyCBZ/Forms/MainForm.Designer.cs +++ b/MyCBZ/Forms/MainForm.Designer.cs @@ -31,10 +31,10 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle(); this.ToolBar = new System.Windows.Forms.ToolStrip(); this.ToolButtonNew = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); @@ -1795,39 +1795,39 @@ private void InitializeComponent() // this.MetaDataGrid.AllowUserToAddRows = false; this.MetaDataGrid.AllowUserToOrderColumns = true; - dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.MetaDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; - dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle6.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.MetaDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle25.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.MetaDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle25; + dataGridViewCellStyle26.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle26.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle26.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle26.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle26.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle26.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle26.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.MetaDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle26; this.MetaDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle7.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle7.Padding = new System.Windows.Forms.Padding(0, 1, 1, 1); - dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.Gold; - dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.MetaDataGrid.DefaultCellStyle = dataGridViewCellStyle7; + dataGridViewCellStyle27.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle27.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle27.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle27.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle27.Padding = new System.Windows.Forms.Padding(0, 1, 1, 1); + dataGridViewCellStyle27.SelectionBackColor = System.Drawing.Color.Gold; + dataGridViewCellStyle27.SelectionForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle27.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.MetaDataGrid.DefaultCellStyle = dataGridViewCellStyle27; this.MetaDataGrid.Dock = System.Windows.Forms.DockStyle.Fill; this.MetaDataGrid.Location = new System.Drawing.Point(3, 39); this.MetaDataGrid.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.MetaDataGrid.MultiSelect = false; this.MetaDataGrid.Name = "MetaDataGrid"; - dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle8.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.MetaDataGrid.RowHeadersDefaultCellStyle = dataGridViewCellStyle8; + dataGridViewCellStyle28.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle28.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle28.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle28.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle28.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle28.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle28.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.MetaDataGrid.RowHeadersDefaultCellStyle = dataGridViewCellStyle28; this.MetaDataGrid.RowHeadersWidth = 51; this.MetaDataGrid.RowTemplate.Height = 24; this.MetaDataGrid.Size = new System.Drawing.Size(725, 132); diff --git a/MyCBZ/Forms/MainForm.cs b/MyCBZ/Forms/MainForm.cs index 6218df14..3cf52edf 100644 --- a/MyCBZ/Forms/MainForm.cs +++ b/MyCBZ/Forms/MainForm.cs @@ -521,8 +521,12 @@ private void HandleGlobalActionRequired(object sender, GlobalActionRequiredEvent GlobalAction action = new GlobalAction(); action.Message = e.Message; action.Action = e.Task; + action.Key = e.TaskType; - CurrentGlobalActions.Add(action); + if (GetGlobalActionByKey(action.Key) == null) + { + CurrentGlobalActions.Add(action); + } if (CurrentGlobalAction == null) { @@ -533,6 +537,18 @@ private void HandleGlobalActionRequired(object sender, GlobalActionRequiredEvent })); } + private GlobalAction GetGlobalActionByKey(string key) + { + foreach (GlobalAction globalAction in CurrentGlobalActions) + { + if (globalAction.Key == key) + { + return globalAction; + } + } + return null; + } + private void HandleGlobalTaskProgress(object sender, GeneralTaskProgressEvent e) { Program.ProjectModel.ApplicationState = e.Status; @@ -543,9 +559,11 @@ private void HandleGlobalTaskProgress(object sender, GeneralTaskProgressEvent e) case GeneralTaskProgressEvent.TASK_STATUS_COMPLETED: Program.ProjectModel.MetaDataPageIndexMissingData = false; Program.ProjectModel.MetaData.RebuildPageMetaData(Program.ProjectModel.Pages); - CurrentGlobalActions.Remove(CurrentGlobalAction); - if (CurrentGlobalActions.Count > 0) + + if (CurrentGlobalActions.Count > 1) { + CurrentGlobalActions.Remove(CurrentGlobalAction); + CurrentGlobalAction = CurrentGlobalActions[0]; this.Invoke(new Action(() => @@ -553,7 +571,15 @@ private void HandleGlobalTaskProgress(object sender, GeneralTaskProgressEvent e) LabelGlobalActionStatusMessage.Text = CurrentGlobalAction.Message; GlobalAlertTableLayout.Visible = true; })); - } + } else + { + if (CurrentGlobalActions.Count > 0) + { + CurrentGlobalActions.Remove(CurrentGlobalAction); + + CurrentGlobalAction = null; + } + } break; } @@ -616,6 +642,24 @@ private void HandleGlobalTaskProgress(object sender, GeneralTaskProgressEvent e) applicationStatusLabel.Text = e.Message; Program.ProjectModel.IsChanged = true; Program.ProjectModel.ApplicationState = ApplicationStatusEvent.STATE_READY; + + if (CurrentGlobalActions.Count > 1) + { + CurrentGlobalActions.Remove(CurrentGlobalAction); + + CurrentGlobalAction = CurrentGlobalActions[0]; + + this.Invoke(new Action(() => + { + LabelGlobalActionStatusMessage.Text = CurrentGlobalAction.Message; + GlobalAlertTableLayout.Visible = true; + })); + } else + { + if (CurrentGlobalActions.Count > 0) + CurrentGlobalActions.Remove(CurrentGlobalAction); + CurrentGlobalAction = null; + } })); try @@ -999,6 +1043,17 @@ private void ApplicationStateChanged(object sender, ApplicationStatusEvent e) switch (e.State) { + case ApplicationStatusEvent.STATE_UPDATING_INDEX: + this.Invoke(new Action(() => + { + LabelGlobalActionStatusMessage.Text = ""; + GlobalAlertTableLayout.Visible = false; + + CurrentGlobalAction = null; + CurrentGlobalActions.Clear(); + })); + break; + case ApplicationStatusEvent.STATE_ANALYZING: info = "Analyzing images..."; break; @@ -1153,6 +1208,9 @@ private void ArchiveStateChanged(object sender, CBZArchiveStatusEvent e) case CBZArchiveStatusEvent.ARCHIVE_FILE_RENAMED: info = "Renaming page..."; break; + case CBZArchiveStatusEvent.ARCHIVE_FILE_UPDATED: + // + break; } try @@ -1746,7 +1804,7 @@ private void MoveItemsTo(int newIndex, System.Windows.Forms.ListView.SelectedLis PageChanged(this, new PageChangedEvent((Page)originalItem.Tag, PageChangedEvent.IMAGE_STATUS_CHANGED)); ArchiveStateChanged(this, new CBZArchiveStatusEvent(Program.ProjectModel, CBZArchiveStatusEvent.ARCHIVE_FILE_UPDATED)); - HandleGlobalActionRequired(null, new GlobalActionRequiredEvent(Program.ProjectModel, 0, "Page order changed. Rebuild pageindex now?", "Rebuild", RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Program.ProjectModel.Pages, Program.ProjectModel.MetaData, HandleGlobalTaskProgress, PageChanged))); + HandleGlobalActionRequired(null, new GlobalActionRequiredEvent(Program.ProjectModel, 0, "Page order changed. Rebuild pageindex now?", "Rebuild", GlobalActionRequiredEvent.TASK_TYPE_INDEX_REBUILD, RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Program.ProjectModel.Pages, Program.ProjectModel.MetaData, HandleGlobalTaskProgress, PageChanged))); //Program.ProjectModel.Pages.Insert(newIndex, (Page)item.Tag); @@ -1829,7 +1887,7 @@ private void MovePageTo(Page page, int newIndex) } ArchiveStateChanged(this, new CBZArchiveStatusEvent(Program.ProjectModel, CBZArchiveStatusEvent.ARCHIVE_FILE_UPDATED)); - HandleGlobalActionRequired(null, new GlobalActionRequiredEvent(Program.ProjectModel, 0, "Page order changed. Rebuild pageindex now?", "Rebuild", RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Program.ProjectModel.Pages, Program.ProjectModel.MetaData, HandleGlobalTaskProgress, PageChanged))); + HandleGlobalActionRequired(null, new GlobalActionRequiredEvent(Program.ProjectModel, 0, "Page order changed. Rebuild pageindex now?", "Rebuild", GlobalActionRequiredEvent.TASK_TYPE_INDEX_REBUILD, RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Program.ProjectModel.Pages, Program.ProjectModel.MetaData, HandleGlobalTaskProgress, PageChanged))); Program.ProjectModel.IsChanged = true; } @@ -2154,7 +2212,7 @@ private void ToolButtonRemoveFiles_Click(object sender, EventArgs e) ArchiveStateChanged(this, new CBZArchiveStatusEvent(Program.ProjectModel, CBZArchiveStatusEvent.ARCHIVE_FILE_DELETED)); } - HandleGlobalActionRequired(null, new GlobalActionRequiredEvent(Program.ProjectModel, 0, "Page order changed. Rebuild pageindex now?", "Rebuild", RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Program.ProjectModel.Pages, Program.ProjectModel.MetaData, HandleGlobalTaskProgress, PageChanged))); + HandleGlobalActionRequired(null, new GlobalActionRequiredEvent(Program.ProjectModel, 0, "Page order changed. Rebuild pageindex now?", "Rebuild", GlobalActionRequiredEvent.TASK_TYPE_INDEX_REBUILD, RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Program.ProjectModel.Pages, Program.ProjectModel.MetaData, HandleGlobalTaskProgress, PageChanged))); //Program.ProjectModel.UpdatePageIndices(); } @@ -2173,16 +2231,25 @@ private void TypeSelectionToolStripMenuItem_Click(object sender, EventArgs e) if (sender is ToolStripMenuItem) { ((Page)item.Tag).ImageType = (String)((ToolStripMenuItem)sender).Tag; - } else + + HandleGlobalActionRequired(null, new GlobalActionRequiredEvent(Program.ProjectModel, 0, "Page type changed. Rebuild pageindex now?", "Rebuild", GlobalActionRequiredEvent.TASK_TYPE_INDEX_REBUILD, RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Program.ProjectModel.Pages, Program.ProjectModel.MetaData, HandleGlobalTaskProgress, PageChanged))); + + PageChanged(null, new PageChangedEvent((Page)item.Tag, PageChangedEvent.IMAGE_STATUS_CHANGED)); + ArchiveStateChanged(null, new CBZArchiveStatusEvent(Program.ProjectModel, CBZArchiveStatusEvent.ARCHIVE_METADATA_CHANGED)); + + } + else { - ((Page)item.Tag).ImageType = (String)((ToolStripSplitButton)sender).Tag; + if (((ToolStripSplitButton)sender).HasDropDown && !((ToolStripSplitButton)sender).DropDown.Visible) + { + ((Page)item.Tag).ImageType = (String)((ToolStripSplitButton)sender).Tag; + } } if (item.SubItems.Count > 0) { item.SubItems[2].Text = ((Page)item.Tag).ImageType; } - } } @@ -2203,6 +2270,14 @@ private void ToolButtonEditImageProps_Click(object sender, EventArgs e) pageToUpdate.UpdatePage(pageResult); if (!pageResult.Deleted) { + if (editPage.Name != pageResult.Name) + { + HandleGlobalActionRequired(null, new GlobalActionRequiredEvent(Program.ProjectModel, 0, "Page name changed. Rebuild pageindex now?", "Rebuild", GlobalActionRequiredEvent.TASK_TYPE_INDEX_REBUILD, RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Program.ProjectModel.Pages, Program.ProjectModel.MetaData, HandleGlobalTaskProgress, PageChanged))); + + PageChanged(null, new PageChangedEvent(pageResult, PageChangedEvent.IMAGE_STATUS_RENAMED)); + ArchiveStateChanged(null, new CBZArchiveStatusEvent(Program.ProjectModel, CBZArchiveStatusEvent.ARCHIVE_FILE_UPDATED)); + } + try { MovePageTo(pageToUpdate, pageResult.Index); @@ -2216,7 +2291,7 @@ private void ToolButtonEditImageProps_Click(object sender, EventArgs e) if (pageResult.Deleted != editPage.Deleted) { - HandleGlobalActionRequired(null, new GlobalActionRequiredEvent(Program.ProjectModel, 0, "Page order changed. Rebuild pageindex now?", "Rebuild", RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Program.ProjectModel.Pages, Program.ProjectModel.MetaData, HandleGlobalTaskProgress, PageChanged))); + HandleGlobalActionRequired(null, new GlobalActionRequiredEvent(Program.ProjectModel, 0, "Page order changed. Rebuild pageindex now?", "Rebuild", GlobalActionRequiredEvent.TASK_TYPE_INDEX_REBUILD, RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Program.ProjectModel.Pages, Program.ProjectModel.MetaData, HandleGlobalTaskProgress, PageChanged))); } if (pageToUpdate.Deleted) @@ -2230,7 +2305,7 @@ private void ToolButtonEditImageProps_Click(object sender, EventArgs e) MessageLogger.Instance.Log(LogMessageEvent.LOGMESSAGE_TYPE_ERROR, ex.Message); } - HandleGlobalActionRequired(null, new GlobalActionRequiredEvent(Program.ProjectModel, 0, "Page order changed. Rebuild pageindex now?", "Rebuild", RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Program.ProjectModel.Pages, Program.ProjectModel.MetaData, HandleGlobalTaskProgress, PageChanged))); + HandleGlobalActionRequired(null, new GlobalActionRequiredEvent(Program.ProjectModel, 0, "Page order changed. Rebuild pageindex now?", "Rebuild", GlobalActionRequiredEvent.TASK_TYPE_INDEX_REBUILD, RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Program.ProjectModel.Pages, Program.ProjectModel.MetaData, HandleGlobalTaskProgress, PageChanged))); } PageChanged(this, new PageChangedEvent(pageToUpdate, PageChangedEvent.IMAGE_STATUS_CHANGED)); @@ -2353,6 +2428,10 @@ private void ToolButtonSetPageType_ButtonClick(object sender, EventArgs e) item.SubItems[2].Text = (String)((ToolStripSplitButton)sender).Tag; } + HandleGlobalActionRequired(null, new GlobalActionRequiredEvent(Program.ProjectModel, 0, "Page type changed. Rebuild pageindex now?", "Rebuild", GlobalActionRequiredEvent.TASK_TYPE_INDEX_REBUILD, RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Program.ProjectModel.Pages, Program.ProjectModel.MetaData, HandleGlobalTaskProgress, PageChanged))); + + PageChanged(null, new PageChangedEvent((Page)item.Tag, PageChangedEvent.IMAGE_STATUS_CHANGED)); + ArchiveStateChanged(null, new CBZArchiveStatusEvent(Program.ProjectModel, CBZArchiveStatusEvent.ARCHIVE_METADATA_CHANGED)); } } diff --git a/MyCBZ/Models/GlobalAction.cs b/MyCBZ/Models/GlobalAction.cs index 94434d4c..27f42767 100644 --- a/MyCBZ/Models/GlobalAction.cs +++ b/MyCBZ/Models/GlobalAction.cs @@ -12,6 +12,8 @@ public class GlobalAction public GlobalAction() { } + public String Key { get; set; } + public GlobalAction(string name) { } public string Name { get; set; } diff --git a/MyCBZ/Models/ProjectModel.cs b/MyCBZ/Models/ProjectModel.cs index 09e8c907..33314b91 100644 --- a/MyCBZ/Models/ProjectModel.cs +++ b/MyCBZ/Models/ProjectModel.cs @@ -871,6 +871,9 @@ protected void UpdatePageIndicesProc() int newIndex = 0; int updated = 1; bool isUpdated = false; + + OnApplicationStateChanged(new ApplicationStatusEvent(this, ApplicationStatusEvent.STATE_UPDATING_INDEX)); + foreach (Page page in Pages) { if (page.Deleted) @@ -1366,12 +1369,12 @@ protected void OpenArchiveProc() if (MetaDataPageIndexMissingData) { - OnGlobalActionRequired(new GlobalActionRequiredEvent(this, 0, "Image metadata missing from pageindex! Reload image metadata and rebuild pageindex now?", "Rebuild", ReadImageMetaDataTask.UpdateImageMetadata(Pages, GeneralTaskProgress))); + OnGlobalActionRequired(new GlobalActionRequiredEvent(this, 0, "Image metadata missing from pageindex! Reload image metadata and rebuild pageindex now?", "Rebuild", GlobalActionRequiredEvent.TASK_TYPE_UPDATE_IMAGE_METADATA, ReadImageMetaDataTask.UpdateImageMetadata(Pages, GeneralTaskProgress))); } if (MetaDataPageIndexFileMissing) { - OnGlobalActionRequired(new GlobalActionRequiredEvent(this, 0, "File missing from pageindex! Rebuild pageindex now?", "Rebuild", RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Pages, MetaData, GeneralTaskProgress, PageChanged))); + OnGlobalActionRequired(new GlobalActionRequiredEvent(this, 0, "File missing from pageindex! Rebuild pageindex now?", "Rebuild", GlobalActionRequiredEvent.TASK_TYPE_INDEX_REBUILD, RebuildPageIndexMetaDataTask.UpdatePageIndexMetadata(Pages, MetaData, GeneralTaskProgress, PageChanged))); }