app/gui/image-menu.c moved the convenience items which create new docks

2003-06-06  Michael Natterer  <mitch@gimp.org>

	* app/gui/image-menu.c
	* app/gui/toolbox-menu.c: moved the convenience items which
	create new docks from the "Dialogs/" level to a new
	"Dialogs/Create New Dock/" sub-menu.  Fixes bug #111278.

	* app/gui/dialogs-commands.[ch] (dialogs_create_data_cmd_callback):
	new convenience constructor callback. Factored out duplicated
	code to the new dialogs_create_dock() utility function.
This commit is contained in:
Michael Natterer 2003-06-06 12:16:13 +00:00 committed by Michael Natterer
parent 4f33a4788f
commit ef30cf315d
9 changed files with 207 additions and 142 deletions

View File

@ -1,3 +1,14 @@
2003-06-06 Michael Natterer <mitch@gimp.org>
* app/gui/image-menu.c
* app/gui/toolbox-menu.c: moved the convenience items which
create new docks from the "Dialogs/" level to a new
"Dialogs/Create New Dock/" sub-menu. Fixes bug #111278.
* app/gui/dialogs-commands.[ch] (dialogs_create_data_cmd_callback):
new convenience constructor callback. Factored out duplicated
code to the new dialogs_create_dock() utility function.
2003-06-06 Michael Natterer <mitch@gimp.org>
* app/gui/image-menu.c: added CW/CCW to the "Rotate" menu entries

View File

@ -35,6 +35,14 @@
#include "dialogs-commands.h"
/* local function prototypes */
static void dialogs_create_dock (const gchar *tabs[],
gint n_tabs);
/* public functions */
void
dialogs_show_toolbox_cmd_callback (GtkWidget *widget,
gpointer data,
@ -296,37 +304,32 @@ dialogs_create_lc_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GtkWidget *dock;
GtkWidget *dockbook;
GtkWidget *dockable;
const gchar *tabs[] =
static const gchar *tabs[] =
{
"gimp-layer-list",
"gimp-channel-list",
"gimp-vectors-list",
"gimp-indexed-palette"
};
gint i;
dock = gimp_dialog_factory_dock_new (global_dock_factory);
dialogs_create_dock (tabs, G_N_ELEMENTS (tabs));
}
gimp_image_dock_set_show_image_menu (GIMP_IMAGE_DOCK (dock), TRUE);
void
dialogs_create_data_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
static const gchar *tabs[] =
{
"gimp-brush-grid",
"gimp-pattern-grid",
"gimp-gradient-list",
"gimp-palette-list",
"gimp-font-list"
};
dockbook = gimp_dockbook_new (global_dock_factory->menu_factory);
gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0);
for (i = 0; i < G_N_ELEMENTS (tabs); i++)
{
dockable = gimp_dialog_factory_dialog_new (global_dock_factory,
tabs[i], -1);
if (dockable && ! GIMP_DOCKABLE (dockable)->dockbook)
gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dockable), -1, -1);
}
gtk_widget_show (dock);
dialogs_create_dock (tabs, G_N_ELEMENTS (tabs));
}
void
@ -334,38 +337,15 @@ dialogs_create_stuff_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GtkWidget *dock;
GtkWidget *dockbook;
GtkWidget *dockable;
const gchar *tabs[] =
static const gchar *tabs[] =
{
"gimp-brush-grid",
"gimp-pattern-grid",
"gimp-gradient-list",
"gimp-palette-list",
"gimp-buffer-list",
"gimp-image-list",
"gimp-document-history"
"gimp-document-list",
"gimp-template-list"
};
gint i;
dock = gimp_dialog_factory_dock_new (global_dock_factory);
dockbook = gimp_dockbook_new (global_dock_factory->menu_factory);
gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0);
for (i = 0; i < G_N_ELEMENTS (tabs); i++)
{
dockable = gimp_dialog_factory_dialog_new (global_dock_factory,
tabs[i], -1);
if (dockable && ! GIMP_DOCKABLE (dockable)->dockbook)
gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dockable), -1, -1);
}
gtk_widget_show (dock);
dialogs_create_dock (tabs, G_N_ELEMENTS (tabs));
}
void
@ -395,3 +375,33 @@ dialogs_show_toolbox (void)
}
}
}
/* private functions */
static void
dialogs_create_dock (const gchar *tabs[],
gint n_tabs)
{
GtkWidget *dock;
GtkWidget *dockbook;
GtkWidget *dockable;
gint i;
dock = gimp_dialog_factory_dock_new (global_dock_factory);
dockbook = gimp_dockbook_new (global_dock_factory->menu_factory);
gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0);
for (i = 0; i < n_tabs; i++)
{
dockable = gimp_dialog_factory_dialog_new (global_dock_factory,
tabs[i], -1);
if (dockable && ! GIMP_DOCKABLE (dockable)->dockbook)
gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dockable), -1, -1);
}
gtk_widget_show (dock);
}

View File

@ -24,39 +24,42 @@ void dialogs_show_toolbox_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_create_toplevel_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_create_dockable_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_add_tab_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_remove_tab_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_toggle_view_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_preview_size_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_toggle_image_menu_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_toggle_auto_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_create_lc_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_create_data_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_create_stuff_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_show_toolbox (void);

View File

@ -35,6 +35,14 @@
#include "dialogs-commands.h"
/* local function prototypes */
static void dialogs_create_dock (const gchar *tabs[],
gint n_tabs);
/* public functions */
void
dialogs_show_toolbox_cmd_callback (GtkWidget *widget,
gpointer data,
@ -296,37 +304,32 @@ dialogs_create_lc_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GtkWidget *dock;
GtkWidget *dockbook;
GtkWidget *dockable;
const gchar *tabs[] =
static const gchar *tabs[] =
{
"gimp-layer-list",
"gimp-channel-list",
"gimp-vectors-list",
"gimp-indexed-palette"
};
gint i;
dock = gimp_dialog_factory_dock_new (global_dock_factory);
dialogs_create_dock (tabs, G_N_ELEMENTS (tabs));
}
gimp_image_dock_set_show_image_menu (GIMP_IMAGE_DOCK (dock), TRUE);
void
dialogs_create_data_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
static const gchar *tabs[] =
{
"gimp-brush-grid",
"gimp-pattern-grid",
"gimp-gradient-list",
"gimp-palette-list",
"gimp-font-list"
};
dockbook = gimp_dockbook_new (global_dock_factory->menu_factory);
gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0);
for (i = 0; i < G_N_ELEMENTS (tabs); i++)
{
dockable = gimp_dialog_factory_dialog_new (global_dock_factory,
tabs[i], -1);
if (dockable && ! GIMP_DOCKABLE (dockable)->dockbook)
gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dockable), -1, -1);
}
gtk_widget_show (dock);
dialogs_create_dock (tabs, G_N_ELEMENTS (tabs));
}
void
@ -334,38 +337,15 @@ dialogs_create_stuff_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GtkWidget *dock;
GtkWidget *dockbook;
GtkWidget *dockable;
const gchar *tabs[] =
static const gchar *tabs[] =
{
"gimp-brush-grid",
"gimp-pattern-grid",
"gimp-gradient-list",
"gimp-palette-list",
"gimp-buffer-list",
"gimp-image-list",
"gimp-document-history"
"gimp-document-list",
"gimp-template-list"
};
gint i;
dock = gimp_dialog_factory_dock_new (global_dock_factory);
dockbook = gimp_dockbook_new (global_dock_factory->menu_factory);
gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0);
for (i = 0; i < G_N_ELEMENTS (tabs); i++)
{
dockable = gimp_dialog_factory_dialog_new (global_dock_factory,
tabs[i], -1);
if (dockable && ! GIMP_DOCKABLE (dockable)->dockbook)
gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dockable), -1, -1);
}
gtk_widget_show (dock);
dialogs_create_dock (tabs, G_N_ELEMENTS (tabs));
}
void
@ -395,3 +375,33 @@ dialogs_show_toolbox (void)
}
}
}
/* private functions */
static void
dialogs_create_dock (const gchar *tabs[],
gint n_tabs)
{
GtkWidget *dock;
GtkWidget *dockbook;
GtkWidget *dockable;
gint i;
dock = gimp_dialog_factory_dock_new (global_dock_factory);
dockbook = gimp_dockbook_new (global_dock_factory->menu_factory);
gimp_dock_add_book (GIMP_DOCK (dock), GIMP_DOCKBOOK (dockbook), 0);
for (i = 0; i < n_tabs; i++)
{
dockable = gimp_dialog_factory_dialog_new (global_dock_factory,
tabs[i], -1);
if (dockable && ! GIMP_DOCKABLE (dockable)->dockbook)
gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dockable), -1, -1);
}
gtk_widget_show (dock);
}

View File

@ -24,39 +24,42 @@ void dialogs_show_toolbox_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_create_toplevel_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_create_dockable_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_add_tab_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_remove_tab_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_toggle_view_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_preview_size_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_toggle_image_menu_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_toggle_auto_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_create_lc_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_create_data_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
void dialogs_create_stuff_cmd_callback (GtkWidget *widget,
gpointer data,
guint action);
gpointer data,
guint action);
void dialogs_show_toolbox (void);

View File

@ -777,14 +777,21 @@ GimpItemFactoryEntry image_menu_entries[] =
MENU_BRANCH (N_("/_Dialogs")),
{ { N_("/Dialogs/Layers, Channels & Paths..."), NULL,
MENU_BRANCH (N_("/Dialogs/_Create New Dock")),
{ { N_("/Dialogs/Create New Dock/Layers, Channels & Paths..."), NULL,
dialogs_create_lc_cmd_callback, 0 },
NULL,
"dialogs/layers_and_channels.html", NULL },
{ { N_("/Dialogs/Brushes, Patterns & Stuff..."), NULL,
{ { N_("/Dialogs/Create New Dock/Brushes, Patterns & Gradients..."), NULL,
dialogs_create_data_cmd_callback, 0 },
NULL,
NULL, NULL },
{ { N_("/Dialogs/Create New Dock/Misc. Stuff..."), NULL,
dialogs_create_stuff_cmd_callback, 0 },
NULL,
NULL, NULL },
{ { N_("/Dialogs/Tool Options..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_TOOL_OPTIONS },

View File

@ -89,14 +89,21 @@ GimpItemFactoryEntry toolbox_menu_entries[] =
MENU_BRANCH (N_("/File/_Dialogs")),
{ { N_("/File/Dialogs/Layers, Channels & Paths..."), NULL,
MENU_BRANCH (N_("/File/Dialogs/_Create New Dock")),
{ { N_("/File/Dialogs/Create New Dock/Layers, Channels & Paths..."), NULL,
dialogs_create_lc_cmd_callback, 0 },
NULL,
"file/dialogs/layers_and_channels.html", NULL },
{ { N_("/File/Dialogs/Brushes, Patterns & Stuff..."), NULL,
{ { N_("/File/Dialogs/Create New Dock/Brushes, Patterns & Gradients..."), NULL,
dialogs_create_data_cmd_callback, 0 },
NULL,
NULL, NULL },
{ { N_("/File/Dialogs/Create New Dock/Misc. Stuff..."), NULL,
dialogs_create_stuff_cmd_callback, 0 },
NULL,
NULL, NULL },
{ { N_("/File/Dialogs/Tool Options..."), "<control><shift>T",
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_TOOL_OPTIONS },

View File

@ -777,14 +777,21 @@ GimpItemFactoryEntry image_menu_entries[] =
MENU_BRANCH (N_("/_Dialogs")),
{ { N_("/Dialogs/Layers, Channels & Paths..."), NULL,
MENU_BRANCH (N_("/Dialogs/_Create New Dock")),
{ { N_("/Dialogs/Create New Dock/Layers, Channels & Paths..."), NULL,
dialogs_create_lc_cmd_callback, 0 },
NULL,
"dialogs/layers_and_channels.html", NULL },
{ { N_("/Dialogs/Brushes, Patterns & Stuff..."), NULL,
{ { N_("/Dialogs/Create New Dock/Brushes, Patterns & Gradients..."), NULL,
dialogs_create_data_cmd_callback, 0 },
NULL,
NULL, NULL },
{ { N_("/Dialogs/Create New Dock/Misc. Stuff..."), NULL,
dialogs_create_stuff_cmd_callback, 0 },
NULL,
NULL, NULL },
{ { N_("/Dialogs/Tool Options..."), NULL,
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_TOOL_OPTIONS },

View File

@ -89,14 +89,21 @@ GimpItemFactoryEntry toolbox_menu_entries[] =
MENU_BRANCH (N_("/File/_Dialogs")),
{ { N_("/File/Dialogs/Layers, Channels & Paths..."), NULL,
MENU_BRANCH (N_("/File/Dialogs/_Create New Dock")),
{ { N_("/File/Dialogs/Create New Dock/Layers, Channels & Paths..."), NULL,
dialogs_create_lc_cmd_callback, 0 },
NULL,
"file/dialogs/layers_and_channels.html", NULL },
{ { N_("/File/Dialogs/Brushes, Patterns & Stuff..."), NULL,
{ { N_("/File/Dialogs/Create New Dock/Brushes, Patterns & Gradients..."), NULL,
dialogs_create_data_cmd_callback, 0 },
NULL,
NULL, NULL },
{ { N_("/File/Dialogs/Create New Dock/Misc. Stuff..."), NULL,
dialogs_create_stuff_cmd_callback, 0 },
NULL,
NULL, NULL },
{ { N_("/File/Dialogs/Tool Options..."), "<control><shift>T",
dialogs_create_dockable_cmd_callback, 0,
"<StockItem>", GIMP_STOCK_TOOL_OPTIONS },