Commit graph

42 commits

Author SHA1 Message Date
TheJackiMonster 98d6eb4975
Remove usage of hardcoded path separators
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
2023-12-12 15:53:37 +01:00
Christian Freitag 42245d38c3 - Added catch of RuntimeError triggered on when sys.stderr is none 2023-08-07 10:04:26 +02:00
TheJackiMonster 029dfe2056
Potential workaround for manuskriptw.exe
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
2022-08-10 00:29:49 +02:00
Jan Wester 0ea4c0d174 Share OpenGL contexts to make Qt WebEngine happy
This takes care of the following warning in our log file:

Qt WebEngine seems to be initialized from a plugin. Please set
Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute before
constructing QGuiApplication
2021-07-10 19:01:58 +02:00
Jan Wester 0a0ffb6d54 Fix broken filename argument handling (issue #898)
In addition to fixing the bug, related code that allowed this one to
slip under the radar has been cleaned up. Validation of the FILENAME
argument is now performed during parsing.
2021-07-10 19:01:58 +02:00
Jan Wester 2d622792f3 Additional logging centered around sys module
Due to my struggles reproducing the official build, I felt it might be
useful to log extra information regarding the version of PyInstaller.

Unfortunately, such information is not available due to the way things
work. However, during that process I came across some other interesting
details that would likely be useful when logged.
2021-04-08 18:44:28 +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
Jan Wester 8884bac0ed Added logging & proper argument parsing.
Sometimes you want to do just one thing, and in the process of
implementing that one thing, you implement several others. This is one
of those types of commits.

Implementing the argparse library is for the sake of controlling the
logging behaviour as well as other future I have yet to implement.

It has all the standard goodies you'd expect, and I have also ported
over the existing commandline arguments. (They may need a bit of polish
still, but there is no regression compared to before, only improvement.)

The logger is because it really needed to happen for numerous reasons.

It still logs to the terminal, but by default it only does so for
messages classified WARNING and above. These are the things we actively
want users to see. But if this is not good enough, adding the --verbose
flag will increasingly show more (-v shows INFO level and -vv also shows
the DEBUG messages) so that us coders don't have to miss anything in the
most convenient location.

It also logs to a file with the very original filename manuskript.log. I
may have to add commandline and/or settings arguments to improve that at
some point in the future, but there distractions are endless.

The log file contains timestamps and module information for easy
interpretation that are not present on the terminal, and it contains all
messages classified DEBUG and up. Ideally users will just be able to
attach it to an issue(*) to deliver us all the information we need to
help them with their inquiry.

Last but not least, the other reason I needed logging implemented is
that Qt has its own logging framework, and I needed to figure out how to
siphon out the data and make it shut up. But there was no point in doing
that as long as our own logging facilities were lacking...

(*) I have yet to convert all existing print statements over to the new
system, but that is probably going to be the next commit. This one has
enough change in it already.
2021-04-08 18:29:15 +02:00
Ling Samuel 41ebf87471
setup signal handler to avoid accident data loss
Signed-off-by: Ling Samuel <lingsamuelgrace@gmail.com>
2021-02-23 16:53:49 +08:00
TheJackiMonster 12be4c3a3d
Fixed all Python syntax warnings 2021-02-21 23:45:34 +01:00
Jan Wester 67f987d44b Fix for Windows 10 Dark Theme on older Qt versions
QtCore.Qt.GlobalColor does not have any accessors for the predefined
colors on PyQt versions before 5.11 despite the object itself existing.

It would have been nice if the documentation* had mentioned that object
being broken on older versions, but I should have tested with even older
versions of PyQt before submitting the original patch.

Apparently the most supported way to access these colors is through the
Qt namespace itself, but those aren't documented in the slightest. Ugh.

My apologies to all those affected. Fixes issue #659.

*: https://www.riverbankcomputing.com/static/Docs/PyQt5/api/qtcore/qt.html#GlobalColor
2019-10-02 09:49:52 -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
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
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
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
Youness Alaoui 4a947a95ac Add support for IPython Jupyter QT Console as a debugging aid
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.
2019-03-29 10:37:53 -06:00
LingSamuel 4ded8d29e0 fix #411: translator won't work in some window, such as settings 2018-12-09 11:35:34 -07:00
LingSamuel 3d6080f3c0 fix #428: zh translation suffix doesn't match system locale; new behavior: load translation from settings first 2018-12-09 11:19:26 -07:00
Sebastian Rasmussen dfe88a9681 Fix typos in code comments, invisible to end-users. 2018-01-29 10:30:41 -07:00
Olivier Keshavjee 9c635301b5 Adds #223: command line parameter to open project 2017-11-30 17:47:23 +01:00
Olivier Keshavjee e62b473c47 Adds: settings for applicatoin font size 2017-11-29 14:34:25 +01:00
Olivier Keshavjee ba4fe6b57a Fixes the organizationName issue in #225. 2017-11-21 23:11:08 +01:00
Olivier Keshavjee 9d3b64de8f Adds: references tests, corrects bugs 2017-11-20 15:42:30 +01:00
Olivier Keshavjee 584b0b04a6 Checkpoint: revisions 2017-11-19 15:29:38 +01:00
Olivier Keshavjee 1a5fdc7b1f Adds unit tests for functions 2017-11-19 00:20:49 +01:00
Olivier Keshavjee b81a571b2e Adds: Disable cursor blinking (#165), Configurable editor margins (#168) 2017-10-19 12:13:20 +02:00
Olivier Keshavjee d2762f2819 Merge branch 'feature/QtWebEngine' into develop 2017-10-12 08:47:57 +02:00
Curtis Gedak 5d462d6a47 Single source the package version
Define one place to store the Manuskript version so that it can be
used in multiple locations.

Reference:

Single-sourcing the package version
https://packaging.python.org/guides/single-sourcing-package-version/
2017-09-28 13:54:53 -06:00
Olivier Keshavjee 2beb3a939b Conditional import of QtWebEngine or QtWebKit 2017-06-20 15:24:15 +02:00
Curtis Gedak 828fc3375e Change message from warning to note for failed to load translator
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.
2017-06-06 10:10:23 -06:00
Olivier Keshavjee 79962f1e0d Bumped version number 2017-05-25 18:15:43 +02:00
Curtis Gedak 7ba028ecc8 Fixes: incorrect reference to 32px icon 2017-05-09 14:55:27 -06:00
Olivier Keshavjee 85cb90d592 Bumping version number 2016-03-31 16:12:54 +02:00
Olivier Keshavjee 824f15e54c Adds: GUI settings to change translation 2016-03-29 18:39:33 +02:00
Olivier Keshavjee dc79ba1396 Bumping version number 2016-02-29 00:04:26 +01:00
Olivier Keshavjee f536764904 Few modifs 2016-02-28 23:48:53 +01:00
Olivier Keshavjee 0714d36dcd Version change 2016-02-08 22:10:16 +01:00
Olivier Keshavjee c4e3fc7d04 Adds application icon 2016-02-06 16:42:22 +01:00
Olivier Keshavjee 69e0ca93be Cleaning up imports, at last 2016-02-06 12:34:22 +01:00
Olivier Keshavjee c469f262f3 Renaming source folder 2016-02-06 08:38:33 +01:00
Renamed from src/main.py (Browse further)