Commit Graph

124 Commits

Author SHA1 Message Date
Adwait bde55188e4
Disabled "Collapse" button in "Flat" view (#1855)
Our `DiffResultDialog` and `ExtractDialog` show a context menu for items of the list/tree view. The collapse action in this menu only makes sense for the tree mode of the view. This commit therefore enables the option only for this view mode.

* src/vorta/views/extract_dialog.py
* src/vorta/views/diff_result.py

* tests/unit/test_diff.py : Add tests for the new behaviour.
* tests/unit/test_extract.py
2024-04-01 16:37:58 +02:00
Jeff Ramnani 634f984e78
Improve metered connection detection for macOS. By @jramnani (#1902)
* Add dependency for pyobjc-CoreWLAN on darwin

* Rename existing implementation with Android

The current implementation was tested with Android, but does not work
with iOS.

Move the existing implementation and include android in the name to make
room for adding a new iOS metered connection detection strategy.

* get_current_wifi works with objc

Switch from using command line tools to using the Objective-C Cocoa API
to get the Wi-Fi status information.

Cocoa has an API to specifically check whether a Wi-Fi connection is
using a Personal Hotspot on iOS.

I'm using a private method to get the Wi-Fi interface object in Cocoa.
The reason for this is that cleaning up mocks on PyObjC/ObjC objects is
much harder than mocking out methods on objects in our control. Using
test doubles also let's me check for different states the Wi-Fi network
could be in.

* get_known_wifis works on darwin

Use the networksetup command on macOS to get the list of the user's
Wi-Fi networks.

  networksetup -listpreferredwirelessnetworks bsd_device

It looks like this command and option has existed on macOS since at
least 2013.

Also add some type annotations around the PyObjC return values to help
the reader know what they're dealing with at each step.

* Add test for get_current_wifi when wifi is off

The user might have Wi-Fi turned off. Account for that use case.

* Add iOS Personal Hotspot support to is_network_metered

The DarwinNetworkManager can now determine if the user is connected to
a Personal Hotspot Wi-Fi network from iOS.

Account for whether the user has Wi-Fi turned on and off.

* Refactor to avoid deprecated API in Cocoa

According to Apple's developer documentation, creating CWInterface
objects directly are discouraged. Instead, they prefer to use
CWInterface objects created by CWWiFiClient.

This also happens to be more compliant with Apple's application sandbox.
Creating CWInterface objects directly accesses raw BSD sockets which is
not allowed in the sandbox.

More details here:
https://developer.apple.com/documentation/corewlan/cwinterface

* Add test case for blank Wi-Fi network name

I have one of these in my list of networks in Vorta. And this also
covers a missing branch in get_known_wifis.

* Move private method below public methods

This is to provide a little more clarity. Especially since this class is
subclassing another one.

* Account for when there is no wifi interface

When a Mac does not have a Wi-Fi interface, CWWiFiClient.interface() can
return None.

Update the type annotation to mark it as Optional, and account for the
null condition in the other methods.

* Fix type annotation error

The CI tests failed on python 3.8.

I used the wrong type annotation to describe a list of SystemWifiInfo's.

The tests now pass for me when I run 'make test-unit' using a python 3.8
interpreter.

* Fix linter issue with imports
2024-02-02 12:05:47 +00:00
TW 675010e401
Random cleanups by @ThomasWaldmann (#1879)
* fix PEP8 E721

do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`

* remove redundant parentheses

* fix SiteWorker.run for empty job queue

local variable job is not assigned if queue was empty
when calling .run(), but it is used in exception handler.

* remove unreachable code in parse_diff_lines

* bug fix for unreachable code in is_worker_running

the code intended to check if *any* worker is running for
any site was *unreachable*.

this caused false negative results for site=None.

* check_failed_response: remove outdated part of docstring

* pull request template: fix relative path to LICENSE.txt

* fix typos

* use logger.warning, .warn is deprecated
2024-01-09 08:06:48 +00:00
Manu b502fc3fd3
Exclude GUI. By @diivi (#1846) 2023-11-24 21:19:28 +00:00
Ted Lawson 071dd86ded
Profile sidebar and new setting interface. By @bigtedde (#1809) 2023-10-24 09:36:50 +01:00
Ted Lawson 60f9fc27b4
Unit test improvements and coverage increase. By @bigtedde (#1787) 2023-10-01 09:19:39 +01:00
Ted Lawson 15fa46ff85
Improve SSH key process. By @bigtedde (#1802) 2023-09-26 14:22:54 +01:00
Ted Lawson 4350f78de5
Prevent borg operation while renaming. By @bigtedde (#1791) 2023-09-11 20:29:07 +01:00
Ted Lawson e5c9b2245a
Improve import/export feature test coverage. By @bigtedde (#1774) 2023-08-17 18:05:42 +01:00
Ted Lawson 2caa093541
Source tab test improvements. By @bigtedde (#1772) 2023-08-17 11:09:00 +01:00
Ted Lawson 81920ea3f0
Repo test improvements. By @bigtedde (#1771) 2023-08-17 11:08:03 +01:00
Ted Lawson e85ec38c65
Add diff tests. By @bigtedde (#1770) 2023-08-17 11:06:36 +01:00
Ted Lawson ee71bcae9a
DRY tests, increase coverage. By @bigtedde (#1769) 2023-08-17 11:05:52 +01:00
Ted Lawson fb42614524
Add test utility functions (#1768) 2023-08-17 11:04:33 +01:00
Divyansh Singh 30c572250f
Inline archive renaming. By @diivi (#1734) 2023-08-15 12:38:51 +01:00
Ted Lawson b58ffb6aed
Setting for number format in archive tab. By @bigtedde (#1719) 2023-08-11 12:22:10 +01:00
jetchirag b015368fee
Integration Tests for Borg (#1716)
Move existing tests into subfolder `tests/unit`. Write integration tests that actually run the installed borg executable. Those tests can be found in `tests/integration`.  Those pytest fixtures that are the same for both kinds of tests remain in `tests/conftest.py`. The others can be found in `tests/integration/conftest.py` or `tests/unit/conftest.py`. This adds nox to the project and configures it to run the tests with different borg versions. This also updates the ci workflow to run the integration tests using nox.

* noxfile.py : Run pytest with a matrix of borg versions OR a specific borg version

* Makefile : Run using nox. Add phonies `test-unit` and `test-integration`.

* tests/conftest.py : Move some fixtures/functions to `tests/unit/conftest.py`.

* tests/test_*.py --> tests/unit/ : Move unittests and assets into subfolder

* tests/integration/ : Write integration tests.

* requirements.d/dev.txt: Add `nox` and `pkgconfig`. The latter is needed for installing new borg versions.

* .github/actions/setup/action.yml : Update to install pre-commit and nox when needed. The action now no longer installs Vorta.

* .github/actions/install-dependencies/action.yml : Install system deps of borg with this new composite action.

* .github/workflows/test.yml : Rename `test` ci to `test-unit` and update it for the new test setup.
                                              Implement `test-integration` ci.

Signed-off-by: Chirag Aggarwal <thechiragaggarwal@gmail.com>
2023-08-05 13:49:45 +00:00
jetchirag 25b4cc0b8b
Introduced password input widget (#1662)
Move existing code for password input widgets into common classes to increase maintainability and reusability alongside reducing redundancy. This implements a `PasswordLineEdit` that can show a red border when an invalid password is entered. It also features a button for showing/hiding the password entered. When combining two of these entries for setting a new password `PasswordInput` can be used from now on. It combines a form for entering and confirming a password with a label to show a message when there is an issue with the password. It also checks the entered password against some rules regarding its length. This PR replaces existing widgets for entering passwords with these two new widgets.

* src/vorta/views/partials/password_input.py : Implement common input widgets/classes

* src/vorta/views/repo_add_dialog.py : Use new widgets.
* src/vorta/assets/UI/repoadd.ui : ^^^
2023-07-28 07:39:10 +00:00
Divyansh Singh 92608f9eaa
Assign names to repos. By @diivi (#1665) 2023-06-24 20:57:46 +01:00
real-yfprojects 24e1dd5c56
Run pre-commit (with newly added ruff) on code base.
Includes all changes by `pre-commit --all-files` including the changes introduced by ruff.
2023-05-01 10:28:11 +02:00
i1sm3ky 7535f92ac8
PyQt6 Upgrade (#1685)
This puts Vorta on PyQt6 and starts a new main branch 0.9.

---------

Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
Co-authored-by: Manu <3916435+m3nu@users.noreply.github.com>
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
2023-04-17 11:17:01 +01:00
bigtedde a64493d254
Setting for Full Disk Access check. By @bigtedde (#1653) 2023-04-04 12:49:34 +01:00
Henry Spanka e3451ed49e
Handle ctime and mtime diff changes (#1675)
Borg v1.2.4 added new change types called `mtime` and `ctime` for the modification and the creation time of a file.
Our diff json parser doesn't support these changes yet.
The plain text parser doesn't need to be updated since it is only used for earlier versions of borg.
This also extends the tooltip in the diff view to show changes in `ctime` or `mtime` in a localised manner.

* src/vorta/views/diff_result.py (ChangeType): Add `CTIME` and `MTIME` linking to `MODIFIED`.

* src/vorta/views/diff_result.py (DiffData): Add fields `ctime_change` and `mtime_change`.

* src/vorta/views/diff_result.py (parse_diff_json): Parse the new change types.

* src/vorta/views/diff_result.py (DiffTree.data): Add time changes to tooltip in a human readable format.

* tests/test_diff.py : Update test data to include new change types. Add additional test cases for unittesting the new change types.
2023-04-03 10:16:09 +02:00
Divyansh Singh 3ebb078409
feat: add profile name to log messages (#1637)
* feat: add profile name to log messages

* update tests

* add profile name to all occurences of backup progress event emit

* update tests

* merge with logs link code

---------

Co-authored-by: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com>
2023-03-22 12:16:46 +01:00
yfprojects 618a1fe278
Add tooltips to settings. (#1521)
This adds tooltips to the settings as well as a 'info' button that shows the tooltip when hovering over it.

* Add tooltips to settings.

* src/vorta/store/models.py (SettingsModel): Add `tooltip` column.

* src/vorta/store/migrations.py (run_migrations): Create `tooltip` column.

* src/vorta/store/connection.py (init_db): Populate `tooltip` column. Increase `SCHEMA_VERSION`.

* src/vorta/views/misc_tab.py (MiscTab.populate): Set tooltip of checkbox widgets.

* src/vorta/store/settings.py : Add tooltips and update label of `override_mount_permissions`

* Add *help* button to settings.

* src/vorta/assets/icons/help-about.svg: Add info icon.

* src/vorta/views/partials/tooltip_button.py: Implement `ToolTipButton`.

* src/vorta/views/misc_tab.py: Add `ToolTipButton` for each setting with a tooltip.
	Add `set_icons` and connect it to palette change.

* tests/test_misc.py (test_autostart): Update test.

---------

Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
2023-02-25 10:10:43 +00:00
Roberto Previdi bcc126b634
Improve size column readability in archives tab (#1598)
Use one size unit for all archives. The unit is selected by a simple algorithm that picks the largest unit that can represent the smallest size with a given precision. Align all sizes in archive and source tab to the left.

* src/vorta/utils.py : Implement `find_best_size_formatting`. Add missing sizes to `sort_sizes`. Simplify `pretty_bytes` and add `fixed_unit` option for use with `find_best_size_formatting`. Implement `clamp` utility function. Add type hints and docstrings.

* src/vorta/views/archive_tab.py (ArchiveTab.populate_from_profile): Use `find_best_sizes_formatting`.

* src/vorta/views/source_tab.py (SizeItem.__init__): Set alignment to left.

* tests/test_utils.py : Add comprehensive tests for `pretty_bytes` and `find_best_sizes_formatting`.

Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
2023-02-21 21:01:49 +00:00
yfprojects c620c0d9ac
Handle empty path in `FileTreeModel.addItem`. (#1552) 2023-01-20 12:51:53 +00:00
yfprojects 66340bc2a8
Add support for `--paths-from-command` to extra borg arguments. (#1538)
Backups will run although no sources are specified if `--paths-from-command` is supplied.
Also arguments after `--` will be appended to the end of the command after all other arguments.
Closes #1537.

* src/vorta/borg/create.py

* tests/test_create.py : Add test for using `--path-from-commands`.

Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
2023-01-18 15:57:23 +00:00
Manu 6779baecff
Use new ssh://-style URL format as placeholder and in test (#1473) 2022-12-16 11:19:34 +01:00
real-yfprojects 2126ef769d Remove *unset* repository value from combobox when a repo is selected.
* src/vorta/views/repo_tab.py (init_repo_stats): Remove *unset* item from combobox.

* src/vorta/views/repo_tab.py (populate_from_profile): Move into `populate_repositories`.

* src/vorta/views/repo_tab.py (repo_unlink_action): Update unset condition. And repopulate repo combobox.

* src/vorta/views/repo_tab.py populate_repositories -> populate_from_profile
* src/vorta/views/main_window.py

* tests/test_repo.py : Fix tests.
2022-11-03 20:47:52 +01:00
yfprojects 93307d278d
Add default `unset` value to repo combobox. By @real-yfprojects (#1429)
First element with index 0 is always the 'unset' option with data `None`.

* src/vorta/views/repo_tab.py (RepoTab.set_repos): Add element.

* src/vorta/views/repo_tab.py (RepoTab.repo_unlink_action): Handle the first element as unset.

* src/vorta/views/repo_tab.py (RepoTab.copy_URL_action): Handle unset state.

* tests/test_repo.py (test_repo_unlink): Fix test.

Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
2022-10-13 13:12:20 +02:00
real-yfprojects ca497f8815 Run hooks on the code base.
This adds trailing lines to files,
removes trailing white space in all the other lines and unifies line endings.
Additionally it formats the test code with `black`.
2022-08-16 18:20:34 +02:00
Manu b6a24debb7 Apply automatic formatting 2022-08-15 15:23:55 +02:00
yfprojects 8a94457b8d
Add spaces after `assert` and enhance git py diff. By @real-yfprojects (#1385) 2022-08-13 20:21:16 +02:00
real-yfprojects 71af54f59b
Use new treemodel for extract dialog.
* src/vorta/views/extract_dialog.py: Add `ParseThread`, `ExtractTree` and `parse_json_lines`.

* src/vorta/views/extract_dialog.py (ExtractTree.__init__): Adjust signature.

* src/vorta/borg/list_archive.py (BorgListArchiveJob.prepare): Adjust format to
	include additional attributes.

* src/vorta/views/archive_tab.py (ArchiveTab): Parse extract data using `ParseThread` and
	open `ExtractDialog` afterwards.

* tests/test_archives.py (test_archive_extract): Update tests.

* src/vorta/borg/extract.py (BorgExtractJob.prepare): Adjust signature.
	Handling of the data isn't implemented yet.

* tests/test_extract.py
2022-07-25 16:15:45 +02:00
real-yfprojects 7003d69577
Update `diffresult.ui` with new features and prettyfy it.
* src/vorta/assets/UI/diffresult.ui : Replace `okButton` with `QDialogButtonBox`
	that has a `close` button.

* src/vorta/views/diff_result.py : Connect `buttonBox` instead of `okButton` to Dialog.

* src/vorta/assets/UI/diffresult.ui : Add title to `DiffResult` dialog and simplify file name display.

* src/vorta/assets/UI/diffresult.ui : Add comboBox to change display mode of tree view.

* src/vorta/views/diff_result.py : Connect comboBox to `DiffTree`.

* src/vorta/application.py : Remove `eventFilter` setup for palette changes.

* src/vorta/tray_menu.py : Connect directly to `app.paletteChanged`.
* src/vorta/views/archive_tab.py
* src/vorta/views/repo_tab.py
* src/vorta/views/schedule_tab.py
* src/vorta/views/source_tab.py

* src/vorta/assets/UI/diffresult.ui : Add buttons to keep folders on top when sorting and
	to expand and collapse all items.

* src/vorta/views/diff_result.py : Connect the added buttons.

* src/vorta/assets/icons/angle-up-solid.svg : Add icon for `bCollapseAll`.

* src/vorta/views/diff_result.py : Add context menu to `treeView` that allows expanding
	and copying of an item.

* src/vorta/views/diff_result.py : Add copy shortcut to `treeView`.
2022-07-25 16:13:28 +02:00
real-yfprojects c8ba273079
Use new treemodel for diff view.
Subclass `treemodel.FileTreeModel` for the purposes of the diff dialog.
Rewrite diff output parsing.
Add sorting through `QSortFilterProxyModel`.

* src/vorta/views/diff_result.py (DiffResult.__init__): Remove doubled if statement.

* src/vorta/views/diff_result.py : Rename `DiffResult` to `DiffResultDialog`.

* src/vorta/views/diff_result.py (DiffTree.__init__): Remove the use of `QVariant`.
	Since python has no type enforcement `QVariant` is not needed.

* src/vorta/views/diff_result.py (DiffTree): Subclass `treemodel.FileTreeModel` and add additional info tooltip.

* src/vorta/views/diff_result.py (parse_diff_json): Some changes for use with new model.

* src/vorta/views/diff_result.py (parse_diff_lines): Full regex based line parsing and
	other modifications to go with the new model.

* src/vorta/views/diff_result.py (FileType): Enum of possible file types.

* src/vorta/views/diff_result.py (ChangeType): Enum of possible change types.
	Currently all are mapped to `ADDED`, `MODIFIED` and `REMOVED`.

* src/vorta/views/diff_result.py (calc_size): Rename to `size_to_byte`.

* src/vorta/assets/UI/diffresult.ui : Move `alternatingRowColours` to the .ui file.

* src/vorta/views/diff_result.py (DiffResultDialog): Move `alternatingRowColours` to the .ui file.

* tests/test_diff.py : Fix tests for diff parser.

* src/vorta/views/diff_result.py : Connect to `sorted` of `DiffSortProxyModel`
	to reveal selected items in view.

* src/vorta/views/partials/treemodel.py : Add `FileTreeSortProxyModel` with abstract code.

* src/vorta/views/diff_result.py (DiffSortProxyModel): Implement `FileTreeSortProxyModel`.

* src/vorta/views/diff_result.py (DiffItem): This variable holds the type `FileSystemItem[DiffData]`.
2022-07-25 16:13:27 +02:00
real-yfprojects 3cd940455c
Implement fresh TreeModel for TreeViews.
* src/vorta/views/partials/treemodel.py
* tests/test_treemodel.py : Write tests.
2022-07-25 16:13:26 +02:00
yfprojects 56e5c5049f
Remove call to `QTranslator.language()` in `get_locale`. (#1316) 2022-05-25 19:42:54 +04:00
yfprojects 182d3fbe0d
Only schedule backup after a manual run, improve labels. @real-yfprojects (#1302) 2022-05-21 15:06:10 +04:00
yfprojects b57414cfc2
Better diff selection without extra dialog. By @real-yfprojects (#1235) 2022-05-05 13:21:54 +04:00
yfprojects 6eaed0a8e9
Add a button to mount full repository. By @real-yfprojects (#1257) 2022-04-16 09:30:31 +04:00
yfprojects fb5a24f66d
Improve UX and HIG-conformity. By @real-yfprojects (#1176)
* Remove fullstops in the labels of the settings.

* src/vorta/store/settings.py (get_misc_setting): Remove fullstops in the `label` fields of each setting.

* Fix *Add Profile*-Dialog.

* src/vorta/assets/UI/profileadd.ui (label_2): Rename to `profileExplainer`.

* src/vorta/assets/UI/profileadd.ui (profileExplainer): Remove unnecessary text and rephrase it in simpler terms.

* src/vorta/assets/UI/profileadd.ui (formLayout): Move into frame for better layout in dialog.

* src/vorta/assets/UI/profileadd.ui (Dialog): Make dialog modal.

* src/vorta/assets/UI/profileadd.ui : Modify spacing a bit and change all widgets to `expanding` mode.

* src/vorta/assets/UI/profileadd.ui (Dialog): Set title to `Add Profile`.

* src/vorta/assets/UI/profileadd.ui : Make `label_3` a buddy of `profileNameField`.

* Add colon after entry label in `Add Profile`-Dialog.

* src/vorta/assets/UI/profileadd.ui (label_3): Add colon at the end of label.

* Fix capitalization in schedule tab.

* src/vorta/assets/UI/scheduletab.ui (pruneCheckBox): Replace `Archive` by `archive`.

* Fix tooltips.

Ensure sentence capitalization.
Rephrase some tooltips that do not mention the action they provide a tip for. (There are still many to go.)
Remove fullstop from tooltips that aren't a sentence.
Add fullstop to tooltips that are a sentence.

* src/vorta/assets/UI/archivetab.ui
* src/vorta/assets/UI/mainwindow.ui
* src/vorta/assets/UI/repoadd.ui
* src/vorta/assets/UI/repotab.ui
* src/vorta/assets/UI/sourcetab.ui
* src/vorta/views/export_window.py
* src/vorta/views/import_window.py
* src/vorta/views/source_tab.py

* Replace `n't` by `not` in GUI strings.

* src/vorta/application.py
* src/vorta/assets/UI/repotab.ui
* src/vorta/assets/UI/scheduletab.ui
* src/vorta/assets/UI/sshadd.ui
* src/vorta/notifications.py
* src/vorta/views/main_window.py
* src/vorta/views/main_window.py
* src/vorta/views/repo_tab.py

* Shorten unlink button tooltip.

* src/vorta/assets/UI/repotab.ui (repoRemoveToolbutton): Shorten tooltip by only keeping the most valuable information needed to understand the feature.

* Fix entry being embedded in label text.

Sentences should not be constructed from text in several controls.
Sentences that run from one control to another will often not make sense when translated into other languages.

* src/vorta/assets/UI/archivetab.ui
* src/vorta/assets/UI/scheduletab.ui

* Rewrite tooltips to make them HIG conform.

The KDE HIG was used.

* src/vorta/assets/UI/exportwindow.ui
* src/vorta/assets/UI/importwindow.ui
* src/vorta/assets/UI/mainwindow.ui
* src/vorta/assets/UI/repoadd.ui
* src/vorta/assets/UI/repotab.ui
* src/vorta/assets/UI/sourcetab.ui
* src/vorta/views/export_window.py

* src/vorta/views/import_window.py (ImportWindow.init_overwrite_profile_checkbox): Make tooltip static as the HIG suggests.

* src/vorta/views/main_window.py

* Replace `...` with unicode ellipses `…` (U+2028) in GUI text.

* src/vorta/borg/break_lock.py
* src/vorta/borg/check.py
* src/vorta/borg/create.py
* src/vorta/borg/delete.py
* src/vorta/borg/diff.py
* src/vorta/borg/extract.py
* src/vorta/borg/info_archive.py
* src/vorta/borg/info_repo.py
* src/vorta/borg/init.py
* src/vorta/borg/list_archive.py
* src/vorta/borg/list_archive.py
* src/vorta/borg/list_repo.py

* Clean prune tab in `archivetab.ui`.

* src/vorta/assets/UI/archivetab.ui

* Prettify `repotab`.

* src/vorta/assets/UI/repotab.ui

* Fix tooltips for pruning in `archivetab.ui`.

* src/vorta/assets/UI/archivetab.ui

* Use affirmative phrase in checkbox for metered networks.

* src/vorta/assets/UI/scheduletab.ui (dontRunOnMeteredNetworksCheckbox): Rename to `meteredNetworksCheckBox`.

* src/vorta/assets/UI/scheduletab.ui (meteredNetworksCheckBox): Change text into affirmative phrase.

* src/vorta/views/schedule_tab.py : Invert values for `meteredNetworksCheckBox`.

* Add label in shell commands pane in `scheduletab` and fix placeholders.

Placeholders shouldn't be a replacement for a label.

* src/vorta/assets/UI/scheduletab.ui

* Group settings widgets in `misctab`.

* src/vorta/assets/UI/misctab.ui (checkboxLayout): Replace with frame `frameSettings` containing a form layout.

* src/vorta/utils.py (search): Added. Searches for a key inside an iterable
	applying a given function before comparison.

* src/vorta/store/models.py (SettingsModel): Add field `group` to assign settings to a group.

* src/vorta/store/migrations.py (run_migrations): Add new schema version `19` and
	implement migration adding the `group` field.

* src/vorta/store/connection.py (SCHEMA_VERSION): Update to `19`.

* src/vorta/store/settings.py (get_misc_settings): Add and assign settings groups.

* src/vorta/store/connection.py (init_db): Update group and type of settings if needed.

* src/vorta/views/misc_tab.py (Imports): Import `search` from `..utils`.

* src/vorta/views/misc_tab.py : Instanciate logger.

* src/vorta/views/misc_tab.py (MiscTab.__init__): Create a checkboxLayout for `frameSettings`.

* src/vorta/views/misc_tab.py (populate): Add settings widgets in groups with labels in spacer in between.

* Fix tests for `misctab`.

* tests/test_misc.py

* Fix margins.

* src/vorta/assets/UI/archivetab.ui
* src/vorta/assets/UI/misctab.ui
* src/vorta/assets/UI/repotab.ui
* src/vorta/assets/UI/scheduletab.ui
* src/vorta/assets/UI/sourcetab.ui

* Morph buttons in `sourcetab` into toolbuttons with icons.

Adds gradient buttons along the way. Fixes #933.

* src/vorta/assets/UI/sourcetab.ui : Change layout and buttons.
	Merge buttons with adding capabilities into one toolbutton (with menu).

* src/vorta/assets/UI/sourcetab.ui : Rename `sourceRemove` to `removeButton`.
	Rename `sourceUpdate` to `updateButton`.
	Add `addButton`.

* src/vorta/assets/icons/minus.svg : Add minus sign icon from *fontawesome* v6.0.

* src/vorta/views/source_tab.py (SourceTab.set_icons): Added.

* src/vorta/views/source_tab.py (SourceTab.__init__): Create Menu for the `addButton` with
	actions to add files and folders and to paste.

* src/vorta/application.py (VortaApp.eventFilter): Call `set_icons` of `sourceTab` as well.

* Fix tests for `sourcetab`.

* tests/test_source.py

* Add paste icon to paste action in `sourcetab`.

* src/vorta/assets/icons/paste.svg : Added from fontawesome (paste-solid, v6.0)

* src/vorta/views/source_tab.py (SourceTab.__init__): Save paste action in `pasteAction`.

* src/vorta/views/source_tab.py (SourceTab.set_icons): Set icon for `pasteAction`.

* Add icons to open actions in `sourcetab`.

* src/vorta/assets/icons/file.svg : Added `file-solid` from fontawesome, v6.0

* src/vorta/assets/icons/folder.svg : Added `folder-solid` from fontawesome, v6.0

* src/vorta/views/source_tab.py (SourceTab.__init__): Save files and folders action
	to `addFilesAction` and `addFoldersAction`.

* src/vorta/views/source_tab.py (SourceTab.set_icons): Set icons for `addFilesAction` and `addFolderAction`.

* Fix icon size of `file.svg`.

* src/vorta/assets/icons/file.svg

* Set fill of added svgs to `#000000`.

* src/vorta/assets/icons/file.svg
* src/vorta/assets/icons/folder.svg
* src/vorta/assets/icons/minus.svg
* src/vorta/assets/icons/paste.svg

* Improve UX and consistency within the app for `scheduletab`.

* src/vorta/assets/UI/scheduletab.ui : Arrange schedule pane in a form layout.

* src/vorta/views/schedule_tab.py (ScheduleTab.__init__): Connect enabled state of entries
	to radiobuttons and checkboxes.

* Workaround scheduletab tests being broken in github actions.

For some unknown reason clicking the `scheduleFixedRadio` won't work
when running using github action on ubuntu.

* tests/test_schedule.py

* Fix labels and spacing in `scheduletab`.

* src/vorta/assets/UI/scheduletab.ui

* Make archive operations more accessible and rename actions of `ArchiveTab`.

* src/vorta/views/archive_tab.py (ArchiveTab): Rename `list_action` to `refresh_archive_list`.
	Rename `refresh_archive_action` to `refresh_archive_info`.
	Rename `refresh_archive_result` to `info_result`.
	Rename `list_archive_action` to `extract_action`.
	Rename `list_archive_result` to `extract_list_result`.

* src/vorta/views/main_window.py : Apply renaming.

* src/vorta/assets/UI/archivetab.ui : Create own buttons for the archive actions.
	Remove `archiveActionButton`. And some other layout changes.

* src/vorta/assets/UI/archivetab.ui : Rename `pruneButton` to `bPrune`.
	Rename `checkButton` to `bCheck`.
	Rename `diffButton` to `bDiff`.
	Rename `listButton` to `bList`.

* tests/test_archives.py : Apply renaming.

* src/vorta/views/archive_tab.py : Connect new action buttons.

* src/vorta/views/archive_tab.py : Remove `archiveActionButton`.

* tests/test_archives.py : Fix tests.

* Enable and disable archive actions depending on selection.

* src/vorta/assets/UI/archivetab.ui : Put archive actions into a frame.

* src/vorta/views/archive_tab.py (ArchiveTab): Added `on_selection_change` that
	enables/disables the frame depending on the selection count.

* src/vorta/views/archive_tab.py (ArchiveTab.populate_from_profile): Clear selection.

* src/vorta/views/archive_tab.py (ArchiveTab.__toggle_all_buttons): Add `fArchiveActions`.
	Call `on_selection_change` at the end.

* Fix tests for `archivetab`.

* tests/test_archives.py

* Replace line by spacer in repotab.

* src/vorta/assets/UI/repotab.ui

* Show labels for archive action buttons.

* src/vorta/assets/UI/archivetab.ui

* Add tooltips and ellipses to archivetab.

* src/vorta/assets/UI/archivetab.ui
* src/vorta/views/archive_tab.py

* Fix tooltips.

* src/vorta/assets/UI/sourcetab.ui : Add tooltips.

* src/vorta/views/archive_tab.py (ArchiveTab.on_selection_change): Add reason for disabled state dynamically to archive action buttons.

* Add context menu to source view.

* src/vorta/views/source_tab.py (SourceTab): Implement `sourceitem_contextmenu` and `source_copy`.
	Set context menu policiy of `sourceFilesWidget` to `CustomContextMenu`.

* src/vorta/assets/UI/sourcetab.ui: Change size hints.

* Add context menu to archive view.

* src/vorta/views/archive_tab.py (ArchiveTab): Set context menu policy of `archiveTable` to `CustomContextMenu`.
	Implement `archiveitem_contextmenu`.

* Replace `Type` column in sources view by icon.

* src/vorta/views/source_tab.py (SourceColumn): Remove `Type` column.

* src/vorta/views/source_tab.py (SourceTab.set_icons): Set icon for each item in source view.

* src/vorta/views/source_tab.py (SourceTab.set_path_info): Set icon instead of `Type` column.

* src/vorta/assets/UI/sourcetab.ui : Remove `Type` column.

* Fix initial sort indicator of source view.

* src/vorta/views/source_tab.py

* Fix adding items while sorting enabled.

* src/vorta/views/source_tab.py

* Remove status bar and remove fix size hint for log text label.

* src/vorta/assets/UI/mainwindow.ui

* src/vorta/views/main_window.py (MainWindow.__init__): Set minimum height of `logText` to
	two times the height of a line calculated by `QFontMetrics`.

* Resize main window height to `670`.

* src/vorta/assets/UI/mainwindow.ui

* Replace `QToolbutton` by `QPushbutton`.

* src/vorta/assets/UI/archivetab.ui
* src/vorta/assets/UI/repotab.ui
* src/vorta/assets/UI/sourcetab.ui
* src/vorta/views/source_tab.py

* Fix flake8

* Improve label of entry for `borg create` extra arguments.

* src/vorta/assets/UI/scheduletab.ui

* Unify label font size in `repotab`.

* src/vorta/assets/UI/repotab.ui

* Morph `QPushButton`s into `QToolButton`s.

Some exceptions were made, especially in the dialog windows.

* src/vorta/assets/UI/archivetab.ui
* src/vorta/assets/UI/mainwindow.ui
* src/vorta/assets/UI/repotab.ui
* src/vorta/assets/UI/sourcetab.ui

* Add copy capabilities to archive view and a copy shortcut to it and to source tab.

* src/vorta/views/source_tab.py (SourceTab): Add QShortcut for copying.

* src/vorta/views/archive_tab.py (ArchiveTab.archiveitem_contextmenu): Add copy action.

* src/vorta/views/archive_tab.py (ArchiveTab): Add QShortcut for copying.

* Move actions in comboBoxes to buttons.

* src/vorta/assets/UI/repotab.ui : Add `bAddSSHKey` and `bAddRepo`.

* src/vorta/views/repo_tab.py : Move code out of `ssh_select_action` and `repo_select_action` into `add_existing_repo`, `new_repo` and `create_ssh_key`.

* src/vorta/views/repo_tab.py

* Make tooltip of `storePassword` checkbox more fluent.

* src/vorta/assets/UI/exportwindow.ui

* Introduce `QDialogButtonBox` to modal dialogs in vorta.

* src/vorta/assets/UI/extractdialog.ui
* src/vorta/views/extract_dialog.py

* src/vorta/assets/UI/repoadd.ui
* src/vorta/views/repo_add_dialog.py

* src/vorta/assets/UI/sshadd.ui
* src/vorta/views/ssh_dialog.py

* Move some options in scheduletab to the side.

This results in two columns of options and fixes vertical scrolling.

* src/vorta/assets/UI/scheduletab.ui

* Changes for macOS layout

* Set `sizeAdjustPolicy` of comboBoxes to `AdustToContents`.

* src/vorta/assets/UI/mainwindow.ui

* src/vorta/assets/UI/repotab.ui

* Fix some icons, translations strings and link

* Lint

Co-authored-by: real-yfprojects <real-yfprojects@users.noreply.github.com>
Co-authored-by: Manu <3916435+m3nu@users.noreply.github.com>
Co-authored-by: Manu <manu@snapdragon.cc>
2022-03-24 10:27:07 +04:00
Manu c4cd054033
Support new `borg compact` command (#1205) 2022-02-21 21:23:56 +04:00
yfprojects 4bbd091c59
Rewrite scheduler logic. By @real-yfprojects (#1204)
The scheduler now will react to a new fixed time also if 24h haven't passed yet.
All in all the code is supposed to be cleaner and easier understandable.
The logging was slightly modified.
2022-02-20 10:04:12 +04:00
yfprojects de971d6cd3
Update next backup time label. By @real-yfprojects (#1180) 2022-02-09 14:55:26 +04:00
Manu 4d399fe2ab
Remove unnecessary qtbot.wait (#1172) 2022-01-24 17:05:57 +04:00
Manu 0390a666e7
Minor/test fixes (#1150)
* Reorder asserts in test_ssh_dialog
* Prevent borg-check from running during tests
2021-12-24 14:26:21 +04:00
Manu 4c3e97a76c
Refactor: Split up vorta/models.py (#1112) 2021-11-17 13:14:11 +04:00
Manu 0c77fdde97
Address DB Locking issues (#1109) 2021-11-16 10:32:40 +04:00