spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit f073eec154be239a7e279f0d9eb6859e29f3ca06
parent 72142860284ba0a492b29b6fe3539c7589dc1766
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Wed, 19 Sep 2012 22:26:42 -0700

Show online manual on F1, closes #24

Diffstat:
MMakefile.am | 4++--
Ddist/osx/about.png | 0
Adist/osx/help.png | 0
Ddist/win/about.ico | 0
Adist/win/help.ico | 0
Mdist/win/spek.rc | 2+-
Msrc/spek-artwork.cc | 12++++++------
Msrc/spek-artwork.hh | 2+-
Msrc/spek-spectrogram.cc | 3+++
Msrc/spek-window.cc | 21++++++++++++++++-----
Msrc/spek-window.hh | 1+
11 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/Makefile.am b/Makefile.am @@ -14,21 +14,21 @@ EXTRA_DIST = \ dist/osx/Info.plist \ dist/osx/README.md \ dist/osx/Spek.icns \ - dist/osx/about.png \ dist/osx/bundle.sh \ dist/osx/close.png \ + dist/osx/help.png \ dist/osx/open.png \ dist/osx/save.png \ dist/win/README.md \ dist/win/SpekInstallDir.wxs \ dist/win/SpekInstallDirDlg.wxs - dist/win/about.ico \ dist/win/banner.bmp \ dist/win/bundle.bat \ dist/win/bundle.sh \ dist/win/close.ico \ dist/win/dialog.bmp \ dist/win/fix-msi.js \ + dist/win/help.ico \ dist/win/open.ico \ dist/win/save.ico \ dist/win/spek.ico \ diff --git a/dist/osx/about.png b/dist/osx/about.png Binary files differ. diff --git a/dist/osx/help.png b/dist/osx/help.png Binary files differ. diff --git a/dist/win/about.ico b/dist/win/about.ico Binary files differ. diff --git a/dist/win/help.ico b/dist/win/help.ico Binary files differ. diff --git a/dist/win/spek.rc b/dist/win/spek.rc @@ -1,5 +1,5 @@ aaaa ICON "spek.ico" -about ICON "about.ico" +help ICON "help.ico" open ICON "open.ico" save ICON "save.ico" close ICON "close.ico" diff --git a/src/spek-artwork.cc b/src/spek-artwork.cc @@ -37,8 +37,8 @@ wxBitmap SpekArtProvider::CreateBitmap( if (id == ART_SPEK) { return wxArtProvider::GetBitmap(wxT("spek"), client, size); } - if (id == ART_ABOUT) { - return wxArtProvider::GetBitmap(wxT("gtk-about"), client, size); + if (id == ART_HELP) { + return wxArtProvider::GetBitmap(wxT("gtk-help"), client, size); } if (id == ART_OPEN) { return wxArtProvider::GetBitmap(wxT("gtk-open"), client, size); @@ -51,8 +51,8 @@ wxBitmap SpekArtProvider::CreateBitmap( } #endif #ifdef OS_WIN - if (id == ART_ABOUT) { - return wxIcon(wxT("about"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24); + if (id == ART_HELP) { + return wxIcon(wxT("help"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24); } if (id == ART_OPEN) { return wxIcon(wxT("open"), wxBITMAP_TYPE_ICO_RESOURCE, 24, 24); @@ -65,8 +65,8 @@ wxBitmap SpekArtProvider::CreateBitmap( } #endif #ifdef OS_OSX - if (id == ART_ABOUT) { - return wxBitmap(wxT("about"), wxBITMAP_TYPE_PNG_RESOURCE); + if (id == ART_HELP) { + return wxBitmap(wxT("help"), wxBITMAP_TYPE_PNG_RESOURCE); } if (id == ART_OPEN) { return wxBitmap(wxT("open"), wxBITMAP_TYPE_PNG_RESOURCE); diff --git a/src/spek-artwork.hh b/src/spek-artwork.hh @@ -24,7 +24,7 @@ #define ART_SPEK wxT("art-spek") #define ART_OPEN wxT("art-open") #define ART_SAVE wxT("art-save") -#define ART_ABOUT wxT("art-about") +#define ART_HELP wxT("art-help") #define ART_CLOSE wxT("art-close") void spek_artwork_init(); diff --git a/src/spek-spectrogram.cc b/src/spek-spectrogram.cc @@ -127,6 +127,9 @@ void SpekSpectrogram::on_char(wxKeyEvent& evt) this->urange = MIN(this->urange + 1, MAX_RANGE); } else if (CS && dn) { this->urange = MAX(this->urange - 1, this->lrange + 1); + } else { + evt.Skip(); + return; } start(); diff --git a/src/spek-window.cc b/src/spek-window.cc @@ -45,6 +45,7 @@ BEGIN_EVENT_TABLE(SpekWindow, wxFrame) EVT_MENU(wxID_SAVE, SpekWindow::on_save) EVT_MENU(wxID_EXIT, SpekWindow::on_exit) EVT_MENU(wxID_PREFERENCES, SpekWindow::on_preferences) + EVT_MENU(wxID_HELP, SpekWindow::on_help) EVT_MENU(wxID_ABOUT, SpekWindow::on_about) EVT_COMMAND(-1, SPEK_NOTIFY_EVENT, SpekWindow::on_notify) END_EVENT_TABLE() @@ -97,13 +98,16 @@ SpekWindow::SpekWindow(const wxString& path) : wxMenu *menu_edit = new wxMenu(); wxMenuItem *menu_edit_prefs = new wxMenuItem(menu_edit, wxID_PREFERENCES); - menu_edit_prefs->SetItemLabel(menu_edit_prefs->GetItemLabelText() + wxT("\tCtrl+E")); + menu_edit_prefs->SetItemLabel(menu_edit_prefs->GetItemLabelText() + wxT("\tCtrl-E")); menu_edit->Append(menu_edit_prefs); menu->Append(menu_edit, _("&Edit")); wxMenu *menu_help = new wxMenu(); + wxMenuItem *menu_help_contents = new wxMenuItem( + menu_help, wxID_HELP, _("&Help") + wxT("\tF1")); + menu_help->Append(menu_help_contents); wxMenuItem *menu_help_about = new wxMenuItem(menu_help, wxID_ABOUT); - menu_help_about->SetItemLabel(menu_help_about->GetItemLabelText() + wxT("\tF1")); + menu_help_about->SetItemLabel(menu_help_about->GetItemLabelText() + wxT("\tShift-F1")); menu_help->Append(menu_help_about); menu->Append(menu_help, _("&Help")); @@ -125,10 +129,10 @@ SpekWindow::SpekWindow(const wxString& path) : #if wxCHECK_VERSION(2, 9, 1) toolbar->AddStretchableSpace(); toolbar->AddTool( - wxID_ABOUT, + wxID_HELP, wxEmptyString, - wxArtProvider::GetBitmap(ART_ABOUT, wxART_TOOLBAR), - menu_help_about->GetItemLabelText() + wxArtProvider::GetBitmap(ART_HELP, wxART_TOOLBAR), + _("Help") ); #endif toolbar->Realize(); @@ -305,6 +309,13 @@ void SpekWindow::on_preferences(wxCommandEvent& event) dlg.ShowModal(); } +void SpekWindow::on_help(wxCommandEvent& event) +{ + wxLaunchDefaultBrowser( + wxString::Format(wxT("http://spek-project.org/man-%s.html"), wxT(PACKAGE_VERSION)) + ); +} + void SpekWindow::on_about(wxCommandEvent& event) { wxAboutDialogInfo info; diff --git a/src/spek-window.hh b/src/spek-window.hh @@ -34,6 +34,7 @@ private: void on_save(wxCommandEvent& event); void on_exit(wxCommandEvent& event); void on_preferences(wxCommandEvent& event); + void on_help(wxCommandEvent& event); void on_about(wxCommandEvent& event); void on_notify(wxCommandEvent& event); void on_visit(wxCommandEvent& event);