Closed fiffty-50 closed 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
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.
backupDir
and hit "restore"backupDir
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.
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!
Okay, ready to go!
Excellent will get to work from tmrw
The purpose of the
BackupWidget
is to primarily enable backing up and restoring the database to and frombackupdir
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:
backupdir
backupdir
, maybe a QTableView or QListView presenting the backup dates from which the user can select a backup.backupdir
toDatabaseLocation
.Delete Backup
to delete an outdated backup, a duplicate or do some 'housekeeping'Backup
andRestore
, the option toImport
andExport
the database, but instead of writing/reading to/from thebackupdir
, a QFileDialog (or similar) enables the user to choose the Location of the Backup.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"