Re: [Gimp-developer] Image Info Dialog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi,

Carol Spears wrote:
since day one with the gimp, everytime i want to get the info dialog i
first search the Image Menu.  my reasoning is "Image -->Info".  i am
really not thinking of viewing anything, more like knowing ....

This is a reasonable suggestion.

Out of interest, are there other menu items that people would like to see elsewhere? This is not very difficult to do, but there has not (yet) been a proposition on where to put menu entries.

is it easy to change the info plugin to show also in the Image Menu?

No, not really... the menu entries are all defined in app/gui/image-menu.c and for consistency there are files containing the callbacks (the functions called when you select a menu item) for each submenu in <menu name>-commands.[ch] (so, for example, the info window calback is in view-commands.c).


Here's a quick, untested patch against the 2.0 branch that changes the placement of that menu. This has probably changed in HEAD since mitch's work converting menus to be GtkAction based.

Cheers,
Dave.

--
Dave Neary
bolsh@xxxxxxxx

? menu_change.patch
Index: app/gui/image-commands.c
===================================================================
RCS file: /cvs/gnome/gimp/app/gui/Attic/image-commands.c,v
retrieving revision 1.51
diff -u -r1.51 image-commands.c
--- app/gui/image-commands.c	31 Jan 2004 20:23:52 -0000	1.51
+++ app/gui/image-commands.c	27 Apr 2004 09:35:40 -0000
@@ -339,6 +339,34 @@
 }
 
 
+void
+image_info_window_cmd_callback (GtkWidget *widget,
+                                gpointer   data)
+{
+  GimpDisplay      *gdisp;
+  GimpDisplayShell *shell;
+  return_if_no_display (gdisp, data);
+
+  shell = GIMP_DISPLAY_SHELL (gdisp->shell);
+
+  if (GIMP_GUI_CONFIG (gdisp->gimage->gimp->config)->info_window_per_display)
+    {
+      if (! shell->info_dialog)
+	shell->info_dialog = info_window_create (gdisp);
+
+      /* To update the fields of the info window for the first time. *
+       * It's no use updating it in info_window_create() because the *
+       * pointer of the info window is not present in the shell yet. */
+      info_window_update (gdisp);
+
+      info_dialog_present (shell->info_dialog);
+    }
+  else
+    {
+      info_window_follow_auto (gdisp->gimage->gimp);
+    }
+}
+
 /****************************/
 /*  The layer merge dialog  */
 /****************************/
Index: app/gui/image-commands.h
===================================================================
RCS file: /cvs/gnome/gimp/app/gui/Attic/image-commands.h,v
retrieving revision 1.8
diff -u -r1.8 image-commands.h
--- app/gui/image-commands.h	8 Nov 2003 15:29:47 -0000	1.8
+++ app/gui/image-commands.h	27 Apr 2004 09:35:40 -0000
@@ -54,5 +54,7 @@
 
 void   image_configure_grid_cmd_callback    (GtkWidget *widget,
                                              gpointer   data);
+void   image_info_window_cmd_callback       (GtkWidget *widget,
+                                             gpointer   data);
 
 #endif /* __IMAGE_COMMANDS_H__ */
Index: app/gui/image-menu.c
===================================================================
RCS file: /cvs/gnome/gimp/app/gui/image-menu.c,v
retrieving revision 1.103
diff -u -r1.103 image-menu.c
--- app/gui/image-menu.c	20 Mar 2004 16:14:48 -0000	1.103
+++ app/gui/image-menu.c	27 Apr 2004 09:35:40 -0000
@@ -431,10 +431,6 @@
 
   MENU_SEPARATOR ("/View/---"),
 
-  { { N_("/View/_Info Window"), "<control><shift>I",
-      view_info_window_cmd_callback, 0,
-      "<StockItem>", GIMP_STOCK_INFO },
-    NULL,
     GIMP_HELP_INFO_DIALOG, NULL },
   { { N_("/View/Na_vigation Window"), "<control><shift>N",
       view_navigation_window_cmd_callback, 0,
@@ -612,6 +608,11 @@
       "<StockItem>", GIMP_STOCK_GRID },
     NULL,
     GIMP_HELP_IMAGE_GRID, NULL },
+  
+  { { N_("/Image/_Info Window"), "<control><shift>I",
+      image_info_window_cmd_callback, 0,
+      "<StockItem>", GIMP_STOCK_INFO },
+    NULL,
 
   /*  <Image>/Layer  */
 
Index: app/gui/view-commands.c
===================================================================
RCS file: /cvs/gnome/gimp/app/gui/Attic/view-commands.c,v
retrieving revision 1.42
diff -u -r1.42 view-commands.c
--- app/gui/view-commands.c	31 Jan 2004 20:23:53 -0000	1.42
+++ app/gui/view-commands.c	27 Apr 2004 09:35:40 -0000
@@ -159,34 +159,6 @@
 }
 
 void
-view_info_window_cmd_callback (GtkWidget *widget,
-			       gpointer   data)
-{
-  GimpDisplay      *gdisp;
-  GimpDisplayShell *shell;
-  return_if_no_display (gdisp, data);
-
-  shell = GIMP_DISPLAY_SHELL (gdisp->shell);
-
-  if (GIMP_GUI_CONFIG (gdisp->gimage->gimp->config)->info_window_per_display)
-    {
-      if (! shell->info_dialog)
-	shell->info_dialog = info_window_create (gdisp);
-
-      /* To update the fields of the info window for the first time. *
-       * It's no use updating it in info_window_create() because the *
-       * pointer of the info window is not present in the shell yet. */
-      info_window_update (gdisp);
-
-      info_dialog_present (shell->info_dialog);
-    }
-  else
-    {
-      info_window_follow_auto (gdisp->gimage->gimp);
-    }
-}
-
-void
 view_navigation_window_cmd_callback (GtkWidget *widget,
                                      gpointer   data)
 {
Index: app/gui/view-commands.h
===================================================================
RCS file: /cvs/gnome/gimp/app/gui/Attic/view-commands.h,v
retrieving revision 1.13
diff -u -r1.13 view-commands.h
--- app/gui/view-commands.h	29 Jan 2004 22:22:22 -0000	1.13
+++ app/gui/view-commands.h	27 Apr 2004 09:35:40 -0000
@@ -33,8 +33,6 @@
                                                 gpointer   data);
 void   view_dot_for_dot_cmd_callback           (GtkWidget *widget,
                                                 gpointer   data);
-void   view_info_window_cmd_callback           (GtkWidget *widget,
-                                                gpointer   data);
 void   view_navigation_window_cmd_callback     (GtkWidget *widget,
                                                 gpointer   data);
 void   view_display_filters_cmd_callback       (GtkWidget *widget,

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux