X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Finterface.cpp;h=348e71821acf13b4c6ee2fbf80526a000b460ff7;hb=4601eacf8d5a7e695e9e83702a805afff34cd2b9;hp=2a2cba4d01822a6a0fd8125649b3bb9625e5d4ef;hpb=6129af7cc5b723223e9617614c931936e5190421;p=inkscape.git diff --git a/src/interface.cpp b/src/interface.cpp index 2a2cba4d0..348e71821 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -33,7 +33,7 @@ #include "file.h" #include "interface.h" #include "desktop.h" -#include "object-ui.h" +#include "ui/context-menu.h" #include "selection.h" #include "selection-chemistry.h" #include "svg-view-widget.h" @@ -88,9 +88,9 @@ static GtkTargetEntry ui_drop_target_entries [] = { {"image/svg", 0, SVG_DATA}, {"image/png", 0, PNG_DATA}, {"image/jpeg", 0, JPEG_DATA}, -#if ENABLE_LCMS +#if ENABLE_MAGIC_COLORS {"application/x-inkscape-color", 0, APP_X_INKY_COLOR}, -#endif // ENABLE_LCMS +#endif // ENABLE_MAGIC_COLORS {"application/x-color", 0, APP_X_COLOR} }; @@ -112,13 +112,17 @@ static void sp_ui_drag_data_received(GtkWidget *widget, static void sp_ui_menu_item_set_sensitive(SPAction *action, unsigned int sensitive, void *data); +static void sp_ui_menu_item_set_name(SPAction *action, + Glib::ustring name, + void *data); SPActionEventVector menu_item_event_vector = { {NULL}, NULL, NULL, /* set_active */ sp_ui_menu_item_set_sensitive, /* set_sensitive */ - NULL /* set_shortcut */ + NULL, /* set_shortcut */ + sp_ui_menu_item_set_name /* set_name */ }; void @@ -779,10 +783,10 @@ sp_ui_checkboxes_menus(GtkMenu *m, Inkscape::UI::View::View *view) checkitem_toggled, checkitem_update, Inkscape::Verb::get(SP_VERB_TOGGLE_RULERS)); sp_ui_menu_append_check_item_from_verb(m, view, NULL, NULL, "scrollbars", checkitem_toggled, checkitem_update, Inkscape::Verb::get(SP_VERB_TOGGLE_SCROLLBARS)); - sp_ui_menu_append_check_item_from_verb(m, view, _("_Statusbar"), _("Show or hide the statusbar (at the bottom of the window)"), "statusbar", - checkitem_toggled, checkitem_update, 0); sp_ui_menu_append_check_item_from_verb(m, view, _("_Palette"), _("Show or hide the color palette"), "panels", checkitem_toggled, checkitem_update, 0); + sp_ui_menu_append_check_item_from_verb(m, view, _("_Statusbar"), _("Show or hide the statusbar (at the bottom of the window)"), "statusbar", + checkitem_toggled, checkitem_update, 0); } /** \brief This function turns XML into a menu @@ -811,9 +815,6 @@ sp_ui_build_dyn_menus(Inkscape::XML::Node *menus, GtkWidget *menu, Inkscape::UI: menu_pntr != NULL; menu_pntr = menu_pntr->next()) { if (!strcmp(menu_pntr->name(), "submenu")) { - if (!strcmp(menu_pntr->attribute("name"), "Effects") && !prefs_get_int_attribute("extensions", "show-effects-menu", 0)) { - continue; - } GtkWidget *mitem = gtk_menu_item_new_with_mnemonic(_(menu_pntr->attribute("name"))); GtkWidget *submenu = gtk_menu_new(); sp_ui_build_dyn_menus(menu_pntr->firstChild(), submenu, view); @@ -981,7 +982,7 @@ sp_ui_drag_data_received(GtkWidget *widget, gpointer user_data) { switch (info) { -#if ENABLE_LCMS +#if ENABLE_MAGIC_COLORS case APP_X_INKY_COLOR: { SPDesktop *desktop = SP_ACTIVE_DESKTOP; @@ -1046,7 +1047,8 @@ sp_ui_drag_data_received(GtkWidget *widget, item->updateRepr(); SPDocument *doc = SP_ACTIVE_DOCUMENT; - sp_document_done( doc ); + sp_document_done( doc , SP_VERB_NONE, + /* TODO: annotate */ "interface.cpp:1047"); if ( srgbProf ) { cmsCloseProfile( srgbProf ); @@ -1055,7 +1057,7 @@ sp_ui_drag_data_received(GtkWidget *widget, } } break; -#endif // ENABLE_LCMS +#endif // ENABLE_MAGIC_COLORS case APP_X_COLOR: { @@ -1087,7 +1089,8 @@ sp_ui_drag_data_received(GtkWidget *widget, item->updateRepr(); SPDocument *doc = SP_ACTIVE_DOCUMENT; - sp_document_done( doc ); + sp_document_done( doc , SP_VERB_NONE, + /* TODO: annotate */ "interface.cpp:1089"); } } } @@ -1140,7 +1143,8 @@ sp_ui_drag_data_received(GtkWidget *widget, } Inkscape::GC::release(newgroup); - sp_document_done(doc); + sp_document_done(doc, SP_VERB_NONE, + /* TODO: annotate */ "interface.cpp:1143"); break; } @@ -1199,7 +1203,8 @@ sp_ui_drag_data_received(GtkWidget *widget, desktop->currentLayer()->appendChildRepr(newImage); Inkscape::GC::release(newImage); - sp_document_done( doc ); + sp_document_done( doc , SP_VERB_NONE, + /* TODO: annotate */ "interface.cpp:1203"); break; } } @@ -1316,6 +1321,15 @@ sp_ui_menu_item_set_sensitive(SPAction *action, unsigned int sensitive, void *da return gtk_widget_set_sensitive(GTK_WIDGET(data), sensitive); } +static void +sp_ui_menu_item_set_name(SPAction *action, Glib::ustring name, void *data) +{ + gtk_label_set_markup_with_mnemonic( + GTK_LABEL (gtk_container_get_children(GTK_CONTAINER (GTK_BIN (data)->child))->data), + name.c_str()); +} + + /* Local Variables: mode:c++