Skip to content

Commit

Permalink
[QR] add guidence how to scan QR code task
Browse files Browse the repository at this point in the history
  • Loading branch information
zinuzoid committed Mar 17, 2024
1 parent b8ffcdf commit 40c8164
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Dialogs/Task/Manager/TaskActionsPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ try {
ShowError(std::current_exception(), _("Download"));
}

inline void
TaskActionsPanel::OnImportQrCodeClicked() noexcept
{
ShowMessageBox(_("You can use an Android camera app to scan QR then select XCSoar JET to import it here. Only .xctsk task is supported."),
_("Import task from QR code"),
MB_OK | MB_ICONINFORMATION);
}

void
TaskActionsPanel::ReClick() noexcept
{
Expand Down Expand Up @@ -149,6 +157,10 @@ TaskActionsPanel::Prepare([[maybe_unused]] ContainerWindow &_parent,
parent.SetCurrent(parent.PAGE_WEGLIDE_PUBLIC_DECLARED);
});

AddButton(_("Import task from QR code"), [this](){
OnImportQrCodeClicked();
});

if (is_simulator())
/* cannot communicate with real devices in simulator mode */
SetRowEnabled(DECLARE, false);
Expand Down
1 change: 1 addition & 0 deletions src/Dialogs/Task/Manager/TaskActionsPanel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class TaskActionsPanel : public RowFormWidget {
void OnNewTaskClicked();
void OnDeclareClicked();
void OnDownloadClicked() noexcept;
void OnImportQrCodeClicked() noexcept;

/* virtual methods from class Widget */
void Prepare(ContainerWindow &parent, const PixelRect &rc) noexcept override;
Expand Down

0 comments on commit 40c8164

Please sign in to comment.