2005-09-25 18:42:24 +00:00
|
|
|
/*
|
2014-04-28 04:00:01 -05:00
|
|
|
Copyright (C) 2014 Waves Audio Ltd.
|
2005-09-25 18:42:24 +00:00
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
2009-02-25 18:26:51 +00:00
|
|
|
#include "pbd/file_utils.h"
|
|
|
|
|
#include "ardour/filesystem_paths.h"
|
2014-11-13 17:29:48 +02:00
|
|
|
#include "ardour/revision.h"
|
2005-09-25 18:42:24 +00:00
|
|
|
|
|
|
|
|
#include "i18n.h"
|
2014-10-31 12:43:32 +02:00
|
|
|
#include "about_dialog.h"
|
|
|
|
|
#include "license_dialog.h"
|
2015-02-12 19:59:01 +02:00
|
|
|
#include "public_editor.h"
|
2005-09-25 18:42:24 +00:00
|
|
|
|
|
|
|
|
using namespace Gtk;
|
2005-09-26 02:09:02 +00:00
|
|
|
using namespace Gdk;
|
2005-09-25 18:42:24 +00:00
|
|
|
using namespace std;
|
|
|
|
|
using namespace ARDOUR;
|
2006-06-21 23:01:03 +00:00
|
|
|
using namespace PBD;
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2005-09-26 02:09:02 +00:00
|
|
|
About::About ()
|
2014-10-31 12:43:32 +02:00
|
|
|
: WavesDialog (_("about_dialog.xml"), true, false)
|
|
|
|
|
, _image_home ( get_v_box("image_home") )
|
|
|
|
|
, _about_button ( get_waves_button ("about_button") )
|
2014-11-13 17:29:48 +02:00
|
|
|
, _credits ( get_label("credits") )
|
2005-09-25 18:42:24 +00:00
|
|
|
{
|
2014-05-27 21:07:37 -04:00
|
|
|
set_modal (true);
|
|
|
|
|
set_resizable (false);
|
2014-10-31 12:43:32 +02:00
|
|
|
|
2014-05-27 21:07:37 -04:00
|
|
|
string image_path;
|
2014-10-31 12:43:32 +02:00
|
|
|
|
2014-06-19 21:23:12 +10:00
|
|
|
if (find_file (ardour_data_search_path(), "splash.png", image_path)) {
|
2014-05-27 21:07:37 -04:00
|
|
|
Gtk::Image* image;
|
|
|
|
|
if ((image = manage (new Gtk::Image (image_path))) != 0) {
|
2014-10-31 12:43:32 +02:00
|
|
|
_image_home.pack_start (*image, false, false);
|
2014-05-27 21:07:37 -04:00
|
|
|
}
|
2014-10-31 12:43:32 +02:00
|
|
|
}
|
|
|
|
|
|
2014-11-13 17:29:48 +02:00
|
|
|
init_credits ();
|
2014-10-31 12:43:32 +02:00
|
|
|
_about_button.signal_clicked.connect (sigc::mem_fun (*this, &About::about_button_pressed));
|
2014-05-27 21:07:37 -04:00
|
|
|
|
|
|
|
|
show_all ();
|
2005-09-25 18:42:24 +00:00
|
|
|
}
|
2014-10-31 12:43:32 +02:00
|
|
|
|
2014-11-13 17:29:48 +02:00
|
|
|
void
|
|
|
|
|
About::init_credits ()
|
|
|
|
|
{
|
|
|
|
|
// Get version
|
|
|
|
|
string revision = ARDOUR::revision;
|
|
|
|
|
int pos = revision.rfind("-");
|
|
|
|
|
revision.erase (pos, revision.size() - pos);
|
|
|
|
|
|
|
|
|
|
// Get current year
|
|
|
|
|
// current date/time based on current system
|
|
|
|
|
time_t now = time(0);
|
|
|
|
|
// convert now to tm struct for UTC
|
|
|
|
|
tm *timeinfo = gmtime(&now);
|
|
|
|
|
|
2014-11-13 18:00:59 +02:00
|
|
|
stringstream ss;
|
|
|
|
|
ss << timeinfo->tm_year + 1900;
|
|
|
|
|
string str_year = ss.str();
|
|
|
|
|
|
2015-02-04 15:27:18 +02:00
|
|
|
// string text="Version : " + revision + "\nCopyright Waves Audio Ltd. 2013-" + str_year;
|
|
|
|
|
string text="Version : " + revision;
|
|
|
|
|
|
2014-11-13 17:29:48 +02:00
|
|
|
_credits.set_text (text);
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-27 21:07:37 -04:00
|
|
|
void
|
2014-10-31 12:43:32 +02:00
|
|
|
About::on_esc_pressed ()
|
2005-09-25 18:42:24 +00:00
|
|
|
{
|
2014-10-31 12:43:32 +02:00
|
|
|
hide();
|
2005-09-25 18:42:24 +00:00
|
|
|
}
|
|
|
|
|
|
2014-10-31 12:43:32 +02:00
|
|
|
void
|
|
|
|
|
About::about_button_pressed (WavesButton*)
|
2010-01-04 02:04:05 +00:00
|
|
|
{
|
2015-04-01 17:08:29 +03:00
|
|
|
MainMenuDisabler m;
|
2014-10-31 12:43:32 +02:00
|
|
|
LicenseDialog license_dialog;
|
|
|
|
|
license_dialog.set_position (WIN_POS_CENTER);
|
|
|
|
|
license_dialog.run ();
|
2010-01-04 02:04:05 +00:00
|
|
|
}
|
|
|
|
|
|
2014-12-15 12:11:10 +02:00
|
|
|
void
|
|
|
|
|
About::on_realize ()
|
|
|
|
|
{
|
|
|
|
|
WavesDialog::on_realize();
|
|
|
|
|
get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_ALL));
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-27 21:07:37 -04:00
|
|
|
About::~About ()
|
|
|
|
|
{
|
|
|
|
|
}
|