From 3ee2a3a0aaf6e5424cc070d946c59896f5542667 Mon Sep 17 00:00:00 2001 From: Maurits Rijk Date: Sat, 28 May 2005 18:13:18 +0000 Subject: [PATCH] use gtk_about_dialog instead of home-brewn stuff. 2005-05-28 Maurits Rijk * plug-ins/imagemap/imap_about.c: use gtk_about_dialog instead of home-brewn stuff. * plug-ins/imagemap/imap_main.c * plug-ins/imagemap/imap_menu.c: minor clean-up. --- ChangeLog | 8 ++++++++ plug-ins/imagemap/imap_about.c | 28 +++++++++++++++++----------- plug-ins/imagemap/imap_main.c | 23 ++++++++++++----------- plug-ins/imagemap/imap_menu.c | 14 ++++++++++---- 4 files changed, 47 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 117eece33f..a34f9a1196 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-05-28 Maurits Rijk + + * plug-ins/imagemap/imap_about.c: use gtk_about_dialog instead of + home-brewn stuff. + + * plug-ins/imagemap/imap_main.c + * plug-ins/imagemap/imap_menu.c: minor clean-up. + 2005-05-27 Sven Neumann * (lots of files): Use the canonical form for signal names. diff --git a/plug-ins/imagemap/imap_about.c b/plug-ins/imagemap/imap_about.c index 8078d00ecd..30b9cd7467 100644 --- a/plug-ins/imagemap/imap_about.c +++ b/plug-ins/imagemap/imap_about.c @@ -26,24 +26,30 @@ #include #include "imap_about.h" -#include "imap_default_dialog.h" #include "libgimp/stdplugins-intl.h" void do_about_dialog(void) { - static DefaultDialog_t *dialog; + static GtkWidget *dialog; if (!dialog) { - dialog = make_default_dialog (_("About")); - default_dialog_hide_cancel_button (dialog); - default_dialog_hide_apply_button (dialog); - default_dialog_hide_help_button (dialog); - default_dialog_set_label (dialog, _("Imagemap plug-in 2.3")); - default_dialog_set_label (dialog, _("Copyright(c) 1999-2005 by Maurits Rijk")); - default_dialog_set_label (dialog, "m.rijk@chello.nl"); - default_dialog_set_label (dialog, _("Released under the GNU General Public License")); + const gchar* authors[] = {"Maurits Rijk (m.rijk@chello.nl)", NULL}; + + dialog = gtk_about_dialog_new (); + gtk_about_dialog_set_name (GTK_ABOUT_DIALOG (dialog), "Imagemap plug-in"); + gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (dialog), "2.3"); + gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG (dialog), + _("Copyright(c) 1999-2005 by Maurits Rijk")); + gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (dialog), authors); + gtk_about_dialog_set_license (GTK_ABOUT_DIALOG (dialog), + _("Released under the GNU General Public License")); + + g_signal_connect (dialog, "destroy", + G_CALLBACK (gtk_widget_destroyed), + &dialog); + } - default_dialog_show (dialog); + gtk_widget_show (dialog); } diff --git a/plug-ins/imagemap/imap_main.c b/plug-ins/imagemap/imap_main.c index 0f35d088bb..9e2a4e769c 100644 --- a/plug-ins/imagemap/imap_main.c +++ b/plug-ins/imagemap/imap_main.c @@ -1270,6 +1270,18 @@ do_move_down(void) */ } +void +do_use_gimp_guides_dialog(void) +{ + command_execute (gimp_guides_command_new (_shapes, _drawable)); +} + +void +do_create_guides_dialog(void) +{ + command_execute (guides_command_new (_shapes)); +} + #ifdef _NOT_READY_YET_ static Command_t* @@ -1302,17 +1314,6 @@ factory_send_to_back(void) return send_to_back_command_new(_shapes); } -static Command_t* -factory_create_guides_dialog(void) -{ - return guides_command_new(_shapes); -} - -static Command_t* -factory_use_gimp_guides_dialog(void) -{ - return gimp_guides_command_new(_shapes, _drawable); -} #endif static Command_t* diff --git a/plug-ins/imagemap/imap_menu.c b/plug-ins/imagemap/imap_menu.c index 54e399c956..3d649b6463 100644 --- a/plug-ins/imagemap/imap_menu.c +++ b/plug-ins/imagemap/imap_menu.c @@ -56,6 +56,9 @@ void do_grid_settings_dialog(); void do_zoom_in(); void do_zoom_out(); void do_edit_selected_shape(); +void do_create_guides_dialog(); +void do_use_gimp_guides_dialog(); + void imap_help(); void set_func(int func); @@ -197,12 +200,15 @@ static GtkActionEntry entries[] = { { "ToolsMenu", NULL, "_Tools" }, { "GridSettings", NULL, "Grid Settings...", NULL, NULL, do_grid_settings_dialog}, - { "UseGimpGuides", NULL, "Use GIMP Guides...", NULL, NULL, NULL}, - { "CreateGuides", NULL, "Create Guides...", NULL, NULL, NULL}, + { "UseGimpGuides", NULL, "Use GIMP Guides...", NULL, NULL, + do_use_gimp_guides_dialog}, + { "CreateGuides", NULL, "Create Guides...", NULL, NULL, + do_create_guides_dialog}, { "HelpMenu", NULL, "_Help" }, - { "Contents", NULL, "_Contents", NULL, NULL, imap_help}, - { "About", NULL, "_About ImageMap...", NULL, NULL, do_about_dialog}, + { "Contents", GTK_STOCK_HELP, "_Contents", NULL, NULL, imap_help}, + { "About", GTK_STOCK_ABOUT, "_About ImageMap...", NULL, NULL, + do_about_dialog}, { "ZoomMenu", NULL, "_Zoom" }, };