backupwidget.h
/*
*openPilotLog - A FOSS Pilot Logbook Application
*Copyright (C) 2020-2022 Felix Turowsky
*
*This program 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, either version 3 of the License, or
*(at your option) any later version.
*
*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/>.
*/
#ifndef BACKUPWIDGET_H
#define BACKUPWIDGET_H
#include "src/classes/paths.h"
#include <QWidget>
#include <QStandardItemModel>
#include <QFileSystemModel>
#include <QFileSystemWatcher>
#include <QTableView>
namespace Ui {
class BackupWidget;
}
class BackupWidget : public QWidget
{
Q_OBJECT
public:
explicit BackupWidget(QWidget *parent = nullptr);
~BackupWidget();
static const QString backupName();
static const QString absoluteBackupPath();
private slots:
void on_tableView_clicked(const QModelIndex &index);
void on_createLocalPushButton_clicked();
void on_restoreLocalPushButton_clicked();
void on_deleteSelectedPushButton_clicked();
void on_createExternalPushButton_clicked();
void on_restoreExternalPushButton_clicked();
void on_aboutPushButton_clicked();
private:
Ui::BackupWidget *ui;
QStandardItemModel *model;
QTableView *view;
QList<int> selectedRows;
void refresh();
protected:
void changeEvent(QEvent* event) override;
};
#endif // BACKUPWIDGET_H
BackupWidget
The BackupWidget is the interface for the user to create and restore backups of the database.
Definition: backupwidget.h:43
BackupWidget::backupName
static const QString backupName()
Generates a filename for creating a backup.
Definition: backupwidget.cpp:88
BackupWidget::absoluteBackupPath
static const QString absoluteBackupPath()
Generates the absolute path for a new local backup file.
Definition: backupwidget.cpp:80
BackupWidget::changeEvent
void changeEvent(QEvent *event) override
Handles change events, like updating the UI to new localisation.
Definition: backupwidget.cpp:49