Commit 8dfa0710 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

* configure.ac, gladeui/glade-app.c: Added --enable-mac-bundle configure option to

special case runtime path lookups to bundling builds.

* gladeui/glade-popup.[ch]: Added glade_popup_is_popup_event () to check the correct
GdkEventButton state for a context menu (in a platform independant way).

* gladeui/glade-base-editor.c, gladeui/glade-editor-property.c, gladeui/glade-palette-item.c,
gladeui/glade-placeholder.c, gladeui/glade-widget.c, gladeui/glade-inspector.c: Use new
popup function to detect whether to show a context menu or not (bug 587128).

* gladeui/glade-base-editor.c: Fixed crashes with editable treeview column types (bug 586715).
parent ddb3374e
2009-06-29 Tristan Van Berkom <tvb@gnome.org>
* configure.ac, gladeui/glade-app.c: Added --enable-mac-bundle configure option to
special case runtime path lookups to bundling builds.
* gladeui/glade-popup.[ch]: Added glade_popup_is_popup_event () to check the correct
GdkEventButton state for a context menu (in a platform independant way).
* gladeui/glade-base-editor.c, gladeui/glade-editor-property.c, gladeui/glade-palette-item.c,
gladeui/glade-placeholder.c, gladeui/glade-widget.c, gladeui/glade-inspector.c: Use new
popup function to detect whether to show a context menu or not (bug 587128).
* gladeui/glade-base-editor.c: Fixed crashes with editable treeview column types (bug 586715).
2009-06-27 Tristan Van Berkom <tvb@gnome.org>
* plugins/gtk+/gtk+.xml.in, glade/gtk+/glade-gtk.c: Fixed GtkTextView crashes when
......
common_defines = \
-DG_LOG_DOMAIN=\"GladeUI\" \
-DGLADE_PREFIX="\"$(prefix)\"" \
-DGLADE_DATADIR="\"$(pkgdatadir)\"" \
-DGLADE_LIBDIR="\"$(pkglibdir)\"" \
-DGLADE_CATALOGSDIR="\"$(pkgdatadir)/catalogs\""\
......@@ -76,6 +75,7 @@ libgladeui_1_la_CPPFLAGS = \
libgladeui_1_la_CFLAGS = \
$(GTK_CFLAGS) \
$(IGE_MAC_BUNDLE_FLAG) \
$(IGE_MAC_CFLAGS) \
$(WARN_CFLAGS) \
$(AM_CFLAGS)
......
......@@ -366,12 +366,13 @@ glade_app_get_locale_dir (void)
static void
build_package_paths (void)
{
#if defined (MAC_INTEGRATION) || defined (G_OS_WIN32)
#if defined (G_OS_WIN32) || (defined (MAC_INTEGRATION) && defined (MAC_BUNDLE))
gchar *prefix;
# ifdef G_OS_WIN32
prefix = g_win32_get_package_installation_directory_of_module (NULL);
# else /* MAC_INTEGRATION */
# else // defined (MAC_INTEGRATION) && defined (MAC_BUNDLE)
IgeMacBundle *bundle = ige_mac_bundle_get_default ();
prefix = g_build_filename (ige_mac_bundle_get_path (bundle), "Contents", "Resources", NULL);
......
......@@ -34,6 +34,7 @@
#include "glade-editor-property.h"
#include "glade-base-editor.h"
#include "glade-app.h"
#include "glade-popup.h"
#include "glade-accumulators.h"
#include <string.h>
......@@ -737,13 +738,13 @@ glade_base_editor_popup (GladeBaseEditor *editor,
gchar *label;
gchar *class_name;
if ((model = get_children_model_for_type (editor, G_OBJECT_TYPE (widget->parent->object))) == NULL)
model = get_children_model_for_type (editor, G_OBJECT_TYPE (editor->priv->gcontainer->object));
if ((model = get_children_model_for_child_type (editor, G_OBJECT_TYPE (widget->object))) == NULL)
return NULL;
g_assert (model);
popup = gtk_menu_new ();
if (gtk_tree_model_get_iter_first (model, &iter))
do
{
......@@ -813,11 +814,7 @@ glade_base_editor_popup_handler (GtkWidget *treeview,
GtkTreePath *path;
GtkWidget *popup;
if (event->button == 3 ||
(event->button == 1 &&
((event->state & GDK_MOD1_MASK) != 0 ||
(event->state & GDK_MOD2_MASK) != 0 ||
(event->state & GDK_MOD2_MASK) != 0)))
if (glade_popup_is_popup_event (event))
{
if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (treeview),
(gint) event->x, (gint) event->y, &path, NULL, NULL, NULL))
......@@ -1963,13 +1960,16 @@ glade_base_editor_add_default_properties (GladeBaseEditor *editor,
GtkWidget *label, *entry;
GtkTreeModel *child_class;
GtkCellRenderer *renderer;
GObject *child = glade_widget_get_object (gchild);
GObject *parent, *child;
g_return_if_fail (GLADE_IS_BASE_EDITOR (editor));
g_return_if_fail (GLADE_IS_WIDGET (gchild));
g_return_if_fail (GLADE_IS_WIDGET (gchild->parent));
child_class = get_children_model_for_type (editor, G_OBJECT_TYPE (child));
child = glade_widget_get_object (gchild);
parent = glade_widget_get_object (gchild->parent);
child_class = get_children_model_for_type (editor, G_OBJECT_TYPE (parent));
/* Name */
label = gtk_label_new (_("Name :"));
......@@ -1981,7 +1981,7 @@ glade_base_editor_add_default_properties (GladeBaseEditor *editor,
g_signal_connect (entry, "focus-out-event", G_CALLBACK (glade_base_editor_name_focus_out), gchild);
glade_base_editor_table_attach (editor, label, entry);
if (child_class)
if (child_class && gtk_tree_model_iter_n_children (child_class, NULL) > 1)
{
/* Type */
label = gtk_label_new (_("Type :"));
......
......@@ -234,7 +234,7 @@ glade_editor_property_button_pressed (GtkWidget *widget,
GdkEventButton *event,
GladeEditorProperty *eprop)
{
if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
if (glade_popup_is_popup_event (event))
{
glade_popup_property_pop (eprop->property, event);
return TRUE;
......
......@@ -920,11 +920,7 @@ button_press_cb (GtkWidget *widget,
/* Give some kind of access in case of missing right button */
if (event->window == gtk_tree_view_get_bin_window (view) &&
(event->button == 3 ||
(event->button == 1 &&
((event->state & GDK_MOD1_MASK) != 0 ||
(event->state & GDK_MOD2_MASK) != 0 ||
(event->state & GDK_MOD2_MASK) != 0))))
glade_popup_is_popup_event (event))
{
if (gtk_tree_view_get_path_at_pos (view, (gint) event->x, (gint) event->y,
&path, NULL,
......
......@@ -337,17 +337,12 @@ static gboolean
glade_palette_item_button_press (GtkWidget *widget,
GdkEventButton *event)
{
/* Give some kind of access in case of missing right button */
if (!event->type == GDK_BUTTON_PRESS &&
(event->button == 3 ||
(event->button == 1 &&
((event->state & GDK_MOD1_MASK) != 0 ||
(event->state & GDK_MOD2_MASK) != 0 ||
(event->state & GDK_MOD2_MASK) != 0))))
if (glade_popup_is_popup_event (event))
{
GladePaletteItemPrivate *priv = GLADE_PALETTE_ITEM_GET_PRIVATE (widget);
glade_popup_palette_pop (priv->adaptor, event);
return TRUE;
}
return GTK_WIDGET_CLASS (glade_palette_item_parent_class)->button_press_event (widget, event);
......
......@@ -357,13 +357,7 @@ glade_placeholder_button_press (GtkWidget *widget, GdkEventButton *event)
}
}
/* Give some kind of access in case of missing right button */
if (!handled && event->type == GDK_BUTTON_PRESS &&
(event->button == 3 ||
(event->button == 1 &&
((event->state & GDK_MOD1_MASK) != 0 ||
(event->state & GDK_MOD2_MASK) != 0 ||
(event->state & GDK_MOD2_MASK) != 0))))
if (!handled && glade_popup_is_popup_event (event))
{
glade_popup_placeholder_pop (placeholder, event);
handled = TRUE;
......
......@@ -18,6 +18,7 @@
*
* Authors:
* Chema Celorio <chema@celorio.com>
* Tristan Van Berkom <tvb@gnome.org>
*/
#ifdef HAVE_CONFIG_H
......@@ -797,3 +798,15 @@ glade_popup_simple_pop (GdkEventButton *event)
NULL, NULL, button, event_time);
}
gboolean
glade_popup_is_popup_event (GdkEventButton *event)
{
g_return_val_if_fail (event, FALSE);
#ifdef MAC_INTEGRATION
return (event->type == GDK_BUTTON_PRESS && event->button == 1 && ((event->state & GDK_MOD1_MASK) != 0));
#else
return (event->type == GDK_BUTTON_PRESS && event->button == 3);
#endif
}
......@@ -27,6 +27,9 @@ void glade_popup_simple_pop (GdkEventButton *event);
void glade_popup_property_pop (GladeProperty *property,
GdkEventButton *event);
gboolean glade_popup_is_popup_event (GdkEventButton *event);
G_END_DECLS
#endif /* __GLADE_POPUP_H__ */
......@@ -905,7 +905,6 @@ glade_widget_adaptor_object_read_widget (GladeWidgetAdaptor *adaptor,
}
g_list_free (read_properties);
/* Read in the signals */
for (iter_node = glade_xml_node_get_children (node);
iter_node; iter_node = glade_xml_node_next (iter_node))
......
......@@ -335,12 +335,7 @@ glade_widget_button_press_event_impl (GladeWidget *gwidget,
}
/* Give some kind of access in case of missing right button */
if (!handled &&
(event->button == 3 ||
(event->button == 1 &&
((event->state & GDK_MOD1_MASK) != 0 ||
(event->state & GDK_MOD2_MASK) != 0 ||
(event->state & GDK_MOD2_MASK) != 0))))
if (!handled && glade_popup_is_popup_event (event))
{
glade_popup_widget_pop (gwidget, event, TRUE);
handled = TRUE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment