~ubuntu-branches/debian/experimental/inkscape/experimental

« back to all changes in this revision

Viewing changes to src/ui/context-menu.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-09-09 23:29:02 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080909232902-c50iujhk1w79u8e7
Tags: 0.46-2.1
* Non-maintainer upload.
* Add upstream patch fixing a crash in the open dialog
  in the zh_CN.utf8 locale. Closes: #487623.
  Thanks to Luca Bruno for the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
#include "context-menu.h"
17
17
#include "../xml/repr.h"
 
18
#include "desktop.h"
 
19
#include "document.h"
 
20
#include "ui/dialog/dialog-manager.h"
18
21
 
19
22
static void sp_object_type_menu(GType type, SPObject *object, SPDesktop *desktop, GtkMenu *menu);
20
23
 
48
51
 
49
52
#include "dialogs/item-properties.h"
50
53
#include "dialogs/object-attributes.h"
51
 
#include "dialogs/object-properties.h"
52
54
 
53
55
#include "sp-path.h"
54
56
 
158
160
    SPDesktop *desktop = (SPDesktop*)gtk_object_get_data(GTK_OBJECT(menuitem), "desktop");
159
161
    g_return_if_fail(desktop != NULL);
160
162
 
161
 
    Inkscape::XML::Node *repr = sp_repr_new("svg:a");
 
163
    Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc());
 
164
    Inkscape::XML::Node *repr = xml_doc->createElement("svg:a");
162
165
    SP_OBJECT_REPR(SP_OBJECT_PARENT(item))->addChild(repr, SP_OBJECT_REPR(item));
163
166
    SPObject *object = SP_OBJECT_DOCUMENT(item)->getObjectByRepr(repr);
164
167
    g_return_if_fail(SP_IS_ANCHOR(object));
165
168
 
166
169
    const char *id = SP_OBJECT_REPR(item)->attribute("id");
167
 
    Inkscape::XML::Node *child = SP_OBJECT_REPR(item)->duplicate();
 
170
    Inkscape::XML::Node *child = SP_OBJECT_REPR(item)->duplicate(xml_doc);
168
171
    SP_OBJECT(item)->deleteObject(false);
169
172
    repr->addChild(child, NULL);
170
173
    child->setAttribute("id", id);
171
 
    sp_document_done(SP_OBJECT_DOCUMENT(object));
 
174
    sp_document_done(SP_OBJECT_DOCUMENT(object), SP_VERB_NONE,
 
175
                     _("Create link"));
172
176
 
173
177
    sp_object_attributes_dialog(object, "SPAnchor");
174
178
 
231
235
    gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_anchor_link_properties), item);
232
236
    gtk_widget_show(w);
233
237
    gtk_menu_append(GTK_MENU(m), w);
234
 
    /* Separator */
235
 
    w = gtk_menu_item_new();
236
 
    gtk_widget_show(w);
237
 
    gtk_menu_append(GTK_MENU(m), w);
238
238
    /* Select item */
239
239
    w = gtk_menu_item_new_with_mnemonic(_("_Follow Link"));
240
240
    gtk_signal_connect(GTK_OBJECT(w), "activate", GTK_SIGNAL_FUNC(sp_anchor_link_follow), item);
249
249
}
250
250
 
251
251
static void
252
 
sp_anchor_link_properties(GtkMenuItem *menuitem, SPAnchor *anchor)
 
252
sp_anchor_link_properties(GtkMenuItem */*menuitem*/, SPAnchor *anchor)
253
253
{
254
254
    sp_object_attributes_dialog(SP_OBJECT(anchor), "Link");
255
255
}
256
256
 
257
257
static void
258
 
sp_anchor_link_follow(GtkMenuItem *menuitem, SPAnchor *anchor)
 
258
sp_anchor_link_follow(GtkMenuItem */*menuitem*/, SPAnchor *anchor)
259
259
{
260
260
    g_return_if_fail(anchor != NULL);
261
261
    g_return_if_fail(SP_IS_ANCHOR(anchor));
264
264
}
265
265
 
266
266
static void
267
 
sp_anchor_link_remove(GtkMenuItem *menuitem, SPAnchor *anchor)
 
267
sp_anchor_link_remove(GtkMenuItem */*menuitem*/, SPAnchor *anchor)
268
268
{
269
269
    GSList *children;
270
270
 
298
298
}
299
299
 
300
300
static void
301
 
sp_image_image_properties(GtkMenuItem *menuitem, SPAnchor *anchor)
 
301
sp_image_image_properties(GtkMenuItem */*menuitem*/, SPAnchor *anchor)
302
302
{
303
303
    sp_object_attributes_dialog(SP_OBJECT(anchor), "Image");
304
304
}
319
319
        sp_desktop_selection(desktop)->set(item);
320
320
    }
321
321
 
322
 
    sp_object_properties_dialog();
 
322
    desktop->_dlg_mgr->showDialog("FillAndStroke");
323
323
}
324
324
 
325
325
static void