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)); } }
private void GetAdditionalEnvironmentInfo(StringBuilder bldr) { bldr.AppendLine("=Additional User Environment Information="); if (Book == null) { if (!string.IsNullOrEmpty(_projectName)) { bldr.AppendLine("Collection name: " + _projectName); } bldr.AppendLine("No Book was selected."); return; } try { var sizeOrient = Book.GetLayout().SizeAndOrientation; bldr.AppendLine("Page Size/Orientation: " + sizeOrient); } catch (Exception) { bldr.AppendLine("GetLayout() or SizeAndOrientation threw an exception."); } var settings = Book.CollectionSettings; if (settings == null) { // paranoia, shouldn't happen bldr.AppendLine("Book's CollectionSettings was null."); return; } bldr.AppendLine("Collection name: " + settings.CollectionName); bldr.AppendLine("xMatter pack name: " + settings.XMatterPackName); bldr.AppendLine("Language1 iso: " + settings.Language1Iso639Code + " font: " + settings.DefaultLanguage1FontName + (settings.IsLanguage1Rtl ? " RTL" : string.Empty)); bldr.AppendLine("Language2 iso: " + settings.Language2Iso639Code + " font: " + settings.DefaultLanguage2FontName + (settings.IsLanguage2Rtl ? " RTL" : string.Empty)); bldr.AppendLine("Language3 iso: " + settings.Language3Iso639Code + " font: " + settings.DefaultLanguage3FontName + (settings.IsLanguage3Rtl ? " RTL" : string.Empty)); }
/// <summary> /// Return true if the book should be published in landscape mode, that is, /// either it is created as a landscape book, or it is a motion book configured /// to play in motion mode. /// </summary> /// <param name="book"></param> /// <returns></returns> public static bool ShouldRecordAsLandscape(Book.Book book) { return(book.BookInfo.PublishSettings.AudioVideo.Motion || (book.GetLayout().SizeAndOrientation.IsLandScape&& !book.GetLayout().SizeAndOrientation.IsSquare)); }