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().
This commit is contained in:

committed by
Michael Natterer

parent
41a9add7da
commit
9377b26ebc
41
ChangeLog
41
ChangeLog
@ -1,3 +1,44 @@
|
||||
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().
|
||||
|
||||
2004-05-02 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* menus/Makefile.am: added a rule to generate gtkuimanager XML
|
||||
|
@ -41,7 +41,8 @@
|
||||
|
||||
static GimpActionEntry brushes_actions[] =
|
||||
{
|
||||
{ "brushes-popup", GIMP_STOCK_BRUSH, N_("Brushes Menu") },
|
||||
{ "brushes-popup", GIMP_STOCK_BRUSH, N_("Brushes Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_BRUSH_DIALOG },
|
||||
|
||||
{ "brushes-edit", GIMP_STOCK_EDIT,
|
||||
N_("_Edit Brush..."), NULL, NULL,
|
||||
|
@ -39,7 +39,8 @@
|
||||
|
||||
static GimpActionEntry buffers_actions[] =
|
||||
{
|
||||
{ "buffers-popup", GIMP_STOCK_BUFFER, N_("Buffers Menu") },
|
||||
{ "buffers-popup", GIMP_STOCK_BUFFER, N_("Buffers Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_BUFFER_DIALOG },
|
||||
|
||||
{ "buffers-paste", GTK_STOCK_PASTE,
|
||||
N_("_Paste Buffer"), "", NULL,
|
||||
|
@ -40,7 +40,8 @@
|
||||
|
||||
static GimpActionEntry channels_actions[] =
|
||||
{
|
||||
{ "channels-popup", GIMP_STOCK_CHANNELS, N_("Channels Menu") },
|
||||
{ "channels-popup", GIMP_STOCK_CHANNELS, N_("Channels Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_CHANNEL_DIALOG },
|
||||
|
||||
{ "channels-edit-attributes", GIMP_STOCK_EDIT,
|
||||
N_("_Edit Channel Attributes..."), NULL, NULL,
|
||||
|
@ -39,7 +39,8 @@
|
||||
static GimpActionEntry colormap_editor_actions[] =
|
||||
{
|
||||
{ "colormap-editor-popup", GIMP_STOCK_INDEXED_PALETTE,
|
||||
N_("Indexed Palette Menu") },
|
||||
N_("Indexed Palette Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_INDEXED_PALETTE_DIALOG },
|
||||
|
||||
{ "colormap-editor-edit-color", GIMP_STOCK_EDIT,
|
||||
N_("_Edit Color..."), NULL, NULL,
|
||||
|
@ -39,7 +39,8 @@
|
||||
static GimpActionEntry colormap_editor_actions[] =
|
||||
{
|
||||
{ "colormap-editor-popup", GIMP_STOCK_INDEXED_PALETTE,
|
||||
N_("Indexed Palette Menu") },
|
||||
N_("Indexed Palette Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_INDEXED_PALETTE_DIALOG },
|
||||
|
||||
{ "colormap-editor-edit-color", GIMP_STOCK_EDIT,
|
||||
N_("_Edit Color..."), NULL, NULL,
|
||||
|
@ -35,26 +35,23 @@
|
||||
|
||||
static GimpActionEntry dialogs_actions[] =
|
||||
{
|
||||
{ "dialogs-menu", NULL,
|
||||
N_("_Dialogs") },
|
||||
|
||||
{ "dialogs-new-dock-menu", NULL,
|
||||
N_("Create New Doc_k") },
|
||||
{ "dialogs-menu", NULL, N_("_Dialogs") },
|
||||
{ "dialogs-new-dock-menu", NULL, N_("Create New Doc_k") },
|
||||
|
||||
{ "dialogs-new-dock-lcp", NULL,
|
||||
N_("_Layers, Channels & Paths"), NULL, NULL,
|
||||
G_CALLBACK (dialogs_create_lc_cmd_callback),
|
||||
NULL },
|
||||
GIMP_HELP_DOCK },
|
||||
|
||||
{ "dialogs-new-dock-data", NULL,
|
||||
N_("_Brushes, Patterns & Gradients"), NULL, NULL,
|
||||
G_CALLBACK (dialogs_create_data_cmd_callback),
|
||||
NULL },
|
||||
GIMP_HELP_DOCK },
|
||||
|
||||
{ "dialogs-new-dock-stuff", NULL,
|
||||
N_("_Misc. Stuff"), NULL, NULL,
|
||||
G_CALLBACK (dialogs_create_stuff_cmd_callback),
|
||||
NULL },
|
||||
GIMP_HELP_DOCK },
|
||||
|
||||
{ "dialogs-toolbox", NULL,
|
||||
N_("Tool_box"), NULL, NULL,
|
||||
|
@ -45,7 +45,9 @@
|
||||
|
||||
static GimpActionEntry dockable_actions[] =
|
||||
{
|
||||
{ "dockable-popup", NULL, N_("Dialogs Menu") },
|
||||
{ "dockable-popup", NULL, N_("Dialogs Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_DOCK },
|
||||
|
||||
{ "dockable-menu", GTK_STOCK_MISSING_IMAGE, "" },
|
||||
{ "dockable-add-tab-menu", NULL, N_("_Add Tab") },
|
||||
{ "dockable-preview-size-menu", NULL, N_("Preview Si_ze") },
|
||||
|
@ -39,7 +39,8 @@
|
||||
|
||||
static GimpActionEntry documents_actions[] =
|
||||
{
|
||||
{ "documents-popup", GTK_STOCK_OPEN, N_("Documents Menu") },
|
||||
{ "documents-popup", GTK_STOCK_OPEN, N_("Documents Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_DOCUMENT_DIALOG },
|
||||
|
||||
{ "documents-open", GTK_STOCK_OPEN,
|
||||
N_("_Open Image"), "", NULL,
|
||||
|
@ -36,7 +36,9 @@
|
||||
|
||||
static GimpActionEntry error_console_actions[] =
|
||||
{
|
||||
{ "error-console-popup", GIMP_STOCK_WARNING, N_("Error Console Menu") },
|
||||
{ "error-console-popup", GIMP_STOCK_WARNING, N_("Error Console Menu"),
|
||||
NULL, NULL, NULL,
|
||||
GIMP_HELP_ERRORS_DIALOG },
|
||||
|
||||
{ "error-console-clear", GTK_STOCK_CLEAR,
|
||||
N_("_Clear Errors"), "", NULL,
|
||||
|
@ -43,7 +43,8 @@
|
||||
|
||||
static GimpActionEntry file_open_actions[] =
|
||||
{
|
||||
{ "file-open-popup", NULL, N_("File Open Menu") },
|
||||
{ "file-open-popup", NULL, N_("File Open Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_FILE_OPEN },
|
||||
|
||||
{ "file-open-automatic", NULL,
|
||||
N_("Automatic"), NULL, NULL,
|
||||
|
@ -43,7 +43,8 @@
|
||||
|
||||
static GimpActionEntry file_save_actions[] =
|
||||
{
|
||||
{ "file-save-popup", NULL, N_("File Save Menu") },
|
||||
{ "file-save-popup", NULL, N_("File Save Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_FILE_SAVE },
|
||||
|
||||
{ "file-save-by-extension", NULL,
|
||||
N_("By Extension"), NULL, NULL,
|
||||
|
@ -41,7 +41,8 @@
|
||||
|
||||
static GimpActionEntry fonts_actions[] =
|
||||
{
|
||||
{ "fonts-popup", GIMP_STOCK_FONT, N_("Fonts Menu") },
|
||||
{ "fonts-popup", GIMP_STOCK_FONT, N_("Fonts Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_FONT_DIALOG },
|
||||
|
||||
{ "fonts-refresh", GTK_STOCK_REFRESH,
|
||||
N_("_Rescan Font List"), "", NULL,
|
||||
|
@ -42,7 +42,9 @@
|
||||
|
||||
static GimpActionEntry gradient_editor_actions[] =
|
||||
{
|
||||
{ "gradient-editor-popup", GIMP_STOCK_GRADIENT, N_("Gradient Editor Menu") },
|
||||
{ "gradient-editor-popup", GIMP_STOCK_GRADIENT, N_("Gradient Editor Menu"),
|
||||
NULL, NULL, NULL,
|
||||
GIMP_HELP_GRADIENT_EDITOR_DIALOG },
|
||||
|
||||
{ "gradient-editor-load-left-color", NULL, N_("_Load Left Color From") },
|
||||
{ "gradient-editor-save-left-color", NULL, N_("_Save Left Color To") },
|
||||
|
@ -42,7 +42,9 @@
|
||||
|
||||
static GimpActionEntry gradients_actions[] =
|
||||
{
|
||||
{ "gradients-popup", GIMP_STOCK_GRADIENT, N_("Gradients Menu") },
|
||||
{ "gradients-popup", GIMP_STOCK_GRADIENT, N_("Gradients Menu"),
|
||||
NULL, NULL, NULL,
|
||||
GIMP_HELP_GRADIENT_DIALOG },
|
||||
|
||||
{ "gradients-edit", GIMP_STOCK_EDIT,
|
||||
N_("_Edit Gradient..."), NULL, NULL,
|
||||
|
@ -45,9 +45,16 @@
|
||||
|
||||
static GimpActionEntry image_actions[] =
|
||||
{
|
||||
{ "toolbox-menubar", NULL, N_("Toolbox Menu") },
|
||||
{ "toolbox-menubar", NULL, N_("Toolbox Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_TOOLBOX },
|
||||
|
||||
{ "image-menubar", NULL, N_("Image Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_IMAGE_WINDOW },
|
||||
|
||||
{ "image-popup", NULL, N_("Image Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_IMAGE_WINDOW },
|
||||
|
||||
{ "extensions-menu", NULL, N_("_Xtns") },
|
||||
{ "image-menubar", NULL, N_("Image Menu") },
|
||||
{ "image-menu", NULL, N_("_Image") },
|
||||
{ "image-mode-menu", NULL, N_("_Mode") },
|
||||
{ "image-transform-menu", NULL, N_("_Transform") },
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "widgets/gimpactiongroup.h"
|
||||
#include "widgets/gimpcontainereditor.h"
|
||||
#include "widgets/gimpcontainerview.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
|
||||
#include "images-actions.h"
|
||||
#include "images-commands.h"
|
||||
@ -39,7 +40,8 @@
|
||||
|
||||
static GimpActionEntry images_actions[] =
|
||||
{
|
||||
{ "images-popup", GIMP_STOCK_IMAGES, N_("Images Menu") },
|
||||
{ "images-popup", GIMP_STOCK_IMAGES, N_("Images Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_IMAGE_DIALOG },
|
||||
|
||||
{ "images-raise-views", GTK_STOCK_GOTO_TOP,
|
||||
N_("_Raise Views"), "", NULL,
|
||||
|
@ -45,7 +45,8 @@
|
||||
|
||||
static GimpActionEntry layers_actions[] =
|
||||
{
|
||||
{ "layers-popup", GIMP_STOCK_LAYERS, N_("Layers Menu") },
|
||||
{ "layers-popup", GIMP_STOCK_LAYERS, N_("Layers Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_LAYER_DIALOG },
|
||||
|
||||
{ "layers-menu", NULL, N_("_Layer") },
|
||||
{ "layers-stack-menu", NULL, N_("Stac_k") },
|
||||
|
@ -36,7 +36,9 @@
|
||||
|
||||
static GimpActionEntry palette_editor_actions[] =
|
||||
{
|
||||
{ "palette-editor-popup", GIMP_STOCK_PALETTE, N_("Palette Editor Menu") },
|
||||
{ "palette-editor-popup", GIMP_STOCK_PALETTE, N_("Palette Editor Menu"),
|
||||
NULL, NULL, NULL,
|
||||
GIMP_HELP_PALETTE_EDITOR_DIALOG },
|
||||
|
||||
{ "palette-editor-edit-color", GIMP_STOCK_EDIT,
|
||||
N_("_Edit Color..."), "", NULL,
|
||||
|
@ -42,7 +42,8 @@
|
||||
|
||||
static GimpActionEntry palettes_actions[] =
|
||||
{
|
||||
{ "palettes-popup", GIMP_STOCK_PALETTE, N_("Palettes Menu") },
|
||||
{ "palettes-popup", GIMP_STOCK_PALETTE, N_("Palettes Menu"), NULL, NULL, NULL,
|
||||
GIMP_HELP_PALETTE_DIALOG },
|
||||
|
||||
{ "palettes-edit", GIMP_STOCK_EDIT,
|
||||
N_("_Edit Palette..."), NULL, NULL,
|
||||
|
@ -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)
|
||||
{
|
||||
GimpPlugInActionEntry entry;
|
||||
gchar *label;
|
||||
GimpPlugInAction *action;
|
||||
|
||||
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"
|
||||
|
118
app/gui/menus.c
118
app/gui/menus.c
@ -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);
|
||||
|
||||
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,
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
#include "gimpactiongroup.h"
|
||||
#include "gimpenumaction.h"
|
||||
#include "gimppluginaction.h"
|
||||
#include "gimppreview.h"
|
||||
#include "gimpstringaction.h"
|
||||
|
||||
@ -466,6 +467,38 @@ gimp_action_group_add_string_actions (GimpActionGroup *group,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_action_group_add_plug_in_actions (GimpActionGroup *group,
|
||||
GimpPlugInActionEntry *entries,
|
||||
guint n_entries,
|
||||
GCallback callback)
|
||||
{
|
||||
gint i;
|
||||
|
||||
g_return_if_fail (GIMP_IS_ACTION_GROUP (group));
|
||||
|
||||
for (i = 0; i < n_entries; i++)
|
||||
{
|
||||
GimpPlugInAction *action;
|
||||
|
||||
action = gimp_plug_in_action_new (entries[i].name,
|
||||
entries[i].label,
|
||||
entries[i].tooltip,
|
||||
entries[i].stock_id,
|
||||
entries[i].proc_def);
|
||||
|
||||
if (callback)
|
||||
g_signal_connect (action, "selected",
|
||||
callback,
|
||||
group->user_data);
|
||||
|
||||
gtk_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
|
||||
GTK_ACTION (action),
|
||||
entries[i].accelerator);
|
||||
g_object_unref (action);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_action_group_set_action_visible (GimpActionGroup *group,
|
||||
const gchar *action_name,
|
||||
|
@ -113,6 +113,18 @@ struct _GimpStringActionEntry
|
||||
const gchar *help_id;
|
||||
};
|
||||
|
||||
struct _GimpPlugInActionEntry
|
||||
{
|
||||
const gchar *name;
|
||||
const gchar *stock_id;
|
||||
const gchar *label;
|
||||
const gchar *accelerator;
|
||||
const gchar *tooltip;
|
||||
PlugInProcDef *proc_def;
|
||||
|
||||
const gchar *help_id;
|
||||
};
|
||||
|
||||
|
||||
GType gimp_action_group_get_type (void);
|
||||
GimpActionGroup *gimp_action_group_new (Gimp *gimp,
|
||||
@ -145,6 +157,10 @@ void gimp_action_group_add_string_actions (GimpActionGroup *group,
|
||||
GimpStringActionEntry *entries,
|
||||
guint n_entries,
|
||||
GCallback callback);
|
||||
void gimp_action_group_add_plug_in_actions(GimpActionGroup *group,
|
||||
GimpPlugInActionEntry *entries,
|
||||
guint n_entries,
|
||||
GCallback callback);
|
||||
|
||||
void gimp_action_group_set_action_visible (GimpActionGroup *group,
|
||||
const gchar *action_name,
|
||||
|
@ -37,7 +37,6 @@
|
||||
|
||||
#include "gimpdataeditor.h"
|
||||
#include "gimpdocked.h"
|
||||
#include "gimpitemfactory.h"
|
||||
#include "gimpmenufactory.h"
|
||||
#include "gimpsessioninfo.h"
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include "gimpdockable.h"
|
||||
#include "gimpdockbook.h"
|
||||
#include "gimpdocked.h"
|
||||
#include "gimpitemfactory.h"
|
||||
#include "gimpuimanager.h"
|
||||
#include "gimpwidgets-utils.h"
|
||||
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include "gimpdockable.h"
|
||||
#include "gimpdockbook.h"
|
||||
#include "gimphelp-ids.h"
|
||||
#include "gimpitemfactory.h"
|
||||
#include "gimpmenufactory.h"
|
||||
#include "gimppreview.h"
|
||||
|
||||
@ -200,7 +199,6 @@ static void
|
||||
gimp_dockbook_init (GimpDockbook *dockbook)
|
||||
{
|
||||
dockbook->dock = NULL;
|
||||
dockbook->item_factory = NULL;
|
||||
dockbook->ui_manager = NULL;
|
||||
|
||||
gtk_notebook_popup_enable (GTK_NOTEBOOK (dockbook));
|
||||
@ -217,12 +215,6 @@ gimp_dockbook_finalize (GObject *object)
|
||||
{
|
||||
GimpDockbook *dockbook = GIMP_DOCKBOOK (object);
|
||||
|
||||
if (dockbook->item_factory)
|
||||
{
|
||||
g_object_unref (dockbook->item_factory);
|
||||
dockbook->item_factory = NULL;
|
||||
}
|
||||
|
||||
if (dockbook->ui_manager)
|
||||
{
|
||||
g_object_unref (dockbook->ui_manager);
|
||||
@ -322,12 +314,6 @@ gimp_dockbook_new (GimpMenuFactory *menu_factory)
|
||||
|
||||
dockbook = g_object_new (GIMP_TYPE_DOCKBOOK, NULL);
|
||||
|
||||
dockbook->item_factory = gimp_menu_factory_menu_new (menu_factory,
|
||||
"<Dialogs>",
|
||||
GTK_TYPE_MENU,
|
||||
dockbook,
|
||||
FALSE);
|
||||
|
||||
dockbook->ui_manager = gimp_menu_factory_manager_new (menu_factory,
|
||||
"<Dialogs>",
|
||||
dockbook,
|
||||
|
@ -41,7 +41,6 @@ struct _GimpDockbook
|
||||
GtkNotebook parent_instance;
|
||||
|
||||
GimpDock *dock;
|
||||
GimpItemFactory *item_factory;
|
||||
GimpUIManager *ui_manager;
|
||||
};
|
||||
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include "gimpdockable.h"
|
||||
#include "gimpdockbook.h"
|
||||
#include "gimphelp-ids.h"
|
||||
#include "gimpitemfactory.h"
|
||||
#include "gimpmenufactory.h"
|
||||
#include "gimpsessioninfo.h"
|
||||
|
||||
|
@ -22,6 +22,17 @@
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
typedef struct _GimpItemFactory GimpItemFactory;
|
||||
|
||||
|
||||
typedef void (* GimpItemFactorySetupFunc) (GimpItemFactory *factory,
|
||||
gpointer callback_data);
|
||||
typedef void (* GimpItemFactoryUpdateFunc) (GtkItemFactory *factory,
|
||||
gpointer update_data);
|
||||
|
||||
|
||||
typedef struct _GimpItemFactoryEntry GimpItemFactoryEntry;
|
||||
|
||||
struct _GimpItemFactoryEntry
|
||||
{
|
||||
GtkItemFactoryEntry entry;
|
||||
|
@ -45,8 +45,6 @@
|
||||
#include "gimpcellrenderertoggle.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimpdocked.h"
|
||||
#include "gimpitemtreeview.h"
|
||||
#include "gimpitemfactory.h"
|
||||
#include "gimplayertreeview.h"
|
||||
#include "gimpmenufactory.h"
|
||||
#include "gimppreviewrenderer.h"
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include "gimpdockable.h"
|
||||
#include "gimpdockbook.h"
|
||||
#include "gimphelp-ids.h"
|
||||
#include "gimpitemfactory.h"
|
||||
#include "gimpmenufactory.h"
|
||||
#include "gimpsessioninfo.h"
|
||||
|
||||
|
@ -33,7 +33,6 @@
|
||||
|
||||
#include "gimpactionfactory.h"
|
||||
#include "gimpmenufactory.h"
|
||||
#include "gimpitemfactory.h"
|
||||
#include "gimpuimanager.h"
|
||||
|
||||
|
||||
@ -103,8 +102,6 @@ gimp_menu_factory_finalize (GObject *object)
|
||||
GList *uis;
|
||||
|
||||
g_free (entry->identifier);
|
||||
g_free (entry->title);
|
||||
g_free (entry->help_id);
|
||||
|
||||
g_list_foreach (entry->action_groups, (GFunc) g_free, NULL);
|
||||
g_list_free (entry->action_groups);
|
||||
@ -146,109 +143,26 @@ gimp_menu_factory_new (Gimp *gimp,
|
||||
return factory;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_menu_factory_menu_register (GimpMenuFactory *factory,
|
||||
const gchar *identifier,
|
||||
const gchar *title,
|
||||
const gchar *help_id,
|
||||
GimpItemFactorySetupFunc setup_func,
|
||||
GimpItemFactoryUpdateFunc update_func,
|
||||
gboolean update_on_popup,
|
||||
guint n_entries,
|
||||
GimpItemFactoryEntry *entries)
|
||||
{
|
||||
GimpMenuFactoryEntry *entry;
|
||||
|
||||
g_return_if_fail (GIMP_IS_MENU_FACTORY (factory));
|
||||
g_return_if_fail (identifier != NULL);
|
||||
g_return_if_fail (title != NULL);
|
||||
g_return_if_fail (help_id != NULL);
|
||||
g_return_if_fail (entries == NULL || n_entries > 0);
|
||||
|
||||
entry = g_new0 (GimpMenuFactoryEntry, 1);
|
||||
|
||||
entry->identifier = g_strdup (identifier);
|
||||
entry->title = g_strdup (title);
|
||||
entry->help_id = g_strdup (help_id);
|
||||
entry->setup_func = setup_func;
|
||||
entry->update_func = update_func;
|
||||
entry->update_on_popup = update_on_popup ? TRUE : FALSE;
|
||||
entry->n_entries = n_entries;
|
||||
entry->entries = entries;
|
||||
|
||||
factory->registered_menus = g_list_prepend (factory->registered_menus, entry);
|
||||
}
|
||||
|
||||
GimpItemFactory *
|
||||
gimp_menu_factory_menu_new (GimpMenuFactory *factory,
|
||||
const gchar *identifier,
|
||||
GType container_type,
|
||||
gpointer callback_data,
|
||||
gboolean create_tearoff)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_MENU_FACTORY (factory), NULL);
|
||||
g_return_val_if_fail (identifier != NULL, NULL);
|
||||
|
||||
for (list = factory->registered_menus; list; list = g_list_next (list))
|
||||
{
|
||||
GimpMenuFactoryEntry *entry = list->data;
|
||||
|
||||
if (! strcmp (entry->identifier, identifier))
|
||||
{
|
||||
GimpItemFactory *item_factory;
|
||||
|
||||
item_factory = gimp_item_factory_new (factory->gimp,
|
||||
container_type,
|
||||
entry->identifier,
|
||||
entry->title,
|
||||
entry->help_id,
|
||||
entry->update_func,
|
||||
entry->update_on_popup,
|
||||
entry->n_entries,
|
||||
entry->entries,
|
||||
callback_data,
|
||||
create_tearoff);
|
||||
|
||||
if (entry->setup_func)
|
||||
entry->setup_func (item_factory, callback_data);
|
||||
|
||||
return item_factory;
|
||||
}
|
||||
}
|
||||
|
||||
g_warning ("%s: no entry registered for \"%s\"",
|
||||
G_STRFUNC, identifier);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_menu_factory_manager_register (GimpMenuFactory *factory,
|
||||
const gchar *identifier,
|
||||
const gchar *first_group,
|
||||
...)
|
||||
{
|
||||
GList *list;
|
||||
GimpMenuFactoryEntry *entry;
|
||||
const gchar *group;
|
||||
const gchar *ui_path;
|
||||
va_list args;
|
||||
|
||||
g_return_if_fail (GIMP_IS_MENU_FACTORY (factory));
|
||||
g_return_if_fail (identifier != NULL);
|
||||
g_return_if_fail (first_group != NULL);
|
||||
|
||||
for (list = factory->registered_menus; list; list = g_list_next (list))
|
||||
{
|
||||
GimpMenuFactoryEntry *entry = list->data;
|
||||
entry = g_new0 (GimpMenuFactoryEntry, 1);
|
||||
|
||||
if (! strcmp (entry->identifier, identifier))
|
||||
{
|
||||
const gchar *group;
|
||||
const gchar *ui_path;
|
||||
const gchar *ui_basename;
|
||||
GimpUIManagerSetupFunc setup_func;
|
||||
va_list args;
|
||||
entry->identifier = g_strdup (identifier);
|
||||
|
||||
g_return_if_fail (entry->action_groups == NULL);
|
||||
factory->registered_menus = g_list_prepend (factory->registered_menus, entry);
|
||||
|
||||
va_start (args, first_group);
|
||||
|
||||
@ -266,6 +180,8 @@ gimp_menu_factory_manager_register (GimpMenuFactory *factory,
|
||||
|
||||
while (ui_path)
|
||||
{
|
||||
const gchar *ui_basename;
|
||||
GimpUIManagerSetupFunc setup_func;
|
||||
GimpUIManagerUIEntry *ui_entry;
|
||||
|
||||
ui_basename = va_arg (args, const gchar *);
|
||||
@ -276,11 +192,8 @@ gimp_menu_factory_manager_register (GimpMenuFactory *factory,
|
||||
ui_entry->ui_path = g_strdup (ui_path);
|
||||
ui_entry->basename = g_strdup (ui_basename);
|
||||
ui_entry->setup_func = setup_func;
|
||||
ui_entry->merge_id = 0;
|
||||
ui_entry->widget = NULL;
|
||||
|
||||
entry->managed_uis = g_list_prepend (entry->managed_uis,
|
||||
ui_entry);
|
||||
entry->managed_uis = g_list_prepend (entry->managed_uis, ui_entry);
|
||||
|
||||
ui_path = va_arg (args, const gchar *);
|
||||
}
|
||||
@ -288,13 +201,6 @@ gimp_menu_factory_manager_register (GimpMenuFactory *factory,
|
||||
entry->managed_uis = g_list_reverse (entry->managed_uis);
|
||||
|
||||
va_end (args);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
g_warning ("%s: no entry registered for \"%s\"",
|
||||
G_STRFUNC, identifier);
|
||||
}
|
||||
|
||||
GimpUIManager *
|
||||
|
@ -31,14 +31,6 @@ typedef struct _GimpMenuFactoryEntry GimpMenuFactoryEntry;
|
||||
struct _GimpMenuFactoryEntry
|
||||
{
|
||||
gchar *identifier;
|
||||
gchar *title;
|
||||
gchar *help_id;
|
||||
GimpItemFactorySetupFunc setup_func;
|
||||
GimpItemFactoryUpdateFunc update_func;
|
||||
gboolean update_on_popup;
|
||||
guint n_entries;
|
||||
GimpItemFactoryEntry *entries;
|
||||
|
||||
GList *action_groups;
|
||||
GList *managed_uis;
|
||||
};
|
||||
@ -74,23 +66,6 @@ GType gimp_menu_factory_get_type (void) G_GNUC_CONST;
|
||||
GimpMenuFactory * gimp_menu_factory_new (Gimp *gimp,
|
||||
GimpActionFactory *action_factory);
|
||||
|
||||
void gimp_menu_factory_menu_register (GimpMenuFactory *factory,
|
||||
const gchar *identifier,
|
||||
const gchar *title,
|
||||
const gchar *help_id,
|
||||
GimpItemFactorySetupFunc setup_func,
|
||||
GimpItemFactoryUpdateFunc update_func,
|
||||
gboolean update_on_popup,
|
||||
guint n_entries,
|
||||
GimpItemFactoryEntry *entries);
|
||||
|
||||
GimpItemFactory * gimp_menu_factory_menu_new (GimpMenuFactory *factory,
|
||||
const gchar *identifier,
|
||||
GType container_type,
|
||||
gpointer callback_data,
|
||||
gboolean create_tearoff);
|
||||
|
||||
|
||||
void gimp_menu_factory_manager_register (GimpMenuFactory *factory,
|
||||
const gchar *identifier,
|
||||
const gchar *first_group,
|
||||
|
@ -607,17 +607,13 @@ static void
|
||||
toolbox_create_tools (GimpToolbox *toolbox,
|
||||
GimpContext *context)
|
||||
{
|
||||
#if 0
|
||||
FIXME
|
||||
GimpItemFactory *item_factory;
|
||||
#endif
|
||||
GimpUIManager *ui_manager;
|
||||
GimpToolInfo *active_tool;
|
||||
GList *list;
|
||||
GSList *group = NULL;
|
||||
|
||||
#if 0
|
||||
item_factory = gimp_item_factory_from_path ("<Image>");
|
||||
#endif
|
||||
ui_manager = gimp_ui_managers_from_name ("<Image>")->data;
|
||||
gimp_ui_manager_ui_get (ui_manager, "/image-popup");
|
||||
|
||||
active_tool = gimp_context_get_tool (context);
|
||||
|
||||
@ -667,40 +663,35 @@ toolbox_create_tools (GimpToolbox *toolbox,
|
||||
toolbox);
|
||||
|
||||
#if 0
|
||||
if (item_factory)
|
||||
{
|
||||
GtkWidget *menu_item;
|
||||
gchar *menu_path;
|
||||
|
||||
menu_path = gimp_strip_uline (tool_info->menu_path);
|
||||
|
||||
menu_item =
|
||||
gtk_item_factory_get_widget (GTK_ITEM_FACTORY (item_factory),
|
||||
menu_path);
|
||||
|
||||
g_free (menu_path);
|
||||
|
||||
if (menu_item)
|
||||
{
|
||||
GList *accel_closures;
|
||||
|
||||
accel_closures = gtk_widget_list_accel_closures (menu_item);
|
||||
|
||||
if (g_list_length (accel_closures) != 1)
|
||||
{
|
||||
g_warning (G_STRLOC ": FIXME: g_list_length (accel_closures) != 1");
|
||||
}
|
||||
else
|
||||
if (ui_manager)
|
||||
{
|
||||
GimpActionGroup *group;
|
||||
GtkAction *action;
|
||||
const gchar *identifier;
|
||||
gchar *tmp;
|
||||
gchar *name;
|
||||
GClosure *accel_closure;
|
||||
GtkAccelGroup *accel_group;
|
||||
|
||||
accel_closure = (GClosure *) accel_closures->data;
|
||||
identifier = gimp_object_get_name (GIMP_OBJECT (tool_info));
|
||||
|
||||
tmp = g_strndup (identifier + strlen ("gimp-"),
|
||||
strlen (identifier) - strlen ("gimp--tool"));
|
||||
name = g_strdup_printf ("tools-%s", tmp);
|
||||
g_free (tmp);
|
||||
|
||||
group = gimp_ui_manager_get_action_group (ui_manager, "tools");
|
||||
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group), name);
|
||||
|
||||
g_free (name);
|
||||
|
||||
accel_closure = gtk_action_get_accel_closure (action);
|
||||
|
||||
g_object_set_data (G_OBJECT (button), "toolbox-accel-closure",
|
||||
accel_closure);
|
||||
|
||||
accel_group = gtk_accel_group_from_accel_closure (accel_closure);
|
||||
accel_group =
|
||||
gtk_accel_group_from_accel_closure (accel_closure);
|
||||
|
||||
g_signal_connect (accel_group, "accel_changed",
|
||||
G_CALLBACK (gimp_toolbox_button_accel_changed),
|
||||
@ -711,10 +702,8 @@ toolbox_create_tools (GimpToolbox *toolbox,
|
||||
accel_closure,
|
||||
button);
|
||||
}
|
||||
|
||||
g_list_free (accel_closures);
|
||||
}
|
||||
}
|
||||
#else
|
||||
gimp_help_set_help_data (button, tool_info->help, tool_info->help_id);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -137,6 +137,7 @@ typedef struct _GimpToggleActionEntry GimpToggleActionEntry;
|
||||
typedef struct _GimpRadioActionEntry GimpRadioActionEntry;
|
||||
typedef struct _GimpEnumActionEntry GimpEnumActionEntry;
|
||||
typedef struct _GimpStringActionEntry GimpStringActionEntry;
|
||||
typedef struct _GimpPlugInActionEntry GimpPlugInActionEntry;
|
||||
typedef struct _GimpDialogFactoryEntry GimpDialogFactoryEntry;
|
||||
typedef struct _GimpSessionInfo GimpSessionInfo;
|
||||
typedef struct _GimpSessionInfoBook GimpSessionInfoBook;
|
||||
@ -164,15 +165,4 @@ typedef void (* GimpSelectionToVectorsFunc) (GimpImage *gimage,
|
||||
gboolean advanced);
|
||||
|
||||
|
||||
/* deprecated stuff, to be removed */
|
||||
|
||||
typedef struct _GimpItemFactory GimpItemFactory;
|
||||
typedef struct _GimpItemFactoryEntry GimpItemFactoryEntry;
|
||||
|
||||
typedef void (* GimpItemFactorySetupFunc) (GimpItemFactory *factory,
|
||||
gpointer callback_data);
|
||||
typedef void (* GimpItemFactoryUpdateFunc) (GtkItemFactory *factory,
|
||||
gpointer update_data);
|
||||
|
||||
|
||||
#endif /* __WIDGETS_TYPES_H__ */
|
||||
|
Reference in New Issue
Block a user