Commit graph

76 commits

Author SHA1 Message Date
luz.paz 2fd45dc42c Fix misc. typos
Found via `codespell -q 3 -S *.ts,./libs,./sample-projects -L searchin`
2019-09-19 09:58:24 -06:00
Youness Alaoui a8ec6512c9 Fix crash if invalid character is inserted into the text.
If an invalid character is inserted into the text, such as a "^L" (ASCII 0x0C)
when copy-pasting from a google document that has a page break in it, a crash
will happen as the character cannot be inserted into XML. This patch removes
those invalid characters from the text so the revisions.xml can be saved.

Fixes #562
2019-05-21 09:52:18 -06:00
Jan Wester 12390a9aab Fix occasional crashes when (re)moving items
Describing all the rabbitholes that I and kakaroto have gone through
while debugging this one until dawn can frankly not do enough justice to
the crazy amount of rubberducking that went on while trying to fix this.

This bug would be triggered whenever you had a document open in the
editor and then moved an ancestor object downwards (visually) in the tree.
Or when you simply deleted the ancestor. Depending on the exact method
that caused the opened item to be removed from the internal model, the
exact nature of the bug would vary, which means this commit fixes a few
different bits of code that lead to what appears to be the same bug.

In order of appearance, the bugs that ruined our sleep were:

1) The editor widget was trying to handle the removed item at too late a
stage.

2) The editor widget tried to fix its view after a move by searching for
the new item with the same ID, but in the case of moving an object down
it came across its own old item, ruining the attempt.

3) The editor widget did not properly account for the hierarchical
nature of the model.

Upon fixing these the next day, it was revealed that:

4) The outlineItem.updateWordCount(emit=False) flag is broken. This
function would call setData() in several spots which would still cause
emits to bubble through the system despite emit=False, and we simply got
lucky that it stopped enough of them until now.

This last one was caused by a small mistake in the fixes for the first
three bugs, but it has led to a couple of extra changes to make any
future bug hunts slightly less arduous and frustrating:

a) When calling item.removeChild(c), it now resets the associated parent
and model to mirror item.insertChild(c). This has also led to an extra
check in model.parent() to check for its validity.

b) The outlineItem.updateWordCount(emit=) flag has been removed entirely
and it now emits away with reckless abandon. I have been unable to
reproduce the crashes the code warned about, so I consider this a code
quality fix to prevent mysterious future issues where things sometimes
do not properly update right.

Worthy of note is that the original code clearly showed the intention to
close tabs for items that were removed. Reworking the editor to support
closing a tab is unfortunately way out of scope, so this intention was
left in and the new fix was structured to make it trivial to implement
such a change when the time comes. An existing FIXME regarding unrelated
buggy editor behaviour was left in, too.

Many thanks to Kakaroto for burning the midnight oil with me to get to
the bottom of this. (I learned a lot that night!)

Issues #479, #516 and #559 are fixed by this commit. And maybe some others,
too.
2019-05-19 09:33:19 -06:00
Youness Alaoui a27a1f399a Adding navigation support to fullscreen editor
This makes the fullscreen editor much more powerful in terms of navigating
through chapters and scenes. This should make issue #234 users happy and
fix #444.

Top panel now has left/right arrows to navigate through the scenes. It will
automatically find the next/previous text item and display it, navigating through
the outline tree.

There's also a "New document" icon which will create a new text entry immediately
after the current one and switch to it.

Navigation can also be done using Alt+Page-Up, Alt+Page-Down or Alt+Left and Alt+right
shortcuts (Fixing #444).

There's now also the option between Title or Path for the top panel, if Path is chosen
then the full path of the scene is displayed and clicking on the scene or parent items
opens a menu to quickly switch to the selected chapter/scene. Selecting a folder will
automatically display the first text entry available in that folder.
2019-04-02 11:42:25 -06:00
Curtis Gedak 60b58d9658 Fix Python 3.7 DeprecationWarning use local.format_string() messages
Fix by replacing locale.format() with locale.format_string().
2018-11-16 12:52:56 -07:00
Curtis Gedak 026861ee87 Fix plot importance changes if delete earlier plot and click other plots
The root cause was a mismatch between plot IDs and plot model rows.

This issue would appear when a plot was deleted such that the plot IDs
did not match the plot model row numbers and different plots had
different importance levels.  The problem would not occur if the most
recently added plot was deleted.

The plot ID / plot model row mismatch was introduced with the
following commit:

    Fixes: add plot then choose new plot does not set \
    importance slider
    3569f78928

Closes issue #404
2018-11-05 09:29:53 -07:00
Sebastian Rasmussen dde836e0f4 Fix typos that are visible to end-users. 2018-01-29 10:30:41 -07:00
Sebastian Rasmussen dfe88a9681 Fix typos in code comments, invisible to end-users. 2018-01-29 10:30:41 -07:00
JackXVII 8a9044b4ae Fix World items positional insertion 2018-01-15 22:02:43 +03:00
JackXVII 43df0b3d8a Fix World sub-items disappearing 2018-01-15 18:29:21 +03:00
JackXVII fe617f871f Adds moving World items. #219 2018-01-11 23:44:50 +03:00
JackXVII 42bda30331 Fix bug in worldModel
Because of this bug treeView could not properly hide the columns
2018-01-11 22:36:42 +03:00
Olivier Keshavjee 9d3b64de8f Adds: references tests, corrects bugs 2017-11-20 15:42:30 +01:00
Olivier Keshavjee f098e74f45 Adds: unit test coverage for outlineItem 2017-11-19 16:03:18 +01:00
Olivier Keshavjee 04fc6a5ae4 Checkpoint: refactoring 2017-11-18 20:53:10 +01:00
Olivier Keshavjee ad01de4cd4 Checkpoint in refactoring outlineItem 2017-11-17 12:16:39 +01:00
Olivier Keshavjee cf4c1c83bf Changes every Enum to IntEnum 2017-11-15 21:05:48 +01:00
Olivier Keshavjee 9e95196cc5 Changes Outline enums to IntEnum 2017-11-15 20:58:12 +01:00
Olivier Keshavjee bc0d6f5760 Creates base classes 2017-11-15 20:34:05 +01:00
Olivier Keshavjee 31dcc6d53a Adds better style colors of references 2017-11-14 15:22:16 +01:00
Olivier Keshavjee a334e8bd1b Improves theme desktop integration greatly 2017-11-14 15:01:20 +01:00
Olivier Keshavjee ee212db39c Removes most of hard-coded colors 2017-11-14 14:56:11 +01:00
Olivier Keshavjee fd0cd2cd4f Improves the Mind Map importer #208 2017-11-13 22:55:33 +01:00
Olivier Keshavjee 4445b55559 Allows pasted items to keep ID if not already in model. 2017-11-10 17:40:59 +01:00
Olivier Keshavjee bb57d3d057 Adds: merge 2017-11-10 17:21:02 +01:00
Olivier Keshavjee a153606811 Adds: split dialog, split at cursor 2017-11-10 16:31:40 +01:00
Olivier Keshavjee 3b17c4e2b4 Adds: Menu Documents. Edit operations (copy, cut, paste, duplicate, remove), and Move up and down. 2017-11-10 11:35:53 +01:00
Olivier Keshavjee 15ccaa513b Adds: import documents from several sources (txt, md, html, epub, docx, OPML, odt, etc.) #200 2017-11-09 15:21:25 +01:00
Olivier Keshavjee a231721bdb Adds: ability to split scenes at custom points. #200 2017-11-09 15:18:21 +01:00
Olivier Keshavjee 3cef130bc6 Fixes a strupid bug recentrly introduced in outlineItem.findUniqueID. 2017-11-09 10:40:54 +01:00
Olivier Keshavjee c6391e976c Adds: ability to import from folder structure. #200 2017-11-08 21:35:26 +01:00
Olivier Keshavjee 0a0649a0db Fixes: Manuskript crashes when a wrong locale is set. See #188. 2017-11-06 18:29:18 +01:00
Olivier Keshavjee e393848bc0 App crash when moving a step in Plots section #134 2017-10-29 10:21:28 +01:00
Olivier Keshavjee c9fc18f685 Fixes a bug in #169: dragging an open folder creates duplicates 2017-10-27 07:30:07 +02:00
Olivier Keshavjee f99e4facab Fixes a bug in #169: when dragging a folder and dropping it between two same folder split panes it is silently deleted 2017-10-25 19:15:30 +02:00
Olivier Keshavjee 761286c497 Merges feature/CustomIcons 2017-10-23 15:10:30 +02:00
Olivier Keshavjee 40cc136836 Adds: custom icons 2017-10-23 13:45:08 +02:00
Olivier Keshavjee 648b4b67eb Fixes more bugs in drag n drop: seg fault when creating an item after deleting an item that was open for editing, and other small stuff 2017-10-20 23:39:57 +02:00
Olivier Keshavjee a44dd41f00 Fixes bug in drag'n'drop: item can be dropped into itself (or children of itself) 2017-10-20 15:28:37 +02:00
Olivier Keshavjee 742e24dbd2 Improving english words: redaction → editor, infos → info. See #53 2017-10-14 20:40:50 +02:00
Curtis Gedak 3569f78928 Fixes: add plot then choose new plot does not set importance slider
By default when a plot is added to the plot model, the
importance value is set to "0" (Minor).  However when the new
plot is selected, the importance slider remains set to the value
of the previously selected plot.

Steps to Reproduce:

1.  Click add plot (plus sign) button.
2.  Select this "New plot".
3.  Select "Basic infos" tab and change Plot name to "My Plot".
4.  Move Importance slider all the way to the right (Main).
5.  Click add plot (plus sign) button.
6.  Select this "New plot".

    Note that the "New plot" is shown in the plot list pane under
    "Minor", but the Importance slider is still all the way to the
    right (Main).

This enhancement ensures that the corresponding plot UI importance
slider is also set to the proper plot importance.
2017-07-01 10:18:46 -06:00
Olivier Keshavjee c14f2493fb Merge branch 'feature/Exporter' into develop 2016-04-15 14:27:44 +02:00
Olivier Keshavjee 714c4a5fb8 Fixes two minor bugs 2016-04-08 15:30:14 +02:00
Olivier Keshavjee 548df14b28 Exporter looking like something now 2016-04-05 17:22:39 +02:00
Olivier Keshavjee a3d3b41dfb Fixes a bug that gives duplicate ID to first item created 2016-04-01 14:08:04 +02:00
Olivier Keshavjee 3571ec3f16 Bug correction: need to convert from html to plain text when loading old file format 2016-03-31 15:40:11 +02:00
Olivier Keshavjee 7e954eab5e Purging types from outlineModel and others 2016-03-30 11:26:31 +02:00
Olivier Keshavjee 6551166000 Purging types from several files 2016-03-30 11:00:27 +02:00
Olivier Keshavjee b676d126ba Cleaning up a bit 2016-03-29 19:24:35 +02:00
Olivier Keshavjee 9f0c5fe527 Display bug corrected in outline view 2016-03-24 11:37:18 +01:00