Skip to content

Commit

Permalink
Add a rich text file format (#26)
Browse files Browse the repository at this point in the history
* Add basic document writer with a somewhat verbose file format
* Use a more compact text or fragment format
* Indent JSON with tabs
* Add basic text document parsing
* Remove private class for settings
* Update text formatting and add text format to settings
* Add text indent button and detect text format status and apply to toolbar
* Fix a couple of issues with updating block format
* Add proper support for block indenting
* Clean up the code a little
* Add a document class and cache documents in project class
* Connect story tree to document editor
  • Loading branch information
vkbo authored Jan 30, 2022
1 parent 12a7b56 commit b8eabe4
Show file tree
Hide file tree
Showing 30 changed files with 1,384 additions and 254 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ list(APPEND SRC_FILES
src/gui/storytree
src/gui/storytreedelegate
src/gui/treetoolbar
src/project/document
src/project/project
src/project/storyitem
src/project/storymodel
Expand Down
91 changes: 48 additions & 43 deletions i18n/collett_en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,45 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/editor/edittoolbar.cpp" line="53"/>
<location filename="../src/editor/edittoolbar.cpp" line="58"/>
<source>Align Left</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/editor/edittoolbar.cpp" line="54"/>
<location filename="../src/editor/edittoolbar.cpp" line="59"/>
<source>Align Right</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/editor/edittoolbar.cpp" line="55"/>
<location filename="../src/editor/edittoolbar.cpp" line="60"/>
<source>Align Centre</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/editor/edittoolbar.cpp" line="56"/>
<location filename="../src/editor/edittoolbar.cpp" line="61"/>
<source>Align Justify</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/editor/edittoolbar.cpp" line="65"/>
<location filename="../src/editor/edittoolbar.cpp" line="75"/>
<source>First Line Indent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/editor/edittoolbar.cpp" line="76"/>
<source>Indent Paragraph</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/editor/edittoolbar.cpp" line="66"/>
<location filename="../src/editor/edittoolbar.cpp" line="77"/>
<source>Outdent Paragraph</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Collett::GuiMain</name>
<message>
<location filename="../src/guimain.cpp" line="72"/>
<location filename="../src/guimain.cpp" line="78"/>
<source>%1 %2 Version %3</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -98,74 +103,74 @@
<context>
<name>Collett::GuiStoryTree</name>
<message>
<location filename="../src/gui/storytree.cpp" line="57"/>
<location filename="../src/gui/storytree.cpp" line="58"/>
<source>Rename</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/gui/storytree.cpp" line="116"/>
<location filename="../src/gui/storytree.cpp" line="119"/>
<source>Add Scene</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/gui/storytree.cpp" line="118"/>
<location filename="../src/gui/storytree.cpp" line="133"/>
<location filename="../src/gui/storytree.cpp" line="148"/>
<location filename="../src/gui/storytree.cpp" line="163"/>
<location filename="../src/gui/storytree.cpp" line="178"/>
<location filename="../src/gui/storytree.cpp" line="121"/>
<location filename="../src/gui/storytree.cpp" line="136"/>
<location filename="../src/gui/storytree.cpp" line="151"/>
<location filename="../src/gui/storytree.cpp" line="166"/>
<location filename="../src/gui/storytree.cpp" line="181"/>
<source>Inside</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/gui/storytree.cpp" line="122"/>
<location filename="../src/gui/storytree.cpp" line="137"/>
<location filename="../src/gui/storytree.cpp" line="152"/>
<location filename="../src/gui/storytree.cpp" line="167"/>
<location filename="../src/gui/storytree.cpp" line="182"/>
<location filename="../src/gui/storytree.cpp" line="125"/>
<location filename="../src/gui/storytree.cpp" line="140"/>
<location filename="../src/gui/storytree.cpp" line="155"/>
<location filename="../src/gui/storytree.cpp" line="170"/>
<location filename="../src/gui/storytree.cpp" line="185"/>
<source>Before</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/gui/storytree.cpp" line="124"/>
<location filename="../src/gui/storytree.cpp" line="139"/>
<location filename="../src/gui/storytree.cpp" line="154"/>
<location filename="../src/gui/storytree.cpp" line="169"/>
<location filename="../src/gui/storytree.cpp" line="184"/>
<location filename="../src/gui/storytree.cpp" line="127"/>
<location filename="../src/gui/storytree.cpp" line="142"/>
<location filename="../src/gui/storytree.cpp" line="157"/>
<location filename="../src/gui/storytree.cpp" line="172"/>
<location filename="../src/gui/storytree.cpp" line="187"/>
<source>After</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/gui/storytree.cpp" line="131"/>
<location filename="../src/gui/storytree.cpp" line="134"/>
<source>Add Chapter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/gui/storytree.cpp" line="146"/>
<location filename="../src/gui/storytree.cpp" line="149"/>
<source>Add Partition</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/gui/storytree.cpp" line="161"/>
<location filename="../src/gui/storytree.cpp" line="164"/>
<source>Add Book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/gui/storytree.cpp" line="163"/>
<location filename="../src/gui/storytree.cpp" line="166"/>
<source>Here</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/gui/storytree.cpp" line="176"/>
<location filename="../src/gui/storytree.cpp" line="179"/>
<source>Add Page</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/gui/storytree.cpp" line="213"/>
<location filename="../src/gui/storytree.cpp" line="216"/>
<source>Rename Story Item</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/gui/storytree.cpp" line="213"/>
<location filename="../src/gui/storytree.cpp" line="216"/>
<source>New name:</source>
<translation type="unfinished"></translation>
</message>
Expand All @@ -186,36 +191,36 @@
<context>
<name>Collett::Project</name>
<message>
<location filename="../src/project/project.cpp" line="156"/>
<location filename="../src/project/project.cpp" line="188"/>
<source>Unnamed Project</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Collett::Storage</name>
<message>
<location filename="../src/core/storage.cpp" line="55"/>
<location filename="../src/core/storage.cpp" line="56"/>
<source>Could not find or create project storage folder: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/core/storage.cpp" line="200"/>
<location filename="../src/core/storage.cpp" line="228"/>
<location filename="../src/core/storage.cpp" line="236"/>
<location filename="../src/core/storage.cpp" line="266"/>
<source>Could not open file: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/core/storage.cpp" line="208"/>
<location filename="../src/core/storage.cpp" line="244"/>
<source>Could not parse file: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/core/storage.cpp" line="215"/>
<location filename="../src/core/storage.cpp" line="251"/>
<source>Unexpected content of file: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/core/storage.cpp" line="251"/>
<location filename="../src/core/storage.cpp" line="302"/>
<source>Could not create folder: %1</source>
<translation type="unfinished"></translation>
</message>
Expand All @@ -228,27 +233,27 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/project/storyitem.cpp" line="315"/>
<location filename="../src/project/storyitem.cpp" line="319"/>
<source>Book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/project/storyitem.cpp" line="316"/>
<location filename="../src/project/storyitem.cpp" line="320"/>
<source>Partition</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/project/storyitem.cpp" line="317"/>
<location filename="../src/project/storyitem.cpp" line="321"/>
<source>Chapter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/project/storyitem.cpp" line="318"/>
<location filename="../src/project/storyitem.cpp" line="322"/>
<source>Scene</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/project/storyitem.cpp" line="319"/>
<location filename="../src/project/storyitem.cpp" line="323"/>
<source>Page</source>
<translation type="unfinished"></translation>
</message>
Expand Down
Loading

0 comments on commit b8eabe4

Please sign in to comment.