dia r4306 - in trunk: . app app/pixmaps data lib



Author: hans
Date: Sat Mar  7 17:09:17 2009
New Revision: 4306
URL: http://svn.gnome.org/viewvc/dia?rev=4306&view=rev

Log:
2009-03-07  Hans Breuer  <hans breuer org>

	* data/display-ui.xml data/integrated-ui.xml data/popup-ui.xml
	  app/menus.c : move "Edit/Properties" to "File/Diagram Properties" as
	suggested by bug #573259, also create a Layers submenu to hold formerly
	"Edit/Layers", "Objects/Move (selection) to layer [...]"
	* app/pixmaps/objects-layer-above.png app/pixmaps/layer-add.png
	  app/pixmaps/objects-layer-below.png app/pixmaps/layers.png
	  app/pixmaps/layer-rename.png : stock icons stolen from Inkscape for 
	the new Layers menu
	* app/Makefile.am app/makefile.msc : generate inline icons
	* app/commands.[ch] : new callbacks for layer add/rename (not enabled)



Added:
   trunk/app/pixmaps/layer-add.png   (contents, props changed)
   trunk/app/pixmaps/layer-rename.png   (contents, props changed)
   trunk/app/pixmaps/layers.png   (contents, props changed)
   trunk/app/pixmaps/objects-layer-above.png   (contents, props changed)
   trunk/app/pixmaps/objects-layer-below.png   (contents, props changed)
Modified:
   trunk/ChangeLog
   trunk/app/Makefile.am
   trunk/app/commands.c
   trunk/app/commands.h
   trunk/app/makefile.msc
   trunk/app/menus.c
   trunk/data/display-ui.xml
   trunk/data/integrated-ui.xml
   trunk/data/popup-ui.xml
   trunk/lib/persistence.c

Modified: trunk/app/Makefile.am
==============================================================================
--- trunk/app/Makefile.am	(original)
+++ trunk/app/Makefile.am	Sat Mar  7 17:09:17 2009
@@ -51,7 +51,14 @@
 	dia_mainpoints_off_icon $(srcdir)/pixmaps/mainpoints-off.png \
 	\
 	dia_diagram_icon $(srcdir)/pixmaps/dia-diagram.png \
-	dia_app_icon $(srcdir)/pixmaps/dia-app.png 
+	dia_app_icon $(srcdir)/pixmaps/dia-app.png \
+	\
+	dia_objects_layer_above $(srcdir)/pixmaps/objects-layer-above.png \
+	dia_objects_layer_below $(srcdir)/pixmaps/objects-layer-below.png \
+	dia_layers $(srcdir)/pixmaps/layers.png \
+	dia_layer_add $(srcdir)/pixmaps/layer-add.png \
+	dia_layer_rename $(srcdir)/pixmaps/layer-rename.png
+	
 
 ICON_PNGS= \
 	pixmaps/connectable.png \
@@ -71,8 +78,14 @@
 	pixmaps/group.png \
 	pixmaps/ungroup.png \
 	pixmaps/mainpoints-on.png \
-	pixmaps/mainpoints-off.png
-
+	pixmaps/mainpoints-off.png \
+	\
+	pixmaps/objects-layer-above.png \
+	pixmaps/objects-layer-below.png \
+	pixmaps/layers.png \
+	pixmaps/layer-add.png \
+	pixmaps/layer-rename.png
+	
 
 dia-app-icons.h: $(ICON_PNGS)
 	gdk-pixbuf-csource --raw --build-list $(ICON_PNG_PAIRS) > dia-app-icons.h

Modified: trunk/app/commands.c
==============================================================================
--- trunk/app/commands.c	(original)
+++ trunk/app/commands.c	Sat Mar  7 17:09:17 2009
@@ -1018,6 +1018,15 @@
   }
 }
 
+void 
+layers_add_layer_callback (GtkAction *action)
+{
+}
+
+void 
+layers_rename_layer_callback (GtkAction *action)
+{
+}
 
 void
 objects_place_over_callback (GtkAction *action)

Modified: trunk/app/commands.h
==============================================================================
--- trunk/app/commands.h	(original)
+++ trunk/app/commands.h	Sat Mar  7 17:09:17 2009
@@ -68,6 +68,9 @@
 void view_main_statusbar_callback     (GtkAction *action);
 void view_layers_callback             (GtkAction *action);
 
+void layers_add_layer_callback    (GtkAction *action);
+void layers_rename_layer_callback (GtkAction *action);
+
 void objects_place_over_callback        (GtkAction *action);
 void objects_place_under_callback       (GtkAction *action);
 void objects_place_up_callback          (GtkAction *action);

Modified: trunk/app/makefile.msc
==============================================================================
--- trunk/app/makefile.msc	(original)
+++ trunk/app/makefile.msc	Sat Mar  7 17:09:17 2009
@@ -95,7 +95,13 @@
 	dia_mainpoints_off_icon pixmaps\mainpoints-off.png \
 	\
 	dia_diagram_icon pixmaps\dia-diagram.png \
-	dia_app_icon pixmaps\dia-app.png 
+	dia_app_icon pixmaps\dia-app.png \
+	\
+	dia_objects_layer_above $(srcdir)/pixmaps/objects-layer-above.png \
+	dia_objects_layer_below $(srcdir)/pixmaps/objects-layer-below.png \
+	dia_layers $(srcdir)/pixmaps/layers.png \
+	dia_layer_add $(srcdir)/pixmaps/layer-add.png \
+	dia_layer_rename $(srcdir)/pixmaps/layer-rename.png
 
 dia-app-icons.h : makefile.msc pixmaps\*.png
 	gdk-pixbuf-csource --build-list \

Modified: trunk/app/menus.c
==============================================================================
--- trunk/app/menus.c	(original)
+++ trunk/app/menus.c	Sat Mar  7 17:09:17 2009
@@ -47,6 +47,11 @@
 
 #define DIA_STOCK_GROUP "dia-stock-group"
 #define DIA_STOCK_UNGROUP "dia-stock-ungroup"
+#define DIA_STOCK_LAYER_ADD "dia-stock-layer-add"
+#define DIA_STOCK_LAYER_RENAME "dia-stock-layer-rename"
+#define DIA_STOCK_OBJECTS_LAYER_ABOVE "dia-stock-objects-layer-above"
+#define DIA_STOCK_OBJECTS_LAYER_BELOW "dia-stock-objects-layer-below"
+#define DIA_STOCK_LAYERS "dia-stock-layers"
 
 #define DIA_SHOW_TEAROFFS TRUE
 
@@ -110,6 +115,7 @@
     { "FileSave", GTK_STOCK_SAVE, NULL, "<control>S", NULL, G_CALLBACK (file_save_callback) },
     { "FileSaveas", GTK_STOCK_SAVE_AS, NULL, "<control><shift>S", NULL, G_CALLBACK (file_save_as_callback) },
     { "FileExport", GTK_STOCK_CONVERT, N_("_Export ..."), NULL, NULL, G_CALLBACK (file_export_callback) },
+    { "DiagramProperties", GTK_STOCK_PROPERTIES, N_("_Diagram Properties"), "<shift><alt>Return", NULL, G_CALLBACK (view_diagram_properties_callback) },
     { "FilePagesetup", NULL, N_("Page Set_up..."), NULL, NULL, G_CALLBACK (file_pagesetup_callback) },
     { "FilePrint", GTK_STOCK_PRINT, NULL, "<control>P", NULL, G_CALLBACK (file_print_callback) },
     { "FileClose", GTK_STOCK_CLOSE, NULL, "<control>W", NULL, G_CALLBACK (file_close_callback) },
@@ -133,9 +139,14 @@
     { "EditCuttext", NULL, N_("Cut Text"), "<control><shift>X", NULL, G_CALLBACK (edit_cut_text_callback) },
     { "EditPastetext", NULL, N_("Paste _Text"), "<control><shift>V", NULL, G_CALLBACK (edit_paste_text_callback) },
 
-  { "Diagram", NULL, N_("_Diagram"), NULL, NULL, NULL }, 
-    { "DiagramProperties", GTK_STOCK_PROPERTIES, NULL, "<shift><alt>Return", NULL, G_CALLBACK (view_diagram_properties_callback) },
-    { "DiagramLayers", NULL, N_("_Layers..."), "<control>L", NULL, G_CALLBACK (dialogs_layers_callback) },
+  { "Layers", NULL, N_("_Layers"), NULL, NULL, NULL }, 
+#if 0 /* TODO: implement the callbacks */
+    { "LayerAdd", DIA_STOCK_LAYER_ADD, N_("Add Layer..."), NULL, NULL, G_CALLBACK (layers_add_layer_callback) },
+    { "LayerRename", DIA_STOCK_LAYER_RENAME, N_("Rename Layer..."), NULL, NULL, G_CALLBACK (layers_rename_layer_callback) },
+#endif
+    { "ObjectsLayerAbove", DIA_STOCK_OBJECTS_LAYER_ABOVE, N_("Move selection to layer above"), NULL, NULL, G_CALLBACK (objects_move_up_layer) },
+    { "ObjectsLayerBelow", DIA_STOCK_OBJECTS_LAYER_BELOW, N_("Move selection to layer below"), NULL, NULL, G_CALLBACK (objects_move_down_layer) },
+    { "DiagramLayers", DIA_STOCK_LAYERS, N_("_Layers..."), "<control>L", NULL, G_CALLBACK (dialogs_layers_callback) },
 
   { "View", NULL, N_("_View"), NULL, NULL, NULL },
     { "ViewZoomin", GTK_STOCK_ZOOM_IN, NULL, "<control>plus", NULL, G_CALLBACK (view_zoom_in_callback) },
@@ -168,9 +179,6 @@
     { "ObjectsSendbackwards", GTK_STOCK_GO_DOWN, N_("Send Backwards"), NULL, NULL, G_CALLBACK (objects_place_down_callback) },
     { "ObjectsBringforwards", GTK_STOCK_GO_UP, N_("Bring Forwards"), NULL, NULL, G_CALLBACK (objects_place_up_callback) },
 
-    { "ObjectsLayerAbove", NULL, N_("Move to layer above"), NULL, NULL, G_CALLBACK (objects_move_up_layer) },
-    { "ObjectsLayerBelow", NULL, N_("Move to layer below"), NULL, NULL, G_CALLBACK (objects_move_down_layer) },
-    
     { "ObjectsGroup", DIA_STOCK_GROUP, N_("_Group"), "<control>G", NULL, G_CALLBACK (objects_group_callback) },
     /* deliberately not using Ctrl+U for Ungroup */
     { "ObjectsUngroup", DIA_STOCK_UNGROUP, N_("_Ungroup"), "<control><shift>G", NULL, G_CALLBACK (objects_ungroup_callback) }, 
@@ -732,36 +740,39 @@
 }
 
 static void
-register_stock_icons (void)
+_add_stock_icon (GtkIconFactory *factory, const char *name, const guint8 *data, const size_t size)
 {
-  GtkIconFactory *factory;
-  GtkIconSet     *set;
   GdkPixbuf      *pixbuf;
+  GtkIconSet     *set;
   GError         *err = NULL;
 
-  factory = gtk_icon_factory_new ();
-
-  pixbuf = gdk_pixbuf_new_from_inline (sizeof (dia_group_icon), dia_group_icon, FALSE, &err);
+  pixbuf = gdk_pixbuf_new_from_inline (size, data, FALSE, &err);
   if (err) {
     g_warning ("%s", err->message);
     g_error_free (err);
     err = NULL;
   }
   set = gtk_icon_set_new_from_pixbuf (pixbuf);
-  gtk_icon_factory_add (factory, DIA_STOCK_GROUP, set);
+  gtk_icon_factory_add (factory, name, set);
   g_object_unref (pixbuf);
   pixbuf = NULL;
+}
 
-  pixbuf = gdk_pixbuf_new_from_inline (sizeof (dia_ungroup_icon), dia_ungroup_icon, FALSE, &err);
-  if (err) {
-    g_warning ("%s", err->message);
-    g_error_free (err);
-    err = NULL;
-  }
-  set = gtk_icon_set_new_from_pixbuf (pixbuf);
-  gtk_icon_factory_add (factory, DIA_STOCK_UNGROUP, set);
-  g_object_unref (pixbuf); 
-  pixbuf = NULL;
+static void
+register_stock_icons (void)
+{
+  GtkIconFactory *factory;
+
+  factory = gtk_icon_factory_new ();
+
+  _add_stock_icon (factory, DIA_STOCK_GROUP, dia_group_icon, sizeof(dia_group_icon));
+  _add_stock_icon (factory, DIA_STOCK_UNGROUP, dia_ungroup_icon, sizeof(dia_ungroup_icon));
+
+  _add_stock_icon (factory, DIA_STOCK_LAYER_ADD, dia_layer_add, sizeof(dia_layer_add));
+  _add_stock_icon (factory, DIA_STOCK_LAYER_RENAME, dia_layer_rename, sizeof(dia_layer_rename));
+  _add_stock_icon (factory, DIA_STOCK_OBJECTS_LAYER_ABOVE, dia_objects_layer_above, sizeof(dia_objects_layer_above));
+  _add_stock_icon (factory, DIA_STOCK_OBJECTS_LAYER_BELOW, dia_objects_layer_below, sizeof(dia_objects_layer_below));
+  _add_stock_icon (factory, DIA_STOCK_LAYERS, dia_layers, sizeof(dia_layers));
 
   gtk_icon_factory_add_default (factory);
   g_object_unref (factory);

Added: trunk/app/pixmaps/layer-add.png
==============================================================================
Binary file. No diff available.

Added: trunk/app/pixmaps/layer-rename.png
==============================================================================
Binary file. No diff available.

Added: trunk/app/pixmaps/layers.png
==============================================================================
Binary file. No diff available.

Added: trunk/app/pixmaps/objects-layer-above.png
==============================================================================
Binary file. No diff available.

Added: trunk/app/pixmaps/objects-layer-below.png
==============================================================================
Binary file. No diff available.

Modified: trunk/data/display-ui.xml
==============================================================================
--- trunk/data/display-ui.xml	(original)
+++ trunk/data/display-ui.xml	Sat Mar  7 17:09:17 2009
@@ -9,6 +9,7 @@
 			<menuitem name="FileSaveas" action="FileSaveas" />
 			<menuitem name="FileExport" action="FileExport" />
 			<separator name="FileSep2 "/>
+			<menuitem name="DiagramProperties" action="DiagramProperties" />
 			<menuitem name="FilePagesetup" action="FilePagesetup" />
 			<menuitem name="FilePrint" action="FilePrint" />
 			<separator name="FileSep3" />
@@ -34,7 +35,6 @@
 			<menuitem name="EditCuttext" action="EditCuttext" />
 			<menuitem name="EditPastetext" action="EditPastetext" />
 			<separator name="EditSep4" />
-			<menuitem name="DiagramProperties" action="DiagramProperties" />
 			<menuitem name="DiagramLayers" action="DiagramLayers" />
 			<separator name="EditSep5" />
 			<separator name="EditExtensionStart" />
@@ -72,13 +72,20 @@
 			<separator name="ViewSep3" />
 			<separator name="ViewExtensionStart" />
 		</menu>
+		<menu name="Layers" action="Layers">
+			<menuitem name="LayerAdd" action="LayerAdd" />
+			<menuitem name="LayerRename" action="LayerRename" />
+			<separator name="LayersSep1" />
+			<menuitem name="ObjectsLayerAbove" action="ObjectsLayerAbove" />
+			<menuitem name="ObjectsLayerBelow" action="ObjectsLayerBelow" />
+			<separator name="LayersSep2" />
+			<menuitem name="DiagramLayers" action="DiagramLayers" />
+		</menu>
 		<menu name="Objects" action="Objects">
 			<menuitem name="ObjectsSendtoback" action="ObjectsSendtoback" />
 			<menuitem name="ObjectsBringtofront" action="ObjectsBringtofront" />
 			<menuitem name="ObjectsSendbackwards" action="ObjectsSendbackwards" />
 			<menuitem name="ObjectsBringforwards" action="ObjectsBringforwards" />
-			<menuitem name="ObjectsLayerAbove" action="ObjectsLayerAbove" />
-			<menuitem name="ObjectsLayerBelow" action="ObjectsLayerBelow" />
 			<separator name="ObjectsSep1" />
 			<menuitem name="ObjectsGroup" action="ObjectsGroup" />
 			<menuitem name="ObjectsUngroup" action="ObjectsUngroup" />

Modified: trunk/data/integrated-ui.xml
==============================================================================
--- trunk/data/integrated-ui.xml	(original)
+++ trunk/data/integrated-ui.xml	Sat Mar  7 17:09:17 2009
@@ -15,6 +15,7 @@
 			<menuitem name="FileSheets" action="FileSheets" />
 			<separator name="FileSep3 "/>
 
+			<menuitem name="DiagramProperties" action="DiagramProperties" />
 			<menuitem name="FilePagesetup" action="FilePagesetup" />
 			<menuitem name="FilePrint" action="FilePrint" />
 			<separator name="FileSep4 "/>
@@ -47,8 +48,6 @@
 			<menuitem name="EditCopytext" action="EditCopytext" />
 			<menuitem name="EditCuttext" action="EditCuttext" />
 			<menuitem name="EditPastetext" action="EditPastetext" />
-			<separator name="EditSep4" />
-			<menuitem name="DiagramProperties" action="DiagramProperties" />
 		</menu>
 		<menu name="View" action="View">
 			<menuitem name="ViewZoomin" action="ViewZoomin" />
@@ -86,13 +85,21 @@
 			<menuitem name="ViewRedraw" action="ViewRedraw" />
 		</menu>
 
+		<menu name="Layers" action="Layers">
+			<menuitem name="LayerAdd" action="LayerAdd" />
+			<menuitem name="LayerRename" action="LayerRename" />
+			<separator name="LayersSep1" />
+			<menuitem name="ObjectsLayerAbove" action="ObjectsLayerAbove" />
+			<menuitem name="ObjectsLayerBelow" action="ObjectsLayerBelow" />
+			<separator name="LayersSep2" />
+			<menuitem name="DiagramLayers" action="DiagramLayers" />
+		</menu>
+
 		<menu name="Objects" action="Objects">
 			<menuitem name="ObjectsSendtoback" action="ObjectsSendtoback" />
 			<menuitem name="ObjectsBringtofront" action="ObjectsBringtofront" />
 			<menuitem name="ObjectsSendbackwards" action="ObjectsSendbackwards" />
 			<menuitem name="ObjectsBringforwards" action="ObjectsBringforwards" />
-			<menuitem name="ObjectsLayerAbove" action="ObjectsLayerAbove" />
-			<menuitem name="ObjectsLayerBelow" action="ObjectsLayerBelow" />
 			<separator name="ObjectsSep1" />
 			<menuitem name="ObjectsGroup" action="ObjectsGroup" />
 			<menuitem name="ObjectsUngroup" action="ObjectsUngroup" />

Modified: trunk/data/popup-ui.xml
==============================================================================
--- trunk/data/popup-ui.xml	(original)
+++ trunk/data/popup-ui.xml	Sat Mar  7 17:09:17 2009
@@ -9,6 +9,7 @@
 			<menuitem name="FileSaveas" action="FileSaveas" />
 			<menuitem name="FileExport" action="FileExport" />
 			<separator name="FileSep2 "/>
+			<menuitem name="DiagramProperties" action="DiagramProperties" />
 			<menuitem name="FilePagesetup" action="FilePagesetup" />
 			<menuitem name="FilePrint" action="FilePrint" />
 			<separator name="FileSep3" />
@@ -33,9 +34,6 @@
 			<menuitem name="EditCopytext" action="EditCopytext" />
 			<menuitem name="EditCuttext" action="EditCuttext" />
 			<menuitem name="EditPastetext" action="EditPastetext" />
-			<separator name="EditSep4" />
-			<menuitem name="DiagramProperties" action="DiagramProperties" />
-			<menuitem name="DiagramLayers" action="DiagramLayers" />
 			<separator name="EditExtensionStart" />
 		</menu>
 		<menu name="View" action="View">
@@ -71,13 +69,20 @@
 			<separator name="ViewSep3" />
 			<separator name="ViewExtensionStart" />
 		</menu>
+		<menu name="Layers" action="Layers">
+			<menuitem name="LayerAdd" action="LayerAdd" />
+			<menuitem name="LayerRename" action="LayerRename" />
+			<separator name="LayersSep1" />
+			<menuitem name="ObjectsLayerAbove" action="ObjectsLayerAbove" />
+			<menuitem name="ObjectsLayerBelow" action="ObjectsLayerBelow" />
+			<separator name="LayersSep2" />
+			<menuitem name="DiagramLayers" action="DiagramLayers" />
+		</menu>
 		<menu name="Objects" action="Objects">
 			<menuitem name="ObjectsSendtoback" action="ObjectsSendtoback" />
 			<menuitem name="ObjectsBringtofront" action="ObjectsBringtofront" />
 			<menuitem name="ObjectsSendbackwards" action="ObjectsSendbackwards" />
 			<menuitem name="ObjectsBringforwards" action="ObjectsBringforwards" />
-			<menuitem name="ObjectsLayerAbove" action="ObjectsLayerAbove" />
-			<menuitem name="ObjectsLayerBelow" action="ObjectsLayerBelow" />
 			<separator name="ObjectsSep1" />
 			<menuitem name="ObjectsGroup" action="ObjectsGroup" />
 			<menuitem name="ObjectsUngroup" action="ObjectsUngroup" />

Modified: trunk/lib/persistence.c
==============================================================================
--- trunk/lib/persistence.c	(original)
+++ trunk/lib/persistence.c	Sat Mar  7 17:09:17 2009
@@ -517,8 +517,10 @@
     wininfo->window = window;
     g_object_ref(window);
   }
+#ifdef G_OS_WIN32
   /* catch the transistion */
   wininfo->isopen = !isclosed;
+#endif
 }
 
 /** Handler for window-related events that should cause persistent storage
@@ -1092,9 +1094,9 @@
   stringval = (gchar *)g_hash_table_lookup(persistent_strings, role);
   if (stringval != NULL) {
     g_hash_table_insert(persistent_strings, role, g_strdup(newvalue));
+  } else {
+    g_hash_table_remove(persistent_strings, role);
   }
-  else 
-    g_warning("No string to set for %s", role);
 }
 
 /* ********* COLORS ********** */



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