removed redundant "Gimp" parameter, cleanup.
2003-09-09 Michael Natterer <mitch@gimp.org> * app/gui/menus.c (menus_last_opened_add): removed redundant "Gimp" parameter, cleanup. * app/gui/image-menu.c (image_menu_setup) * app/gui/toolbox-menu.c (toolbox_menu_setup): changed accordingly.
This commit is contained in:

committed by
Michael Natterer

parent
253121ea5a
commit
da27248654
@ -1,3 +1,11 @@
|
|||||||
|
2003-09-09 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* app/gui/menus.c (menus_last_opened_add): removed redundant
|
||||||
|
"Gimp" parameter, cleanup.
|
||||||
|
|
||||||
|
* app/gui/image-menu.c (image_menu_setup)
|
||||||
|
* app/gui/toolbox-menu.c (toolbox_menu_setup): changed accordingly.
|
||||||
|
|
||||||
2003-09-09 Michael Natterer <mitch@gimp.org>
|
2003-09-09 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
Got rid of the last global variables except the_gimp:
|
Got rid of the last global variables except the_gimp:
|
||||||
|
@ -1103,7 +1103,7 @@ image_menu_setup (GimpItemFactory *factory)
|
|||||||
"/filters-separator", FALSE);
|
"/filters-separator", FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
menus_last_opened_add (factory, factory->gimp);
|
menus_last_opened_add (factory);
|
||||||
|
|
||||||
/* create tool menu items */
|
/* create tool menu items */
|
||||||
{
|
{
|
||||||
|
@ -287,16 +287,20 @@ menus_clear (Gimp *gimp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
menus_last_opened_add (GimpItemFactory *item_factory,
|
menus_last_opened_add (GimpItemFactory *item_factory)
|
||||||
Gimp *gimp)
|
|
||||||
{
|
{
|
||||||
GimpItemFactoryEntry *last_opened_entries;
|
GimpItemFactoryEntry *last_opened_entries;
|
||||||
|
gint n_last_opened_entries;
|
||||||
gint i;
|
gint i;
|
||||||
gint n = GIMP_GUI_CONFIG (gimp->config)->last_opened_size;
|
|
||||||
|
|
||||||
last_opened_entries = g_new (GimpItemFactoryEntry, n);
|
g_return_if_fail (GIMP_IS_ITEM_FACTORY (item_factory));
|
||||||
|
|
||||||
for (i = 0; i < n; i++)
|
n_last_opened_entries =
|
||||||
|
GIMP_GUI_CONFIG (item_factory->gimp->config)->last_opened_size;
|
||||||
|
|
||||||
|
last_opened_entries = g_new (GimpItemFactoryEntry, n_last_opened_entries);
|
||||||
|
|
||||||
|
for (i = 0; i < n_last_opened_entries; i++)
|
||||||
{
|
{
|
||||||
last_opened_entries[i].entry.path =
|
last_opened_entries[i].entry.path =
|
||||||
g_strdup_printf ("/File/Open Recent/%02d", i + 1);
|
g_strdup_printf ("/File/Open Recent/%02d", i + 1);
|
||||||
@ -317,14 +321,14 @@ menus_last_opened_add (GimpItemFactory *item_factory,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gimp_item_factory_create_items (item_factory,
|
gimp_item_factory_create_items (item_factory,
|
||||||
n, last_opened_entries,
|
n_last_opened_entries, last_opened_entries,
|
||||||
gimp, 2, TRUE, FALSE);
|
item_factory->gimp, 2, TRUE, FALSE);
|
||||||
|
|
||||||
gimp_item_factory_set_sensitive (GTK_ITEM_FACTORY (item_factory),
|
gimp_item_factory_set_sensitive (GTK_ITEM_FACTORY (item_factory),
|
||||||
"/File/Open Recent/(None)",
|
"/File/Open Recent/(None)",
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n_last_opened_entries; i++)
|
||||||
{
|
{
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
|
|
||||||
@ -343,17 +347,17 @@ menus_last_opened_add (GimpItemFactory *item_factory,
|
|||||||
|
|
||||||
g_free (last_opened_entries);
|
g_free (last_opened_entries);
|
||||||
|
|
||||||
g_signal_connect_object (gimp->documents, "add",
|
g_signal_connect_object (item_factory->gimp->documents, "add",
|
||||||
G_CALLBACK (menus_last_opened_update),
|
G_CALLBACK (menus_last_opened_update),
|
||||||
item_factory, 0);
|
item_factory, 0);
|
||||||
g_signal_connect_object (gimp->documents, "remove",
|
g_signal_connect_object (item_factory->gimp->documents, "remove",
|
||||||
G_CALLBACK (menus_last_opened_update),
|
G_CALLBACK (menus_last_opened_update),
|
||||||
item_factory, 0);
|
item_factory, 0);
|
||||||
g_signal_connect_object (gimp->documents, "reorder",
|
g_signal_connect_object (item_factory->gimp->documents, "reorder",
|
||||||
G_CALLBACK (menus_last_opened_reorder),
|
G_CALLBACK (menus_last_opened_reorder),
|
||||||
item_factory, 0);
|
item_factory, 0);
|
||||||
|
|
||||||
menus_last_opened_update (gimp->documents, NULL, item_factory);
|
menus_last_opened_update (item_factory->gimp->documents, NULL, item_factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -36,8 +36,7 @@ void menus_restore (Gimp *gimp);
|
|||||||
void menus_save (Gimp *gimp);
|
void menus_save (Gimp *gimp);
|
||||||
void menus_clear (Gimp *gimp);
|
void menus_clear (Gimp *gimp);
|
||||||
|
|
||||||
void menus_last_opened_add (GimpItemFactory *item_factory,
|
void menus_last_opened_add (GimpItemFactory *item_factory);
|
||||||
Gimp *gimp);
|
|
||||||
void menus_filters_subdirs_to_top (GtkMenu *menu);
|
void menus_filters_subdirs_to_top (GtkMenu *menu);
|
||||||
|
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ toolbox_menu_setup (GimpItemFactory *factory)
|
|||||||
GList *list;
|
GList *list;
|
||||||
gint i, pos;
|
gint i, pos;
|
||||||
|
|
||||||
menus_last_opened_add (factory, factory->gimp);
|
menus_last_opened_add (factory);
|
||||||
|
|
||||||
plug_in_menus_create (factory, factory->gimp->plug_in_proc_defs);
|
plug_in_menus_create (factory, factory->gimp->plug_in_proc_defs);
|
||||||
|
|
||||||
|
@ -1103,7 +1103,7 @@ image_menu_setup (GimpItemFactory *factory)
|
|||||||
"/filters-separator", FALSE);
|
"/filters-separator", FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
menus_last_opened_add (factory, factory->gimp);
|
menus_last_opened_add (factory);
|
||||||
|
|
||||||
/* create tool menu items */
|
/* create tool menu items */
|
||||||
{
|
{
|
||||||
|
@ -287,16 +287,20 @@ menus_clear (Gimp *gimp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
menus_last_opened_add (GimpItemFactory *item_factory,
|
menus_last_opened_add (GimpItemFactory *item_factory)
|
||||||
Gimp *gimp)
|
|
||||||
{
|
{
|
||||||
GimpItemFactoryEntry *last_opened_entries;
|
GimpItemFactoryEntry *last_opened_entries;
|
||||||
|
gint n_last_opened_entries;
|
||||||
gint i;
|
gint i;
|
||||||
gint n = GIMP_GUI_CONFIG (gimp->config)->last_opened_size;
|
|
||||||
|
|
||||||
last_opened_entries = g_new (GimpItemFactoryEntry, n);
|
g_return_if_fail (GIMP_IS_ITEM_FACTORY (item_factory));
|
||||||
|
|
||||||
for (i = 0; i < n; i++)
|
n_last_opened_entries =
|
||||||
|
GIMP_GUI_CONFIG (item_factory->gimp->config)->last_opened_size;
|
||||||
|
|
||||||
|
last_opened_entries = g_new (GimpItemFactoryEntry, n_last_opened_entries);
|
||||||
|
|
||||||
|
for (i = 0; i < n_last_opened_entries; i++)
|
||||||
{
|
{
|
||||||
last_opened_entries[i].entry.path =
|
last_opened_entries[i].entry.path =
|
||||||
g_strdup_printf ("/File/Open Recent/%02d", i + 1);
|
g_strdup_printf ("/File/Open Recent/%02d", i + 1);
|
||||||
@ -317,14 +321,14 @@ menus_last_opened_add (GimpItemFactory *item_factory,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gimp_item_factory_create_items (item_factory,
|
gimp_item_factory_create_items (item_factory,
|
||||||
n, last_opened_entries,
|
n_last_opened_entries, last_opened_entries,
|
||||||
gimp, 2, TRUE, FALSE);
|
item_factory->gimp, 2, TRUE, FALSE);
|
||||||
|
|
||||||
gimp_item_factory_set_sensitive (GTK_ITEM_FACTORY (item_factory),
|
gimp_item_factory_set_sensitive (GTK_ITEM_FACTORY (item_factory),
|
||||||
"/File/Open Recent/(None)",
|
"/File/Open Recent/(None)",
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n_last_opened_entries; i++)
|
||||||
{
|
{
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
|
|
||||||
@ -343,17 +347,17 @@ menus_last_opened_add (GimpItemFactory *item_factory,
|
|||||||
|
|
||||||
g_free (last_opened_entries);
|
g_free (last_opened_entries);
|
||||||
|
|
||||||
g_signal_connect_object (gimp->documents, "add",
|
g_signal_connect_object (item_factory->gimp->documents, "add",
|
||||||
G_CALLBACK (menus_last_opened_update),
|
G_CALLBACK (menus_last_opened_update),
|
||||||
item_factory, 0);
|
item_factory, 0);
|
||||||
g_signal_connect_object (gimp->documents, "remove",
|
g_signal_connect_object (item_factory->gimp->documents, "remove",
|
||||||
G_CALLBACK (menus_last_opened_update),
|
G_CALLBACK (menus_last_opened_update),
|
||||||
item_factory, 0);
|
item_factory, 0);
|
||||||
g_signal_connect_object (gimp->documents, "reorder",
|
g_signal_connect_object (item_factory->gimp->documents, "reorder",
|
||||||
G_CALLBACK (menus_last_opened_reorder),
|
G_CALLBACK (menus_last_opened_reorder),
|
||||||
item_factory, 0);
|
item_factory, 0);
|
||||||
|
|
||||||
menus_last_opened_update (gimp->documents, NULL, item_factory);
|
menus_last_opened_update (item_factory->gimp->documents, NULL, item_factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -36,8 +36,7 @@ void menus_restore (Gimp *gimp);
|
|||||||
void menus_save (Gimp *gimp);
|
void menus_save (Gimp *gimp);
|
||||||
void menus_clear (Gimp *gimp);
|
void menus_clear (Gimp *gimp);
|
||||||
|
|
||||||
void menus_last_opened_add (GimpItemFactory *item_factory,
|
void menus_last_opened_add (GimpItemFactory *item_factory);
|
||||||
Gimp *gimp);
|
|
||||||
void menus_filters_subdirs_to_top (GtkMenu *menu);
|
void menus_filters_subdirs_to_top (GtkMenu *menu);
|
||||||
|
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ toolbox_menu_setup (GimpItemFactory *factory)
|
|||||||
GList *list;
|
GList *list;
|
||||||
gint i, pos;
|
gint i, pos;
|
||||||
|
|
||||||
menus_last_opened_add (factory, factory->gimp);
|
menus_last_opened_add (factory);
|
||||||
|
|
||||||
plug_in_menus_create (factory, factory->gimp->plug_in_proc_defs);
|
plug_in_menus_create (factory, factory->gimp->plug_in_proc_defs);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user