Closed dbarnett closed 7 years ago
Melike will work on this.
Something like this:
main.cc
gboolean do_show_version = false;
...
// Note to translators: This is the help string for "--version"
{"version", 'v', 0, G_OPTION_ARG_NONE, &do_show_version, N_("Show the version details."), NULL},
...
if (do_show_version)
{
option_version();
return 0;
}
DasherAppSettings.h
void option_version()
DasherAppSettings.cpp
void option_version()
{
g_print("\n");
// Note to translators: This is the version keyword showing for the command line option "--version"
g_print("%-30s %-30s\n", _("Version"), PACKAGE_VERSION);
}
Also check dasher_main.cpp. Constants such as PACKAGE_VERSION and other information such as license can be used in producing the version string inside option_version() method.
gtk_show_about_dialog(GTK_WINDOW(pPrivate->pMainWindow),
"authors", authors,
"comments", _("Dasher is a predictive text entry application"),
"copyright", "Copyright \xC2\xA9 1998-2011 The Dasher Project",
"documenters", documenters,
"license", "GPL 2+",
"logo-icon-name", "dasher",
"translator-credits", _("translator-credits"),
"version", PACKAGE_VERSION,
"website", PACKAGE_URL,
"wrap-license", true,
NULL);
Hi, I committed some changes in the files Src/main.cc, Src/Gtk2/DasherAppSettings.h and Src/Gtk2/DasherAppSettings.cpp Could you please check them? Thanks Melike
Most programs accept a
--version
argument to run them in a mode that prints the program version and exits, e.g.:Dasher completely ignores a
--version
arg if I pass it and starts normally instead. It doesn't seem to have any way to query the version besides loading the GUI and checkingHelp>About
.