public void CopyImageMetadataToWholeBook(Metadata metadata) { using (var dlg = new ProgressDialogForeground()) //REVIEW: this foreground dialog has known problems in other contexts... it was used here because of its ability to handle exceptions well. TODO: make the background one handle exceptions well { dlg.ShowAndDoWork(progress => CurrentBook.CopyImageMetadataToWholeBookAndSave(metadata, progress)); } }
/// <summary> /// Before calling this, ConfigurationData has to be loaded. E.g., by running ShowConfigurationDialog() /// </summary> /// <param name="bookPath"></param> public void ConfigureBook(string bookPath) { using (var dlg = new ProgressDialogForeground()) { dlg.Text = L10NSharp.LocalizationManager.GetString("ConfiguringBookMessage", "Building..."); dlg.ShowAndDoWork((progress) => ConfigureBookInternal(bookPath)); } }
public void BringBookUpToDate() { var b = _bookSelection.CurrentSelection; _bookSelection.SelectBook(null); using (var dlg = new ProgressDialogForeground()) //REVIEW: this foreground dialog has known problems in other contexts... it was used here because of its ability to handle exceptions well. TODO: make the background one handle exceptions well { dlg.ShowAndDoWork(progress => b.BringBookUpToDate(progress)); } _bookSelection.SelectBook(b); }
public void UpdateModelUponActivation() { if (BookSelection.CurrentSelection == null) { return; } _currentlyLoadedBook = BookSelection.CurrentSelection; PageLayout = _currentlyLoadedBook.GetLayout(); // BL-8648: In case we have an older version of a book (downloaded, e.g.) and the user went // straight to the Publish tab avoiding the Edit tab, we could arrive here needing to update // things. We choose to do the original book update here (when the user clicks on the Publish tab), // instead of the various places that we publish the book. // Note that the BringBookUpToDate() called by PublishHelper.MakeDeviceXmatterTempBook() and // called by BloomReaderFileMaker.PrepareBookForBloomReader() applies to a copy of the book // and is done in a way that explicitly avoids updating images. This call updates the images, // if needed, as a permanent fix. using (var dlg = new ProgressDialogForeground()) { dlg.ShowAndDoWork(progress => _currentlyLoadedBook.BringBookUpToDate(progress)); } }