Do not use help buttons and menu items if it's not built

This commit is contained in:
Yevgen Muntyan 2007-09-08 01:12:01 -05:00
parent 2e0e0324cf
commit 36b5ee89fc
3 changed files with 9 additions and 0 deletions

View File

@ -1285,12 +1285,14 @@ install_common_actions (void)
"closure-callback", moo_app_about_dialog,
NULL);
#ifdef MOO_ENABLE_HELP
moo_window_class_new_action (klass, "Help", NULL,
"label", GTK_STOCK_HELP,
"accel", "F1",
"stock-id", GTK_STOCK_HELP,
"closure-callback", moo_app_help,
NULL);
#endif
moo_window_class_new_action (klass, "SystemInfo", NULL,
/* menu item label */

View File

@ -11,6 +11,7 @@
* See COPYING file that comes with this distribution.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "mooutils/moodialogs.h"
#include "mooutils/mooprefs.h"
@ -368,12 +369,14 @@ GtkWidget *file_chooser_dialog_new (const char *title,
start_dir);
#ifdef MOO_ENABLE_HELP
if (help_id)
{
moo_help_set_id (dialog, help_id);
moo_help_connect_keys (dialog);
gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_HELP, GTK_RESPONSE_HELP);
}
#endif
return dialog;
}

View File

@ -125,14 +125,18 @@ moo_prefs_dialog_init (MooPrefsDialog *dialog)
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
#ifdef MOO_ENABLE_HELP
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
#endif
GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
#if GTK_MINOR_VERSION >= 6
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
#ifdef MOO_ENABLE_HELP
GTK_RESPONSE_HELP,
#endif
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
GTK_RESPONSE_APPLY,