Commit 8dfa07101f94dd591b6722708478aea9270a6b76
- Diff rendering mode:
- inline
- side by side
ChangeLog
(14 / 0)
|   | |||
| 1 | 2009-06-29 Tristan Van Berkom <tvb@gnome.org> | ||
| 2 | |||
| 3 | * configure.ac, gladeui/glade-app.c: Added --enable-mac-bundle configure option to | ||
| 4 | special case runtime path lookups to bundling builds. | ||
| 5 | |||
| 6 | * gladeui/glade-popup.[ch]: Added glade_popup_is_popup_event () to check the correct | ||
| 7 | GdkEventButton state for a context menu (in a platform independant way). | ||
| 8 | |||
| 9 | * gladeui/glade-base-editor.c, gladeui/glade-editor-property.c, gladeui/glade-palette-item.c, | ||
| 10 | gladeui/glade-placeholder.c, gladeui/glade-widget.c, gladeui/glade-inspector.c: Use new | ||
| 11 | popup function to detect whether to show a context menu or not (bug 587128). | ||
| 12 | |||
| 13 | * gladeui/glade-base-editor.c: Fixed crashes with editable treeview column types (bug 586715). | ||
| 14 | |||
| 1 | 15 | 2009-06-27 Tristan Van Berkom <tvb@gnome.org> | |
| 2 | 16 | ||
| 3 | 17 | * plugins/gtk+/gtk+.xml.in, glade/gtk+/glade-gtk.c: Fixed GtkTextView crashes when |
gladeui/Makefile.am
(1 / 1)
|   | |||
| 1 | 1 | ||
| 2 | 2 | common_defines = \ | |
| 3 | 3 | -DG_LOG_DOMAIN=\"GladeUI\" \ | |
| 4 | -DGLADE_PREFIX="\"$(prefix)\"" \ | ||
| 5 | 4 | -DGLADE_DATADIR="\"$(pkgdatadir)\"" \ | |
| 6 | 5 | -DGLADE_LIBDIR="\"$(pkglibdir)\"" \ | |
| 7 | 6 | -DGLADE_CATALOGSDIR="\"$(pkgdatadir)/catalogs\""\ | |
| … | … | ||
| 75 | 75 | ||
| 76 | 76 | libgladeui_1_la_CFLAGS = \ | |
| 77 | 77 | $(GTK_CFLAGS) \ | |
| 78 | $(IGE_MAC_BUNDLE_FLAG) \ | ||
| 78 | 79 | $(IGE_MAC_CFLAGS) \ | |
| 79 | 80 | $(WARN_CFLAGS) \ | |
| 80 | 81 | $(AM_CFLAGS) |
gladeui/glade-app.c
(3 / 2)
|   | |||
| 366 | 366 | static void | |
| 367 | 367 | build_package_paths (void) | |
| 368 | 368 | { | |
| 369 | #if defined (MAC_INTEGRATION) || defined (G_OS_WIN32) | ||
| 369 | #if defined (G_OS_WIN32) || (defined (MAC_INTEGRATION) && defined (MAC_BUNDLE)) | ||
| 370 | 370 | gchar *prefix; | |
| 371 | 371 | ||
| 372 | 372 | # ifdef G_OS_WIN32 | |
| 373 | 373 | prefix = g_win32_get_package_installation_directory_of_module (NULL); | |
| 374 | # else /* MAC_INTEGRATION */ | ||
| 374 | |||
| 375 | # else // defined (MAC_INTEGRATION) && defined (MAC_BUNDLE) | ||
| 375 | 376 | IgeMacBundle *bundle = ige_mac_bundle_get_default (); | |
| 376 | 377 | ||
| 377 | 378 | prefix = g_build_filename (ige_mac_bundle_get_path (bundle), "Contents", "Resources", NULL); |
gladeui/glade-base-editor.c
(13 / 13)
|   | |||
| 34 | 34 | #include "glade-editor-property.h" | |
| 35 | 35 | #include "glade-base-editor.h" | |
| 36 | 36 | #include "glade-app.h" | |
| 37 | #include "glade-popup.h" | ||
| 37 | 38 | #include "glade-accumulators.h" | |
| 38 | 39 | ||
| 39 | 40 | #include <string.h> | |
| … | … | ||
| 738 | 738 | gchar *label; | |
| 739 | 739 | gchar *class_name; | |
| 740 | 740 | ||
| 741 | if ((model = get_children_model_for_type (editor, G_OBJECT_TYPE (widget->parent->object))) == NULL) | ||
| 742 | model = get_children_model_for_type (editor, G_OBJECT_TYPE (editor->priv->gcontainer->object)); | ||
| 741 | 743 | ||
| 742 | if ((model = get_children_model_for_child_type (editor, G_OBJECT_TYPE (widget->object))) == NULL) | ||
| 743 | return NULL; | ||
| 744 | |||
| 744 | g_assert (model); | ||
| 745 | |||
| 745 | 746 | popup = gtk_menu_new (); | |
| 746 | 747 | ||
| 747 | |||
| 748 | 748 | if (gtk_tree_model_get_iter_first (model, &iter)) | |
| 749 | 749 | do | |
| 750 | 750 | { | |
| … | … | ||
| 814 | 814 | GtkTreePath *path; | |
| 815 | 815 | GtkWidget *popup; | |
| 816 | 816 | ||
| 817 | if (event->button == 3 || | ||
| 818 | (event->button == 1 && | ||
| 819 | ((event->state & GDK_MOD1_MASK) != 0 || | ||
| 820 | (event->state & GDK_MOD2_MASK) != 0 || | ||
| 821 | (event->state & GDK_MOD2_MASK) != 0))) | ||
| 817 | if (glade_popup_is_popup_event (event)) | ||
| 822 | 818 | { | |
| 823 | 819 | if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (treeview), | |
| 824 | 820 | (gint) event->x, (gint) event->y, &path, NULL, NULL, NULL)) | |
| … | … | ||
| 1960 | 1960 | GtkWidget *label, *entry; | |
| 1961 | 1961 | GtkTreeModel *child_class; | |
| 1962 | 1962 | GtkCellRenderer *renderer; | |
| 1963 | GObject *child = glade_widget_get_object (gchild); | ||
| 1964 | |||
| 1963 | GObject *parent, *child; | ||
| 1964 | |||
| 1965 | 1965 | g_return_if_fail (GLADE_IS_BASE_EDITOR (editor)); | |
| 1966 | 1966 | g_return_if_fail (GLADE_IS_WIDGET (gchild)); | |
| 1967 | 1967 | g_return_if_fail (GLADE_IS_WIDGET (gchild->parent)); | |
| 1968 | 1968 | ||
| 1969 | child_class = get_children_model_for_type (editor, G_OBJECT_TYPE (child)); | ||
| 1969 | child = glade_widget_get_object (gchild); | ||
| 1970 | parent = glade_widget_get_object (gchild->parent); | ||
| 1971 | |||
| 1972 | child_class = get_children_model_for_type (editor, G_OBJECT_TYPE (parent)); | ||
| 1970 | 1973 | ||
| 1971 | 1974 | /* Name */ | |
| 1972 | 1975 | label = gtk_label_new (_("Name :")); | |
| … | … | ||
| 1981 | 1981 | g_signal_connect (entry, "focus-out-event", G_CALLBACK (glade_base_editor_name_focus_out), gchild); | |
| 1982 | 1982 | glade_base_editor_table_attach (editor, label, entry); | |
| 1983 | 1983 | ||
| 1984 | if (child_class) | ||
| 1984 | if (child_class && gtk_tree_model_iter_n_children (child_class, NULL) > 1) | ||
| 1985 | 1985 | { | |
| 1986 | 1986 | /* Type */ | |
| 1987 | 1987 | label = gtk_label_new (_("Type :")); |
|   | |||
| 234 | 234 | GdkEventButton *event, | |
| 235 | 235 | GladeEditorProperty *eprop) | |
| 236 | 236 | { | |
| 237 | if (event->button == 3 && event->type == GDK_BUTTON_PRESS) | ||
| 237 | if (glade_popup_is_popup_event (event)) | ||
| 238 | 238 | { | |
| 239 | 239 | glade_popup_property_pop (eprop->property, event); | |
| 240 | 240 | return TRUE; |
gladeui/glade-inspector.c
(1 / 5)
|   | |||
| 920 | 920 | ||
| 921 | 921 | /* Give some kind of access in case of missing right button */ | |
| 922 | 922 | if (event->window == gtk_tree_view_get_bin_window (view) && | |
| 923 | (event->button == 3 || | ||
| 924 | (event->button == 1 && | ||
| 925 | ((event->state & GDK_MOD1_MASK) != 0 || | ||
| 926 | (event->state & GDK_MOD2_MASK) != 0 || | ||
| 927 | (event->state & GDK_MOD2_MASK) != 0)))) | ||
| 923 | glade_popup_is_popup_event (event)) | ||
| 928 | 924 | { | |
| 929 | 925 | if (gtk_tree_view_get_path_at_pos (view, (gint) event->x, (gint) event->y, | |
| 930 | 926 | &path, NULL, |
gladeui/glade-palette-item.c
(2 / 7)
|   | |||
| 337 | 337 | glade_palette_item_button_press (GtkWidget *widget, | |
| 338 | 338 | GdkEventButton *event) | |
| 339 | 339 | { | |
| 340 | /* Give some kind of access in case of missing right button */ | ||
| 341 | if (!event->type == GDK_BUTTON_PRESS && | ||
| 342 | (event->button == 3 || | ||
| 343 | (event->button == 1 && | ||
| 344 | ((event->state & GDK_MOD1_MASK) != 0 || | ||
| 345 | (event->state & GDK_MOD2_MASK) != 0 || | ||
| 346 | (event->state & GDK_MOD2_MASK) != 0)))) | ||
| 340 | if (glade_popup_is_popup_event (event)) | ||
| 347 | 341 | { | |
| 348 | 342 | GladePaletteItemPrivate *priv = GLADE_PALETTE_ITEM_GET_PRIVATE (widget); | |
| 349 | 343 | ||
| 350 | 344 | glade_popup_palette_pop (priv->adaptor, event); | |
| 345 | return TRUE; | ||
| 351 | 346 | } | |
| 352 | 347 | ||
| 353 | 348 | return GTK_WIDGET_CLASS (glade_palette_item_parent_class)->button_press_event (widget, event); |
gladeui/glade-placeholder.c
(1 / 7)
|   | |||
| 357 | 357 | } | |
| 358 | 358 | } | |
| 359 | 359 | ||
| 360 | /* Give some kind of access in case of missing right button */ | ||
| 361 | if (!handled && event->type == GDK_BUTTON_PRESS && | ||
| 362 | (event->button == 3 || | ||
| 363 | (event->button == 1 && | ||
| 364 | ((event->state & GDK_MOD1_MASK) != 0 || | ||
| 365 | (event->state & GDK_MOD2_MASK) != 0 || | ||
| 366 | (event->state & GDK_MOD2_MASK) != 0)))) | ||
| 360 | if (!handled && glade_popup_is_popup_event (event)) | ||
| 367 | 361 | { | |
| 368 | 362 | glade_popup_placeholder_pop (placeholder, event); | |
| 369 | 363 | handled = TRUE; |
gladeui/glade-popup.c
(13 / 0)
|   | |||
| 18 | 18 | * | |
| 19 | 19 | * Authors: | |
| 20 | 20 | * Chema Celorio <chema@celorio.com> | |
| 21 | * Tristan Van Berkom <tvb@gnome.org> | ||
| 21 | 22 | */ | |
| 22 | 23 | ||
| 23 | 24 | #ifdef HAVE_CONFIG_H | |
| … | … | ||
| 796 | 796 | } | |
| 797 | 797 | gtk_menu_popup (GTK_MENU (popup_menu), NULL, NULL, | |
| 798 | 798 | NULL, NULL, button, event_time); | |
| 799 | } | ||
| 800 | |||
| 801 | gboolean | ||
| 802 | glade_popup_is_popup_event (GdkEventButton *event) | ||
| 803 | { | ||
| 804 | g_return_val_if_fail (event, FALSE); | ||
| 805 | |||
| 806 | #ifdef MAC_INTEGRATION | ||
| 807 | return (event->type == GDK_BUTTON_PRESS && event->button == 1 && ((event->state & GDK_MOD1_MASK) != 0)); | ||
| 808 | #else | ||
| 809 | return (event->type == GDK_BUTTON_PRESS && event->button == 3); | ||
| 810 | #endif | ||
| 799 | 811 | } |
gladeui/glade-popup.h
(3 / 0)
|   | |||
| 27 | 27 | void glade_popup_property_pop (GladeProperty *property, | |
| 28 | 28 | GdkEventButton *event); | |
| 29 | 29 | ||
| 30 | |||
| 31 | gboolean glade_popup_is_popup_event (GdkEventButton *event); | ||
| 32 | |||
| 30 | 33 | G_END_DECLS | |
| 31 | 34 | ||
| 32 | 35 | #endif /* __GLADE_POPUP_H__ */ |
|   | |||
| 905 | 905 | } | |
| 906 | 906 | g_list_free (read_properties); | |
| 907 | 907 | ||
| 908 | |||
| 909 | 908 | /* Read in the signals */ | |
| 910 | 909 | for (iter_node = glade_xml_node_get_children (node); | |
| 911 | 910 | iter_node; iter_node = glade_xml_node_next (iter_node)) |
gladeui/glade-widget.c
(1 / 6)
|   | |||
| 335 | 335 | } | |
| 336 | 336 | ||
| 337 | 337 | /* Give some kind of access in case of missing right button */ | |
| 338 | if (!handled && | ||
| 339 | (event->button == 3 || | ||
| 340 | (event->button == 1 && | ||
| 341 | ((event->state & GDK_MOD1_MASK) != 0 || | ||
| 342 | (event->state & GDK_MOD2_MASK) != 0 || | ||
| 343 | (event->state & GDK_MOD2_MASK) != 0)))) | ||
| 338 | if (!handled && glade_popup_is_popup_event (event)) | ||
| 344 | 339 | { | |
| 345 | 340 | glade_popup_widget_pop (gwidget, event, TRUE); | |
| 346 | 341 | handled = TRUE; |

