commit 2622e55b2c00d7093434ade547111536d71d7928
parent 4e87e70934fb0d339c16a58142ff24ac45a9529b
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date: Sun, 19 Aug 2012 19:06:32 -0700
About dialogue
Diffstat:
3 files changed, 31 insertions(+), 66 deletions(-)
diff --git a/src/spek-window.cc b/src/spek-window.cc
@@ -16,6 +16,7 @@
* along with Spek. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <wx/aboutdlg.h>
#include <wx/artprov.h>
#include <wx/dnd.h>
#include <wx/filename.h>
@@ -53,7 +54,8 @@ private:
SpekWindow::SpekWindow(const wxString& path) :
path(path), wxFrame(NULL, -1, wxEmptyString)
{
- SetTitle(_("Spek - Acoustic Spectrum Analyser"));
+ this->description = _("Spek - Acoustic Spectrum Analyser");
+ SetTitle(this->description);
// TODO: test on all platforms
//SetIcon(wxIcon(wxT("spek")));
@@ -155,7 +157,7 @@ static const char *audio_extensions[] = {
NULL
};
-void SpekWindow::on_open(wxCommandEvent& WXUNUSED(event))
+void SpekWindow::on_open(wxCommandEvent& event)
{
static wxString filters = wxEmptyString;
static int filter_index = 1;
@@ -195,7 +197,7 @@ void SpekWindow::on_open(wxCommandEvent& WXUNUSED(event))
dlg->Destroy();
}
-void SpekWindow::on_save(wxCommandEvent& WXUNUSED(event))
+void SpekWindow::on_save(wxCommandEvent& event)
{
static wxString filters = wxEmptyString;
@@ -230,15 +232,37 @@ void SpekWindow::on_save(wxCommandEvent& WXUNUSED(event))
dlg->Destroy();
}
-void SpekWindow::on_exit(wxCommandEvent& WXUNUSED(event))
+void SpekWindow::on_exit(wxCommandEvent& event)
{
Close(true);
}
-void SpekWindow::on_preferences(wxCommandEvent& WXUNUSED(event))
+void SpekWindow::on_preferences(wxCommandEvent& event)
{
}
-void SpekWindow::on_about(wxCommandEvent& WXUNUSED(event))
+void SpekWindow::on_about(wxCommandEvent& event)
{
+ wxAboutDialogInfo info;
+ info.AddDeveloper(wxT("Alexander Kojevnikov"));
+ info.AddDeveloper(wxT("Fabian Deutsch"));
+ info.AddDeveloper(wxT("Jonathan Gonzalez V"));
+ info.AddDeveloper(wxT("Stefan Kost"));
+ info.AddDeveloper(wxT("Thibault North"));
+ info.AddArtist(wxT("Olga Vasylevska"));
+ // TRANSLATORS: Add your name here
+ wxString translator = _("translator-credits");
+ if (translator != wxT("translator-credits")) {
+ info.AddTranslator(translator);
+ }
+ info.SetName(wxT("Spek"));
+ info.SetVersion(wxT(PACKAGE_VERSION));
+ info.SetCopyright(_("Copyright (c) 2010-2012 Alexander Kojevnikov and contributors"));
+ info.SetDescription(this->description);
+#ifdef OS_UNIX
+ info.SetWebSite(wxT("http://spek-project.org/"), _("Spek Website"));
+ // TODO
+ // info.SetIcon();
+#endif
+ wxAboutBox(info);
}
diff --git a/src/spek-window.hh b/src/spek-window.hh
@@ -39,6 +39,7 @@ private:
SpekSpectrogram *spectrogram;
wxString path;
wxString cur_dir;
+ wxString description;
DECLARE_EVENT_TABLE()
};
diff --git a/src/spek-window.vala b/src/spek-window.vala
@@ -69,66 +69,6 @@ namespace Spek {
dlg.run ();
}
- private void on_help_about () {
- string[] authors = {
- "Primary Development:",
- "\tAlexander Kojevnikov (maintainer)",
- "",
- "Contributors:",
- "\tFabian Deutsch",
- "\tJonathan Gonzalez V",
- "\tStefan Kost",
- "\tThibault North"
- };
- string[] artists = {
- "Olga Vasylevska"
- };
- string license = "Copyright (C) 2010-2011 Alexander Kojevnikov";
- license += "\n\n";
- license += "Spek is free software: you can redistribute it and/or modify ";
- license += "it under the terms of the GNU General Public License as published by ";
- license += "the Free Software Foundation, either version 3 of the License, or ";
- license += "(at your option) any later version.";
- license += "\n\n";
- license += "Spek is distributed in the hope that it will be useful, ";
- license += "but WITHOUT ANY WARRANTY; without even the implied warranty of ";
- license += "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ";
- license += "GNU General Public License for more details.";
- license += "\n\n";
- license += "You should have received a copy of the GNU General Public License ";
- license += "along with Spek. If not, see http://www.gnu.org/licenses/";
-
- var dlg = new AboutDialog ();
- dlg.program_name = "Spek";
- dlg.version = Config.PACKAGE_VERSION;
- dlg.copyright = _("Copyright \xc2\xa9 2010-2011 Alexander Kojevnikov");
- dlg.comments = description;
- dlg.set ("authors", authors);
-// dlg.set ("documenters", documenters);
- dlg.set ("artists", artists);
- dlg.website_label = _("Spek Website");
- dlg.website = "http://www.spek-project.org/";
- dlg.license = license;
- dlg.wrap_license = true;
- try {
- dlg.logo = IconTheme.get_default ().load_icon ("spek", 128, IconLookupFlags.FORCE_SVG);
- } catch (Error e) {
- dlg.logo_icon_name = "spek";
- }
- // TRANSLATORS: Add your name here
- dlg.translator_credits = _("translator-credits");
- dlg.set_transient_for (this);
- dlg.destroy_with_parent = true;
- dlg.response.connect (id => dlg.destroy ());
- dlg.set_url_hook (url_hook);
- dlg.modal = true;
- dlg.present ();
- }
-
- private void url_hook (AboutDialog about, string link) {
- Platform.show_uri (link);
- }
-
private void * check_version () {
// Does the user want to check for updates?
var prefs = Preferences.instance;