Commit graph

1110 commits

Author SHA1 Message Date
Curtis Gedak 81b232fc79 Add all current weblate languages to i18n/manuskript.pro 2019-09-30 09:25:35 -06:00
Curtis Gedak 3be69a7177 Rename Chinese (traditional) translation file identification to zh_HANT
Reference:

Language codes for simplified Chinese and traditional Chinese?
https://stackoverflow.com/questions/4892372/language-codes-for-simplified-chinese-and-traditional-chinese
2019-09-30 09:21:42 -06:00
Curtis Gedak 69423da710 Merge remote-tracking branch 'weblate/develop' into develop
Merge the weblate language translations with the following commands:

    git remote update weblate
    git checkout develop
    git merge weblate/develop
2019-09-30 09:16:43 -06:00
Riccardo Mangili 2af68208c3
Translated using Weblate (Italian)
Currently translated at 100.0% (856 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/it/
2019-09-30 11:56:02 +02:00
Jan Wester 7377a34714 Added warning to revision UI 2019-09-29 09:34:48 -06:00
Jan Wester 961bac7e16 UI enforces >=1 revision kept per timespan 2019-09-29 09:34:48 -06:00
leela decb60cbef change markdown to "Markdown" in....
...A universal document converter. Can be used to convert markdown to a wide range of other formats.
see https://en.wikipedia.org/wiki/Markdown
2019-09-29 09:09:31 -06:00
Alexander Klar 54ab01099d
Translated using Weblate (German)
Currently translated at 94.0% (805 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/de/
2019-09-27 16:54:24 +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
Curtis Gedak be35786b68 Default keep revisions to disabled, and remove tests for revisions
This commit sets the "keep revisions" setting to disabled by default
for new projects.  It also removes the test cases associated with
revisions.

The revisions feature as currently implemented is of questionable use.
It has been a source of performance issues for users, and has consumed
developer time in attempts to address its shortcomings.  This commit
is the first step to deprecate the current revisions feature.
2019-09-22 10:45:07 -06:00
Curtis Gedak b473ead98e Fix word recognition for spell checker, ignore active partial words
See PR #651

This commit restores the functionality that prevents spell checking a
word that is being actively typed at the end of a paragraph.

The goals for the spell check word match regexp are:

A. Words should include those with an apostrophe
   *E.g., can't*
B. Words should exclude underscore
   *E.g., hello_world is two words*
C. Words in other languages should be recognized
   *E.g., French word familiarisé*
D. Spell check should include word at absolute end of line with no
   trailing space or punctuation
   *E.g., tezt*
E. Spell check should ignore partial words in progress (user typing)
   *E.g., paragr while midway through typing paragraph*

This commit addresses all five of the above goals.

HISTORY:
- See issue #166 and commit 6ec0c19 in the 0.5.0 release.
- See issue #283 and commit 63b471e in the 0.7.0 release.

Also fix minor incorrect utf-8 encoding at top of source file.
2019-09-22 10:28:49 -06:00
Curtis Gedak 10df2baf8d Fix typo missed in two previous commits
See PR #645 and PR #648.

Change second instance in string of "save" to "saved".
2019-09-19 10:38:16 -06:00
luz.paz d20e7a8122 Fix typo missed in previous commit
https://github.com/olivierkes/manuskript/pull/489#issuecomment-533195819
2019-09-19 10:13:15 -06: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
Curtis Gedak 0943d81317 Move Qt 5.11 / 5.12 version warning to Import invocation
See issue #611 and pull request #642.

The warning previously added in PR #612 for Manuskript users with Qt
5.11 / 5.12 has shown itself, in my opinion, to be overly annoying.
This is because the warning *always* displays on systems with the
affected Qt versions even though the crash is verified to happen with
the import feature only.

Additionally the process to upgrade to a newer version of PyQt / Qt is
not trivial for users who rely on pre-built packages and do not run
from source code.

Because the crash has been verified with the Import feature only, limit
the scope of the warning to the Import feature.
2019-09-17 10:41:33 -06:00
luz.paz 1368a9b79b Fix source typo
Split off from #489
2019-09-17 10:26:46 -06:00
Jan Wester 5dcd93ced3 Improved detection of UI language
The user can configure a language for Manuskript in the dialog, but
before that setting is ever written to disk, there is the default
behaviour that tries to auto-detect the best language to show based on
the configuration of the device it is running on.

While doing my due diligence on issue #619, I realized we were relying
on the system locale, which is not necessarily equivalent to the
language the user is working with. Worse still: a user can have multiple
preferred languages for their user interface, and our old approach might
actually offer them the 'wrong' language. This patch fixes this.

It also refactors and comments things a little bit where necessary.
2019-09-15 09:21:31 -06:00
Jan Wester 0aa83180de Reworked translation loading to avoid ambiguity
Issue #619 revealed an unintentional overlap between the auto-detection
of the locale and the implicit builtin English language, which resulted
in users being unable to select the builtin English language when their
device was configured with a locale that we happen to have a translation
for. The code has been rewritten to more clearly separate auto-detection
and the final fallback that is the builtin English translations.
2019-09-15 09:21:31 -06:00
Curtis Gedak a2fc4c5ecd Set default window tab to Word frequency for Frequency Analyzer tool
This code change sets:
- Fequency Analyzer tool default first tab of "Word frequency"
  (was Phrase frequency)

Steps to set default window tab:

1. Start Qt Designer
2. Open .ui file
3. Ensure that each selected window tab is the one desired as default
4. Save .ui file
5. Exit Qt Designer
6. Generate .py file with:  make ui

See PR #623
2019-09-13 10:00:29 -06:00
Curtis Gedak 8f4ddefb48 Fix tab key order, and default window tab for character pane and plot pane
This code change sets:
- Character pane default first tab of "Basic info" (was Notes)
- Character pane Basic info "Name" as the default first field (was Motivation)
- Plots pane default first tab of "Basic info" (was Resolution steps)

Steps to edit tab order and default window tab:

1. Start Qt Designer
2. Open .ui file
3. Choose menu **Edit -> Edit Tab Order**
4. Ctrl-click on item just before the first incorrect tab order item
5. Click other items in order until remaining order is correct
6. Ensure that each selected window tab is the one desired as default
7. Save .ui file
8. Exit Qt Designer
9. Generate .py file with:  make ui

See https://doc.qt.io/qt-5/designer-tab-order.html

This code change implements a portion of issue #244
2019-09-13 10:00:29 -06:00
obw 78290d5cdb
Translated using Weblate (German)
Currently translated at 93.3% (799 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/de/
2019-09-13 03:23:56 +02:00
Curtis Gedak 846c0e920c Add DISABLE_WAYLAND to snapcraft.yaml
See request at:
https://github.com/olivierkes/manuskript/pull/511#issuecomment-528593686
2019-09-12 10:05:42 -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 860ada2c1b Basic dark theme support (Windows 10)
Windows 10 has supported a 'dark theme' option for a while, and the fact
Manuskript is like looking into a bastion of bright white while using it
is bothersome to say the least.

Since this is a setting defined as the OS level, I believe this should
be something Manuskript automatically adjusts itself to match, thus the
lack of a configurable setting on the Manuskript end.
2019-09-10 10:15:54 -06:00
Viktor S a0fb887c6c
Translated using Weblate (Russian)
Currently translated at 99.9% (855 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/ru/
2019-09-10 15:25:33 +02:00
King Fung Ng fdcf8175e9
Translated using Weblate (Chinese (Traditional))
Currently translated at 1.4% (12 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/zh_Hant/
2019-09-08 11:24:54 +02: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 f6fa3e8375 Do not try to export after dismissing the dialog
I happened to notice the UI briefly locking up when testing my previous
changes on some of the Pandoc exporters. While the bigger mess I found
along the way is more than a little fix can handle, this stopgap measure
will at least stop us from running pandoc when it isn't needed.
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
King Fung Ng 33d26afc0d
Added translation using Weblate (Chinese (Traditional)) 2019-09-07 10:22:05 +02:00
Jan Wester bcf749d165 Use native look for the import FileDialog
It is the only FileDialog in the entire codebase that does not conform
to the rest of the OS like its brethren, and it stuck out like a sore
thumb because of it.
2019-09-04 14:18:02 -06:00
Jan Wester c2dce6e0c6 Warn user about buggy libraries
Some bugs are out of our reach to fix, but can still impact the user
considerably. Because losing progress always hurts, we want to make
the user aware of the risks before any tears are shed. (PR #612)
2019-09-04 14:18:02 -06:00
Jan Wester fe0405ca8f Reinstate importer-specific settings in UI
Once upon a time very long ago, someone commented out one line too many.

And that broke all Pandoc-based imports. Oops. See issue #611.
2019-09-04 14:18:02 -06:00
Swann Martinet a2bc50e1e0
Translated using Weblate (French)
Currently translated at 91.9% (787 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/fr/
2019-09-04 07:25:04 +02:00
Hosted Weblate 0b5b7b7abc
Merge branch 'origin/develop' into Weblate. 2019-08-28 18:35:27 +02:00
Curtis Gedak 730e80caf9 Compile British English translation into respective .qm file
See issue #592

This was done with the following command:

$ lrelease i18n/manuskript_en_GB.ts
2019-08-28 10:21:16 -06:00
murth 534d06115b Add British English Translation
See issue #592
2019-08-28 10:21:16 -06:00
leela 85d3744eaf
Translated using Weblate (French)
Currently translated at 91.4% (782 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/fr/
2019-08-28 15:24:50 +02:00
Swann Martinet 131990a41d
Translated using Weblate (French)
Currently translated at 91.4% (782 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/fr/
2019-08-25 03:24:03 +02:00
Curtis Gedak 65fb184f60 Rename setting "Save on quit" to "Save on project close"
See PR #615

This rename is being done to clarify that when a user enables "Save on
project close" then the project will be saved whenever the user
chooses to close the project or to quit Manuskript.

Note that the actual name of the setting saveOnQuit should also be
changed but instead has been marked as a future TODO because it
involves a change in the project file format.
2019-08-22 15:18:18 -06:00
Curtis Gedak f4c8108b28 Do not prompt "Save project?" when _Save on quit_ setting enabled
See PR #615

The Travis CI tests began failing after merging Pull Request #583.

Log snippet:

----------------------------------------------------------------------
...
Ref not implemented
PASSED
manuskript/tests/ui/test_welcome.py::test_autoLoad QXcbConnection: XCB error: 8 (BadMatch), sequence: 613, resource id: 2097162, major code: 42 (SetInputFocus), minor code: 0
QXcbConnection: XCB error: 8 (BadMatch), sequence: 619, resource id: 2097168, major code: 42 (SetInputFocus), minor code: 0
QXcbConnection: XCB error: 8 (BadMatch), sequence: 625, resource id: 2097171, major code: 42 (SetInputFocus), minor code: 0
----------------------------------------------------------------------

When running "pytest -vs" locally, which is a command used in our
.travis.yml file, a dialog to "Save project?" is displayed.  Because
the test scripts use the "saveOnQuit" default setting of *enabled*,
the "Save project?" dialog should not be displayed.

In other words when a call is made to close the project, a "Save
project?" dialog is incorrectly displayed because the dirtyProject
flag is set, but so too is saveOnQuit set to True.  What should happen
is an automatic save with no prompt.  This PR fixes this logic so that
the Travis CI test suite completes successfully.
2019-08-22 15:18:18 -06:00
Elizabeth Sherrock 7627c5aa35
Translated using Weblate (Chinese (Simplified))
Currently translated at 81.7% (699 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/zh_Hans/
2019-08-16 17:24:08 +02:00
PanDedoctor b37c76ae5d
Translated using Weblate (Polish)
Currently translated at 98.7% (845 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/pl/
2019-08-13 14:24:07 +02:00
Mateusz Mendel 8f797847b0
Translated using Weblate (Polish)
Currently translated at 98.7% (845 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/pl/
2019-08-13 14:24:07 +02:00
Jan Wester 34f84126df Fixed race when closing an auto-saving project.
Turning off the timer for saveTimerNoChanges just like the code
already did in closeProject() for saveTimer fixes this bug. Easy.

But how to prevent this kind of race condition in the future?

Several related routines have been adjusted to fail gracefully or report
a bug to the console when something goes wrong, depending on what is
most suitable for that bit of logic.
2019-08-12 10:35:07 -06:00
Jan Wester 97cf0e1373 Track dirty state and have the UI respect it
Intending to learn more about the way Manuskript goes about saving the
project in order to figure out how to tackle some recent saving-related
issues, I stumbled into learning that Manuskript likes to save data a
whole lot. Too much, in fact. When I close the project with unsaved
changes, I expected those changes to not be saved... but they were. This
completely subverts my expectations of a program using typical
file-based operations involving opening, saving and closing files.

There are three more settings that influence when the program saves, and
I personally consider them a bit overkill or even detrimental to the
stated purpose. What if Manuskript forces a save when nothing was
changed and something goes wrong? Saving too much can in fact be
dangerous!

For now, I have left existing functionality as-is, but I would prefer to
respect the dirty flag I have introduced in this commit for at least the
'save-on-quit' and 'save every X minutes' features. (The third is
smarter and only triggers after noticing changes, so it is less
important.)

Making sure the dirty flag works as expected is the first step in making
such changes in the future.

UI-wise, this commit now offers the user the opportunity to save their
changes, discard them, or outright cancel their action entirely when
performing a destructive action on a dirty project. As of this commit, I
have identified two of such scenarios:

1) closing the project,
2) closing the window with save-on-quit turned off.

If I missed any, do let me know. But for now, maybe now I can finally
start digging into those issues that sent me down this rabbit hole...
2019-08-12 10:35:07 -06:00
PanDedoctor 65a2c83b35
Translated using Weblate (Polish)
Currently translated at 82.1% (703 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/pl/
2019-08-12 13:48:33 +02:00
Mateusz Mendel c4adb4f67b
Translated using Weblate (Polish)
Currently translated at 82.1% (703 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/pl/
2019-08-12 13:48:33 +02:00
Allan Nordhøy db1ce406ac
Translated using Weblate (Norwegian Bokmål)
Currently translated at 96.8% (829 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/nb_NO/
2019-08-03 20:23:30 +02:00
Allan Nordhøy c8e5bd53c9
Translated using Weblate (Norwegian Bokmål)
Currently translated at 96.7% (828 of 856 strings)

Translation: Manuskript/Translations
Translate-URL: https://hosted.weblate.org/projects/manuskript/translations/nb_NO/
2019-08-01 07:13:22 +02:00