Skip to content

Commit

Permalink
Add "Update" / "Help" menu entries
Browse files Browse the repository at this point in the history
  • Loading branch information
fboes committed Mar 24, 2019
1 parent dfc3e06 commit d171dd1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Change log
==========

* 🎁 Add "Update" / "Help" menu entries

1.1.0
-----

* 💊 Fix METAR value translation into Aerofly Weather object (wind speed, visibility)

1.0.1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Requirements
Installation
------------

1. Download the current release ZIP from https://github.com/fboes/aerofly-wettergeraet/releases.
1. Download the current release ZIP from https://github.com/fboes/aerofly-wettergeraet/releases/latest.
2. Unpack the ZIP file to some sensible location.
3. Create a shortcut on your desktop by right-clicking `aerofly-wettergeraet-desktop.exe` > "Send to" > "Desktop (Create shortcut)".
3. Start the desktop application by clicking on the desktop link.
Expand Down
16 changes: 16 additions & 0 deletions src/WettergeraetDesktop/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ Frame::Frame(const wxString& title, int argc, char * argv[]) : wxFrame(nullptr,
{
wxMenu *file = new wxMenu;
file->Append(wxID_OPEN, wxT("&Load 'main.mcf'"));
file->AppendSeparator();
file->Append(wxID_EXIT, wxT("&Exit"));
menubar->Append(file, wxT("&File"));

wxMenu *help = new wxMenu;
help->Append(wxID_HELP, wxT("View &help"));
help->Append(EL_MENU_UPDATE, wxT("Check for &updates"));
help->AppendSeparator();
help->Append(wxID_ABOUT, wxT("&About"));
menubar->Append(help, wxT("&Help"));
}
Expand Down Expand Up @@ -342,10 +346,22 @@ void Frame::actionLoadMainMcf(wxCommandEvent& WXUNUSED(event))
this->loadMainMcf();
}

void Frame::actionUpdate(wxCommandEvent& WXUNUSED(event))
{
wxLaunchDefaultBrowser("https://github.com/fboes/aerofly-wettergeraet/releases/latest");
}

void Frame::actionHelp(wxCommandEvent& WXUNUSED(event))
{
wxLaunchDefaultBrowser("https://github.com/fboes/aerofly-wettergeraet/blob/master/README.md");
}

wxBEGIN_EVENT_TABLE(Frame, wxFrame)
EVT_BUTTON(Frame::EL_BUTTON_FETCH, Frame::actionFetch)
//EVT_BUTTON(Frame::EL_BUTTON_PARSE, Frame::actionParse)
EVT_BUTTON(wxID_SAVE, Frame::actionSave)
EVT_MENU(wxID_HELP, Frame::actionHelp)
EVT_MENU(EL_MENU_UPDATE, Frame::actionUpdate)
EVT_MENU(wxID_ABOUT, Frame::actionAbout)
EVT_MENU(wxID_EXIT, Frame::actionExit)
EVT_MENU(wxID_OPEN, Frame::actionLoadMainMcf)
Expand Down
5 changes: 5 additions & 0 deletions src/WettergeraetDesktop/Frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Frame : public wxFrame
static const unsigned short EL_CTRL_METAR = 4;
static const unsigned short EL_CTRL_DATETIME = 5;
static const unsigned short EL_CTRL_SLIDER = 6;
static const unsigned short EL_MENU_UPDATE = 7;

Frame(const wxString& title, int argc, char * argv[]);
virtual ~Frame();
Expand All @@ -70,4 +71,8 @@ class Frame : public wxFrame
virtual void actionAbout(wxCommandEvent&);

virtual void actionLoadMainMcf(wxCommandEvent&);

virtual void actionUpdate(wxCommandEvent&);

virtual void actionHelp(wxCommandEvent&);
};

0 comments on commit d171dd1

Please sign in to comment.