Commit 7be60d74 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

Merge branch 'master' into signal-tree-model

Conflicts:
	ChangeLog
parents 5a2aa19b db4732e8
......@@ -11,6 +11,11 @@
the first signal of a type is added with a NULL handler
- Fixed devhelp icon visibility to not show when !glade_util_have_devhelp()
* gladeui/glade-widget.c: Dont set packing properties onto internal widgets.
* plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Expose internal GtkTreeSelection
child of GtkTreeView so that "changed" signal can be connected to. Fixes bug 383766.
2011-01-09 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-design-layout.c: Fixed to not hide widgets when removing
......@@ -59,6 +64,17 @@
* plugins/gtk+/glade-column-types.c: Fixed crash when user performs Drag'n'Drop of
< enter column here > and no columns are yet added (fixes bug 633943).
* src/glade-window.c: Fix possible crash when saving new project. bug 622635, fix
by Martin Schlemmer.
* gladeui/glade-app.[ch], gladeui/glade-base-editor.c: Removed glade_app_set/get_transient_parent()
* src/glade-window.c: Added idle function to raise the undocked windows at startup time,
closes bug 475421.
* src/glade-window.c: Applied patch by Sergio García Lobo to fix bug 487656 and provide
mnemonic key access to "Text beside icons" palette option.
2011-01-08 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-utils.[ch], gladeui/glade-widget.c, gladeui/glade-builtins.c,
......
......@@ -69,10 +69,6 @@ struct _GladeAppPrivate
GKeyFile *config; /* The configuration file */
GtkWindow *transient_parent; /* If set by glade_app_set_transient_parent(); this
* will be used as the transient parent of all toplevel
* GladeWidgets.
*/
GtkAccelGroup *accel_group; /* Default acceleration group for this app */
};
......@@ -456,28 +452,6 @@ glade_app_config_save ()
return 0;
}
void
glade_app_set_transient_parent (GtkWindow * parent)
{
GladeApp *app;
g_return_if_fail (GTK_IS_WINDOW (parent));
app = glade_app_get ();
app->priv->transient_parent = parent;
}
GtkWindow *
glade_app_get_transient_parent (void)
{
GtkWindow *parent;
GladeApp *app = glade_app_get ();
parent = app->priv->transient_parent;
return parent;
}
GladeApp *
glade_app_get (void)
{
......
......@@ -85,9 +85,6 @@ GladeProject* glade_app_get_project_by_path (const gchar *project_path);
void glade_app_set_window (GtkWidget *window);
GtkWidget* glade_app_get_window (void);
void glade_app_set_transient_parent (GtkWindow *parent);
GtkWindow *glade_app_get_transient_parent (void);
void glade_app_set_accel_group (GtkAccelGroup *accel_group);
GtkAccelGroup *glade_app_get_accel_group (void);
......
......@@ -2175,7 +2175,7 @@ glade_base_editor_help (GtkButton * button, gchar * markup)
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new (glade_app_get_transient_parent (),
dialog = gtk_message_dialog_new (glade_app_get_window (),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, " ");
......
......@@ -921,7 +921,8 @@ glade_widget_constructor (GType type,
if (gwidget->priv->construct_reason == GLADE_CREATE_USER)
glade_widget_sync_custom_props (gwidget);
if (gwidget->priv->parent && gwidget->priv->packing_properties == NULL)
if (!gwidget->priv->internal && gwidget->priv->parent &&
gwidget->priv->packing_properties == NULL)
glade_widget_set_packing_properties (gwidget, gwidget->priv->parent);
if (GTK_IS_WIDGET (gwidget->priv->object) &&
......
......@@ -1866,6 +1866,7 @@ glade_gtk_box_replace_child (GladeWidgetAdaptor * adaptor,
GWA_GET_CLASS (GTK_TYPE_CONTAINER)->replace_child (adaptor,
container,
current, new_widget);
gbox = glade_widget_get_from_gobject (container);
if ((gchild = glade_widget_get_from_gobject (new_widget)) != NULL)
/* The "Remove Slot" operation only makes sence on placeholders,
......@@ -1873,7 +1874,6 @@ glade_gtk_box_replace_child (GladeWidgetAdaptor * adaptor,
*/
glade_widget_set_pack_action_visible (gchild, "remove_slot", FALSE);
gbox = glade_widget_get_from_gobject (container);
fix_response_id_on_child (gbox, current, FALSE);
fix_response_id_on_child (gbox, new_widget, TRUE);
......@@ -11142,6 +11142,18 @@ glade_gtk_cell_layout_action_activate_as_widget (GladeWidgetAdaptor * adaptor,
/*--------------------------- GtkTreeView ---------------------------------*/
void
glade_gtk_treeview_post_create (GladeWidgetAdaptor *adaptor,
GObject *object,
GladeCreateReason reason)
{
GladeWidget *widget = glade_widget_get_from_gobject (object);
glade_widget_adaptor_create_internal
(widget, G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (object))),
"selection", "treeview", FALSE, reason);
}
static void
glade_gtk_treeview_launch_editor (GObject * treeview)
{
......@@ -11259,7 +11271,22 @@ GList *
glade_gtk_treeview_get_children (GladeWidgetAdaptor * adaptor,
GtkTreeView * view)
{
return gtk_tree_view_get_columns (view);
GList *children;
children = gtk_tree_view_get_columns (view);
children = g_list_prepend (children, gtk_tree_view_get_selection (view));
return children;
}
GObject *
glade_gtk_treeview_get_internal_child (GladeWidgetAdaptor * adaptor,
GtkTreeView *view, const gchar * name)
{
if (strcmp (name, "selection") == 0)
return (GObject *)gtk_tree_view_get_selection (view);
return NULL;
}
/* XXX FIXME: We should hide the actual "fixed-height-mode" setting from
......
......@@ -2012,10 +2012,11 @@ embedded in another object</_tooltip>
<glade-widget-class name="GtkTreeView" generic-name="treeview" _title="Tree View">
<post-create-function>empty</post-create-function>
<post-create-function>glade_gtk_treeview_post_create</post-create-function>
<child-set-property-function>glade_gtk_treeview_set_child_property</child-set-property-function>
<child-get-property-function>glade_gtk_treeview_get_child_property</child-get-property-function>
<get-children-function>glade_gtk_treeview_get_children</get-children-function>
<get-internal-child-function>glade_gtk_treeview_get_internal_child</get-internal-child-function>
<add-child-function>glade_gtk_treeview_add_child</add-child-function>
<replace-child-function>glade_gtk_treeview_replace_child</replace-child-function>
<remove-child-function>glade_gtk_treeview_remove_child</remove-child-function>
......
This diff is collapsed.
......@@ -1122,48 +1122,50 @@ save (GladeWindow * window, GladeProject * project, const gchar * path)
return;
/* check for external modification to the project file */
mtime = glade_util_get_file_mtime (glade_project_get_path (project), NULL);
if (mtime > glade_project_get_file_mtime (project))
if (glade_project_get_path (project))
{
mtime = glade_util_get_file_mtime (glade_project_get_path (project), NULL);
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_NONE,
_
("The file %s has been modified since reading it"),
glade_project_get_path (project));
if (mtime > glade_project_get_file_mtime (project))
{
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_
("If you save it, all the external changes could be lost. Save it anyway?"));
dialog = gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_NONE,
_("The file %s has been modified since reading it"),
glade_project_get_path (project));
gtk_window_set_title (GTK_WINDOW (dialog), "");
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("If you save it, all the external changes could be lost. "
"Save it anyway?"));
button = gtk_button_new_with_mnemonic (_("_Save Anyway"));
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_stock (GTK_STOCK_SAVE,
GTK_ICON_SIZE_BUTTON));
gtk_widget_show (button);
gtk_window_set_title (GTK_WINDOW (dialog), "");
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button,
GTK_RESPONSE_ACCEPT);
gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Don't Save"),
GTK_RESPONSE_REJECT);
button = gtk_button_new_with_mnemonic (_("_Save Anyway"));
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_stock (GTK_STOCK_SAVE,
GTK_ICON_SIZE_BUTTON));
gtk_widget_show (button);
gtk_dialog_set_default_response (GTK_DIALOG (dialog),
GTK_RESPONSE_REJECT);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button,
GTK_RESPONSE_ACCEPT);
gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Don't Save"),
GTK_RESPONSE_REJECT);
response = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_dialog_set_default_response (GTK_DIALOG (dialog),
GTK_RESPONSE_REJECT);
gtk_widget_destroy (dialog);
response = gtk_dialog_run (GTK_DIALOG (dialog));
if (response == GTK_RESPONSE_REJECT)
{
g_free (display_path);
return;
}
gtk_widget_destroy (dialog);
if (response == GTK_RESPONSE_REJECT)
{
g_free (display_path);
return;
}
}
}
/* Interestingly; we cannot use `path' after glade_project_reset_path
......@@ -2316,7 +2318,7 @@ static guint n_view_entries = G_N_ELEMENTS (view_entries);
static GtkRadioActionEntry radio_entries[] = {
{"IconsAndLabels", NULL, N_("Text beside icons"), NULL,
{"IconsAndLabels", NULL, N_("Text _beside icons"), NULL,
N_("Display items as text beside icons"), GLADE_ITEM_ICON_AND_LABEL},
{"IconsOnly", NULL, N_("_Icons only"), NULL,
......@@ -2544,8 +2546,7 @@ create_drag_resize_tool_button (GtkToolbar * toolbar)
gtk_tool_button_set_label (GTK_TOOL_BUTTON (button), _("Drag Resize"));
gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (button),
_
("Drag and resize widgets in the workspace"));
_("Drag and resize widgets in the workspace"));
gtk_widget_show (GTK_WIDGET (button));
gtk_widget_show (image);
......@@ -3275,6 +3276,12 @@ glade_window_config_load (GladeWindow * window)
load_paned_position (config, window->priv->right_pane, "right_pane", 220);
}
static gboolean
raise_window_idle (GtkWindow *window)
{
gtk_window_present (window);
return FALSE;
}
static void
show_dock_first_time (GladeWindow * window,
......@@ -3298,7 +3305,11 @@ show_dock_first_time (GladeWindow * window,
&maximized);
if (detached == 1)
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), FALSE);
{
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), FALSE);
g_idle_add ((GSourceFunc)raise_window_idle, gtk_widget_get_toplevel (dock->widget));
}
if (maximized)
gtk_window_maximize (GTK_WINDOW (gtk_widget_get_toplevel (dock->widget)));
......
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