Skip to content

Commit

Permalink
including restore files option to menu
Browse files Browse the repository at this point in the history
- rename buttons
- including button to restore files from OpenSoar backup
  • Loading branch information
Blaubart committed Jul 5, 2024
1 parent 3252681 commit 595a107
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions src/OpenVario/FileMenuWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ void FileMenuWidget::Prepare([[maybe_unused]] ContainerWindow &parent,
[[maybe_unused]] const PixelRect &rc) noexcept
{
StaticString<60> title;

title.Format(_(" - Upload IGC Files to USB"), main_app);
AddLabel(title);

AddButton(_("Upload IGC Files to USB (WIP)"), []() {
AddButton(_("Upload IGC Files (WIP)"), []() {
static constexpr const char *argv[] = {
"/usr/bin/download-igc.sh", nullptr
};
Expand All @@ -49,10 +52,22 @@ void FileMenuWidget::Prepare([[maybe_unused]] ContainerWindow &parent,
});

//-----------------------------------------------------
title.Format(_(" - File Transfers %s Data"), main_app);
title.Format(_(" - File Upload %s Data"), main_app);
AddLabel(title);
AddButton(_("Upload files to OpenVario from USB (map, profile. airspce, etc.)"), []() {
static constexpr const char *argv[] = {"/usr/bin/transfers.sh",
"upload-data", _main_app, nullptr};

AddButton(_("Save: OpenVario -> USB"), []() {
StaticString<32> dialog_title;
dialog_title.Format(_("Restore %s"), main_app);
RunProcessDialog(UIGlobals::GetMainWindow(), UIGlobals::GetDialogLook(),
dialog_title, argv);
});

title.Format(_(" - Backup and Restore OpenSoar only"), main_app);
AddLabel(title);

AddButton(_("Save OpenVario Settings and Files to USB"), []() {
static constexpr const char *argv[] = {
"/usr/bin/transfers.sh", "download-data", _main_app, nullptr
};
Expand All @@ -62,9 +77,9 @@ void FileMenuWidget::Prepare([[maybe_unused]] ContainerWindow &parent,
_("Download files"), argv);
});

AddButton(_("Restore: OpenVario <- USB"), []() {
AddButton(_("Restore OpenVario Settings and Files from USB"), []() {
static constexpr const char *argv[] = {"/usr/bin/transfers.sh",
"upload-data", _main_app, nullptr};
"restore-data", _main_app, nullptr};

StaticString<32> dialog_title;
dialog_title.Format(_("Restore %s"), main_app);
Expand All @@ -73,10 +88,10 @@ void FileMenuWidget::Prepare([[maybe_unused]] ContainerWindow &parent,
});

//-----------------------------------------------------
title.Format(_("- Complete System Data Transfers"), main_app);
title.Format(_("- Backup and Restore OpenSoar AND OpenVario System"), main_app);
AddLabel(title); // "---OpenSoar Data Files---");

AddButton(_("Backup: OpenVario System to USB"), []() {
AddButton(_("Backup OpenSoar AND OpenVario System to USB"), []() {
static constexpr const char *argv[] = {"/usr/bin/transfer-system.sh",
"backup", _main_app, nullptr
};
Expand All @@ -86,7 +101,7 @@ void FileMenuWidget::Prepare([[maybe_unused]] ContainerWindow &parent,
_("Backup System"), argv);
});

AddButton(_("Restore: OpenVario System from USB"), []() {
AddButton(_("Restore OpenSoar AND OpenVario System from USB"), []() {
static constexpr const char *argv[] = {"/usr/bin/transfer-system.sh",
"restore", _main_app, nullptr
};
Expand Down

0 comments on commit 595a107

Please sign in to comment.