diff options
author | Shaun McCance <shaunm@src.gnome.org> | 2005-01-09 21:02:03 +0000 |
---|---|---|
committer | Shaun McCance <shaunm@src.gnome.org> | 2005-01-09 21:02:03 +0000 |
commit | a249367fa2e20b90f39c866b58d938b768888693 (patch) | |
tree | aa0a722b1525e40481935e166902915bc82e3767 | |
parent | 81e8bc27148541b8fcc389682bc315223d49f8ed (diff) | |
download | yelp-a249367fa2e20b90f39c866b58d938b768888693.tar.gz |
- Put the current URI in the Ctrl+L dialog
* src/yelp-window.c:
- Put the current URI in the Ctrl+L dialog
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/yelp-window.c | 18 |
2 files changed, 23 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2005-01-09 Shaun McCance <shaunm@gnome.org> + + * src/yelp-window.c: + - Put the current URI in the Ctrl+L dialog + 2005-01-03 Shaun McCance <shaunm@gnome.org> * src/yelp-toc-pager.c: diff --git a/src/yelp-window.c b/src/yelp-window.c index e3c2a015..f8a7dd43 100644 --- a/src/yelp-window.c +++ b/src/yelp-window.c @@ -1813,11 +1813,24 @@ window_open_location_cb (GtkAction *action, YelpWindow *window) GladeXML *glade; GtkWidget *dialog; GtkWidget *entry; + gchar *uri; g_return_if_fail (YELP_IS_WINDOW (window)); priv = window->priv; + if (priv->current_doc) { + uri = yelp_doc_info_get_uri (priv->current_doc, + priv->current_frag, + YELP_URI_TYPE_NO_FILE); + if (!uri) + uri = yelp_doc_info_get_uri (priv->current_doc, + priv->current_frag, + YELP_URI_TYPE_FILE); + } else { + uri = NULL; + } + glade = glade_xml_new (DATADIR "/yelp/ui/yelp.glade", "location_dialog", NULL); @@ -1833,6 +1846,11 @@ window_open_location_cb (GtkAction *action, YelpWindow *window) priv->location_dialog = dialog; priv->location_entry = entry; + if (uri) { + gtk_entry_set_text (GTK_ENTRY (entry), uri); + gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1); + } + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window)); g_signal_connect (G_OBJECT (dialog), |