X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=src%2Fhelpmenu.c;h=4a8d9dc5377a157e16b03439948e2ff15c345d4f;hb=5905b40585298defb8e4230adfe90dfbccb465b9;hp=f1a468a8547418ab3cdbeb05cec47d9770d963a6;hpb=6a65dca9d597772744524b909f2d89b479b8bf77;p=emu8051.git diff --git a/src/helpmenu.c b/src/helpmenu.c index f1a468a..4a8d9dc 100644 --- a/src/helpmenu.c +++ b/src/helpmenu.c @@ -16,13 +16,15 @@ * * 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. + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ #if HAVE_CONFIG_H # include "config.h" #endif +#include + #if STDC_HEADERS # include #elif HAVE_STRINGS_H @@ -37,50 +39,81 @@ #include "messagebox.h" #include "helpmenu.h" +#define PACKAGE_COPYRIGHT "(c) Hugo Villeneuve" static void -HelpCommandsEvent( gchar *string ) +HelpCommandsEvent(gchar *string) { - ShowMessage( "Command Line Options", COMMAND_LINE_OPTIONS, GTK_JUSTIFY_LEFT, - MESSAGE_DIALOG_FIXED_FONT ); + ShowMessage("Command Line Options", COMMAND_LINE_OPTIONS, + GTK_JUSTIFY_LEFT, MESSAGE_DIALOG_FIXED_FONT); } - static void -HelpAboutEvent( gchar *string ) +HelpAboutEvent(GtkWidget *widget, gpointer data) { - ShowMessage( "About", VERSION_STRING, GTK_JUSTIFY_CENTER, MESSAGE_DIALOG_NORMAL_FONT ); -} + const char *authors[] = { + "Hugo Villeneuve ", + "Jonathan St-André", + "Pascal Fecteau", + "Jimmy Ringuette", + NULL, + }; + const char *license = + "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.\n\n" + "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.\n\n" + "You should have received a copy of the GNU General Public" + " License along with this program. If not, see\n" + " "; + + gtk_show_about_dialog( + NULL, + "name", PACKAGE_NAME, + "title", "About Dialog", + "version", PACKAGE_VERSION, + "logo-icon-name", PACKAGE_TARNAME, + "comments", get_package_description(), + "authors", authors, + "website", PACKAGE_URL, + "copyright", PACKAGE_COPYRIGHT, + "license", license, + "wrap-license", true, + NULL); +} void -HelpAddMenu( GtkWidget *menu_bar ) +HelpAddMenu(GtkWidget *menu_bar) { - GtkWidget *item; - GtkWidget *menu; - - menu = gtk_menu_new(); - - /* Create the 'Help Command Line Options' item. */ - item = gtk_menu_item_new_with_label("Command Line Options"); - gtk_menu_append( GTK_MENU(menu), item ); - /* Attach the callback functions to the activate signal. */ - gtk_signal_connect_object( GTK_OBJECT(item), "activate", - GTK_SIGNAL_FUNC(HelpCommandsEvent), - NULL ); - - AddMenuSeparator(menu); - - /* Create the 'Help About' item. */ - item = gtk_menu_item_new_with_label( "About " PACKAGE ); - gtk_menu_append( GTK_MENU(menu), item ); - /* Attach the callback functions to the activate signal. */ - gtk_signal_connect_object( GTK_OBJECT(item), "activate", - GTK_SIGNAL_FUNC(HelpAboutEvent), - NULL ); - - /* Adding submenu title. */ - item = gtk_menu_item_new_with_label( "Help" ); - gtk_menu_item_set_submenu( GTK_MENU_ITEM(item), menu ); - gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), item ); + GtkWidget *item; + GtkWidget *menu; + + menu = gtk_menu_new(); + + /* Create the 'Help Command Line Options' item. */ + item = gtk_menu_item_new_with_label("Command Line Options"); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + /* Attach the callback functions to the activate signal. */ + g_signal_connect(item, "activate", G_CALLBACK(HelpCommandsEvent), NULL); + + AddMenuSeparator(menu); + + /* Create the 'Help About' item. */ + item = gtk_menu_item_new_with_label("About " PACKAGE); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); + /* Attach the callback functions to the activate signal. */ + g_signal_connect(item, "activate", G_CALLBACK(HelpAboutEvent), NULL); + + /* Adding submenu title. */ + item = gtk_menu_item_new_with_label("Help"); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), menu); + gtk_menu_shell_append((GtkMenuShell *) menu_bar, item); }