Commit graph

191 commits

Author SHA1 Message Date
TheJackiMonster a7abc68f8e
Initialize textColor with None
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
2023-12-07 16:08:44 +01:00
Tobias Frisch 3d4eef2b49
Merge pull request #1214 from TheShadowblast123/develop
Update spellchecker.py And Fixed crashing
2023-12-07 16:06:03 +01:00
mousse 56dac84932 issue 1224: contextmenu on unknown word in context of pyspellchecker and symspellpy 2023-09-20 16:24:55 +02:00
Shadow 161290686b Update corkDelegate.py 2023-09-18 14:28:30 -07:00
Shadow 7d31628977 Resolved critical error that crashes
textColor isn't always set to a value and whenever it was used as an empty variable the program would crash. I'm uncertain as to whether or not this solution is appropriate, but this is one way to handle it and maintain functionality. Another would be setting textColor to a default value, but this default would have to depend on the theme set by the user.
2023-09-18 14:11:30 -07:00
Arne Sostack b05377b417 Implemented history back and forward navigation 2023-05-14 11:59:07 +02:00
tntscreed 953ce4bd15 Multi-Deletion of Characters + Confirmation Dialog
-Since multi-selection of characters is now possible, it's more intuitive that all selected characters should be deleted.

-Added a confirmation dialog before character-deletion? Why the heck  was this not a thing before? It was way too easy to accidentally delete characters, with no way to restore them without external source-control or backups.
2023-03-07 20:56:54 +01:00
tntscreed 06f8ab3519 The bulk info managers is now completely functional.
Also, a change has been made to the character tree view. Theoretically it shouldn't have any functional significance, but "addCharacterInfo" is used for adding info to only one character, so it makes sense to remove the old multi-selection info-adding functionality, even if it wouldn't ever be accessible.
2023-03-07 20:27:16 +01:00
tntscreed fc86ed5df6 Started work on character multi-selection features.
-Added currentCharacters method, a list counterpart of currentCharacter.

-Replaced the connection for currentItemChanged with itemSelectionChanged. This is to accommodate for the bulk-changes when multiple characters are selected. The currentItemChanged method is now not called with a connection, but from the handleCharacterSelectionChanged method. The latter is called with the itemSelectionChanged connection.

-If no valid characters are selected, the tabPersos widget is disabled. This obviously breaks the functionality of bulk-adding info to characters. This will have to be fixed by only disabling the parts of the tabPersos widget that should not be affected with multiple selection operations.
2023-03-05 14:14:58 +01:00
tntscreed a046656acf Made bulk-adding "Detailed info" to characters possible
-Changed the selection mode to extended selection on the lstCharacters tree-view. This will not affect anything else other than the "detailed info" rows. Every other change to a character's descriptions, motivations and such only affect the last selected one.

-Made a method to get all the IDs of the selected characters.

-Added a character-info dialog UI. Originally, adding information worked by adding a placeholder and then changing it. Users never want to just add a placeholder without initialising the values. And the bulk-adding only works this way.
2023-03-05 00:58:25 +01:00
TheJackiMonster 6ea209e523
Prevent right-click for popup menus to select item (fix #919)
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
2023-02-13 21:34:35 +01:00
TheJackiMonster 414cd0f8a3
Cleanup code
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
2023-01-30 23:19:33 +01:00
TheJackiMonster c656911996
Removed snow flake method
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
2022-08-10 11:43:32 +02:00
TheJackiMonster a33249fc9d
Added guard to catch errors with translation
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
2022-05-17 11:43:22 +02:00
Tobias Frisch b859631a50
Replaced try & catch with early exit on NoneType
This should fix the issue without exception handling.
2022-03-30 22:44:12 +02:00
Megan Conners 6fd6a68d9d catch AttributeError in plotTreeView double click event 2022-02-19 11:41:19 -05:00
Megan Conners 01036e4540 fixes #992 and #998 with explicit int casts 2022-01-16 12:31:16 -05:00
TheJackiMonster dc86e3b14e
Adjusted fixes for python 3.10 to not crash immediately
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
2021-12-13 14:27:59 +01:00
TheJackiMonster 77eee852de
Fixed issue #808 by resetting POV once the character gets deleted
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
2021-11-30 23:40:31 +01:00
TheJackiMonster a63da8d0a8
Fixed issue #937
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
2021-11-30 23:08:59 +01:00
TheJackiMonster 1af7d89d2a
Fixed issue #931, updated ui files and updated translation files
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
2021-10-23 16:15:58 +02:00
Jan Wester d6e472b939 Implemented fix for failed cursor iteration (#729)
A long time ago, I identified this failure but wasn't sure why it was
failing. I still don't know why, but the emergency fix at least prevents
other people from running into it. As a bonus, since we have a proper
logging facility now, we can actually log it as I desired to do back
then!

This commit tentatively fixes issue 729.
2021-07-10 19:01:58 +02:00
Jan Wester 32caf6aa04 Partial fix for erroneous nbsp->space conversion
QDocument::toPlainText() has the stupid decision to convert nbsp to
spaces in it, which our users obviously hate. Unfortunately, this is
out of our control to fix completely. It is a very deep rabbit hole. :(

Typing non-breaking spaces in the editor now works. Reopening these
files at a later point has these characters remain intact.

What does NOT work is copy-pasting non-breaking spaces. These will end
up looking like normal spaces when you paste them somewhere else, be it
in Manuskript or some other document. In other words: it is impossible
for users to verify whether something is a non-breaking space or an
ordinary one.

I realize that it makes this partial fix meaningless for many. Sorry. :/

Partially fixes issue 738.
2021-07-10 19:01:58 +02:00
Jan Wester 239e66e7cb Comprehensively log all version information
Manuskript now logs the versions of modules and libraries powering them
for as far those are easily accessible. This includes all the optional
modules, too. None of this is visible on the terminal of course - unless
Manuskript is run with the --verbose flag. This clears up the last bit
of unnecessary console spam, leaving our users blissfully unaware.

Until we (and/or Qt) break something again, that is...
2021-04-08 18:44:28 +02:00
Jan Wester ff2cbca028 Converted most print statements to use logging
Some snippets have yet to be converted due to the more complex nature
of those snippets, and to keep things neat a separate commit makes more
sense for those.
2021-04-08 18:44:28 +02:00
Tobias Frisch 2545f9c7a3
Merge pull request #793 from FrancoisDuchene/notEnoughArgsFix
Fix for TypeErrors when using certain app styles
2021-04-08 14:46:59 +02:00
Robert Barlow a266b1bfff
Fixed project not opening with missing background
This is the quick way to patch this. I'd recommend changing the findFirstFile function in functions/__init__.py for a more permanent solution, but this should suffice for now.
2021-04-04 13:48:54 -04:00
Moisés J 1e52af54e2 Add global search 2021-04-02 14:15:17 +01:00
TheJackiMonster 3effe5c7fa
Added more consistency to the context menu 2021-02-22 03:18:45 +01:00
nagolinc 22fdab3f46 added 3 buttons to the textEditView that allow quickly adding new items
add character takes parameter name
2021-02-21 20:06:17 -05:00
TheJackiMonster 0cb65c452e
Fixed cursor selection without suggestions 2021-02-22 01:26:07 +01:00
TheJackiMonster ad21d5faa5
Fixed finding suggestions using enchant and word selection without external dictionary 2021-02-22 01:13:19 +01:00
TheJackiMonster 12be4c3a3d
Fixed all Python syntax warnings 2021-02-21 23:45:34 +01:00
bentleyjoakes 06e35cd969 Clones importance setting.
When creating a new character, sets an appropriate importance level.
* If a character is selected, the new character has the same importance level.
* If a top-level importance level is selected, the new character has that level
* Otherwise, the importance level is zero
2021-02-21 21:09:20 +01:00
Tobias Frisch e8c61e74ba
Merge branch 'develop' into optional-pov 2021-02-19 16:02:45 +01:00
TheJackiMonster 61734c1afa
Enabling/Disabling POV for a specific character 2021-02-19 16:01:30 +01:00
Tobias Frisch ca5a987e3c
Merge pull request #747 from TheJackiMonster/languagetool
Added basic support for LanguageTool via 'language_check' as advanced spellchecker
2021-02-19 15:46:47 +01:00
TheJackiMonster ac8cb3e403
Added support for LanguageTool via 'language_check' as advanced spellchecker 2021-02-19 15:44:38 +01:00
FrancoisDuchene bd7b1e96f7 Fix for TypeErrors when using certain styles
When i was using certain styles like cleanlooks or qt5ct-style, a TypeError was raising in cascade about the function not having enough arguments.
It looked like that, despite the last args of Qstyle.subElementRect() and Qstyle.sizeFromContents() were optional, it was still required to mention it (even if it was just None).
That TypeError was only appearing with certain styles, at startup or when changing styles in the settings window.
2020-08-13 19:10:16 +02:00
TheJackiMonster 24f3f092bb Added char-count with settings to enable/disable it. 2020-03-27 15:12:44 +01:00
TheJackiMonster 9f6b65aaca Fixed bugs caused by parallel access during multithreading 2020-01-06 11:16:02 -07:00
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
Jan Wester d626d3ba75 Fixed & robustified image tooltips (issue #593)
Last time I touched this code, I went in looking for a specific problem,
and came out with a fix specific to that issue. That fix was not wrong,
yet it hardly covered all the problems present in the code once one took
into account issues like:

- local vs remote resources,
- relative vs absolute paths,
- different operating systems behaving differently, and
- Qt being uniquely buggy on different platforms.

The major part of it was fixed by using QUrl.fromUserInput(), which does
the exact kind of auto-detection for the nature of the resource that we
were in need of.

The rest of the issues were fixed by creating a number of test cases and
fixing problems as they popped up. Testing was done in Windows & Ubunty
against the above-mentioned test cases, which can be found in PR #629.

Regarding ImageTooltip.supportedSchemes

When QUrl.fromUserInput() misidentifies the scheme on Linux, it causes
all resemblance between the original request and the reply.request() in
the finished() signal to be lost, which results in this item getting
stuck in the ImageTooltip processing pipeline.

Limiting the supported schemes to the ones most commonly encountered
('file', 'http', 'https' and the schema-less local paths) is the only
reliable method I have found to work around this particular bug in Qt.
2019-09-10 11:30:35 -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 5c33ce54f3 spellcheck: show 'add to dictionary' even if a word has no suggestions 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
Jan Wester 0238ccec7b Fixed #549 and refactored the image tooltip also
Issue #549 was caused because the request and reply object urls are not
guaranteed to be the same. Redirects are the most common cause, but a
malformed URL apparently also qualifies. We now make sure to look at the
original request.

Because the code confused me while I was working on it, I decided to
refactor and document it in order to understand what was going on. I am
glad I did: I found another crashing bug involving the rapid-firing of
tooltip requests, and the processing dict never had its entries removed
either, leading to a (very slow) memory leak over time.

All is good in the world of image tooltips now.
2019-04-23 12:25:39 -06:00
Youness Alaoui 3f217257c4 Fix background of popup menus that was transparent (black)
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.
2019-02-27 10:49:05 -07:00
Youness Alaoui 7928ea2796 Fix corkView background image on Windows
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")
2019-02-26 13:25:30 -07:00
Youness Alaoui c3c9eef415 Do not default spellcheck to True for new editor views
default spellcheck to the settings value instead. Otherwise any new editor tab
will have spellcheck enabled regardless of setting.

Fixes #474
2019-02-25 12:58:00 -07:00