[Summary] Added credits label in about dialog

This commit is contained in:
Nikolay 2014-11-13 17:29:48 +02:00
parent ab51cc7f72
commit d4b0e577f7
3 changed files with 41 additions and 1 deletions

View file

@ -19,6 +19,7 @@
#include "pbd/file_utils.h"
#include "ardour/filesystem_paths.h"
#include "ardour/revision.h"
#include "i18n.h"
#include "about_dialog.h"
@ -34,6 +35,7 @@ About::About ()
: WavesDialog (_("about_dialog.xml"), true, false)
, _image_home ( get_v_box("image_home") )
, _about_button ( get_waves_button ("about_button") )
, _credits ( get_label("credits") )
{
set_modal (true);
set_resizable (false);
@ -47,11 +49,31 @@ About::About ()
}
}
init_credits ();
_about_button.signal_clicked.connect (sigc::mem_fun (*this, &About::about_button_pressed));
show_all ();
}
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);
string year = to_string(timeinfo->tm_year + 1900);
string text="Version : " + revision + "\nCopyright 2001-" + year + " Paul Devis\nWaves Audio Ltd. 2013-" + year;
_credits.set_text (text);
}
void
About::on_esc_pressed ()
{

View file

@ -35,9 +35,11 @@ protected:
private:
void close_button_pressed (WavesButton*);
void about_button_pressed (WavesButton*);
void init_credits ();
Gtk::VBox& _image_home;
WavesButton& _about_button;
Gtk::Label& _credits;
};
#endif /* __about_dialog_h__ */

View file

@ -7,7 +7,23 @@
<VBox id="image_home"
x="0"
y="0"/>
<VBox x="293"
y="270"
width="200"
height="60">
<Label id="credits"
width="200"
height="60"
text="-"
justify="center"
horzalignment="center"
vertalignment="center"
winfont ="Arial Bold 10"
macfont ="Helvetica Bold 10"
fgnormal="#FFFFFF"/>
</VBox>
<Button id="about_button"
winfont ="Arial Bold 10"
macfont ="Helvetica Bold 10"