This includes the auto-hide of each panel as well as the shown/hidden status
of each of the displays. Now that it's consistent, it makes it so much more useful.
This is an experimental idea. We can add to a myPanel a list of widgets to show/hide
if the user wants to, via the context menu. This can be very useful for a user who
wants to disable auto-hide for the bottom panel but remove the theme selector which
can be useless to have open permanently.
This is the first step in fixing #234. Would need the auto-hide and the displays
configurations to be saved in settings though before it can become usable.
If manuskript is launched with its last argument set to "--console" an
interactive console opens up to help debug the application.
The IPython, qtconsole and matplotlib libraries must be installed for it
to work and they won't get imported unless the argument is passed to the app.
Color scheme was inverted if foreground was transparent, bug and fix provided
by @tildagail [1] and the text on the left side panel was ignoring text color
settings, making it unreadable in dark themes, as reported by @worstje in #527
[1] https://github.com/olivierkes/manuskript/issues/527#issuecomment-469578130
While tackling issue #529, I stumbled across the odd behaviour that
re-compressing the archive with 7-Zip broke what should be a valid
Manuskript project.
After investigation it turned out that the code that loads the texts
sensibly expects there to only be files tracked in the files dictionary.
It is completely valid for a zip file to contain entries describing the
contained directories. The logical fix is to simply avoid adding these
directory entries to our files dictionary in the first place.
The Cork background and fullscreen theme backgrounds images can now be added
by using the "+" icon from the combobox. Once a file is added, the combobox
is repopulated and the new image is selected.
Note on line 871, in updateThemeBackground, there was a bug where it was using
self.cmbCorkImage instead of self.cmbThemeBackgroundImage
Fixes#399
If you right click once on the fullscreen panel and the context menu pop up
then you right click again somewhere else on the panel *while the previous
context menu is still visible* then it will cause a crash with :
"Windows fatal exception: access violation"
It seems to be caused by a crash in the QT event loop, trying to delete the
existing QMenu within an event handler.
In the properties view, the context menu on the title line would be black
making its content unreadable. Same in the filter line of the "Set Custom icon"
window on the outline's context menu.
Several crashes were encountered opening files on operating systems
that do not default to UTF-8 encoding, such as Windows. In each case
the project file appears to have become corrupted. Because the only
reports to date have been on Windows, attempt to fix by specifying
utf-8 encoding for all text file open methods.
See issues #331, #470, and #502.
Windows path to the image has '\' path separator instead of '/' which makes
the stylesheet fail. Background images don't appear and console gets spammed with :
Could not parse stylesheet of object corkView(0x27248eb6900, name = "corkView")
This prevents any child widget from inheriting the same stylesheet,
more specifically, the context menu of the full screen editor will now
appear normal instead of being black text on black background, which made
it unreadable.
Fixes#440
The lambda function will keep a reference to the scrollbar python object preventing it
from getting destroyed when the QScrollbar is destroyed. This causes the underlying
QT widget to be freed while the python object still exists, therefore the timer itself
doesn't get stopped/cleaned, so the timer will get called and cause a crash with :
"RuntimeError: Wrapped C/C++ object of type myScrollbar has been deleted"
To reproduce, press F11 repeatedly while scrolling.
The menu option "View -> Mode -> Snowflake" has not been implemented.
This greyed out / disabled option has caused some confusion for users.
Remove the snowflake menu option to avoid confusion.
Closes issue #419
See also earlier issue #45
Many applications, including Manuskript in the Editor pane, use the
keyboard shortcut 'Ctrl+Backspace' to delete the previous word.
However in the Plot pane Manuskript uses 'Ctrl+Backspace' to delete a
plot resolution step.
Fix this inconsistent behaviour by removing the keyboard shortcuts for
'Ctrl+Enter' and 'Ctrl+Backspace' from the Plot pane.
Closes issue #375
When running pytest on kubuntu 16.04 the following warning was displayed:
$ python3 -m pytest -v
...
./manuskript/load_save/version_1.py:319: \
UserWarning: Duplicate name: 'outline/0-Folder/0-Text-3.md'
zf.writestr(filename, content, compress_type=compression)
The error was tracked down using the following pytest invocation:
$ python3 -m pytest -v -W error::UserWarning
This invocation showed 4 occurrences similar to the following warning:
self = <zipfile.ZipFile filename='/tmp/tmpgs_sjpzr.msk' mode='w'>
zinfo = <[AttributeError("compress_size") raised in repr()] \
ZipInfo object at 0x7f3cc0124588>
def _writecheck(self, zinfo):
"""Check for errors before writing a file to the archive."""
if zinfo.filename in self.NameToInfo:
import warnings
> warnings.warn('Duplicate name: %r' % zinfo.filename, \
stacklevel=3)
E UserWarning: Duplicate name: 'outline/0-Folder/0-Text-3.md'
These warnings arose in the following 4 tests:
- test_references
- test_autoLoad
- test_loadExportWiget
- test_loadImportWiget
The cause of the issue is that in manuskript/tests/conftest.py, the
mainWindow::closeProject() method is called to close the project, but
the project was never loaded. This meant the zip file setting
defaulted to True, when in fact the Acts sample project is not stored
in a single zip project file.
Fix by removing the call to MW.closeProject() before the project is
loaded.
Manuskript started to segmentation fault on import starting with Qt 5.11.
I found the following link and the Qt bug links within to be useful in
my trouble-shooting efforts.
[Qt 5.11] Various Applications Segfault in 'libfm-qt'
https://github.com/lxqt/libfm-qt/issues/164
Closes issue #402
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
This reverts commit 2fdf8c64bf.
The problem introduced by the commit is that the Editor pane would
incorrectly label book elements with the plural form of a word. For
example "Books 4", "Sections 2", "Chapters 1", or "Scenes 3". Hence
the need to undo the commit.
Closes issue #383.
See issue #281.
When loading a project that has the setting **Save to one single
file** disabled, Manuskript tries to read all directories and files
under the project directory.
Manuskript expects all files to contain valid unicode characters.
However if a file containing non-unicode characters is read then
Manuskript will crash.
The error message displayed on the console is similar to the
following:
----- begin snippet -----
Traceback (most recent call last):
File "/home/gedakc/workspace/manuskript.olivierkes/bin/../manuskript/ui/welcome.py", line 134, in loadRecentFile
self.mw.loadProject(act.data())
File "/home/gedakc/workspace/manuskript.olivierkes/bin/../manuskript/mainWindow.py", line 566, in loadProject
self.loadDatas(project)
File "/home/gedakc/workspace/manuskript.olivierkes/bin/../manuskript/mainWindow.py", line 793, in loadDatas
errors = loadSave.loadProject(project)
File "/home/gedakc/workspace/manuskript.olivierkes/bin/../manuskript/loadSave.py", line 66, in loadProject
v1.loadProject(project, zip=isZip)
File "/home/gedakc/workspace/manuskript.olivierkes/bin/../manuskript/load_save/version_1.py", line 657, in loadProject
files[os.path.join(p, f)] = fo.read()
File "/usr/lib/python3.5/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 3131: invalid start byte
----- end snippet -----
There are at least two known situations in which files with
non-unicode characters can arise:
A. The project is on Mac OS X and the operating system automatically
creates a .DS_Store file.
B. The project is under git version control and contains a .git
subdirectory.
This enhancement prevents the Manuskript crash on project load by
ignoring all directory and file names that start with a period.
Add "Help -> About" menu entry that invokes an "About" dialog window
for Manuskript.
Show details such as logo, version, website, copyright, license, and
software versions in use (Python, PyQT, and Qt).
See issue #14.
Four panels use custom widgets on the Right-Hand-Side tabs to control
visibility. These panels are:
PANEL NAME VIEWABLE ON NAVIGATION TAB
------------ --------------------------
Book summary Plots
Project tree Redaction
Metadata Redaction
Story line Redaction
When the custom widget is created, it is assigned a name that is
marked for translation. The final text name appears to have a
shortcut letter automatically assigned. For example in English:
Book summary -> B&ook summary
Project tree -> &Project tree
Metadata -> &Metadata
Story line -> Story &line
On restoration the choice to restore state is based on successful
comparison between title and btn.text(). Currently this comparison
fails because title contains "&" and btn.text() does not contain "&".
Fix by removing all ampersand "&" characters from both title and
btn.text() when performing comparison.
See issue #128.
With the "Save to one single file" setting **disabled** (accessible
via "Edit -> Settings" under the General tab), then using
"File -> Save as..." creates only a portion of the previous project
files and content.
Steps to Reproduce:
1. Open or create project with data (characters, plots, outline, etc.)
2. Ensure existing project is saved with "File -> Save".
3. Choose "File -> Save as..."
4. Enter a new filename and click Save button.
5. Choose "File -> Close Project"
6. Choose "File -> Open" and choose the newly created project filename.
Note that most of the project contents are missing or empty
(plots, outline, etc.).
This enhancement disables smart caching for the first save of the new
project filename so that all project files are saved under the new
filename.
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.
Previously if a character was selected, and next
either: a title (Main, Secondary, Minor) was selected,
or: the character remove button was clicked,
then the character tabs would remain enabled. This was incorrect
behaviour.
In the case a character was removed and the user moved the
importance slider then Manuskript would crash.
This enhancement disables the character tabs when there is no valid
character selected.
See issue #102.
By default when a character is added to the character model, the
importance value is set to "0" (Minor). However when the new
character is selected, the importance slider remains set to the value
of the previously selected character.
Steps to Reproduce:
1. Click add character (plus sign) button.
2. Select this "New character".
3. Select "Basic infos" tab and change Name to "Bob".
4. Move Importance slider all the way to the right (Main).
5. Click add character (plus sign) button.
6. Select this "New character".
Note that the "New character" is shown in the character list pane
under "Minor", but the Importance slider is still all the way to
the right (Main).
This enhancement ensures that the corresponding character UI
importance slider is also set to the proper character importance.
Previously creating a new project with an existing filename would
blindly overwrite the existing project file(s). This could result in
an author accidentally losing all of their work, assuming they did not
have a backup.
This enhancement pops up a warning asking the user if they wish to
overwrite the existing project filename.
See issue #52.
Enable selection of background color in addition to background image
for index cards. This setting is accessed from the manuskript menu
**Edit -> Settings -> Views -> Index cards**.
Keep initial default of "writingdesk" background image for Index cards.
Also update comments for functions to better describe how these work.
The message for failing to find and load a language translator was
misleading.
There is no problem running Manuskript with the default English
language (no translation loaded). The word **Warning** implied that
something was wrong with manuskript and could be confusing to users.
See issue #96.
This change creates a new class disconnectAll() to ensure that all
connections are disconnected for a specific signal and slot. Now when
a project is closed, the UI signals are disconnected. As before,
these signals and slots are connected when a project is opened.
Because Manuskript permits working on only one project at a time, the
menu items for File Open and Recents are disabled after a project is
loaded. These menu items are enabled when a project is closed.
Prior to this commit, subsequent open project selections would
complain with the following message:
TypeError: connection is not unique