Commit graph

15 commits

Author SHA1 Message Date
deeplow
bbd0d98f50
Implement 'move to subdir' logic & store in settings
Fixes #251 by implementing the logic for archiving a document after
conversion into a default sub-directory.
2022-11-24 11:16:30 +00:00
deeplow
e64954acfa
Validate safe-extension (-safe.pdf) before converting
Avoid conversion issues when saving the output file when it is set
wrongly. Inform the user with a red box saying "must end in .pdf"
and prevent the user from clicking "convert" before that is fixed.

Combines the validation logic with the already-existing 'update_ui()'
2022-11-21 12:38:09 +00:00
deeplow
cb8130042e
Rename global_common.GlobalCommon class to logic.Dangerzone
Rename the `global_common` module and `global_common.GlobalCommon` class
to `logic` and `logic.Dangerzone` respectively. Also rename variables
that hold instances of this class.

This change is part of the initial refactor to make the Dangerzone class
handle the core logic of the Dangerzone project.
2022-10-27 13:44:13 +01:00
deeplow
7b46d1e3cf
fix spacing (black lint tool) 2022-08-22 11:12:14 +01:00
deeplow
e76132a2f0
add typed hints to Settings dictionary
Originally tied to implment following PEP 589 [1] – TypedDict: Type
Hints for Dictionaries with a Fixed Set of Keys for the Settings
dict.

But this quickly turned out to very challenging without redoing the
code. So we opted instead for using the Any keyword.

[1]: https://peps.python.org/pep-0589/
2022-08-22 11:09:13 +01:00
deeplow
b34f7381b4
fix GlobalCommon ref. that was supposed to be Common
The type hints actually warned about this inconsistency.
2022-08-22 11:09:09 +01:00
deeplow
d579a47a84
add type hints (1st pass: non problematic cases) 2022-08-22 10:33:23 +01:00
deeplow
4d8e4c53e3
sort imports with isort linter 2022-08-22 10:15:26 +01:00
deeplow
67d91be81a
replace prints with logging
fixes #144: printing non-ascii characters in a macOS application
opened directly from finder would sometimes lead to an error
message in /var/log/system.log similar to this:

  Failed to execute script 'dangerzone' due to unhandled exception:
  'ascii' codec can't encode character '\u201c' in position 1:
  ordinal not in range(128)
2022-08-18 12:07:23 +01:00
Micah Lee
e81e6ccc6c
Remove everything related to updating the container image 2021-07-01 15:56:12 -07:00
Micah Lee
6ff68f88ea
Refactor dangerzone to move GUI code into its own module 2021-06-09 15:24:03 -07:00
Micah Lee
cf367adcfa
This creates a separate script dangerzone-container which is a wrapper for running the container. This lets us run dangerzone as unprivileged, but dangerzone-container as privileged, to avoid adding the user to the dangerzone group. 2020-03-13 16:49:53 -07:00
Micah Lee
dd295271f5
Make work in macOS using docker instead of podman 2020-01-09 13:09:17 -08:00
Micah Lee
bdcd61b964
Clicking start starts running the tasks 2020-01-07 16:09:08 -08:00
Micah Lee
c9e32ef82d
Allow selecting a document, then show settings 2020-01-07 15:32:21 -08:00