Commit graph

655 commits

Author SHA1 Message Date
Erik Moeller
ed41dd7646
Merge pull request #281 from freedomofpress/fix-kudu
Use the proper codename for Ubuntu Kinetic Kudu
2022-12-01 11:24:53 -08:00
Alex Pyrgiotis
8658753d57
Use the proper codename for Ubuntu Kinetic Kudu
In a previous commit, we used the wrong codename for Ubuntu 22.10
"Kinetic Kudu". Instead of "kudu", we should use "kinetic".
2022-12-01 21:18:40 +02:00
deeplow
361001579e
Bump version to v0.4.0 2022-12-01 15:58:01 +00:00
Alex Pyrgiotis
03823bbd29
Update the QA section in RELEASE.md
Update the QA section in the RELEASE.md, based on the latest changes on
our main branch.
2022-12-01 17:53:48 +02:00
deeplow
eb38c39557
Changelog: add exit confirmation feature 2022-12-01 15:24:19 +00:00
deeplow
aa1476d59b
Replace exit() with sys.exit() to work on Windows
Windows was complaining that 'exit' is not defined.
2022-12-01 15:03:34 +00:00
deeplow
766c455929
Windows: persist "Open safe documents after converting" setting
Now that safe PDFs can open on Windows right after conversion
(implemented in commit 5b2fefd), we need to save/load the "Open safe
documents after converting" setting.
2022-12-01 15:02:31 +00:00
deeplow
99f23216d6
Fix limited PATH in produced .exe and .msi
Cx-Freeze 6.13.0 limited the PATH of the build executables, making it so
Dangerzone couldn't find Docker through shutil.which().

More information on the issue is available at:
https://github.com/marcelotduarte/cx_Freeze/issues/1674
2022-12-01 14:58:30 +00:00
deeplow
5761255b56
Fix Python version in Windows build scripts
Windows python build scripts were still referencing the old python 3.9
version, whereas 3.10 is the currently used one in the dev environment.
2022-12-01 14:58:29 +00:00
deeplow
642d86899b
Fix timeout message: replace pdfseparate with pdftk 2022-12-01 14:51:52 +00:00
Alex Pyrgiotis
1ad6b59bb1
Support Ubuntu 22.10 "Kinetic Kudu"
Add support for the newly released Ubuntu 22.10 "Kinetic Kudu".

Closes #265
2022-12-01 01:05:00 +02:00
deeplow
cb75cfd958
Update changelog with 'open with' functionality 2022-11-30 12:51:02 +00:00
deeplow
7e42994f81
Prevent user from adding files from multiple dirs
Allowing this would lead to several UI edge-cases related to where the
files would be saved. Avoiding this is the easiest solution at the
moment.

In the future we should consider other options.
2022-11-30 12:49:20 +00:00
deeplow
06797ab626
Prevent adding duplicate documents
It was possible that users would add duplicate documents via 'open with
Dangerzone'. This would lead to unexpected situations and preventing it
both in the CLI and the GUI solves those issues.
2022-11-30 12:49:18 +00:00
deeplow
65d0b7a0d0
Allow adding more docs via 'open_with' while in settings
Handle the case where a user has already added some documents (either
through 'open with' or via Dangerzone 'select documents' button) and
then they want to add some more via the 'open_with' dialog.

It updates the settings to reflect the newly added documents and blocks
the user from adding them if a conversion is already in progress.
2022-11-30 12:49:17 +00:00
deeplow
cb68ba7d1c
Centralize 'document adding' in ContentWidget
Makes the ContentWidget a choke-point, where we can allow or prevent
adding more documents and where we can ensure that newly selected
documents are added immediately to the DangerzoneGui class.

Logically, the application flow should not change in any way.
2022-11-30 12:49:16 +00:00
deeplow
ce5558b5a2
Fix "open with" on macOS for single files
Fixes partially #268
2022-11-30 12:49:14 +00:00
deeplow
af5f7c70d3
Quit dangerzone on macOS when window is closed
Closing windows on macOS would not actually close Dangerzone. Now that
it is a single-window program, it makes sense for it to close
immediately.

Fixes #271
2022-11-29 16:01:27 +00:00
deeplow
466d83129e
Increase minimum window width for macOS
The save group box would get partially trimmed when running in macOS
this appears to be due to differences in rendering fonts and widget
sizes.

Refs #270
2022-11-29 15:56:09 +00:00
deeplow
d582e25606
Changelog: update for 0.4.0 release 2022-11-25 08:27:37 +00:00
deeplow
49b7736cb4
GUI: disable option if archive dir is not writable
Disable the option to move original documents to 'unsafe' subdirectory
when said directory is not writable.
2022-11-24 11:16:38 +00:00
deeplow
c36f73ac8d
Tests: add cli --archive param test 2022-11-24 11:16:37 +00:00
deeplow
b4849995e3
Add CLI support for archiving original / unsafe PDFs 2022-11-24 11:16:35 +00:00
deeplow
c6a0b59379
Add unit tests to cover archive-related methods
Additionally this adds the pytest-mock dev dependency to be able to mock
certain methods.
2022-11-24 11:16:34 +00:00
deeplow
f54446f2fd
Ensure archive directory can be created
Verifies that the archive directory can be created as soon as the
document is set to be archived.
2022-11-24 11:16:31 +00:00
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
d3e125de55
Remove mypy ignore comments
For some reason, mypy was complaining that these statements were no
longer unreachable, but now it no longer is.
2022-11-24 11:16:28 +00:00
deeplow
8a31b085ee
Adjust window / settings widget proportions to fit
With the added new widgets not all widgets in the settings fit
perfectly.
2022-11-24 11:15:02 +00:00
deeplow
994e70c17a
Switch save widgets order
Move the 'safe_extension' widget to the top of the settings and the save
location widget to the bottom.
2022-11-24 09:32:15 +00:00
deeplow
a88f8cc44b
Release: add to instructions tooting release 2022-11-24 09:28:08 +00:00
deeplow
bc82163bc4
Inform user # of selected docs when in settings
Reminds the users of the number of documents selected when they are in
the settings.
2022-11-24 09:05:24 +00:00
Alex Pyrgiotis
0a993a682f
Add QA section in our release notes
Add a QA section in our release notes, which describes the list of
manual checks a developer needs to make before a release, to ensure that
we have no regressions.

Closes #246
2022-11-23 20:17:03 +02:00
Alex Pyrgiotis
cc4e39b3fc
Add a bad PDF file in our test samples
Add a bad PDF file in our test samples, which we can use for testing
purposes.
2022-11-23 20:16:50 +02:00
Alex Pyrgiotis
57fdf06f0f
Bump global timeout to two minutes
Bump the global timeout used for various steps from 1 minute to 2
minutes. The reason is that we've seen several reports of operations
failing due to timeout reasons, that were otherwise legitimately
running.

Also, bump the timeout used for compression, which has been reported as
problematic as well.

Refs #146
Refs #149
2022-11-23 18:13:41 +02:00
deeplow
1f18f77b64
Disable parallel conversions
Temporarily limit conversions to one at a time until timeout limitations
are resolved: https://github.com/freedomofpress/dangerzone/issues/257
2022-11-23 15:20:28 +00:00
deeplow
5b2fefd150
Open PDFs on Windows (instead of explorer.exe)
Homogenize GUI by having on Windows the option of opening documents after
conversion. This removes the need for windows-specific GTK widgets.
2022-11-21 12:39:29 +00:00
Alex Pyrgiotis
21dc5b29df
Remove duplicate doc ID logs 2022-11-21 12:39:27 +00:00
Alex Pyrgiotis
699258543a
Fail if a provided suffix cannot be applied
If a user has provided an output filename for a document, then we should
no longer accept suffixes. The reason is that we can't do something
meaningful with it, as we can't alter the provided output filename.

The proper behavior is to reject this action with an exception. Note
that this acts more of a safeguard, since (currently) there is no path
where a user may add a suffix to a document that already has an output
filename.
2022-11-21 12:39:25 +00:00
deeplow
8b3739707d
Rename document_selected to documents_selected 2022-11-21 12:39:24 +00:00
deeplow
aba699a238
Pass Documents instead of file list in document_selected
In the various UI widgets we need to know which documents were just
added. Previously, we passed the filenames around via a PySides signal.
2022-11-21 12:39:23 +00:00
deeplow
2aa329d524
Changelog: add multi-document support
Fixes #77
2022-11-21 12:39:21 +00:00
deeplow
39621fe51d
Limit n. parallel conversions in GUI
Limit the number of simultaneous document conversions to prevent
consuming too much CPU.
2022-11-21 12:39:20 +00:00
deeplow
45a865aae3
Prompt on exit: abort conversion?
Foot-shooting prevention by prompting the user if they are sure
they want to quit Dangerzone with ongoing conversions in progress.
2022-11-21 12:39:16 +00:00
deeplow
3c1e8a232d
Get OCR settings before conversion starts
In preparation for adding a limit on how many convert threads exist, we
are simplifying its logic. Getting ocr_lang doesn't seem to belong to
the thread.
2022-11-21 12:38:42 +00:00
deeplow
95a0536c61
Change start button text to plural when multiple docs 2022-11-21 12:38:27 +00:00
deeplow
06bd117d52
Align document labels
Aligns document labels following the design specified in issue #117.
It did not specify how it would change with window resize, so it
currently expands the progress bar / error message width and keeps the
document name fixed in size.
2022-11-21 12:38:25 +00:00
deeplow
bbc70df43b
Match styling of document-labels to design reference
- removes bold
- removes font size (default works)
- removes 'suspicious: ' label before the document name
2022-11-21 12:38:24 +00:00
deeplow
6707cbbc4a
Add conversion status icon next to each document
Allows the user to see the staus of each document at a gance.
2022-11-21 12:38:23 +00:00
deeplow
9641a61bb3
Typing: ignore 'unreachable' lint warning
Mypy complains about a line being unreachable. This is probably a false
positive. It must assume the code is not using a framework and thus it
can't when a PySide 'connect()' is being called.
2022-11-21 12:38:21 +00:00
deeplow
ce4efc0c25
Lint mypy: ignore type inconsistency w/ official docs
The official docs state the setProperty() method is (str, Any) but
mypy-pyside says it is (bytes, Any). So we ignore it.

[1]: https://doc.qt.io/qtforpython-5/PySide2/QtCore/QObject.html#PySide2.QtCore.PySide2.QtCore.QObject.setProperty
2022-11-21 12:38:20 +00:00