fiffty-50 / openPilotLog

A FOSS pilot logbook written in C++(Qt5)
GNU General Public License v3.0
13 stars 2 forks source link

Develop BackupWidget #69

Closed fiffty-50 closed 3 years ago

fiffty-50 commented 3 years ago

The purpose of the BackupWidget is to primarily enable backing up and restoring the database to and from backupdir as in AStandardPaths, but should also allow exporting and importing the database to an external path (a Pen Drive, a cloud folder etc.)

So what I have in mind is a widget containing the following:

Apart from that basic layout, we also need to think about how to verify that the file the user wants to import is valid, so we need to establish some requirements that a file must fulfill in order to be acceptable.

Nice to have: The list of available backups can display a few key dates about the backup itself when selecting a line from the QTableView, for example something like:

"Backup from 2021-02-12, 364 Flights with 748:33h Total Time, last Flight: KJFK-EDDF on 2021-01-03"

KotzaBoss commented 3 years ago

Let me comment on the main points of this widget so i can see if im on the right track or not

As far as valid files are concerned this needs some discussion because we need to know exactly what those files are.

The nice to have is just UI sugar, if we get the listing of the backups nice and clean then thats just another function when clicking one of the entries

fiffty-50 commented 3 years ago

Yes to most of it!

Housekeeping in itself is a bit vague.

By housekeeping I mean the user managing his backups. Let's say the user normally makes a weekly backup but only wants to keep a monthly backup for times further in the past because the list of backups keeps growing - that's where a delete backup button comes in.

I don't think we should automatically clean up backups after a certain period of time, that should always be a conscious choice.

So the whole point is to let the user choose their own backupDIr instead of our preset?

Yes and no, there's two parts to that.

1. Backup

2. Import/Export

KotzaBoss commented 3 years ago

Ok i think i got it but still import export doesnt sound something a "backup" widget should do. What you have described sound like something you would find in the File option on the top bar of a program. Any way its more of a naming thing because these operations arent too different. Do you have the ui side of the widget ready because if i set up the ui i may deviate from your current aesthetic. If not perhaps you can setup the ui vaguely so that i work on the behind logic.

fiffty-50 commented 3 years ago

I don't have it set up yet, but I can do that. I'm not sure if I'll have time tomorrow, but by Thursday or latest Friday I should have something ready!

fiffty-50 commented 3 years ago

Okay, ready to go!

backupwidget

KotzaBoss commented 3 years ago

Excellent will get to work from tmrw