[glade] * gladeui/glade-project.c: Notify "path" changes when loading new project
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade] * gladeui/glade-project.c: Notify "path" changes when loading new project
- Date: Thu, 3 Feb 2011 15:09:29 +0000 (UTC)
commit 4253ad61aeec4b1480c0df778237bc27f79a1d48
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Fri Feb 4 00:16:39 2011 +0900
* gladeui/glade-project.c: Notify "path" changes when loading new project
* src/glade-window.c: Refresh window title when project path changes.
ChangeLog | 4 ++++
gladeui/glade-project.c | 14 ++++++--------
src/glade-window.c | 11 +++++++++--
3 files changed, 19 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a2ef5b6..b561ec8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 33a3e42..2fb2213 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 4ed5f50..9ebad9c 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]