Commit 1669906b authored by Henrik Brix Andersen's avatar Henrik Brix Andersen Committed by Henrik Brix Andersen

moved Configure Grid entry to the <Image>/Image branch

2003-07-27 Henrik Brix Andersen <brix@gimp.org>

* app/gui/image-menu.c (image_menu_entries): moved Configure Grid
entry to the <Image>/Image branch

* app/gui/view-commands.[ch] (view_configure_grid_cmd_callback):
removed function

* app/gui/image-commands.[ch] (image_configure_grid_cmd_callback):
added function here

* app/gui/grid-dialog.c: removed snap and show options from the
dialog
parent ea648dc9
2003-07-27 Henrik Brix Andersen <brix@gimp.org>
* app/gui/image-menu.c (image_menu_entries): moved Configure Grid
entry to the <Image>/Image branch
* app/gui/view-commands.[ch] (view_configure_grid_cmd_callback):
removed function
* app/gui/image-commands.[ch] (image_configure_grid_cmd_callback):
added function here
* app/gui/grid-dialog.c: removed snap and show options from the
dialog
2003-07-27 Henrik Brix Andersen <brix@gimp.org>
* app/base/tile-swap.c: re-added fallback definitions for
......@@ -45,6 +45,7 @@
#include "convert-dialog.h"
#include "image-commands.h"
#include "grid-dialog.h"
#include "resize-dialog.h"
#include "gimp-intl.h"
......@@ -295,6 +296,32 @@ image_flatten_image_cmd_callback (GtkWidget *widget,
gimp_image_flush (gimage);
}
void
image_configure_grid_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
if (! shell->grid_dialog)
{
shell->grid_dialog = grid_dialog_new (GIMP_DISPLAY (gdisp));
gtk_window_set_transient_for (GTK_WINDOW (shell->grid_dialog),
GTK_WINDOW (shell));
gtk_window_set_destroy_with_parent (GTK_WINDOW (shell->grid_dialog),
TRUE);
g_object_add_weak_pointer (G_OBJECT (shell->grid_dialog),
(gpointer *) &shell->grid_dialog);
}
gtk_window_present (GTK_WINDOW (shell->grid_dialog));
}
/****************************/
/* The layer merge dialog */
......
......@@ -51,5 +51,7 @@ void image_flatten_image_cmd_callback (GtkWidget *widet,
void image_layers_merge_query (GimpImage *gimage,
gboolean merge_visible);
void image_configure_grid_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __IMAGE_COMMANDS_H__ */
......@@ -42,7 +42,6 @@
#include "dialogs.h"
#include "info-dialog.h"
#include "info-window.h"
#include "grid-dialog.h"
#include "view-commands.h"
......@@ -351,32 +350,6 @@ view_snap_to_guides_cmd_callback (GtkWidget *widget,
}
}
void
view_configure_grid_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
if (! shell->grid_dialog)
{
shell->grid_dialog = grid_dialog_new (GIMP_DISPLAY (gdisp));
gtk_window_set_transient_for (GTK_WINDOW (shell->grid_dialog),
GTK_WINDOW (shell));
gtk_window_set_destroy_with_parent (GTK_WINDOW (shell->grid_dialog),
TRUE);
g_object_add_weak_pointer (G_OBJECT (shell->grid_dialog),
(gpointer *) &shell->grid_dialog);
}
gtk_window_present (GTK_WINDOW (shell->grid_dialog));
}
void
view_toggle_grid_cmd_callback (GtkWidget *widget,
......
......@@ -59,8 +59,6 @@ void view_snap_to_guides_cmd_callback (GtkWidget *widget,
gpointer data);
void view_toggle_grid_cmd_callback (GtkWidget *widget,
gpointer data);
void view_configure_grid_cmd_callback (GtkWidget *widget,
gpointer data);
void view_snap_to_grid_cmd_callback (GtkWidget *widget,
gpointer data);
void view_new_view_cmd_callback (GtkWidget *widget,
......
......@@ -37,7 +37,6 @@
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "display/gimpdisplayshell-appearance.h"
#include "widgets/gimpviewabledialog.h"
#include "widgets/gimppropwidgets.h"
......@@ -77,17 +76,11 @@ grid_dialog_new (GimpDisplay *gdisp)
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *frame;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *table;
GtkWidget *type;
GtkWidget *color_button;
GtkWidget *sizeentry;
GtkWidget *show_button;
GtkWidget *snap_button;
gboolean show_grid;
gboolean snap_to_grid;
g_return_val_if_fail (GIMP_IS_DISPLAY (gdisp), NULL);
......@@ -105,7 +98,7 @@ grid_dialog_new (GimpDisplay *gdisp)
GIMP_STOCK_GRID, _("Configure Image Grid"),
gimp_standard_help_func,
"dialogs/configure_grid.html",
GIMP_STOCK_RESET, reset_callback,
NULL, NULL, NULL, FALSE, FALSE,
......@@ -126,29 +119,6 @@ grid_dialog_new (GimpDisplay *gdisp)
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
main_vbox);
/* misc options */
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0);
show_button = gtk_check_button_new_with_mnemonic (_("S_how Grid"));
gtk_box_pack_start (GTK_BOX (vbox), show_button, FALSE, FALSE, 0);
show_grid = gimp_display_shell_get_show_grid (GIMP_DISPLAY_SHELL (shell));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show_button),
show_grid);
gtk_widget_show (show_button);
snap_button = gtk_check_button_new_with_mnemonic (_("S_nap to Grid"));
gtk_box_pack_start (GTK_BOX (vbox), snap_button, FALSE, FALSE, 0);
snap_to_grid = gimp_display_shell_get_snap_to_grid (GIMP_DISPLAY_SHELL (shell));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (snap_button),
snap_to_grid);
gtk_widget_show (snap_button);
gtk_widget_show (vbox);
/* the appearance frame */
frame = gtk_frame_new (_("Appearance"));
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
......@@ -159,7 +129,7 @@ grid_dialog_new (GimpDisplay *gdisp)
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_container_add (GTK_CONTAINER (frame), table);
type = gimp_prop_enum_option_menu_new (G_OBJECT (grid), "type",
GIMP_GRID_TYPE_INTERSECTION,
GIMP_GRID_TYPE_SOLID);
......@@ -288,9 +258,6 @@ grid_dialog_new (GimpDisplay *gdisp)
g_object_set_data_full (G_OBJECT (dialog), "grid", grid,
(GDestroyNotify) g_object_unref);
g_object_set_data (G_OBJECT (dialog), "show-button", show_button);
g_object_set_data (G_OBJECT (dialog), "snap-button", snap_button);
return dialog;
}
......@@ -307,16 +274,10 @@ reset_callback (GtkWidget *widget,
GimpGrid *grid_orig;
GimpGrid *grid;
GimpUnit unit_orig;
GtkWidget *show_button;
GtkWidget *snap_button;
gboolean show_grid;
gboolean snap_to_grid;
gimage = g_object_get_data (G_OBJECT (dialog), "gimage");
grid = g_object_get_data (G_OBJECT (dialog), "grid");
shell = g_object_get_data (G_OBJECT (dialog), "shell");
show_button = g_object_get_data (G_OBJECT (dialog), "show-button");
snap_button = g_object_get_data (G_OBJECT (dialog), "snap-button");
grid_orig = gimp_image_get_grid (GIMP_IMAGE (gimage));
unit_orig = gimp_image_get_unit (GIMP_IMAGE (gimage));
......@@ -340,14 +301,6 @@ reset_callback (GtkWidget *widget,
g_object_thaw_notify (G_OBJECT (grid));
}
show_grid = gimp_display_shell_get_show_grid (GIMP_DISPLAY_SHELL (shell));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show_button),
show_grid);
snap_to_grid = gimp_display_shell_get_snap_to_grid (GIMP_DISPLAY_SHELL (shell));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (snap_button),
snap_to_grid);
}
static void
......@@ -356,7 +309,7 @@ remove_callback (GtkWidget *widget,
{
GimpImage *gimage;
GimpDisplayShell *shell;
gimage = g_object_get_data (G_OBJECT (dialog), "gimage");
shell = g_object_get_data (G_OBJECT (dialog), "shell");
......@@ -381,16 +334,10 @@ ok_callback (GtkWidget *widget,
GimpDisplayShell *shell;
GimpGrid *grid;
GimpGrid *grid_orig;
GtkWidget *show_button;
GtkWidget *snap_button;
gboolean show_grid;
gboolean snap_to_grid;
gimage = g_object_get_data (G_OBJECT (dialog), "gimage");
grid = g_object_get_data (G_OBJECT (dialog), "grid");
shell = g_object_get_data (G_OBJECT (dialog), "shell");
show_button = g_object_get_data (G_OBJECT (dialog), "show-button");
snap_button = g_object_get_data (G_OBJECT (dialog), "snap-button");
grid_orig = gimp_image_get_grid (GIMP_IMAGE (gimage));
......@@ -398,11 +345,5 @@ ok_callback (GtkWidget *widget,
G_OBJECT (grid)))
gimp_image_set_grid (GIMP_IMAGE (gimage), grid, TRUE);
show_grid = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (show_button));
gimp_display_shell_set_show_grid (GIMP_DISPLAY_SHELL (shell), show_grid);
snap_to_grid = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (snap_button));
gimp_display_shell_set_snap_to_grid (GIMP_DISPLAY_SHELL (shell), snap_to_grid);
gtk_widget_destroy (dialog);
}
......@@ -37,7 +37,6 @@
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "display/gimpdisplayshell-appearance.h"
#include "widgets/gimpviewabledialog.h"
#include "widgets/gimppropwidgets.h"
......@@ -77,17 +76,11 @@ grid_dialog_new (GimpDisplay *gdisp)
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *frame;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *table;
GtkWidget *type;
GtkWidget *color_button;
GtkWidget *sizeentry;
GtkWidget *show_button;
GtkWidget *snap_button;
gboolean show_grid;
gboolean snap_to_grid;
g_return_val_if_fail (GIMP_IS_DISPLAY (gdisp), NULL);
......@@ -105,7 +98,7 @@ grid_dialog_new (GimpDisplay *gdisp)
GIMP_STOCK_GRID, _("Configure Image Grid"),
gimp_standard_help_func,
"dialogs/configure_grid.html",
GIMP_STOCK_RESET, reset_callback,
NULL, NULL, NULL, FALSE, FALSE,
......@@ -126,29 +119,6 @@ grid_dialog_new (GimpDisplay *gdisp)
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
main_vbox);
/* misc options */
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0);
show_button = gtk_check_button_new_with_mnemonic (_("S_how Grid"));
gtk_box_pack_start (GTK_BOX (vbox), show_button, FALSE, FALSE, 0);
show_grid = gimp_display_shell_get_show_grid (GIMP_DISPLAY_SHELL (shell));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show_button),
show_grid);
gtk_widget_show (show_button);
snap_button = gtk_check_button_new_with_mnemonic (_("S_nap to Grid"));
gtk_box_pack_start (GTK_BOX (vbox), snap_button, FALSE, FALSE, 0);
snap_to_grid = gimp_display_shell_get_snap_to_grid (GIMP_DISPLAY_SHELL (shell));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (snap_button),
snap_to_grid);
gtk_widget_show (snap_button);
gtk_widget_show (vbox);
/* the appearance frame */
frame = gtk_frame_new (_("Appearance"));
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
......@@ -159,7 +129,7 @@ grid_dialog_new (GimpDisplay *gdisp)
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_container_add (GTK_CONTAINER (frame), table);
type = gimp_prop_enum_option_menu_new (G_OBJECT (grid), "type",
GIMP_GRID_TYPE_INTERSECTION,
GIMP_GRID_TYPE_SOLID);
......@@ -288,9 +258,6 @@ grid_dialog_new (GimpDisplay *gdisp)
g_object_set_data_full (G_OBJECT (dialog), "grid", grid,
(GDestroyNotify) g_object_unref);
g_object_set_data (G_OBJECT (dialog), "show-button", show_button);
g_object_set_data (G_OBJECT (dialog), "snap-button", snap_button);
return dialog;
}
......@@ -307,16 +274,10 @@ reset_callback (GtkWidget *widget,
GimpGrid *grid_orig;
GimpGrid *grid;
GimpUnit unit_orig;
GtkWidget *show_button;
GtkWidget *snap_button;
gboolean show_grid;
gboolean snap_to_grid;
gimage = g_object_get_data (G_OBJECT (dialog), "gimage");
grid = g_object_get_data (G_OBJECT (dialog), "grid");
shell = g_object_get_data (G_OBJECT (dialog), "shell");
show_button = g_object_get_data (G_OBJECT (dialog), "show-button");
snap_button = g_object_get_data (G_OBJECT (dialog), "snap-button");
grid_orig = gimp_image_get_grid (GIMP_IMAGE (gimage));
unit_orig = gimp_image_get_unit (GIMP_IMAGE (gimage));
......@@ -340,14 +301,6 @@ reset_callback (GtkWidget *widget,
g_object_thaw_notify (G_OBJECT (grid));
}
show_grid = gimp_display_shell_get_show_grid (GIMP_DISPLAY_SHELL (shell));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show_button),
show_grid);
snap_to_grid = gimp_display_shell_get_snap_to_grid (GIMP_DISPLAY_SHELL (shell));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (snap_button),
snap_to_grid);
}
static void
......@@ -356,7 +309,7 @@ remove_callback (GtkWidget *widget,
{
GimpImage *gimage;
GimpDisplayShell *shell;
gimage = g_object_get_data (G_OBJECT (dialog), "gimage");
shell = g_object_get_data (G_OBJECT (dialog), "shell");
......@@ -381,16 +334,10 @@ ok_callback (GtkWidget *widget,
GimpDisplayShell *shell;
GimpGrid *grid;
GimpGrid *grid_orig;
GtkWidget *show_button;
GtkWidget *snap_button;
gboolean show_grid;
gboolean snap_to_grid;
gimage = g_object_get_data (G_OBJECT (dialog), "gimage");
grid = g_object_get_data (G_OBJECT (dialog), "grid");
shell = g_object_get_data (G_OBJECT (dialog), "shell");
show_button = g_object_get_data (G_OBJECT (dialog), "show-button");
snap_button = g_object_get_data (G_OBJECT (dialog), "snap-button");
grid_orig = gimp_image_get_grid (GIMP_IMAGE (gimage));
......@@ -398,11 +345,5 @@ ok_callback (GtkWidget *widget,
G_OBJECT (grid)))
gimp_image_set_grid (GIMP_IMAGE (gimage), grid, TRUE);
show_grid = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (show_button));
gimp_display_shell_set_show_grid (GIMP_DISPLAY_SHELL (shell), show_grid);
snap_to_grid = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (snap_button));
gimp_display_shell_set_snap_to_grid (GIMP_DISPLAY_SHELL (shell), snap_to_grid);
gtk_widget_destroy (dialog);
}
......@@ -45,6 +45,7 @@
#include "convert-dialog.h"
#include "image-commands.h"
#include "grid-dialog.h"
#include "resize-dialog.h"
#include "gimp-intl.h"
......@@ -295,6 +296,32 @@ image_flatten_image_cmd_callback (GtkWidget *widget,
gimp_image_flush (gimage);
}
void
image_configure_grid_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
if (! shell->grid_dialog)
{
shell->grid_dialog = grid_dialog_new (GIMP_DISPLAY (gdisp));
gtk_window_set_transient_for (GTK_WINDOW (shell->grid_dialog),
GTK_WINDOW (shell));
gtk_window_set_destroy_with_parent (GTK_WINDOW (shell->grid_dialog),
TRUE);
g_object_add_weak_pointer (G_OBJECT (shell->grid_dialog),
(gpointer *) &shell->grid_dialog);
}
gtk_window_present (GTK_WINDOW (shell->grid_dialog));
}
/****************************/
/* The layer merge dialog */
......
......@@ -51,5 +51,7 @@ void image_flatten_image_cmd_callback (GtkWidget *widet,
void image_layers_merge_query (GimpImage *gimage,
gboolean merge_visible);
void image_configure_grid_cmd_callback (GtkWidget *widget,
gpointer data);
#endif /* __IMAGE_COMMANDS_H__ */
......@@ -433,10 +433,6 @@ GimpItemFactoryEntry image_menu_entries[] =
MENU_SEPARATOR ("/View/---"),
{ { N_("/View/Configure G_rid..."), NULL,
view_configure_grid_cmd_callback, 0, NULL },
NULL,
"view/configure_grid.html", NULL },
{ { N_("/View/S_how Grid"), NULL,
view_toggle_grid_cmd_callback, 0, "<ToggleItem>" },
NULL,
......@@ -571,6 +567,13 @@ GimpItemFactoryEntry image_menu_entries[] =
NULL,
"layers/flatten_image.html", NULL },
MENU_SEPARATOR ("/Image/---"),
{ { N_("/Image/Configure G_rid..."), NULL,
image_configure_grid_cmd_callback, 0, NULL },
NULL,
"image/dialogs/configure_grid.html", NULL },
/* <Image>/Layer */
MENU_BRANCH (N_("/_Layer")),
......
......@@ -42,7 +42,6 @@
#include "dialogs.h"
#include "info-dialog.h"
#include "info-window.h"
#include "grid-dialog.h"
#include "view-commands.h"
......@@ -351,32 +350,6 @@ view_snap_to_guides_cmd_callback (GtkWidget *widget,
}
}
void
view_configure_grid_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
if (! shell->grid_dialog)
{
shell->grid_dialog = grid_dialog_new (GIMP_DISPLAY (gdisp));
gtk_window_set_transient_for (GTK_WINDOW (shell->grid_dialog),
GTK_WINDOW (shell));
gtk_window_set_destroy_with_parent (GTK_WINDOW (shell->grid_dialog),
TRUE);
g_object_add_weak_pointer (G_OBJECT (shell->grid_dialog),
(gpointer *) &shell->grid_dialog);
}
gtk_window_present (GTK_WINDOW (shell->grid_dialog));
}
void
view_toggle_grid_cmd_callback (GtkWidget *widget,
......
......@@ -59,8 +59,6 @@ void view_snap_to_guides_cmd_callback (GtkWidget *widget,
gpointer data);
void view_toggle_grid_cmd_callback (GtkWidget *widget,
gpointer data);
void view_configure_grid_cmd_callback (GtkWidget *widget,
gpointer data);
void view_snap_to_grid_cmd_callback (GtkWidget *widget,
gpointer data);
void view_new_view_cmd_callback (GtkWidget *widget,
......
......@@ -433,10 +433,6 @@ GimpItemFactoryEntry image_menu_entries[] =
MENU_SEPARATOR ("/View/---"),
{ { N_("/View/Configure G_rid..."), NULL,
view_configure_grid_cmd_callback, 0, NULL },
NULL,
"view/configure_grid.html", NULL },
{ { N_("/View/S_how Grid"), NULL,
view_toggle_grid_cmd_callback, 0, "<ToggleItem>" },
NULL,
......@@ -571,6 +567,13 @@ GimpItemFactoryEntry image_menu_entries[] =
NULL,
"layers/flatten_image.html", NULL },
MENU_SEPARATOR ("/Image/---"),
{ { N_("/Image/Configure G_rid..."), NULL,
image_configure_grid_cmd_callback, 0, NULL },
NULL,
"image/dialogs/configure_grid.html", NULL },
/* <Image>/Layer */
MENU_BRANCH (N_("/_Layer")),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment