borgbase / vorta

Desktop Backup Client for Borg Backup
https://vorta.borgbase.com
GNU General Public License v3.0
1.98k stars 132 forks source link

Add setting for running vorta in the backround. #1582

Open real-yfprojects opened 1 year ago

real-yfprojects commented 1 year ago

There is already a setting called enable_background_question that asks whether to continue in the background on exit when the system tray isn't available. Maybe this setting could be expanded to the case when a system tray is available.

Discussed in https://github.com/borgbase/vorta/discussions/1581

Originally posted by **DaffyTheDuck** February 5, 2023 When you run the `vorta` command from the terminal to launch new session and close the application from GUI instead of closing it from the terminal, the command `vorta` keeps running though the application is closed ![image](https://user-images.githubusercontent.com/34976093/216822026-12e3a800-5176-4538-a33e-4261f808cfb4.png) ## How to reproduce ? 1. Launch vorta from terminal 2. Close it through GUI 3. See the terminal ## Desktop Ubuntu 22.04 ## Update! I actually just found that it keeps running in background! But while closing the application it would be nice to prompt user whether he want's to continue the process or not 😄
DaffyTheDuck commented 1 year ago

Can I try to work on this 😃

m3nu commented 1 year ago

So the bug is to run vorta from the terminal, then close it with Quit and it's still there in the terminal? On macOS this isn't reproducible. Vorta quits as expected. I don't recall seeing it on Gnome either, but didn't try for a while.

With regards to the suggested prompt, it's a good idea and may avoid confusion. Since Vorta is indeed "stealthy" and aims to stay in the background. So if you want to add that, go ahead! Best if you summarize the planned changes first and what's the user benefit again, @DaffyTheDuck .

real-yfprojects commented 1 year ago

So the bug is to run vorta from the terminal, then close it with Quit and it's still there in the terminal?

I think @DaffyTheDuck didn't click on quit in the system tray but rather only closed the window.

DaffyTheDuck commented 1 year ago

Hi! @m3nu @real-yfprojects, this is what I was talking about 😄

VortaCMDBug

DaffyTheDuck commented 1 year ago

Hi! @m3nu and @real-yfprojects I actually had a question! How can I test my changes after making them ? like i'm new to Qt and eager to learn it 😄

real-yfprojects commented 1 year ago

How can I test my changes after making them ?

Have you followed the contributing guide and installed vorta in development mode?

You can then enter vorta in the terminal. If you don't want to alter your global vorta install have a look at virtual environments.

m3nu commented 1 year ago

Closing the window isn't supposed to close the app. It should run in the background to do backups. 😀

If this is a source of confusion, I'm totally open to show the prompt for all cases. Just have an option to make it go away forever.

real-yfprojects commented 1 year ago

I'm totally open to show the prompt for all cases. Just have an option to make it go away forever.

Yes, my idea was adding a setting for always showing the prompt.

DaffyTheDuck commented 1 year ago

Closing the window isn't supposed to close the app. It should run in the background to do backups. grinning

If this is a source of confusion, I'm totally open to show the prompt for all cases. Just have an option to make it go away forever.

Um! Yes I got that since I started the app in dev version, I'm able to see the terminal 😄 My Bad! just tested the apt version and it works really great 😄. But as per the directions of @real-yfprojects I'll try to add some cases where system tray is available

I would like to get suggestions 😄

real-yfprojects commented 1 year ago

You can start with adjusting these if-cases.

https://github.com/borgbase/vorta/blob/78ec74a72cecc8198b2422470ac6c4587ee08fd6/src/vorta/views/main_window.py#L280-L281

DaffyTheDuck commented 1 year ago

You can start with adjusting these if-cases.

https://github.com/borgbase/vorta/blob/78ec74a72cecc8198b2422470ac6c4587ee08fd6/src/vorta/views/main_window.py#L280-L281

Hi! Just found the code, thanks for pointing out 😄, I would love some suggestions on the expected behaviour 😄

real-yfprojects commented 1 year ago

There is already a setting called enable_background_question that asks whether to continue in the background on exit when the system tray isn't available. This setting could be reworded and its behaviour adjusted. When it is activated vorta asks whether to continue running in the background even if the system tray is available.

DaffyTheDuck commented 1 year ago

There is already a setting called enable_background_question that asks whether to continue in the background on exit when the system tray isn't available. This setting could be reworded and its behaviour adjusted. When it is activated vorta asks whether to continue running in the background even if the system tray is available.

okay! that's done! now it's show the dialogue when we attempt to close the application 😄

but out of curiosity, isn't the code just repeating ? like can we treat the repeating code as a component (the pyqt5 code I mean)

real-yfprojects commented 1 year ago

isn't the code just repeating ?

Their might be code repeating but I am sure you can find a solution without any redundant code.

marcolaux commented 1 year ago

Update!

I actually just found that it keeps running in background! But while closing the application it would be nice to prompt user whether he want's to continue the process or not 😄

Shouldn't this be handled within the desktop environment? GNOME and KDE for example should notify the user if an application is still running if and if not an appindicator / tray icon is available.

real-yfprojects commented 1 year ago

GNOME and KDE for example should notify the user if an application is still running

I don't know about any DE that does this. Besides that isn't the point. This is about making closing the app more convenient and adding an option for customizing ser behaviour.