index 34f7e44638cf32d3b92bd840fbb26191f01322d2..e0c891ea1ad22c4aedf4f30eec1d88f610fc1238 100644 (file)
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+
#include <glibmm/i18n.h>
+#include <string>
+#include <cstring>
+
#include "helper/window.h"
#include "macros.h"
#include "sp-anchor.h"
#include "sp-attribute-widget.h"
+#include "../xml/repr.h"
#include <sigc++/connection.h>
#include <sigc++/functors/ptr_fun.h>
{ NULL, NULL}
};
+static const SPAttrDesc image_nohref_desc[] = {
+ { N_("X:"), "x"},
+ { N_("Y:"), "y"},
+ { N_("Width:"), "width"},
+ { N_("Height:"), "height"},
+ { NULL, NULL}
+};
+
static void
-object_released (SPObject *object, GtkWidget *widget)
+object_released( SPObject */*object*/, GtkWidget *widget )
{
gtk_widget_destroy (widget);
}
static void
-window_destroyed (GtkObject *window, GtkObject *object)
+window_destroyed( GtkObject *window, GtkObject */*object*/ )
{
sigc::connection *release_connection = (sigc::connection *)g_object_get_data(G_OBJECT(window), "release_connection");
release_connection->disconnect();
attrs[i] = desc[i].attribute;
}
- title = g_strdup_printf (_("%s attributes"), tag);
+ title = g_strdup_printf (_("%s Properties"), tag);
w = sp_window_new (title, TRUE);
g_free (title);
if (!strcmp (tag, "Link")) {
sp_object_attr_show_dialog (object, anchor_desc, tag);
} else if (!strcmp (tag, "Image")) {
- sp_object_attr_show_dialog (object, image_desc, tag);
+ Inkscape::XML::Node *ir = SP_OBJECT_REPR(object);
+ const gchar *href = ir->attribute("xlink:href");
+ if ( (!href) || ((strncmp(href, "data:", 5) == 0)) ) {
+ sp_object_attr_show_dialog (object, image_nohref_desc, tag);
+ } else {
+ sp_object_attr_show_dialog (object, image_desc, tag);
+ }
}
} // end of sp_object_attributes_dialog()