Commit ba93bf37 authored by Tristan Van Berkom's avatar Tristan Van Berkom

Set custom label on the property editor sensitive/insensitive according to


	* src/glade-window.c: Set custom label on the property editor sensitive/insensitive
	  according to whether there is a project loaded or not

	* gladeui/glade-app.c: Unset editor widget and set insensitive when no project is
	  loaded (fixes segfaults from editing widgets that dont exist when project is
	  closed, also looks consistant with the rest of the insensitive UI with no project
	  loaded).


svn path=/trunk/; revision=1507
parent cfa8ddb4
2006-06-24 Tristan Van Berkom <tvb@gnome.org>
* src/glade-window.c: Set custom label on the property editor sensitive/insensitive
according to whether there is a project loaded or not
* gladeui/glade-app.c: Unset editor widget and set insensitive when no project is
loaded (fixes segfaults from editing widgets that dont exist when project is
closed, also looks consistant with the rest of the insensitive UI with no project
loaded).
2006-06-23 Tristan Van Berkom <tvb@gnome.org>
* NEWS, configure.ac: Rolling 3.3.2
......
......@@ -938,8 +938,9 @@ glade_app_add_project (GladeProject *project)
glade_app_set_project (project);
/* XXX I think the palette should detect this by itself */
/* XXX I think the palette & editor should detect this by itself */
gtk_widget_set_sensitive (GTK_WIDGET (app->priv->palette), TRUE);
gtk_widget_set_sensitive (GTK_WIDGET (app->priv->editor), TRUE);
}
......@@ -960,8 +961,14 @@ glade_app_remove_project (GladeProject *project)
/* If no more projects */
if (app->priv->projects == NULL)
{
/* XXX I think the palette should detect this. */
/* XXX I think the palette & editor should detect this. */
gtk_widget_set_sensitive (GTK_WIDGET (app->priv->palette), FALSE);
/* set loaded widget to NULL first so that we dont mess
* around with sensitivity of the editor children.
*/
glade_editor_load_widget (app->priv->editor, NULL);
gtk_widget_set_sensitive (GTK_WIDGET (app->priv->editor), FALSE);
}
else
glade_app_set_project (g_list_last (app->priv->projects)->data);
......
......@@ -618,7 +618,9 @@ project_selection_changed_cb (GladeProject *project, GladeWindow *window)
gchar *text;
gint num;
g_return_if_fail (GLADE_IS_PROJECT (project));
/* This is sometimes called with a NULL project (to make the label
* insensitive with no projects loaded)
*/
g_return_if_fail (GLADE_IS_WINDOW (window));
label = window->priv->label;
......@@ -627,8 +629,10 @@ project_selection_changed_cb (GladeProject *project, GladeWindow *window)
* the currently active project.
*/
if (glade_app_get_editor() &&
(project == glade_app_get_project ()))
project && (project == glade_app_get_project ()))
{
gtk_widget_set_sensitive (GTK_WIDGET (label), TRUE);
list = glade_project_selection_get (project);
num = g_list_length (list);
......@@ -653,6 +657,13 @@ project_selection_changed_cb (GladeProject *project, GladeWindow *window)
gtk_label_set_text (label, _("Properties"));
}
}
else if (glade_app_get_editor ())
{
gtk_widget_set_sensitive (GTK_WIDGET (label), FALSE);
gtk_label_set_text (label, _("Properties"));
}
}
static GladeDesignView *
......@@ -1711,6 +1722,8 @@ notebook_tab_added_cb (GtkNotebook *notebook,
refresh_title (window);
project_selection_changed_cb (glade_app_get_project (), window);
if (window->priv->num_tabs > 0)
gtk_action_group_set_sensitive (window->priv->project_actions, TRUE);
......@@ -1750,6 +1763,8 @@ notebook_tab_removed_cb (GtkNotebook *notebook,
refresh_title (window);
project_selection_changed_cb (glade_app_get_project (), window);
if (window->priv->active_view)
set_sensitivity_according_to_project (window, glade_design_view_get_project (window->priv->active_view));
else
......
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