Commit graph

23 commits

Author SHA1 Message Date
Alex Pyrgiotis
4f66353639
Add dark mode logic in our dialogs
Make our dialogs set the OSColorMode CSS property, so that we can
properly style them.

Refs #528
2023-10-02 16:34:56 +03:00
Garrett Robinson
46f978e6f0
Detect OS color mode and set as property for stylesheets
Sets the detected OS color mode (dark/light) as a property on the
QApplication so it can be referenced in stylesheets to select style
rules suited to the OS color mode.
2023-09-28 17:20:34 +03:00
Alex Pyrgiotis
cfa0c01d8f
Sanitize filenames before logging them
Sanitize filenames in various places in the code, before we write them
to the user's terminal. Filenames, especially in Linux, can contain
virtually any character except for '\0' and '/', so it's important to
sanitize them.
2023-08-01 14:43:48 +03:00
Alex Pyrgiotis
d5ca6bb422
updater: Move "Ok" button to the right
Move the "Ok" button in the prompt that asks users if they want to
enable update checks to the right, to further reinforce that this is
the default action.
2023-07-28 19:57:46 +03:00
Alex Pyrgiotis
f6b5e1293d
gui: Add references to dialog buttons
Add references to dialog buttons, so that we can click on them from our
GUI tests.
2023-07-28 11:50:44 +03:00
Moon Sungjoon
494f498d17
Remove pipes module and use shlex instead
Thanks: https://github.com/tox-dev/tox/pull/2418/files

Closes #373
2023-07-24 18:13:00 +03:00
Alex Pyrgiotis
58c5fc846a
gui: Add Update Dialog
Add a dialog that we will show for update-related tasks. This dialog has
a different layout than the Alert class: it has a message, followed by
a widget that the user chooses (can be a text box or collapsible
element), and then one last message.
2023-07-24 14:22:28 +03:00
Alex Pyrgiotis
64ca90c92f
Add a Qt widget for creating collapsible sections
Add a Qt widget called "CollapsibleBox", in order to build sections that
you can hide/show with a single click. There is no native widget for
this functionality, so we borrow some code from a StackOverflow user:
https://stackoverflow.com/a/52617714
2023-07-24 14:22:27 +03:00
Alex Pyrgiotis
20a25f1dd4
Allow more types of dialogs
Factor out some parts of the Alert class into a more generic dialog
class. This class will be used for a new type of dialog that we will
introduce in a subsequent commit.

Note that this commit does not alter the functionality of the Alert
class.
2023-07-24 14:22:27 +03:00
Alex Pyrgiotis
8b846820d2
Update typing hints for Mypy 1.1.1
Due to a bump in our Python dependencies, we now install Mypy 1.1.1
instead of 0.982. This change triggered the following errors:

* Incompatible default for argument <a> (default has type
  None, argument has type <t>):

  Mypy further explains here that PEP 484 prohibits implicit Optional,
  so we need to make these types explicit Optional.

* Unused "type: ignore" comment, use narrower [method-assign] instead of
  [assignment]:

  Mypy has specialized some of its lints, meaning that we should switch
  to the newer variants.

Also, it detected several other small inconsistencies. We fix all of
these errors in this commit.
2023-03-27 15:19:43 +03:00
Alex Pyrgiotis
1f308e9cc5
Reformat code with Black 23
Due to a bump in our Python dependencies, we now install Black 23
instead of 22, which detects some of our files as badly formatted.
2023-03-27 15:17:23 +03:00
deeplow
81e9ccf30a
Add PySide6 dependency for Windows and MacOS
We're not yet adding them to Linux, since PySide6 is not yet available
in Linux distros' packages, whereas with Linux and macOS our packaging
process includes the shipped binaries.

Fixes #211
2023-01-30 11:42:18 +00:00
deeplow
ab2f9ead9a
Replace PySide2-stubs with types-PySide2
Replace PySide2-stubs with types-PySide2, both of which are projects
that provide PySide2 typing hints, for the following reasons:

1. types-PySide2 is more complete and allows us to ditch some 'type:
   ignore' comments for Mypy.
2. PySide2-stubs also brings PySide2 as a dependency, which cannot be
   installed in MacOS M1 machines.

Refs #177
2023-01-30 11:42:09 +00:00
deeplow
a339eff648
Add dummy conversion to GUI 2023-01-25 14:53:26 +00:00
deeplow
da0cb6b3c5
Add dummy isolation provider to CLI
When enabled, the conversion part does nothing but print some simulated
output. This can be useful for testing non-conversion code (e.g. GUI).

Activated with the hidden flag --unsafe-dummy-conversion.
2023-01-25 14:51:50 +00:00
deeplow
538df18709
Split isolation providers into their own .py files
Provides more clear code organization having each provider in their own
python file rather than a single one.
2023-01-25 14:19:05 +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
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
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
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
1e16eca392
remove unneeded imports: plistlib, grp, getpass
plistlib:
  - originaly added in commit 3be1d63330
  - no longer needed

grp, getpass:
  - originally added in commit ae7c919d8e
  - used for finding the 'docker' executable. No longer needed.
2022-11-18 13:09:01 +00:00
deeplow
649e427486
Make DangerzoneGui a subclass of DangerzoneCore
Simplify state sharing by having all dangerzone core logic in one
single class instead of two.
2022-10-27 13:44:16 +01:00
deeplow
dca290fb6b
Rename gui.common.GuiCommon class to gui.logic.DangerzoneGui
Rename the `gui.common` module and `gui.common.GuiCommon` class
to `gui.logic` and `gui.logic.DangerzoneGui` respectively. We keep as is
the original names of the variables that hold instances of this class,
since they will change in subsequent commits.

This change is part of the initial refactor to make the DangerzoneGui
class handle the GUI logic of the Dangerzone project.
2022-10-27 13:44:15 +01:00
Renamed from dangerzone/gui/common.py (Browse further)