diff options
author | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2011-02-04 00:16:39 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2011-02-04 00:16:39 +0900 |
commit | 4253ad61aeec4b1480c0df778237bc27f79a1d48 (patch) | |
tree | 1b4131cd64af0e08fd49ce4dc2fbbd8636c2b1dc | |
parent | e05916c1f03dbab8c5a4536e1650c772736d1ccb (diff) |
* gladeui/glade-project.c: Notify "path" changes when loading new project
* src/glade-window.c: Refresh window title when project path changes.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | gladeui/glade-project.c | 14 | ||||
-rw-r--r-- | src/glade-window.c | 11 |
3 files changed, 19 insertions, 10 deletions
@@ -17,6 +17,10 @@ * gladeui/glade-editor.c: Make reset/docs buttons insensitive by default. + * gladeui/glade-project.c: Notify "path" changes when loading new project + + * src/glade-window.c: Refresh window title when project path changes. + 2011-02-02 Juan Pablo Ugarte <juanpablougarte@gmail.com> * gladeui/glade-design-layout.c: diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c index 33a3e429..2fb22135 100644 --- a/gladeui/glade-project.c +++ b/gladeui/glade-project.c @@ -981,8 +981,7 @@ glade_project_class_init (GladeProjectClass * klass) PROP_MODIFIED, g_param_spec_boolean ("modified", "Modified", - _ - ("Whether project has been modified since it was last saved"), + _("Whether project has been modified since it was last saved"), FALSE, G_PARAM_READABLE)); @@ -990,8 +989,7 @@ glade_project_class_init (GladeProjectClass * klass) PROP_HAS_SELECTION, g_param_spec_boolean ("has-selection", _("Has Selection"), - _ - ("Whether project has a selection"), + _("Whether project has a selection"), FALSE, G_PARAM_READABLE)); @@ -999,8 +997,7 @@ glade_project_class_init (GladeProjectClass * klass) PROP_PATH, g_param_spec_string ("path", _("Path"), - _ - ("The filesystem path of the project"), + _("The filesystem path of the project"), NULL, G_PARAM_READABLE)); @@ -1008,8 +1005,7 @@ glade_project_class_init (GladeProjectClass * klass) PROP_READ_ONLY, g_param_spec_boolean ("read-only", _("Read Only"), - _ - ("Whether project is read-only"), + _("Whether project is read-only"), FALSE, G_PARAM_READABLE)); @@ -1586,6 +1582,7 @@ glade_project_load_from_file (GladeProject * project, const gchar * path) g_return_val_if_fail (GLADE_IS_PROJECT (project), FALSE); project->priv->path = glade_util_canonical_path (path); + g_object_notify (G_OBJECT (project), "path"); retval = glade_project_load_internal (project); @@ -1865,6 +1862,7 @@ glade_project_save (GladeProject * project, const gchar * path, GError ** error) project->priv->path = (g_free (project->priv->path), g_strdup (canonical_path)); + g_object_notify (G_OBJECT (project), "path"); /* Update prefs dialogs here... */ name = glade_project_get_name (project); diff --git a/src/glade-window.c b/src/glade-window.c index 4ed5f505..9ebad9c5 100644 --- a/src/glade-window.c +++ b/src/glade-window.c @@ -717,8 +717,15 @@ project_notify_handler_cb (GladeProject * project, GParamSpec * spec, GladeProject *active_project = get_active_project (window); GtkAction *action; - if (strcmp (spec->name, "path") == 0 || strcmp (spec->name, "format") == 0) - refresh_notebook_tab_for_project (window, project); + if (strcmp (spec->name, "path") == 0) + { + refresh_title (window); + refresh_notebook_tab_for_project (window, project); + } + else if (strcmp (spec->name, "format") == 0) + { + refresh_notebook_tab_for_project (window, project); + } else if (strcmp (spec->name, "modified") == 0) { refresh_title (window); |