Commit 9377b26e authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

added help IDs to all actions representing the toplevel popups and menus

2004-05-02  Michael Natterer  <mitch@gimp.org>

	* app/actions/*-actions.c: added help IDs to all actions
	representing the toplevel popups and menus (as fallbacks for the
	still-to-be-written help system intrgration of GimpUIManager).

	* app/display/gimpdisplayshell.c (gimp_display_shell_new): removed
	call to gtk_ui_manager_ensure_update() because that's done by
	gimp_ui_manager_ui_get() now.

	* app/widgets/gimpmenufactory.[ch]: removed API to register and
	create item factories.

	* app/gui/menus.c: changed accordingly.

	* app/gui/dialogs.c
	* app/actions/plug-in-commands.c
	* app/gui/file-dialog-utils.c
	* app/gui/file-save-dialog.c
	* app/widgets/gimpdataeditor.c
	* app/widgets/gimpdockable.c
	* app/widgets/gimpdockbook.[ch]
	* app/widgets/gimpimagedock.c
	* app/widgets/gimpitemtreeview.c: removed leftover item factory
	cruft.

	* app/widgets/widgets-types.h: removed item factory typedefs...

	* app/widgets/gimpitemfactory.h: ...and added them here.

	* app/widgets/gimpactiongroup.[ch]: added new function
	gimp_action_group_add_plug_in_actions().

	* app/actions/plug-in-actions.c: use it here instead of adding
	the actions manually.

	* app/widgets/gimptoolbox.c: ported the code which dynamically
	updates the tool button tooltips on accelerator changes to
	GtkAction. Disabled the whole stuff because GTK+ lacks
	gtk_action_get_accel_closure().
parent 41a9add7
......@@ -41,7 +41,8 @@
static GimpActionEntry patterns_actions[] =
{
{ "patterns-popup", GIMP_STOCK_PATTERN, N_("Patterns Menu") },
{ "patterns-popup", GIMP_STOCK_PATTERN, N_("Patterns Menu"), NULL, NULL, NULL,
GIMP_HELP_PATTERN_DIALOG },
{ "patterns-edit", GIMP_STOCK_EDIT,
N_("_Edit Pattern..."), NULL, NULL,
......
......@@ -40,7 +40,6 @@
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimppluginaction.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
......@@ -287,31 +286,26 @@ plug_in_actions_add_proc (GimpActionGroup *group,
if (p1 && p2)
{
gchar *label;
GimpPlugInAction *action;
GimpPlugInActionEntry entry;
gchar *label;
label = p2 + 1;
entry.name = proc_def->db_info.name;
entry.stock_id = NULL;
entry.label = label;
entry.accelerator = proc_def->accelerator;
entry.tooltip = NULL;
entry.proc_def = proc_def;
entry.help_id = help_id;
#if 0
g_print ("adding plug-in action '%s' (%s)\n",
proc_def->db_info.name, label);
#endif
action = gimp_plug_in_action_new (proc_def->db_info.name,
label, NULL, NULL,
proc_def);
g_signal_connect (action, "selected",
G_CALLBACK (plug_in_run_cmd_callback),
group->user_data);
gtk_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
GTK_ACTION (action),
proc_def->accelerator);
g_object_unref (action);
g_free (help_id);
gimp_action_group_add_plug_in_actions (group, &entry, 1,
G_CALLBACK (plug_in_run_cmd_callback));
*p1 = '\0';
*p2 = '\0';
......@@ -321,6 +315,8 @@ plug_in_actions_add_proc (GimpActionGroup *group,
g_free (path_original);
g_free (path_translated);
}
g_free (help_id);
}
void
......
......@@ -34,7 +34,6 @@
#include "plug-in/plug-in-proc.h"
#include "widgets/gimpdock.h"
#include "widgets/gimpitemfactory.h"
#include "display/gimpdisplay.h"
......
......@@ -40,7 +40,8 @@
static GimpActionEntry qmask_actions[] =
{
{ "qmask-popup", NULL, N_("QMask Menu") },
{ "qmask-popup", NULL, N_("QMask Menu"), NULL, NULL, NULL,
GIMP_HELP_QMASK },
{ "qmask-configure", NULL,
N_("_Configure Color and Opacity..."), NULL, NULL,
......
......@@ -40,7 +40,8 @@
static GimpActionEntry qmask_actions[] =
{
{ "qmask-popup", NULL, N_("QMask Menu") },
{ "qmask-popup", NULL, N_("QMask Menu"), NULL, NULL, NULL,
GIMP_HELP_QMASK },
{ "qmask-configure", NULL,
N_("_Configure Color and Opacity..."), NULL, NULL,
......
......@@ -39,7 +39,9 @@
static GimpActionEntry templates_actions[] =
{
{ "templates-popup", GIMP_STOCK_TEMPLATE, N_("Templates Menu") },
{ "templates-popup", GIMP_STOCK_TEMPLATE, N_("Templates Menu"),
NULL, NULL, NULL,
GIMP_HELP_TEMPLATE_DIALOG },
{ "templates-create-image", GIMP_STOCK_IMAGE,
N_("_Create Image from Template..."), "", NULL,
......
......@@ -52,7 +52,9 @@ static void tool_options_actions_update_presets (GimpActionGroup *group,
static GimpActionEntry tool_options_actions[] =
{
{ "tool-options-popup", GIMP_STOCK_TOOL_OPTIONS, N_("Tool Options Menu") },
{ "tool-options-popup", GIMP_STOCK_TOOL_OPTIONS, N_("Tool Options Menu"),
NULL, NULL, NULL,
GIMP_HELP_TOOL_OPTIONS_DIALOG },
{ "tool-options-save-menu", NULL, N_("_Save Options to") },
{ "tool-options-restore-menu", NULL, N_("_Restore Options from") },
......
......@@ -40,7 +40,8 @@
static GimpActionEntry vectors_actions[] =
{
{ "vectors-popup", GIMP_STOCK_PATHS, N_("Paths Menu") },
{ "vectors-popup", GIMP_STOCK_PATHS, N_("Paths Menu"), NULL, NULL, NULL,
GIMP_HELP_PATH_DIALOG },
{ "vectors-path-tool", GIMP_STOCK_TOOL_PATH,
N_("Path _Tool"), NULL, NULL,
......
......@@ -26,7 +26,6 @@
#include "core/gimpcontext.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpitemfactory.h"
#include "dialogs.h"
#include "dialogs-constructors.h"
......
......@@ -23,7 +23,7 @@
#include "gui-types.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpactiongroup.h"
#include "file-dialog-utils.h"
......@@ -32,9 +32,18 @@ void
file_dialog_show (GtkWidget *dialog,
GtkWidget *parent)
{
gimp_item_factories_set_sensitive ("<Image>", "/File/Save", FALSE);
gimp_item_factories_set_sensitive ("<Image>", "/File/Save as...", FALSE);
gimp_item_factories_set_sensitive ("<Image>", "/File/Save a Copy...", FALSE);
GList *list;
for (list = gimp_action_groups_from_name ("file");
list;
list = g_list_next (list))
{
GimpActionGroup *group = list->data;
gimp_action_group_set_action_sensitive (group, "file-save", FALSE);
gimp_action_group_set_action_sensitive (group, "file-save-as", FALSE);
gimp_action_group_set_action_sensitive (group, "file-save-a-copy", FALSE);
}
gtk_window_set_screen (GTK_WINDOW (dialog), gtk_widget_get_screen (parent));
gtk_window_present (GTK_WINDOW (dialog));
......@@ -43,9 +52,18 @@ file_dialog_show (GtkWidget *dialog,
void
file_dialog_hide (GtkWidget *dialog)
{
GList *list;
gtk_widget_hide (dialog);
gimp_item_factories_set_sensitive ("<Image>", "/File/Save", TRUE);
gimp_item_factories_set_sensitive ("<Image>", "/File/Save as...", TRUE);
gimp_item_factories_set_sensitive ("<Image>", "/File/Save a Copy...", TRUE);
for (list = gimp_action_groups_from_name ("file");
list;
list = g_list_next (list))
{
GimpActionGroup *group = list->data;
gimp_action_group_set_action_sensitive (group, "file-save", TRUE);
gimp_action_group_set_action_sensitive (group, "file-save-as", TRUE);
gimp_action_group_set_action_sensitive (group, "file-save-a-copy", TRUE);
}
}
......@@ -36,7 +36,6 @@
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpfiledialog.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpmenufactory.h"
#include "dialogs.h"
......
......@@ -636,9 +636,7 @@ gimp_display_shell_new (GimpDisplay *gdisp,
main_vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (shell), main_vbox);
menubar = gimp_ui_manager_ui_get (shell->menubar_manager,
"/image-menubar");
gtk_ui_manager_ensure_update (GTK_UI_MANAGER (shell->menubar_manager));
menubar = gimp_ui_manager_ui_get (shell->menubar_manager, "/image-menubar");
gtk_box_pack_start (GTK_BOX (main_vbox), menubar, FALSE, FALSE, 0);
if (shell->options->show_menubar)
......
......@@ -26,7 +26,6 @@
#include "core/gimpcontext.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpitemfactory.h"
#include "dialogs.h"
#include "dialogs-constructors.h"
......
......@@ -23,7 +23,7 @@
#include "gui-types.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpactiongroup.h"
#include "file-dialog-utils.h"
......@@ -32,9 +32,18 @@ void
file_dialog_show (GtkWidget *dialog,
GtkWidget *parent)
{
gimp_item_factories_set_sensitive ("<Image>", "/File/Save", FALSE);
gimp_item_factories_set_sensitive ("<Image>", "/File/Save as...", FALSE);
gimp_item_factories_set_sensitive ("<Image>", "/File/Save a Copy...", FALSE);
GList *list;
for (list = gimp_action_groups_from_name ("file");
list;
list = g_list_next (list))
{
GimpActionGroup *group = list->data;
gimp_action_group_set_action_sensitive (group, "file-save", FALSE);
gimp_action_group_set_action_sensitive (group, "file-save-as", FALSE);
gimp_action_group_set_action_sensitive (group, "file-save-a-copy", FALSE);
}
gtk_window_set_screen (GTK_WINDOW (dialog), gtk_widget_get_screen (parent));
gtk_window_present (GTK_WINDOW (dialog));
......@@ -43,9 +52,18 @@ file_dialog_show (GtkWidget *dialog,
void
file_dialog_hide (GtkWidget *dialog)
{
GList *list;
gtk_widget_hide (dialog);
gimp_item_factories_set_sensitive ("<Image>", "/File/Save", TRUE);
gimp_item_factories_set_sensitive ("<Image>", "/File/Save as...", TRUE);
gimp_item_factories_set_sensitive ("<Image>", "/File/Save a Copy...", TRUE);
for (list = gimp_action_groups_from_name ("file");
list;
list = g_list_next (list))
{
GimpActionGroup *group = list->data;
gimp_action_group_set_action_sensitive (group, "file-save", TRUE);
gimp_action_group_set_action_sensitive (group, "file-save-as", TRUE);
gimp_action_group_set_action_sensitive (group, "file-save-a-copy", TRUE);
}
}
......@@ -36,7 +36,6 @@
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpfiledialog.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpmenufactory.h"
#include "dialogs.h"
......
......@@ -34,7 +34,6 @@
#include "file/file-utils.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpmenufactory.h"
#include "widgets/gimpuimanager.h"
......@@ -85,11 +84,6 @@ menus_init (Gimp *gimp)
global_menu_factory = gimp_menu_factory_new (gimp, global_action_factory);
gimp_menu_factory_menu_register (global_menu_factory, "<Image>",
_("Image Menu"),
GIMP_HELP_IMAGE_WINDOW,
NULL, NULL, FALSE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Image>",
"file",
"debug",
......@@ -116,11 +110,6 @@ menus_init (Gimp *gimp)
"qmask-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Load>",
_("Open Menu"),
GIMP_HELP_FILE_OPEN,
NULL, NULL, FALSE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Load>",
"file-open",
NULL,
......@@ -129,11 +118,6 @@ menus_init (Gimp *gimp)
file_open_menu_setup,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Save>",
_("Save Menu"),
GIMP_HELP_FILE_SAVE,
NULL, NULL, FALSE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Save>",
"file-save",
NULL,
......@@ -142,11 +126,6 @@ menus_init (Gimp *gimp)
file_save_menu_setup,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Layers>",
_("Layers Menu"),
GIMP_HELP_LAYER_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Layers>",
"layers",
NULL,
......@@ -154,11 +133,6 @@ menus_init (Gimp *gimp)
"layers-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Channels>",
_("Channels Menu"),
GIMP_HELP_CHANNEL_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Channels>",
"channels",
NULL,
......@@ -166,11 +140,6 @@ menus_init (Gimp *gimp)
"channels-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Vectors>",
_("Paths Menu"),
GIMP_HELP_PATH_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Vectors>",
"vectors",
NULL,
......@@ -178,11 +147,6 @@ menus_init (Gimp *gimp)
"vectors-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Dialogs>",
_("Dialogs Menu"),
GIMP_HELP_DOCK,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Dialogs>",
"dockable",
NULL,
......@@ -190,11 +154,6 @@ menus_init (Gimp *gimp)
"dockable-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Brushes>",
_("Brushes Menu"),
GIMP_HELP_BRUSH_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Brushes>",
"brushes",
NULL,
......@@ -202,11 +161,6 @@ menus_init (Gimp *gimp)
"brushes-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Patterns>",
_("Patterns Menu"),
GIMP_HELP_PATTERN_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Patterns>",
"patterns",
NULL,
......@@ -214,11 +168,6 @@ menus_init (Gimp *gimp)
"patterns-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Gradients>",
_("Gradients Menu"),
GIMP_HELP_GRADIENT_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Gradients>",
"gradients",
NULL,
......@@ -226,11 +175,6 @@ menus_init (Gimp *gimp)
"gradients-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Palettes>",
_("Palettes Menu"),
GIMP_HELP_PALETTE_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Palettes>",
"palettes",
NULL,
......@@ -238,11 +182,6 @@ menus_init (Gimp *gimp)
"palettes-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Fonts>",
_("Fonts Menu"),
GIMP_HELP_FONT_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Fonts>",
"fonts",
NULL,
......@@ -250,11 +189,6 @@ menus_init (Gimp *gimp)
"fonts-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Buffers>",
_("Buffers Menu"),
GIMP_HELP_BUFFER_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Buffers>",
"buffers",
NULL,
......@@ -262,11 +196,6 @@ menus_init (Gimp *gimp)
"buffers-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Documents>",
_("Documents Menu"),
GIMP_HELP_DOCUMENT_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Documents>",
"documents",
NULL,
......@@ -274,11 +203,6 @@ menus_init (Gimp *gimp)
"documents-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Templates>",
_("Templates Menu"),
GIMP_HELP_TEMPLATE_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Templates>",
"templates",
NULL,
......@@ -286,11 +210,6 @@ menus_init (Gimp *gimp)
"templates-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Images>",
_("Images Menu"),
GIMP_HELP_IMAGE_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Images>",
"images",
NULL,
......@@ -298,11 +217,6 @@ menus_init (Gimp *gimp)
"images-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<GradientEditor>",
_("Gradient Editor Menu"),
GIMP_HELP_GRADIENT_EDITOR_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<GradientEditor>",
"gradient-editor",
NULL,
......@@ -310,11 +224,6 @@ menus_init (Gimp *gimp)
"gradient-editor-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<PaletteEditor>",
_("Palette Editor Menu"),
GIMP_HELP_PALETTE_EDITOR_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<PaletteEditor>",
"palette-editor",
NULL,
......@@ -322,11 +231,6 @@ menus_init (Gimp *gimp)
"palette-editor-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<ColormapEditor>",
_("Indexed Palette Menu"),
GIMP_HELP_INDEXED_PALETTE_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<ColormapEditor>",
"colormap-editor",
NULL,
......@@ -334,23 +238,6 @@ menus_init (Gimp *gimp)
"colormap-editor-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<QMask>",
_("QuickMask Menu"),
GIMP_HELP_QMASK,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<QMask>",
"qmask",
NULL,
"/qmask-popup",
"qmask-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<ErrorConsole>",
_("Error Console Menu"),
GIMP_HELP_ERRORS_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<ErrorConsole>",
"error-console",
NULL,
......@@ -358,11 +245,6 @@ menus_init (Gimp *gimp)
"error-console-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<ToolOptions>",
_("Tool Options Menu"),
GIMP_HELP_TOOL_OPTIONS_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<ToolOptions>",
"tool-options",
NULL,
......
......@@ -34,7 +34,6 @@
#include "file/file-utils.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
#include "widgets/gimpmenufactory.h"
#include "widgets/gimpuimanager.h"
......@@ -85,11 +84,6 @@ menus_init (Gimp *gimp)
global_menu_factory = gimp_menu_factory_new (gimp, global_action_factory);
gimp_menu_factory_menu_register (global_menu_factory, "<Image>",
_("Image Menu"),
GIMP_HELP_IMAGE_WINDOW,
NULL, NULL, FALSE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Image>",
"file",
"debug",
......@@ -116,11 +110,6 @@ menus_init (Gimp *gimp)
"qmask-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Load>",
_("Open Menu"),
GIMP_HELP_FILE_OPEN,
NULL, NULL, FALSE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Load>",
"file-open",
NULL,
......@@ -129,11 +118,6 @@ menus_init (Gimp *gimp)
file_open_menu_setup,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Save>",
_("Save Menu"),
GIMP_HELP_FILE_SAVE,
NULL, NULL, FALSE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Save>",
"file-save",
NULL,
......@@ -142,11 +126,6 @@ menus_init (Gimp *gimp)
file_save_menu_setup,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Layers>",
_("Layers Menu"),
GIMP_HELP_LAYER_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Layers>",
"layers",
NULL,
......@@ -154,11 +133,6 @@ menus_init (Gimp *gimp)
"layers-menu.xml", NULL,
NULL);
gimp_menu_factory_menu_register (global_menu_factory, "<Channels>",
_("Channels Menu"),
GIMP_HELP_CHANNEL_DIALOG,
NULL, NULL, TRUE,
0, NULL);
gimp_menu_factory_manager_register (global_menu_factory, "<Channels>",
"channels",
NULL,
......@@ -166,11 +140,6 @@ menus_init (Gimp *gimp)
"channels-menu.xml", NULL,
NULL);