8000 feat: Persistent icon style in toolbar by s4moore · Pull Request #2002 · bit-team/backintime · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Persistent icon style in toolbar #2002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 18, 2025

Conversation

s4moore
Copy link
Contributor
@s4moore s4moore commented Jan 11, 2025

Added toolbar_button_style property to the state data so the selected main toolbar icon styling persists between sessions.

@buhtz buhtz self-assigned this Jan 11, 2025
@buhtz buhtz added the PR: Modifications requested Maintenance team requested modifications and waiting for their implementation label Jan 11, 2025
@buhtz buhtz added this to the 1.6.0 (upcoming release) milestone Jan 11, 2025
@buhtz buhtz changed the title add save state data for main menu toolbar icon state [skip ci] feat: Persistent icon style in toolbar Jan 11, 2025
s4moore and others added 3 commits January 11, 2025 13:27
Co-authored-by: Christian Buhtz <c.buhtz@posteo.jp>
Co-authored-by: Christian Buhtz <c.buhtz@posteo.jp>
@buhtz buhtz added PR: Merge after creative-break Merge after creative-break (min. 1 week) and removed PR: Modifications requested Maintenance team requested modifications and waiting for their implementation labels Jan 11, 2025
Copy link
Member
@buhtz buhtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Samuel,
thank you very much for this contribution. I appreciate that.

Have you installed one of that linters on your system? ruff, pylint or flake8?
I recommend to install all of them and then run the unit tests. The tests also run that linters and you will find some minor warnings related to code styling.

You can also try to add a changelog entry.

@buhtz
Copy link
Member
buhtz commented Jan 12, 2025

I have a question related to the state file in general and not to this PR.

Might it be appropriate to move the state file code into the "qt" part of the code base? As I can see all variables in this file are somehow related to the GUI and not relevant for the command line version of BIT.

Moving it to the GUI would solve two other problems: 1) Saving it at application exit without using "atexit" module but exit handler of Qt and 2) risk to lose state data by overwriting the file from different BIT instances running at the same time.

What do you think?

@s4moore
Copy link
Contributor Author
s4moore commented Jan 12, 2025

Regarding the linters, I have started using ruff but need to get into the habit of checking every time. I will start to use flake8 and pylint as well as per your suggestion. Do you have a preferred configuration to share or should I just set them up myself. I assume that with ruff, you're ignoring E: 402, 712, 713, 714, 721, 722, 731, 741, 751; F: 401, 403, 405, 811, 821, 841, is that right? (I'm quite new to linters (and contributing in general) so any suggestions/advice would be appreciated)

Your suggestion to move the state data into the qt code makes sense to me. The only issue I could think of would be if two gui instances were open at once but that seems quite unlikely and is not handled in the current setup anyway, I guess it's much more likely that a user might exit a gui instance while a cron job is running so it seems like a logical step to move it. Do yout want me to work on that? Otherwise I was thinking of working on #1018 (unless there's something else you suggest)?

@s4moore
Copy link
Contributor Author
s4moore commented Jan 12, 2025

I've added an entry to the changleog, please let me know if any issues with format / wording.

@buhtz
Copy link
Member
buhtz commented Jan 12, 2025

Regarding the linters, I have started using ruff
[..]
a preferred configuration
[..]

Please see common/test/test_lint.py and qt/test/test_lint.py. It might be unusual but we do have "unit tests" that do execute the linters (with our preferred configuration) and fail if the linters are not satisfied.

I recommend to stick to the unit tests with running $ pytest test/test_lint.py. Using linters the regular way, with their default config and/or integrated in your IDE, won't work well with BIT. The code base of BIT is extrem smelly and will produce thousands of linter errors.

As you can see in the unit tests. The current approach is to use the linters with all warnings disabled and only some of them enabled. See Issue #1755 for details about how we reduce the amount of linter errors step by step. We also have tests using a linter in its default configuration (all warnings enabled) but only for an exclusive set of files.

Let me give you a short overview via looking into test_lint.py.

  1. test010_ruff_default_ruleset() - Default ruff plus some extended rules on an exclusive list of files (see module variable full_test_files)
  2. test020_flake8_default_ruleset() - Same as the previous test but using flake8.
  3. test030_pylint_default_ruleset() - Same as the previous test but using pylint.
  4. test050_pylint_exclusive_ruleset() - PyLint with all warnings disabled (--disable=all), then some warnings enabled (--enable=, see variable err_codes), running on all py files.

The numbers in the method names are there to set the execution order of them. Ruff is very fast and will cover a big amount of possible errors, so use it as first. Next use flake8 to cover errors not caught by Ruff. At the end use PyLint which is extrem slow but also extrem pedantic and covering much more then code styling but also common bad coding habits and other code smells.

Your suggestion to move the state data into the qt code makes sense to me. [..] Do yout want me to work on that?

Thanks for your thought. I'll work on that.

I was thinking of working on #1018 (unless there's something else you suggest)?

Looks OK to me.

@buhtz buhtz merged commit 9f7891e into bit-team:dev Jan 18, 2025
1 check passed
buhtz added a commit that referenced this pull request Feb 13, 2025
# Summary
This is a release candidate. Please report if you use it even if there are no new problems.

This version is set to be released with Debian 13 (Trixie) this early summer and will remain available for the long lifetime of that Debian version.
EncFS, used for encrypted profiles, has been marked as deprecated and is  schedule for removal in 2026. The Smart & Auto remove GUI has been reorganized and renamed into "Remove & Retention", with improvements to the user manual section. Its behavior remains unchange. An offse
8000
t minute can now be configured for hourly schedule options. Some config file fields have been moved to a newly introduced state file. License and copyright information is now provided in machine-readable SPDX format, following the REUSE standard.

# Contributors
This version received extensive support from contributors (in alphabetical order):

 - @bremnere
 - David Gibbs @fallingrock
 - graysky @graysky2
 - Samuel More @mooresamuel
 - Iván Rodríguez @ivanrdgz03
 - Peter Sevens @sevens
 - David Wales @daviewales
 - Dylan Wilson @dylan-wilson-usq
 - Also not to be forgotten are the many people who supported the project by testing it, providing feedback, reporting issues, and analyzing problems.

# Known major issues open
- qt_probing.py may hang with high CPU usage when running Back In Time as root via cron (#1592)
- File permissions handling and therefore possible non-differential backups (#988 & #994)

# Changelog
* Changed: More clear and intense warning about EncFS deprecation and removal (#1904)
* Changed: Updated desktop entry files
* Changed: Move several values from config file into new introduce state file ($XDG_STATE_HOME/backintime.json)
* Changed: Completed license information to conform the REUSE.software and SPDX standards.
* Breaking Change: Auto-remove rules "Free inodes" and "Free space" disabled by default (#1976)
* Fix!: Smart-remove rule "Keep one snapshots per week or the last week" use calendar weeks
* Fix: The width of the fourth column in files view is now saved
* Fix: Snapshot compare copy symlink as symlink (#1902) (Peter Sevens @sevens)
* Fix: Crash when comparing a snapshot with a symlink pointing to a nonexistent target (Peter Sevens @sevens)
* Fix: Crash (KeyError) opening language setup dialog with unknown locale/language
* Feature: Open user manual (local if available otherwise online) via Help menu
* Feature: Toolbar context menu to display the buttons in different combinations with icons and text (#1105, #2002) (Samuel Moore @s4moore)
* Feature: Add offset minutes to hourly schedules (David Gibbs @fallingrock)
* Doc: Remove & Retention (formally known as Auto-/Smart-Remove) with improved GUI and user manual section (#2000)
@buhtz buhtz mentioned this pull request Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Merge after creative-break Merge after creative-break (min. 1 week)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0