Commit graph

9 commits

Author SHA1 Message Date
Moisés J 1e52af54e2 Add global search 2021-04-02 14:15:17 +01:00
TheJackiMonster fc653ad74b Added setting to disable counting spaces as chars but requires restart 2020-07-05 01:27:54 +02:00
Jan Wester 3aa9cadfd8 Restore progress bar functionality
A previous fix (5f9ea3) inadvertently broke the progress bar by
converting to the wrong data type. (See issue #561 / PR #609).

While checking the code I realized the problem occurred primarily
because we weren't checking the validity of the values closer to the
source. Doing so alleviates the need to check elsewhere.

In the hope of inspiring a more systematic approach, a new uiParse()
utility function has been added to curb the further growth of toXxx()
functions that exist solely to validate user input.

There is no doubt room for improvement, both on the end of the new
uiParse() function as well as the spot where it is used. Ideally, the
data that comes out of the model should already be 'safe', but since
this is a bugfix for a bugfix I want to keep waves to a minimum.

This commit fixes issue #652.
2019-09-23 14:13:38 -06:00
Jan Wester 5da31230c7 Fixed crash for pre-Qt5.6
Qt has garbage documentation. I dug into Qt 5.0 source code to make sure
the crashing call can be safely left out for older versions, and that is
indeed the case. setSupportedSchemes() appears to be introduced together
with the future to select non-local files in the dialog, but we only
cared about local files to begin with.
2019-09-07 15:59:45 -06:00
Jan Wester 9317dc97d8 Do not reinvent QFileDialog's default suffix
According to issue #608 we were silently overwriting files when there
was a suffix being generated for a chosen export filename when one was
missing to begin with. Unfortunately, this helpful feature avoids all
the conveniences offered by QFileDialog in regards to alerting the user
to overwriting an existing file. Worse still, this feature already
exists in QFileDialog and the native APIs it can rely on.

This patch reimplements QFileDialog.getSaveFileName to allow the use of
the default suffix feature as functions.getSaveFileNameWithSuffix and
removes most of the magic involved with the old solution.
2019-09-07 15:59:45 -06:00
Curtis Gedak 5f9ea3baa5 Fix crash when setting word Goal on new Text (scene) in Outline pane
See issue #561.

The problem appears to be a due to a combination of factors, such as:

- Python does not automatically convert an empty/blank variable to the
  integer zero (0)
- Default goal value is empty/blank for a new Text (scene)
- Asynchronous events can occur such that the change in the Outline
  pane of a new Text (scene) goal from empty/blank to a value is not
  saved to the data model prior to the update event in the Editor pane
  accessing the model value for the word count progress display.

Steps to Reproduce:

1. Start manuskript and create new project (no template).

2. Select **Outline** pane.

3. Click "Text Plus" icon to create a text (default name "New")

4. Select **Editor** pane.

5. Click on **New** to display empty text.

6. Select **Outline** pane.

7. Double-click the empty area on **New** line under title **Goal**,
  type in "300", and press **Enter**.

   Note that manuskript crashes with a segmentation fault.

Work around the crash by using the already existing manuskript
function toInt() which handles conversion of empty/blank values to
integer value zero (0).
2019-07-31 10:46:06 -06:00
Youness Alaoui 20c5586a6c Add support for pyspellchecker as an alternative to PyEnchant
This modifies the Spellchecker abstraction to add a new dictionary support, with
support for pyspellchecker. It also changes the main UI so that multiple libraries
can be supported and dictionaries provided to the user. The custom dictionary of
pyspellchecker has to be handled manually, and the performance and words of this
library isn't on par with PyEnchant, but at least it works with 64 bits.

Fixes #505
2019-04-30 09:54:31 -06:00
Youness Alaoui d0f02cb2a7 Add a Spellchecker abstraction layer and clean up code
This is in preparation for adding support for additional spellchecking libraries
other than PyEnchant which seems to be unmaintained and does not build in
Windows 64 bit.
2019-04-30 09:54:31 -06:00
Olivier Keshavjee cd8ad6cc3a Adds: clickable links, and display images as tooltips (#22, #215) 2017-12-14 14:55:14 +01:00
Renamed from manuskript/functions.py (Browse further)