comparison finch/libgnt/gnttree.c @ 18872:85b155a574a3

libgnt.localize Start working towards non-utf8 locale support.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 11 Aug 2007 04:18:14 +0000
parents b5d6e360eca0
children 7066896f6628
comparison
equal deleted inserted replaced
18871:2e41a68009ba 18872:85b155a574a3
1484 GntTreeRow *row; 1484 GntTreeRow *row;
1485 GntTreeCol *col; 1485 GntTreeCol *col;
1486 1486
1487 g_return_if_fail(colno < tree->ncol); 1487 g_return_if_fail(colno < tree->ncol);
1488 1488
1489 text = gnt_util_localize_string(text);
1489 row = g_hash_table_lookup(tree->hash, key); 1490 row = g_hash_table_lookup(tree->hash, key);
1490 if (row) 1491 if (row)
1491 { 1492 {
1492 col = g_list_nth_data(row->columns, colno); 1493 col = g_list_nth_data(row->columns, colno);
1493 if (BINARY_DATA(tree, colno)) { 1494 if (BINARY_DATA(tree, colno)) {
1623 col->span = 1; 1624 col->span = 1;
1624 if (BINARY_DATA(tree, i)) { 1625 if (BINARY_DATA(tree, i)) {
1625 col->text = iter->data; 1626 col->text = iter->data;
1626 col->isbinary = TRUE; 1627 col->isbinary = TRUE;
1627 } else { 1628 } else {
1628 col->text = g_strdup(iter->data ? iter->data : ""); 1629 const char *text = iter->data;
1630 text = gnt_util_localize_string(text);
1631 col->text = g_strdup(text ? text : "");
1629 col->isbinary = FALSE; 1632 col->isbinary = FALSE;
1630 } 1633 }
1631 1634
1632 row->columns = g_list_append(row->columns, col); 1635 row->columns = g_list_append(row->columns, col);
1633 } 1636 }
1665 } 1668 }
1666 1669
1667 void gnt_tree_set_column_title(GntTree *tree, int index, const char *title) 1670 void gnt_tree_set_column_title(GntTree *tree, int index, const char *title)
1668 { 1671 {
1669 g_free(tree->columns[index].title); 1672 g_free(tree->columns[index].title);
1673 title = gnt_util_localize_string(title);
1670 tree->columns[index].title = g_strdup(title); 1674 tree->columns[index].title = g_strdup(title);
1671 } 1675 }
1672 1676
1673 void gnt_tree_set_column_titles(GntTree *tree, ...) 1677 void gnt_tree_set_column_titles(GntTree *tree, ...)
1674 { 1678 {
1677 1681
1678 va_start(args, tree); 1682 va_start(args, tree);
1679 for (i = 0; i < tree->ncol; i++) 1683 for (i = 0; i < tree->ncol; i++)
1680 { 1684 {
1681 const char *title = va_arg(args, const char *); 1685 const char *title = va_arg(args, const char *);
1686 title = gnt_util_localize_string(title);
1682 tree->columns[i].title = g_strdup(title); 1687 tree->columns[i].title = g_strdup(title);
1683 } 1688 }
1684 va_end(args); 1689 va_end(args);
1685 } 1690 }
1686 1691