~ubuntu-branches/ubuntu/trusty/xiphos/trusty

« back to all changes in this revision

Viewing changes to src/gnome2/bookmarks_treeview.c

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs, Dmitrijs Ledkovs
  • Date: 2012-03-11 18:43:32 UTC
  • mfrom: (17.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120311184332-splq3ecpx7tyi87d
Tags: 3.1.5+dfsg-1
[ Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> ]  
* New upstream release.
* Build using webkit backend
* Contains unpacked source for waf binary (Closes: #654511)
* Update debian/copyright to latest specification

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * Xiphos Bible Study Tool
3
3
 * bookmarks_treeview.c - gui for bookmarks using treeview
4
4
 *
5
 
 * Copyright (C) 2003-2010 Xiphos Developer Team
 
5
 * Copyright (C) 2003-2011 Xiphos Developer Team
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify
8
8
 * it under the terms of the GNU General Public License as published by
451
451
 
452
452
/******************************************************************************
453
453
 * Name
454
 
 *   gui_load_removed
455
 
 *
456
 
 * Synopsis
457
 
 *   #include "gui/bookmarks_treview.h"
458
 
 *
459
 
 *   void gui_load_removed()
460
 
 *
461
 
 * Description
462
 
 *    restore bookmarks that have been removed and saved
463
 
 *
464
 
 * Return value
465
 
 *   void
466
 
 */
467
 
 
468
 
void gui_load_removed(const xmlChar * file)
469
 
{
470
 
        xmlNodePtr cur = NULL;
471
 
        BOOKMARK_DATA data, *p = NULL;
472
 
        GtkTreeIter iter;
473
 
        GtkTreeIter parent;
474
 
        GtkTreePath *path;
475
 
//      gchar *caption = NULL;
476
 
        GtkTreeSelection *selection;
477
 
        GtkTreeIter selected;
478
 
 
479
 
        selection = gtk_tree_view_get_selection(bookmark_tree);
480
 
        if (!gtk_tree_selection_get_selected
481
 
            (selection, NULL, &selected))
482
 
                return;
483
 
        p = &data;
484
 
 
485
 
        cur = xml_load_bookmark_file(file);
486
 
        while (cur != NULL) {
487
 
                if (!xmlStrcmp(cur->name, (const xmlChar *) "Bookmark")) {
488
 
                        get_xml_bookmark_data(cur, p);
489
 
                        gui_add_item_to_tree(&iter, &parent, p);
490
 
                        free_bookmark_data(p);
491
 
                } else {
492
 
                        get_xml_folder_data(cur, p);
493
 
                        if (p->caption) {
494
 
                                gui_add_item_to_tree(&parent, &selected, p);
495
 
                        }
496
 
                        free_bookmark_data(p);
497
 
                        add_node(cur, &parent);
498
 
                }
499
 
 
500
 
                if (cur->next)
501
 
                        cur = cur->next;
502
 
                else
503
 
                        break;
504
 
        }
505
 
        xml_free_bookmark_doc();
506
 
        path =
507
 
            gtk_tree_model_get_path(GTK_TREE_MODEL(model), &selected);
508
 
        gtk_tree_view_expand_to_path(bookmark_tree, path);
509
 
        gtk_tree_path_free(path);
510
 
}
511
 
 
512
 
 
513
 
/******************************************************************************
514
 
 * Name
515
454
 *  load_xml_bookmarks
516
455
 *
517
456
 * Synopsis
639
578
                pixbuf_finder("epiphany-bookmark-page.png", 0, NULL);
640
579
 
641
580
        if (!bm_pixbufs->pixbuf_helpdoc)
 
581
 
 
582
#ifdef USE_GTK_3
 
583
        bm_pixbufs->pixbuf_helpdoc = 
 
584
                gtk_widget_render_icon_pixbuf(widgets.app,
 
585
                                              GTK_STOCK_DND,
 
586
                                              GTK_ICON_SIZE_MENU );
 
587
#else   
642
588
                bm_pixbufs->pixbuf_helpdoc
643
589
                    = gtk_widget_render_icon(widgets.app,
644
590
                                             GTK_STOCK_DND,
645
591
                                             GTK_ICON_SIZE_MENU, NULL);
 
592
#endif
646
593
}
647
594
 
648
595
/******************************************************************************