diff options
author | Mikael Hallendal <micke@codefactory.se> | 2002-03-03 04:57:36 +0000 |
---|---|---|
committer | Mikael Hallendal <hallski@src.gnome.org> | 2002-03-03 04:57:36 +0000 |
commit | 9a7825296c3924079c1f2acd7290bdfa49210b61 (patch) | |
tree | 20cac43cd9788f8b0f2609822e2b81bb1398597f | |
parent | 0cccbee31d6633ef5e556aed1ba6c44c3b413dc6 (diff) | |
download | yelp-9a7825296c3924079c1f2acd7290bdfa49210b61.tar.gz |
- Fixes #73056 (yelp_window_new): don't create index view if no index is
2002-03-03 Mikael Hallendal <micke@codefactory.se>
* src/yelp-window.c:
- Fixes #73056
(yelp_window_new): don't create index view if no index is
available.
(yw_create_toolbar): don't add index-button if index is not
available.
(yw_populate): don't insert index page in notebook if index is not
present.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/yelp-base.c | 3 | ||||
-rw-r--r-- | src/yelp-scrollkeeper.c | 2 | ||||
-rw-r--r-- | src/yelp-window.c | 52 |
4 files changed, 31 insertions, 35 deletions
@@ -1,5 +1,14 @@ 2002-03-03 Mikael Hallendal <micke@codefactory.se> + * src/yelp-window.c: + - Fixes #73056 + (yelp_window_new): don't create index view if no index is + available. + (yw_create_toolbar): don't add index-button if index is not + available. + (yw_populate): don't insert index page in notebook if index is not + present. + * src/yelp-base.c: (impl_Yelp_getWindows): added/impl. (yelp_base_class_init): use getWindows. diff --git a/src/yelp-base.c b/src/yelp-base.c index 1f61f646..61b6a67a 100644 --- a/src/yelp-base.c +++ b/src/yelp-base.c @@ -167,7 +167,7 @@ yelp_base_new (void) YelpBase *base; YelpBasePriv *priv; gboolean result; - + base = g_object_new (YELP_TYPE_BASE, NULL); priv = base->priv; @@ -198,7 +198,6 @@ yelp_base_new_window (YelpBase *base) (GWeakNotify) yelp_base_window_finalized_cb, base); - g_signal_connect (window, "new_window_requested", G_CALLBACK (yelp_base_new_window_cb), base); diff --git a/src/yelp-scrollkeeper.c b/src/yelp-scrollkeeper.c index 27724d5b..bc39b8cf 100644 --- a/src/yelp-scrollkeeper.c +++ b/src/yelp-scrollkeeper.c @@ -393,7 +393,7 @@ ys_parse_index (GList **index) GNOME_VFS_FILE_INFO_DEFAULT); if (result != GNOME_VFS_OK) { - g_warning ("Error opening directory: %s\n", index_dir); + g_warning ("Error opening index directory: %s\n", index_dir); return FALSE; } diff --git a/src/yelp-window.c b/src/yelp-window.c index f0b8d01f..d8589dc0 100644 --- a/src/yelp-window.c +++ b/src/yelp-window.c @@ -287,9 +287,11 @@ yw_populate (YelpWindow *window) priv->content_view, NULL, PAGE_CONTENT_VIEW); - gtk_notebook_insert_page (GTK_NOTEBOOK (priv->notebook), - priv->index_view, - NULL, PAGE_INDEX_VIEW); + if (priv->index) { + gtk_notebook_insert_page (GTK_NOTEBOOK (priv->notebook), + priv->index_view, + NULL, PAGE_INDEX_VIEW); + } gtk_box_pack_start (GTK_BOX (main_box), toolbar, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (main_box), priv->notebook, @@ -597,36 +599,19 @@ yw_create_toolbar (YelpWindow *window) G_CALLBACK (yw_home_button_clicked), window); + if (priv->index) { + icon = gtk_image_new_from_stock ("gtk-index", + GTK_ICON_SIZE_LARGE_TOOLBAR); - icon = gtk_image_new_from_stock ("gtk-index", - GTK_ICON_SIZE_LARGE_TOOLBAR); - - button = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), - _("Index"), - _("Search in the index"), - NULL, icon, - G_CALLBACK (yw_index_button_clicked), - window); - -#if 0 - gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); - - button = gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), - "gtk-find", - _("Search for a phrase in the document"), "", - NULL, NULL, -1); - - /* Connect to find-button */ - - gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), - gtk_label_new (_("Help on ")), - "", ""); + button = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), + _("Index"), + _("Search in the index"), + NULL, icon, + G_CALLBACK (yw_index_button_clicked), + window); + + } - gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), - gtk_entry_new (), - _("Enter phrase to search for in all documents"), ""); -#endif - return toolbar; } @@ -644,7 +629,10 @@ yelp_window_new (GNode *doc_tree, GList *index) priv->toc_view = yelp_view_toc_new (doc_tree); priv->content_view = yelp_view_content_new (doc_tree); - priv->index_view = yelp_view_index_new (index); + + if (priv->index) { + priv->index_view = yelp_view_index_new (index); + } g_signal_connect (priv->toc_view, "url_selected", G_CALLBACK (yw_url_selected_cb), |