Skip to content
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

PR: Implement Profile Sidebar and New Setting Interface #1809

Merged
merged 32 commits into from Oct 24, 2023

Conversation

bigtedde
Copy link
Collaborator

@bigtedde bigtedde commented Sep 6, 2023

Description

Vorta allows configuring profiles. A profile defines a number of sources, a backup destination, a schedule and some more settings. Currently there is a ComboBox for selecting a profile at the top of the window alongside buttons for adding or removing profiles. All profiles are active at the same time. However you can only edit the profile selected. This happens in the tabs below. The Misc tab is an exception. It contains the global settings that aren't associated to a profile.
In this task you will implement a sidebar next to the tab widget that replaces the current way of selecting a profile to edit. The sidebar should be comprised of a list with the configured profiles that can be selected and a visually distinct Misc item that gives access to the global settings. The old Misc tab will be removed in favour of this new user interface. The new Misc item now provides space for an about view and a way to manage profiles configured in Vorta.

Task outline: Implement the profile list that will be part of the sidebar. Add buttons for editing the profile list. Remove the old profile management GUI elements. Implement Misc item and the corresponding view. Move global settings to the new Misc view. Create an About tab and add it to the new Misc view. Implement a repository management tab and add it to the new Misc view. Write unittests for the new GUI parts.

Related Issue

Addresses #1677

Motivation and Context

Easier management of profiles, separates the global settings tab from profile-specific tabs

How Has This Been Tested?

Due to the nature of a main window redesign, some current tests will be broken until the final design is approved and I refactor the tests.

Most Recent Demo:

updated_sidebar

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.

@m3nu @real-yfprojects

@bigtedde
Copy link
Collaborator Author

bigtedde commented Sep 6, 2023

Current TODO:

  • Refactor profile selector from ComboBox to a QListWidget (or something else?)
  • Move Vorta/Borg versions + bug report link to "about" (maybe more items here, like link to Borg Docs?)
  • Create Repository management tab and decide what should go here
  • Create new tests for sidebar + settings panel, refactor old tests.

Anything else that should be added, or suggestions for improving the sidebar design/implementation please let me know :)

@m3nu
Copy link
Contributor

m3nu commented Sep 6, 2023

Screenshot looks good and there is space for a full list of profiles. 👍

@real-yfprojects
Copy link
Collaborator

As I said I dought we need a profile management tab but a repe management tab could be useful.

Can you make it so that the settings button has different states when the settings are open or closed?

@bigtedde
Copy link
Collaborator Author

bigtedde commented Sep 6, 2023

As I said I doubt we need a profile management tab but a repo management tab could be useful.

What features would we like to see in the repo management tab? Maybe we move the repo actions from the archive tab to here?

Can you make it so that the settings button has different states when the settings are open or closed?

Sure - maybe have the button label change to " <- Home " or "Exit Settings"? Or simply fill it in with a background color?

@bigtedde
Copy link
Collaborator Author

bigtedde commented Sep 7, 2023

Here is the latest update. I created the "about" tab UI and changed the setting button when toggled. Thoughts?

updated_sidebar

@m3nu
Copy link
Contributor

m3nu commented Sep 7, 2023

I think you're on the right track. My thoughts:

  • Set the profile list to expand all the way, so there is no vertical scrolling (same as similar Apple windows)
  • Closing settings isn't needed IMO. When one clicks a profile, settings are gone anyways.
  • Button Settings and then tab Settings is confusing. Maybe we want to have a few tabs for different subcategories of settings?
  • What's "Repository Management" for? If this is a new feature, I'd keep it for later.

@real-yfprojects
Copy link
Collaborator

  • When one clicks a profile, settings are gone anyways.

When I tested this PR that wasn't the case.

@real-yfprojects
Copy link
Collaborator

  • Button Settings and then tab Settings is confusing.

Maybe Misc and Settings?

  • What's "Repository Management" for? If this is a new feature, I'd keep it for later.

It would be. The tab would resolve #1198.

@bigtedde
Copy link
Collaborator Author

bigtedde commented Sep 7, 2023

Set the profile list to expand all the way, so there is no vertical scrolling (same as similar Apple windows)

I may need additional clarity here, or maybe an example of the Apple window you have in mind? I can allow the profile list to dynamically expand further down to accommodate more profiles, and this would cover most use cases, however with enough profiles there would inevitably be some vertical scrolling.

Closing settings isn't needed IMO. When one clicks a profile, settings are gone anyways.

This is not the current behavior, but I could implement it. I'm open to other ideas too, maybe a 'back' or 'home' button in the top left of the interface that always takes users back to the repository tab?

Button Settings and then tab Settings is confusing. Maybe we want to have a few tabs for different subcategories of settings?

@real-yfprojects idea of a MIsc button and then a Setting panel could solve this overlap.

@real-yfprojects
Copy link
Collaborator

This is not the current behavior, but I could implement it.

That would be great!

I may need additional clarity here

You can make the list expand automatically filling the room that currently resides between the list and the settings button.

@bigtedde
Copy link
Collaborator Author

bigtedde commented Sep 7, 2023

This is not the current behavior, but I could implement it.

That would be great!

I may need additional clarity here

You can make the list expand automatically filling the room that currently resides between the list and the settings button.

I implemented both of those features this morning. Check it out and LMK when you think!

updated_sidebar

Also, regarding the repo management tab - did we want this to be a separate PR, or combine it here?

@real-yfprojects
Copy link
Collaborator

Can you swap the trash can through a minus sign? And right align the plus and minus sign while left aligning the others?

@real-yfprojects
Copy link
Collaborator

Also, regarding the repo management tab - did we want this to be a separate PR, or combine it here?

I would rather leave that for a separate PR.

Regarding the about view can you add the following?

  • Copyright
  • License
  • Link Repo and Docs

@bigtedde
Copy link
Collaborator Author

bigtedde commented Sep 10, 2023

Can you swap the trash can through a minus sign? And right align the plus and minus sign while left aligning the others?

Done 👍

Regarding the about view can you add the following?

  • Copyright
  • License
  • Link Repo and Docs

Certainly.

  • What should I link to for copyright? #403 suggests linking to contributors?
  • For license, should I link to GitHub or open the license.txt file?

@real-yfprojects
Copy link
Collaborator

  <one line to give the program's name and a brief idea of what it does.>

Copyright (C) 2018-2020 Manuel Riel and Vorta contributors (see <CONTRIBUTORS.md>)

     Vorta is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 only.

    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. 

Then you could also add one of the GPL logos and a python logo.

@bigtedde bigtedde changed the title Implement Profile Sidebar and New Setting Interface PR: Implement Profile Sidebar and New Setting Interface Sep 26, 2023
@bigtedde
Copy link
Collaborator Author

After talking with @m3nu, a few ideas came up for discussion:

  1. keeping the profile selector a set height (400px) instead of increasing/decreasing in size based on number of profiles.
  2. renaming the "misc" button to a more explicit "Settings / About" button
  3. removing the "repository management" tab from this PR, out of scope
  4. Adding the contributions, license, and repo/docs links info to the about tab
  5. Have the style of profile action buttons mimic the style found here:
    image

@real-yfprojects Do you have any feedback/ideas for these topics?

@real-yfprojects
Copy link
Collaborator

  1. keeping the profile selector a set height (400px) instead of increasing/decreasing in size based on number of profiles.

Actually, I would make the size dependent on the window size. Basically like it is done in the screenshot of the network dialog you shared.

4. Adding the contributions, license, and repo/docs links info to the about tab

Didn't we already decide to do that?

5. Have the style of profile action buttons mimic the style found here:

Not sure how this will look in Qt, but feel free to share a screenshot once possible.

@bigtedde
Copy link
Collaborator Author

@m3nu Added changes:

  • rearranged profile action buttons.
  • added a blue background to button when user is in the "settings / about" tab.
  • selecting the current profile will now return to the main screen if the settings / about tab is open.

Next I will work to allow changing the size between profile list and the rest of the app, and then I will write tests for the new features.

@m3nu
Copy link
Contributor

m3nu commented Oct 16, 2023

Hey Ted, thanks for those latest changes. I think it's coming along nicely and gives it a new and polished look.

Regarding the button state, we need to be careful with colors due to different skins in Qt, as well as dark/light node. Maybe just make the button font bold, if that's possible? I couldn't find a suitable "button active" state in the docs.

@bigtedde
Copy link
Collaborator Author

Maybe just make the button font bold, if that's possible?

I implemented this change 👍

@bigtedde bigtedde marked this pull request as ready for review October 20, 2023 03:24
@bigtedde
Copy link
Collaborator Author

Marked as ready for review. Slightly reduced scope from the original outline, but this profile sidebar should make our users happy.

After this is merged into master, I will create a follow-up post about features that remain to be implemented.

@m3nu
Copy link
Contributor

m3nu commented Oct 20, 2023

Work well here. Can be merged. What do you think @real-yfprojects @Hofer-Julian ? Some screenshots:

Screenshot 2023-10-20 at 10 38 03
Screenshot 2023-10-20 at 10 38 09
Screenshot 2023-10-20 at 10 38 15

m3nu
m3nu previously approved these changes Oct 20, 2023
@m3nu
Copy link
Contributor

m3nu commented Oct 20, 2023

Is close_X.svg still used? If not it can be removed from the PR.

Where is settings_wheel.svg from? It has some comments with "SVG mixer" ? If it's from a random site, it would be better to use a similar icon from ForkAwesome or Google Material. Since we just cleaned up our icon licenses. More here: https://vorta.borgbase.com/contributing/#icons

@real-yfprojects
Copy link
Collaborator

Looks pretty cool! That's exactly what I had in mind when added this task to the ideas page.

Comment on lines 20 to 31
def get_colored_pixmap(icon_name, scaled_height):
"""
Return SVG icon in the correct color.
"""
with open(get_asset(f"icons/{icon_name}.svg"), 'rb') as svg_file:
svg_str = svg_file.read()
if uses_dark_mode():
svg_str = svg_str.replace(b'#000000', b'#ffffff')
# Reduce image size to specified scaled height
svg_img = QImage.fromData(svg_str).scaledToHeight(scaled_height)

return QPixmap(svg_img)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would make sense to alter get_colored_icon so that it uses this new method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a couple optional args in get_colored_icon to accomplish this 👍

Hofer-Julian
Hofer-Julian previously approved these changes Oct 20, 2023
Copy link
Collaborator

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

Screenshots look good to me

@bigtedde bigtedde dismissed stale reviews from Hofer-Julian and m3nu via 98af58b October 21, 2023 03:19
@bigtedde
Copy link
Collaborator Author

@m3nu removed extra icon, switched to Material for the settings_wheel, and removed the extra utils function @real-yfprojects pointed out. Please let me know if there is anything else to button up before merge 👍

@m3nu
Copy link
Contributor

m3nu commented Oct 22, 2023

Nothing left to add from me. If nobody objects, I'll merge this and do a new beta-release to get even broader testing.

Thanks all!

@m3nu m3nu merged commit 071dd86 into borgbase:master Oct 24, 2023
11 checks passed
@m3nu
Copy link
Contributor

m3nu commented Oct 24, 2023

This concludes @bigtedde's GSoC projects. Thanks again for the great work and for extending to finish everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants