Skip to content

Commit

Permalink
2006-09-24 Daniel Leidert <daniel.leidert.spam@gmx.net>
Browse files Browse the repository at this point in the history
	* gcu/Makefile.am: Fixed automake warning.
	* programs/3d/window.cc (on_about, on_about_activate_url): Just some
	cleanup and improvements. Added "clickable" Homepage URL.
	(entries[]): Fixed print and added about icon.
	* programs/table/gchemtable-app.cc (on_about, on_about_activate_url)
	(entries[]): Ditto.
	* programs/calc/gchemcalc.cc (on_about, on_about_activate_url)
	(entries[]): Ditto.
	(cb_print_version): Fixed string.
	(main): Improved usage output.
  • Loading branch information
dleidert committed Sep 24, 2006
1 parent 0310543 commit 4038574
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 61 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
##Text encoding: utf-8

2006-09-24 Daniel Leidert <daniel.leidert.spam@gmx.net>
* gcu/Makefile.am: Fixed automake warning.
* programs/3d/window.cc (on_about, on_about_activate_url): Just some
cleanup and improvements. Added "clickable" Homepage URL.
(entries[]): Fixed print and added about icon.
* programs/table/gchemtable-app.cc (on_about, on_about_activate_url)
(entries[]): Ditto.
* programs/calc/gchemcalc.cc (on_about, on_about_activate_url)
(entries[]): Ditto.
(cb_print_version): Fixed string.
(main): Improved usage output.

2006-09-24 Daniel Leidert <daniel.leidert.spam@gmx.net>
* configure.ac (MP_*): Replaced by GCU_* macros.
* AUTHORS: Updated information.
Expand Down
8 changes: 5 additions & 3 deletions gcu/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
MAINTAINERCLEANFILES = Makefile.in

INCLUDES = -I$(top_srcdir) @GCU_CFLAGS@
LDFLAGS = -version-info @GCU_VERSION_INFO@ @GCU_LIBS@
DEFS += -DDATADIR=\"$(datadir)\" -DLOCALEDIR=\"$(localedir)\" -DPKGDATADIR=\"$(datadir)/gchemutils-unstable\" -DGLADEDIR=\"$(datadir)/gchemutils-unstable/glade\"

AM_LDFLAGS = -version-info @GCU_VERSION_INFO@ @GCU_LIBS@
DEFS += -DDATADIR=\"$(datadir)\" \
-DLOCALEDIR=\"$(localedir)\" \
-DPKGDATADIR=\"$(datadir)/gchemutils-unstable\" \
-DGLADEDIR=\"$(datadir)/gchemutils-unstable/glade\"
lib_LTLIBRARIES= libgcu-unstable.la

libgcu_unstable_la_SOURCES = \
Expand Down
58 changes: 36 additions & 22 deletions programs/3d/window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <libgnomeprint/gnome-print-job.h>
#include <libgnomeprintui/gnome-print-dialog.h>
#include <libgnomeprintui/gnome-print-job-preview.h>
#include <libgnomevfs/gnome-vfs.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>

Expand Down Expand Up @@ -79,13 +80,24 @@ static void on_display (GtkRadioAction *action, GtkRadioAction *current, gc3dWin
window->GetView ()->Update ();
}

static void on_about_activate_url (GtkAboutDialog *about, const gchar *url, gpointer data)
{
GnomeVFSResult error = gnome_vfs_url_show(url);
if (error != GNOME_VFS_OK) {
g_print("GnomeVFSResult while trying to launch URL in about dialog: error %u\n", error);
}
}

static void on_about (GtkWidget *widget, void *data)
{
char * authors[] = {"Jean Bréfort", NULL};
// char * documentors[] = {NULL};
char license[] = "This program is free software; you can redistribute it and/or\n"
const gchar * authors[] = {"Jean Bréfort", NULL};
const gchar * comments = _("GChem3D is a molecular structures viewer for Gnome");
/* const gchar * documentors[] = {NULL}; */
const gchar * copyright = "Copyright \xc2\xa9 2004-2006 Jean Bréfort\n";
const gchar * license =
"This program is free software; you can redistribute it and/or\n"
"modify it under the terms of the GNU General Public License as\n"
"published by the Free Software Foundation; either version 2 of the\n"
"published by the Free Software Foundation; either version 2 of the\n"
"License, or (at your option) any later version.\n\n"
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
Expand All @@ -95,44 +107,46 @@ static void on_about (GtkWidget *widget, void *data)
"along with this program; if not, write to the Free Software\n"
"Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307\n"
"USA";
/* Note to translators: replace the following string with the appropriate credits for you lang */
char *translator_credits = _("translator_credits");

gtk_about_dialog_set_url_hook(on_about_activate_url, NULL, NULL);

/* Note to translators: replace the following string with the appropriate credits for you lang */
const gchar * translator_credits = _("translator_credits");
gtk_show_about_dialog (NULL,
"name", "GChem3D",
"authors", authors,
"comments", _("GChem3D is a molecular structures viewer for Gnome"),
"copyright", _("(C) 2004-2006 by Jean Bréfort"),
"license", license,
"translator_credits", strcmp (translator_credits, "translator_credits") != 0 ?
(const char *)translator_credits : NULL,
"version", VERSION,
"website", "http://www.nongnu.org/gchemutils",
NULL);
"name", "GChem3D",
"authors", authors,
"comments", comments,
"copyright", copyright,
"license", license,
"translator_credits", translator_credits,
"version", VERSION,
"website", "http://www.nongnu.org/gchemutils",
NULL);
}

static GtkActionEntry entries[] = {
{ "FileMenu", NULL, N_("_File") },
{ "Open", GTK_STOCK_OPEN, N_("_Open..."), "<control>O",
N_("Open a file"), G_CALLBACK (on_file_open) },
{ "Print", GTK_STOCK_OPEN, N_("_Print..."), "<control>P",
{ "Print", GTK_STOCK_PRINT, N_("_Print..."), "<control>P",
N_("Print the current scene"), G_CALLBACK (on_file_print) },
{ "Close", GTK_STOCK_CLOSE, N_("_Close"), "<control>W",
N_("Close the current file"), G_CALLBACK (on_file_close) },
{ "Quit", GTK_STOCK_QUIT, N_("_Quit"), "<control>Q",
N_("Quit GChem3D"), G_CALLBACK (on_quit) },
{ "ViewMenu", NULL, N_("_View") },
{ "HelpMenu", NULL, N_("_Help") },
{ "About", NULL, N_("_About"), NULL,
{ "About", GTK_STOCK_ABOUT, N_("_About"), NULL,
N_("About GChem3D"), G_CALLBACK (on_about) }
};

static GtkRadioActionEntry radios[] = {
{ "BallnStick", NULL, N_("Balls and sticks"), NULL,
{ "BallnStick", NULL, N_("Balls and sticks"), NULL,
N_("Display a balls and sticks model"),
0 },
{ "SpaceFill", "NULL", N_("Space filling"), NULL,
0 },
{ "SpaceFill", "NULL", N_("Space filling"), NULL,
N_("Display a space filling model"),
1 },
1 },
};

static const char *ui_description =
Expand Down
53 changes: 34 additions & 19 deletions programs/calc/gchemcalc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#include <goffice/utils/go-marker.h>
#include <gsf/gsf-input-memory.h>
#include <gsf/gsf-output-memory.h>
#include <libgnomevfs/gnome-vfs.h>
#include <math.h>
#include <iostream>

Expand Down Expand Up @@ -93,13 +94,24 @@ static void on_quit (GtkWidget *widget, void *data)
gtk_main_quit();
}

static void on_about_activate_url (GtkAboutDialog *about, const gchar *url, gpointer data)
{
GnomeVFSResult error = gnome_vfs_url_show(url);
if (error != GNOME_VFS_OK) {
g_print("GnomeVFSResult while trying to launch URL in about dialog: error %u\n", error);
}
}

static void on_about (GtkWidget *widget, void *data)
{
char * authors[] = {"Jean Bréfort", NULL};
// char * documentors[] = {NULL};
char license[] = "This program is free software; you can redistribute it and/or\n"
const gchar * authors[] = {"Jean Bréfort", NULL};
const gchar * comments = _("GChemCalc is a simple calculator for chemists");
/* const gchar * documentors[] = {NULL}; */
const gchar * copyright = "Copyright \xc2\xa9 2005,2006 Jean Bréfort\n";
const gchar * license =
"This program is free software; you can redistribute it and/or\n"
"modify it under the terms of the GNU General Public License as\n"
"published by the Free Software Foundation; either version 2 of the\n"
"published by the Free Software Foundation; either version 2 of the\n"
"License, or (at your option) any later version.\n\n"
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
Expand All @@ -109,19 +121,22 @@ static void on_about (GtkWidget *widget, void *data)
"along with this program; if not, write to the Free Software\n"
"Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307\n"
"USA";
/* Note to translators: replace the following string with the appropriate credits for you lang */
char *translator_credits = _("translator_credits");

gtk_about_dialog_set_url_hook(on_about_activate_url, NULL, NULL);

/* Note to translators: replace the following string with the appropriate credits for you lang */
const gchar * translator_credits = _("translator_credits");

gtk_show_about_dialog (NULL,
"name", "GChemCalc",
"authors", authors,
"comments", _("GChemCalc is a simple calculator for chemists"),
"copyright", _("(C) 2005-2006 by Jean Bréfort"),
"license", license,
"translator_credits", strcmp (translator_credits, "translator_credits") != 0 ?
(const char *)translator_credits : NULL,
"version", VERSION,
"website", "http://www.nongnu.org/gchemutils",
NULL);
"name", "GChemCalc",
"authors", authors,
"comments", comments,
"copyright", copyright,
"license", license,
"translator_credits", translator_credits,
"version", VERSION,
"website", "http://www.nongnu.org/gchemutils",
NULL);
}

static void cb_entry_active (GtkEntry *entry, gpointer data)
Expand Down Expand Up @@ -374,7 +389,7 @@ static GtkActionEntry entries[] = {
{ "Quit", GTK_STOCK_QUIT, N_("_Quit"), "<control>Q",
N_("Quit GChemCalc"), G_CALLBACK (on_quit) },
{ "HelpMenu", NULL, N_("_Help") },
{ "About", NULL, N_("_About"), NULL,
{ "About", GTK_STOCK_ABOUT, N_("_About"), NULL,
N_("About GChemCalc"), G_CALLBACK (on_about) }
};

Expand All @@ -392,7 +407,7 @@ static const char *ui_description =

gboolean cb_print_version (const gchar *option_name, const gchar *value, gpointer data, GError **error)
{
char *version = g_strconcat (_("Gnome Chemistry Utils version: "), VERSION, NULL);
char *version = g_strconcat (_("GChemCalc Calculator version: "), VERSION, NULL);
puts (version);
g_free (version);
exit (0);
Expand Down Expand Up @@ -429,7 +444,7 @@ int main (int argc, char *argv[])

#warning "the following line should be edited for stable releases"
if (argc > 1) {
cout << _("Usage: gchemcalc-unstable [OPTION...] [formula]") << endl;
cout << _("For usage see: gchemcalc-unstable [-?|--help]") << endl;
return -1;
}

Expand Down
48 changes: 31 additions & 17 deletions programs/table/gchemtable-app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <gtk/gtkstock.h>
#include <gtk/gtkuimanager.h>
#include <gtk/gtkwindow.h>
#include <libgnomevfs/gnome-vfs.h>
#include <stdlib.h>
#include <string.h>

Expand All @@ -60,13 +61,24 @@ void on_state_colors (GtkWidget *widget, GChemTableApp *App)
}
#endif

static void on_about_activate_url (GtkAboutDialog *about, const gchar *url, gpointer data)
{
GnomeVFSResult error = gnome_vfs_url_show(url);
if (error != GNOME_VFS_OK) {
g_print("GnomeVFSResult while trying to launch URL in about dialog: error %u\n", error);
}
}

static void on_about (GtkWidget *widget, GChemTableApp *app)
{
char * authors[] = {"Jean Bréfort", NULL};
// char * documentors[] = {NULL};
char license[] = "This program is free software; you can redistribute it and/or\n"
const gchar * authors[] = {"Jean Bréfort", NULL};
const gchar * comments = _("GChemTable is a chemical periodic table of the elements application");
/* const gchar * documentors[] = {NULL}; */
const gchar * copyright = "Copyright \xc2\xa9 2005,2006 Jean Bréfort";
const gchar * license =
"This program is free software; you can redistribute it and/or\n"
"modify it under the terms of the GNU General Public License as\n"
"published by the Free Software Foundation; either version 2 of the\n"
"published by the Free Software Foundation; either version 2 of the\n"
"License, or (at your option) any later version.\n\n"
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
Expand All @@ -76,19 +88,21 @@ static void on_about (GtkWidget *widget, GChemTableApp *app)
"along with this program; if not, write to the Free Software\n"
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307\n"
"USA";
/* Note to translators: replace the following string with the appropriate credits for you lang */
char *translator_credits = _("translator_credits");

gtk_about_dialog_set_url_hook(on_about_activate_url, NULL, NULL);

/* Note to translators: replace the following string with the appropriate credits for you lang */
const gchar * translator_credits = _("translator_credits");
gtk_show_about_dialog (app->GetWindow (),
"name", "GChemTable",
"authors", authors,
"comments", _("GChemTable is a chemical periodic table of the elements application"),
"copyright", _("(C) 2005-2006 by Jean Bréfort"),
"license", license,
"translator_credits", strcmp (translator_credits, "translator_credits") != 0 ?
(const char *)translator_credits : NULL,
"version", VERSION,
"website", "http://www.nongnu.org/gchemutils",
NULL);
"name", "GChemTable",
"authors", authors,
"comments", comments,
"copyright", copyright,
"license", license,
"translator_credits", translator_credits,
"version", VERSION,
"website", "http://www.nongnu.org/gchemutils",
NULL);
}

void on_changed (GtkPeriodic* periodic, guint Z, GChemTableApp *app)
Expand All @@ -112,7 +126,7 @@ static GtkActionEntry entries[] = {
G_CALLBACK (on_state_colors) },
#endif
{ "HelpMenu", NULL, N_("_Help") },
{ "About", NULL, N_("_About"), NULL,
{ "About", GTK_STOCK_ABOUT, N_("_About"), NULL,
N_("About GChemTable"), G_CALLBACK (on_about) }
};

Expand Down

0 comments on commit 4038574

Please sign in to comment.