wiki:PREVIEW_MODE_R0
Last modified 16 years ago Last modified on 05/19/09 19:23:09

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=PREVIEW_MODE_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

Overview

  • This mode shows the book as it will look like in Reader. This mode is most convenient for reading books. It allows the user to test his links, events, timelines etc.

Note: Preview mode = Test mode.

Author mode = Edit mode.

  • The user can’t edit his book in preview mode. He can only interact with it.
  • In preview mode, all links and timelines are functional.
  • Reader mode applies to current book.
  • The user can evoke preview mode window by:
    • click on preview mode button on the bottom bar
    • selecting View -> Preview Mode from the menu.
  • Preview mode window shouldn't have preview mode button and outline frames check box, also the button from the View menu is disabled.
    • Outline frames will be disable in the preview mode.
    • Instead of preview mode button, we should have close preview button at the same place.
  • Frame borders will be visible if they are set so, the page borders will be visible also (all of them). This means that in preview mode tha page borders will be visible (left, top, right, bottom), the frame borders will be visible too(again, left, top, right, bottom).
  • All menu items related to editing, for example the Insert menu, File->Save, should be disabled. Decide how the items will be disabled - whether each item/functionality will watch the current book previewMode option, or someone will disallow book editing. If every item will disable itself, define which are these items.
  • Tabs that allow editing are in disable mode and this should be visible for the user.
  • To exit preview mode window user have to close it or press close preview button(this will also close the window).
  • Although editing is not allowed, comments and annotations (stickies, highlightings) can be created/modified/deleted.
  • Selecting objects and copying them to the clipboard is allowed.
  • Preview mode also has a presentation mode.
  • The preview mode should act as the reader do.
  • The preview mode should use the reader work area - it should not show elements outside the borders of the page.

Task requirements

  • Ensure the reader work area is used in preview mode. It must hide all the frames outside the page borders, but must not hide the book extras. In reader area the page borders and frame borders will not be hidden.
  • Change the "preview mode" checkbox with a button. It will open a copy of the book in preview mode, not the book itself. The same button in the copy will be replaced with one, which closes the preview. The Outline checkbox will not be visible in preview mode.
  • In preview mode, all halos must be hidden. Menubars concerning book editing must be disabled. If there is time left, try to disable palettes related to editing and user interactions which could change the book.
  • In preview mode, links must be functional, timelines too. But timeline editing must not.
  • If possible (because of other implementors), check that presentation mode uses the preview mode correctly. Since the View menu is implemented in another task, which is not ready, this one could not require putting items in that menu.

Task result

  • The result of this task should be source code.

Implementation idea

  • Actually currently the book can edit the book using links/timelines; however, these changes should not affect the original book. This is why it is a good idea to make a copy of the book, operate on it, and this will not change the original book.
  • We should use the reader area - it will hide content outside the page borders. Note: the reader area is not working right now, so it must be implemented, too.
  • A good idea (maybe) is to move all logic about visibility in the corresponding feature - for example, huds should hide themselves, flaps, palettes also, etc. This way the bookView / readerArea does not need to know about all the visible gadgets and hide them one by one.
  • Preview mode needs performance optimizations and bugfixing - define these two problems, research for more.

How to demo

  • Run Sophie 2, Default book with 3 frames should be created. If not, create one.
  • Go to preview mode.
  • Try to move the frame or to edit its text content, to edit some palettes, to insert something or save the book - should not be possible.
  • Show the bottom flap and the timeline controls are active, if they are implemented - demonstrate them.

Design

  • The reader work area is currently used in preview mode, but it does not clip the frames outside the page borders. To do so, in the ReaderPageWorkArea should be provided logic to control the clip of the frameConpositeElement : in PageWorkArea add ability to clip the frameConposite element, with default value - clip nothing, then override the method in ReaderPageWorkArea. There is a bug with the clipping - in ElementHelper, the getEffectiveClip() method should transform by the inverse matrix of what is now. Fix this, also.
  • Make a new class in main.app.commons.book.panels- PreviewModeButton. It must extend BaseVisualElement and implement BookPanel element. It will have 2 LogicR3 buttons inside of it, displaying just one of them, depending on the inPreviewMode() property. Each of them will fire different event, respectively START_PREVIEW and STOP_PREVIEW. They will be handled in a newly created enum PreviewButtonOperation, implementing OperationDef. the first event will call BookLogic.userSetPreviewMode, the second one will fire "new EventR3(bdw , null, null, null, DefaultDocumentWindow.UserWindowAction.CLOSE)" in order to close the book. To do all of these, first move LogicR3Button from resourceMetaPalette to base.commons.gui.LogicR3Button and fix the problems. Add the corresponding logic in the OutlineFramesCheckBox in order to hide it in preview mode. After this, delete the ReaderModeCheckbox: add method computeVisible() to the bookPanelElement interface, implement it and track for it in the setup() of the bottom panel.
  • Disable the menus that should not be active:
    • Show connections - done
    • Save - done
    • Save as - done
    • Save as template - done
    • Whole Insert menu - done
    • Whole Edit menu
  • Hide all halo menus
    • Frame rotate - done
    • Main halo menu - done (Currently includes BackgroundAndBorder, FrameSizeAndPosition, FrameInsets, FrameZOrderUp, FrameZOrderDown, TextWrapping, FrameContentUseTemplate, PageFramesUseTemplate, AddTemplate, AlignElements, GroupPageElements, UngroupPageElements).
  • Palette disabling could be implemented best using the plugin hot enable/disable, which is currently not ready. So, it would be best to postpone it for the next revision.
  • For the scene interactions, disable frame selection and key pressing events by adding simple checks in the corresponding classes: PageElementLogic and HotTextLogic.

Design reviewed code is merged into the trunk in [2753] revision.

Implementation

Changesets: [2639], [2640], [2641], [2643], [2644], [2645].

For the next revision:

  • Disable / Hide any new menus / halos.
  • Implement palette disabling.
  • Put preview mode item in the view menu.
  • Completely disable scene interaction (except links), maybe DND also.
  • Further synchronization with presentation mode / fullscreen mode . Reader / links / timelines will be possible.

Merged to the trunk in [2762].

Testing

Comments

(Write comments for this or later revisions here.)