[libgda] GdaBrowser: fixed the displayed diagram page
- From: Vivien Malerba <vivien src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libgda] GdaBrowser: fixed the displayed diagram page
- Date: Sun, 23 Aug 2009 20:19:31 +0000 (UTC)
commit bbd71443b7b89341e3798e447a18623dc38fdd04
Author: Vivien Malerba <malerba gnome-db org>
Date: Wed Aug 12 15:52:30 2009 +0200
GdaBrowser: fixed the displayed diagram page
tools/browser/schema-browser/relations-diagram.c | 10 ++++++++++
tools/browser/schema-browser/relations-diagram.h | 1 +
.../schema-browser/schema-browser-perspective.c | 8 +++++---
3 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/tools/browser/schema-browser/relations-diagram.c b/tools/browser/schema-browser/relations-diagram.c
index 08276f3..d367698 100644
--- a/tools/browser/schema-browser/relations-diagram.c
+++ b/tools/browser/schema-browser/relations-diagram.c
@@ -592,3 +592,13 @@ relations_diagram_set_fav_id (RelationsDiagram *diagram, gint fav_id, GError **e
g_free (fav.contents);
}
+/**
+ * relations_diagram_get_fav_id
+ *
+ */
+gint
+relations_diagram_get_fav_id (RelationsDiagram *diagram)
+{
+ g_return_val_if_fail (IS_RELATIONS_DIAGRAM (diagram), -1);
+ return diagram->priv->fav_id;
+}
diff --git a/tools/browser/schema-browser/relations-diagram.h b/tools/browser/schema-browser/relations-diagram.h
index 29935b1..92f89df 100644
--- a/tools/browser/schema-browser/relations-diagram.h
+++ b/tools/browser/schema-browser/relations-diagram.h
@@ -50,6 +50,7 @@ struct _RelationsDiagramClass {
GType relations_diagram_get_type (void) G_GNUC_CONST;
GtkWidget *relations_diagram_new (BrowserConnection *bcnc);
GtkWidget *relations_diagram_new_with_fav_id (BrowserConnection *bcnc, gint fav_id, GError **error);
+gint relations_diagram_get_fav_id (RelationsDiagram *diagram);
G_END_DECLS
diff --git a/tools/browser/schema-browser/schema-browser-perspective.c b/tools/browser/schema-browser/schema-browser-perspective.c
index 5202eb2..78e99f7 100644
--- a/tools/browser/schema-browser/schema-browser-perspective.c
+++ b/tools/browser/schema-browser/schema-browser-perspective.c
@@ -310,7 +310,7 @@ schema_browser_perspective_get_actions_ui (BrowserPerspective *bpers)
void
schema_browser_perspective_display_diagram (SchemaBrowserPerspective *bpers, gint fav_id)
{
- GtkWidget *diagram;
+ GtkWidget *diagram = NULL;
if (fav_id >= 0) {
gint ntabs, i;
@@ -320,8 +320,10 @@ schema_browser_perspective_display_diagram (SchemaBrowserPerspective *bpers, gin
GtkWidget *child;
child = gtk_notebook_get_nth_page (GTK_NOTEBOOK (bpers->priv->notebook), i);
if (IS_RELATIONS_DIAGRAM (child)) {
- gtk_notebook_set_current_page (GTK_NOTEBOOK (bpers->priv->notebook), i);
- return;
+ if (relations_diagram_get_fav_id (RELATIONS_DIAGRAM (child)) == fav_id) {
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (bpers->priv->notebook), i);
+ return;
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]