~ubuntu-branches/ubuntu/gutsy/yelp/gutsy-updates

« back to all changes in this revision

Viewing changes to src/yelp-window.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-08-14 13:14:03 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20070814131403-k4h8l2t6mc8pcrix
Tags: 2.19.90-0ubuntu1
* New upstream version:
  - Fix distcheck
  - Use x-yelp-index instead of index, which unbreaks some docbook files
  - Write html on command instead of in idle, which fixes info pages
  - Update some copyrights on files
  - Make MAINTAINERS meet bkor's high expectations
  - Add a "phrase not found" message to the find bar
  - Fix "info <page>" in search bar (LP: #54430)
  - Handle malformed .so tags
  - Better handling of cross links in man pages
  - Fix crashes in various info pages
  - Remove extra markup from print dialog
  - Fix searching of single ':' using basic search (LP: #128130)
  - Various fixes to basic search
  - Handle '\*=' escape sequence in man pages
  - Resolve full paths given with ghelp: uri (LP: #130724)
  - Reduce static data and relocations
  - Fix build on Solaris
  - Remove c++ comment
  - Mark -help contents as translatable
  - Remove suffix from icon
  - Make error messages less cryptic
  - Mark print dialog title as translatable
  - Fix building with Beagle again
  - Register EXSLT extensions
  - Fixes docbook pages again
  - Updated translations
* debian/patches/07_rosetta_translations_update.patch:
  - updated
* debian/patches/90_from_svn_exslt_registration.patch:
  - dropped, fixed with the new version
* debian/rules:
  - use beagle search

Show diffs side-by-side

added added

removed removed

Lines of Context:
245
245
    gchar          *find_string;
246
246
    GtkAction      *find_next_menu;
247
247
    GtkAction      *find_prev_menu;
 
248
    GtkToolItem    *find_sep;
 
249
    GtkToolItem    *find_not_found;
248
250
 
249
251
    /* Open Location */
250
252
    GtkWidget      *location_dialog;
277
279
    gulong          finish_handler;
278
280
 
279
281
    gint            toc_pause;
280
 
    guint           html_idle_handle;
281
282
 
282
283
    GtkActionGroup *action_group;
283
284
    GtkUIManager   *ui_manager;
878
879
        data->window = window;
879
880
        data->page = (YelpPage *) func_data;
880
881
 
881
 
        window->priv->html_idle_handle = g_idle_add ((GSourceFunc)window_write_html, data);
 
882
        window_write_html (data);
882
883
 
883
884
        window->priv->current_request = -1;
884
885
        yelp_page_free ((YelpPage *) func_data);
931
932
        window->priv->base_uri = tmp;
932
933
    }
933
934
 
934
 
    if (window->priv->html_idle_handle) {
935
 
        g_source_remove (window->priv->html_idle_handle);
936
 
        window->priv->html_idle_handle = 0;
937
 
    }
938
935
 
939
936
    window_set_loading (window);
940
937
 
999
996
    history_clear_forward (window);
1000
997
 
1001
998
    type = yelp_uri_resolve (trace_uri, &real_uri, &frag_id);
 
999
 
1002
1000
    if (type == YELP_RRN_TYPE_ERROR) {
1003
1001
        gchar *message = g_strdup_printf (_("The requested URI \"%s\" is invalid"), trace_uri);
1004
1002
        window_error (window, _("Unable to load page"), message, FALSE);
1034
1032
            break;
1035
1033
        case YELP_RRN_TYPE_SEARCH:
1036
1034
            doc = yelp_search_new (&real_uri[14]); /* to remove x-yelp-search:*/
 
1035
            priv->base_uri = g_strdup ("file:///fakefile");
 
1036
 
1037
1037
            break;
1038
1038
        case YELP_RRN_TYPE_HTML:
1039
1039
        case YELP_RRN_TYPE_XHTML:
1041
1041
            break;
1042
1042
        case YELP_RRN_TYPE_EXTERNAL:
1043
1043
            {
1044
 
                gchar *stdout = NULL;
1045
 
                gchar *stderr = NULL;
 
1044
                gchar *str_stdout = NULL;
 
1045
                gchar *str_stderr = NULL;
1046
1046
                gchar *cmd = NULL;
1047
1047
                gint status = 0;
1048
1048
                GError *error = NULL;
1049
1049
                cmd = g_strdup_printf ("gnome-open %s", uri);
1050
 
                if (!g_spawn_command_line_sync (cmd, &stdout, &stderr, &status, &error)) {
 
1050
                if (!g_spawn_command_line_sync (cmd, &str_stdout, &str_stderr, &status, &error)) {
1051
1051
                    g_free (error);
1052
1052
                    error = NULL;
1053
1053
                    g_free (cmd);
1054
1054
                    cmd = g_strdup_printf ("xdg-open %s", uri);
1055
 
                    if (!g_spawn_command_line_sync (cmd, &stdout, &stderr, &status, &error)) {
 
1055
                    if (!g_spawn_command_line_sync (cmd, &str_stdout, &str_stderr, &status, &error)) {
1056
1056
                        window_error(window, _("Error executing \"gnome-open\""), error->message, FALSE);
1057
1057
                        return;
1058
1058
                    }
1072
1072
    if (doc) {
1073
1073
        gboolean need_hist = FALSE;
1074
1074
        if (!frag_id)
1075
 
            frag_id = g_strdup ("index");
 
1075
          frag_id = g_strdup ("x-yelp-index");
1076
1076
 
1077
1077
        if (priv->current_document || (priv->current_type == YELP_RRN_TYPE_HTML ||
1078
1078
                                       priv->current_type == YELP_RRN_TYPE_XHTML))
1167
1167
        spaces = strchr (search_terms, ' ');
1168
1168
        while (spaces) {
1169
1169
            count++;
1170
 
            spaces = strchr (search_terms, ' ');
 
1170
            spaces = strchr (spaces+1, ' ');
1171
1171
        }
1172
1172
        if (count == 1) {
1173
1173
            uri = g_strdup (search_terms);
1436
1436
                      window);
1437
1437
    gtk_toolbar_insert (GTK_TOOLBAR (find_bar), priv->find_prev, -1);
1438
1438
 
 
1439
    priv->find_sep = gtk_separator_tool_item_new ();
 
1440
    gtk_toolbar_insert (GTK_TOOLBAR (find_bar), priv->find_sep, -1);
 
1441
 
 
1442
    label = gtk_label_new (_("Phrase not found"));
 
1443
    priv->find_not_found = gtk_tool_item_new ();
 
1444
 
 
1445
    gtk_tool_item_set_expand (priv->find_not_found, TRUE);
 
1446
    gtk_container_add (GTK_CONTAINER (priv->find_not_found), label);
 
1447
    gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
 
1448
    gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
 
1449
    gtk_toolbar_insert (GTK_TOOLBAR (find_bar), priv->find_not_found, -1);    
 
1450
 
1439
1451
    item = gtk_separator_tool_item_new ();
1440
1452
    gtk_tool_item_set_expand (item, TRUE);
1441
1453
    gtk_separator_tool_item_set_draw (GTK_SEPARATOR_TOOL_ITEM (item), FALSE);
2114
2126
    debug_print (DB_FUNCTION, "entering\n");
2115
2127
 
2116
2128
    gtk_widget_show_all (priv->find_bar);
 
2129
    gtk_widget_hide (GTK_WIDGET (priv->find_not_found));
 
2130
    gtk_widget_hide (GTK_WIDGET (priv->find_sep));
2117
2131
    gtk_widget_grab_focus (priv->find_entry);
2118
2132
    window_find_entry_changed_cb (GTK_EDITABLE (priv->find_entry), window);
2119
2133
}
2521
2535
        window_find_buttons_set_sensitive (window, FALSE, FALSE);
2522
2536
    else
2523
2537
        if (found) {
 
2538
            gtk_widget_hide (GTK_WIDGET (priv->find_sep));
 
2539
            gtk_widget_hide (GTK_WIDGET (priv->find_not_found));
2524
2540
            window_find_buttons_set_sensitive (window, FALSE, TRUE);
2525
2541
        } else {
 
2542
            gtk_widget_show_all (GTK_WIDGET (priv->find_sep));
 
2543
            gtk_widget_show_all (GTK_WIDGET (priv->find_not_found));
2526
2544
            window_find_buttons_set_sensitive (window, TRUE, TRUE);
2527
2545
        }
2528
2546
 
2641
2659
        yelp_html_write (html, contents, read);
2642
2660
    } while (read == BUFFER_SIZE);
2643
2661
    yelp_html_close (html);
2644
 
    data->window->priv->html_idle_handle = 0;
2645
2662
    return FALSE;
2646
2663
}
2647
2664