summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikael Hallendal <micke@codefactory.se>2002-03-03 04:44:44 +0000
committerMikael Hallendal <hallski@src.gnome.org>2002-03-03 04:44:44 +0000
commit0cccbee31d6633ef5e556aed1ba6c44c3b413dc6 (patch)
tree8ecde6fdeb4f32c87c181acb3370028c303169e2 /src
parent0cc6ef2c505baa853c107f96431b786c60871398 (diff)
downloadyelp-0cccbee31d6633ef5e556aed1ba6c44c3b413dc6.tar.gz
added/impl. (yelp_base_class_init): use getWindows.
2002-03-03 Mikael Hallendal <micke@codefactory.se> * src/yelp-base.c: (impl_Yelp_getWindows): added/impl. (yelp_base_class_init): use getWindows. * idl/GNOME_Yelp.idl (GNOME): - Added getWindows which returns a sequence of strings with the URL's of all open windows. This is needed to save the session-state. (Fixes #73184).
Diffstat (limited to 'src')
-rw-r--r--src/yelp-base.c33
-rw-r--r--src/yelp-main.c2
2 files changed, 33 insertions, 2 deletions
diff --git a/src/yelp-base.c b/src/yelp-base.c
index 6b15ca29..1f61f646 100644
--- a/src/yelp-base.c
+++ b/src/yelp-base.c
@@ -76,6 +76,36 @@ impl_Yelp_newWindow (PortableServer_Servant servant,
}
}
+static GNOME_Yelp_WindowList *
+impl_Yelp_getWindows (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ YelpBase *base;
+ YelpBasePriv *priv;
+ GNOME_Yelp_WindowList *list;
+ gint len, i;
+ GSList *node;
+ const gchar *url;
+
+ base = YELP_BASE (bonobo_object (servant));
+ priv = base->priv;
+
+ len = g_slist_length (priv->windows);
+
+ list = GNOME_Yelp_WindowList__alloc ();
+ list->_buffer = CORBA_sequence_CORBA_string_allocbuf (len);
+ list->_length = len;
+ list->_maximum = len;
+ CORBA_sequence_set_release (list, CORBA_TRUE);
+
+ for (node = priv->windows, i = 0; node; node = node->next, i++) {
+ url = yelp_window_get_current_uri (YELP_WINDOW (node->data));
+ list->_buffer[i] = CORBA_string_dup (url);
+ }
+
+ return list;
+}
+
static void
yelp_base_init (YelpBase *base)
{
@@ -98,7 +128,8 @@ yelp_base_class_init (YelpBaseClass *klass)
parent_class = gtk_type_class (PARENT_TYPE);
- epv->newWindow = impl_Yelp_newWindow;
+ epv->newWindow = impl_Yelp_newWindow;
+ epv->getWindows = impl_Yelp_getWindows;
}
static void
diff --git a/src/yelp-main.c b/src/yelp-main.c
index 2581a559..a1467355 100644
--- a/src/yelp-main.c
+++ b/src/yelp-main.c
@@ -105,7 +105,7 @@ yelp_main_open_new_window (CORBA_Object yelp_base, const gchar *url)
CORBA_exception_init (&ev);
GNOME_Yelp_newWindow (yelp_base, url, &ev);
-
+
if (BONOBO_EX (&ev)) {
g_error (_("Could not open new window."));
}