Removed static App* constants in GtkLumiera - replaced with static

functions
This commit is contained in:
Joel Holdsworth 2009-01-19 19:25:06 +00:00
parent 977cbf9e64
commit f6e28febdb
4 changed files with 67 additions and 54 deletions

View file

@ -45,7 +45,7 @@ using namespace gui;
using namespace gui::workspace;
using namespace gui::model;
using namespace gui::controller;
using namespace std;
GtkLumiera the_application;
@ -61,7 +61,7 @@ GtkLumiera::main(int argc, char *argv[])
Main kit(argc, argv);
Glib::set_application_name(AppTitle);
Glib::set_application_name(get_app_title());
Project project;
Controller controller(project);
@ -84,30 +84,52 @@ GtkLumiera::get_home_data_path()
return ustring::compose("%1/.%2", path, app_name);
}
const Glib::ustring
GtkLumiera::get_app_title()
{
return "Lumiera";
}
const Glib::ustring
GtkLumiera::get_app_version()
{
return "0.1-dev";
}
const Glib::ustring GtkLumiera::get_app_copyright()
{
return _("© 2008 The Lumiera Team");
}
const Glib::ustring GtkLumiera::get_app_website()
{
return "www.lumiera.org";
}
const std::vector<Glib::ustring>
GtkLumiera::get_app_authors()
{
const gchar* app_authors[] = {
"Joel Holdsworth",
"Christian Thaeter",
"Hermann Vosseler",
"<Other Authors Here>"};
const int count = sizeof(app_authors) / sizeof(gchar*);
std::vector<Glib::ustring> list(count);
for(int i = 0; i < count; i++)
list[i] = app_authors[i];
return list;
}
GtkLumiera&
application()
{
return the_application;
}
/* ===== Constants ===== */
const gchar* GtkLumiera::AppTitle = "Lumiera";
const gchar* GtkLumiera::AppVersion = _("0.1-dev");
const gchar* GtkLumiera::AppCopyright =
_("© 2008 The Lumiera Team");
const gchar* GtkLumiera::AppWebsite = "www.lumiera.org";
const gchar* GtkLumiera::AppAuthors[] = {
"Joel Holdsworth",
"Christian Thaeter",
"Hermann Vosseler",
"<Other Authors Here>"};
const int GtkLumiera::AppAuthorCount = 4;
} // namespace gui
/**
* Run the Lumiera GTK GUI as standalone application without backend.
*/

View file

@ -73,38 +73,30 @@ public:
static Glib::ustring get_home_data_path();
public:
/* ----- Constants ----- */
/**
* The name of the application
*/
static const gchar* AppTitle;
/**
* The version number of the application
*/
static const gchar* AppVersion;
/**
* The copyright of the application
*/
static const gchar* AppCopyright;
/**
* The website of the application
*/
static const gchar* AppWebsite;
/**
* An alphabetical list of the application's authors
*/
static const gchar* AppAuthors[];
/**
* The number of authors in AppAuthors
* Returns the name of the application
**/
static const int AppAuthorCount;
static const Glib::ustring get_app_title();
/**
* Returns the version number of the application
**/
static const Glib::ustring get_app_version();
/**
* Returns the copyright of the application
**/
static const Glib::ustring get_app_copyright();
/**
* Returns the website of the application
**/
static const Glib::ustring get_app_website();
/**
* Returns tn alphabetical list of the application's authors
**/
static const std::vector<Glib::ustring> get_app_authors();
};
/**

View file

@ -208,12 +208,11 @@ Actions::on_menu_help_about()
AboutDialog dialog;
//dialog.set_program_name(AppTitle);
dialog.set_version(GtkLumiera::AppVersion);
dialog.set_version(GtkLumiera::get_app_version());
//dialog.set_version(AppState::get("version"));
dialog.set_copyright(GtkLumiera::AppCopyright);
dialog.set_website(GtkLumiera::AppWebsite);
dialog.set_authors(StringArrayHandle(GtkLumiera::AppAuthors,
GtkLumiera::AppAuthorCount, OWNERSHIP_NONE));
dialog.set_copyright(GtkLumiera::get_app_copyright());
dialog.set_website(GtkLumiera::get_app_website());
dialog.set_authors(GtkLumiera::get_app_authors());
dialog.set_transient_for(workspaceWindow);

View file

@ -85,7 +85,7 @@ void
WorkspaceWindow::create_ui()
{
//----- Configure the Window -----//
set_title(GtkLumiera::AppTitle);
set_title(GtkLumiera::get_app_title());
set_default_size(1024, 768);
//----- Set up the UI Manager -----//