/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2001-2006 Match Grun and the Sylpheed-Claws team
+ * Copyright (C) 2001-2007 Match Grun and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
*/
/*
gtk_main_quit();
}
-static void addressbook_foldersel_folder_select( GtkCTree *ctree, gint row, gint column,
- GdkEvent *event, gpointer data )
+static void addressbook_foldersel_folder_select( GtkCTree *ctree, GtkCTreeNode *node,
+ gint column, gpointer data )
{
- addressbook_foldersel_dlg.fiSelected = gtk_clist_get_row_data( GTK_CLIST(ctree), row );
+ addressbook_foldersel_dlg.fiSelected = gtk_ctree_node_get_row_data( ctree, node );
}
static gboolean addressbook_foldersel_tree_button( GtkCTree *ctree, GdkEventButton *event, gpointer data )
GtkWidget *ok_btn;
GtkWidget *cancel_btn;
static GdkGeometry geometry;
+ gchar *titles[1];
- window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "addressbook_foldersel" );
gtk_container_set_border_width( GTK_CONTAINER(window), 0 );
gtk_window_set_title( GTK_WINDOW(window), _("Select Address Book Folder") );
gtk_window_set_position( GTK_WINDOW(window), GTK_WIN_POS_MOUSE );
GTK_POLICY_AUTOMATIC );
gtk_box_pack_start( GTK_BOX(vlbox), tree_win, TRUE, TRUE, 0 );
- tree_folder = gtk_ctree_new( 1, 0 );
+ titles[0] = _( "Address Book") ;
+
+ tree_folder = gtk_sctree_new_with_titles( 1, 0, titles );
gtk_container_add( GTK_CONTAINER(tree_win), tree_folder );
gtk_clist_column_titles_show( GTK_CLIST(tree_folder) );
- gtk_clist_set_column_title( GTK_CLIST(tree_folder), 0, _( "Address Book" ) );
- gtk_ctree_set_line_style( GTK_CTREE(tree_folder), GTK_CTREE_LINES_DOTTED );
+ if (prefs_common.enable_dotted_lines) {
+ gtk_ctree_set_line_style(GTK_CTREE(tree_folder), GTK_CTREE_LINES_DOTTED);
+ gtk_ctree_set_expander_style(GTK_CTREE(tree_folder),
+ GTK_CTREE_EXPANDER_SQUARE);
+ } else {
+ gtk_ctree_set_line_style(GTK_CTREE(tree_folder), GTK_CTREE_LINES_NONE);
+ gtk_ctree_set_expander_style(GTK_CTREE(tree_folder),
+ GTK_CTREE_EXPANDER_TRIANGLE);
+ }
+ gtk_sctree_set_stripes(GTK_SCTREE(tree_folder), prefs_common.use_stripes_everywhere);
gtk_clist_set_selection_mode( GTK_CLIST(tree_folder), GTK_SELECTION_BROWSE );
- gtk_ctree_set_expander_style( GTK_CTREE(tree_folder), GTK_CTREE_EXPANDER_SQUARE );
gtk_ctree_set_indent( GTK_CTREE(tree_folder), CTREE_INDENT );
gtk_clist_set_auto_sort( GTK_CLIST(tree_folder), TRUE );
G_CALLBACK(addressbook_foldersel_ok), NULL );
g_signal_connect( G_OBJECT(cancel_btn), "clicked",
G_CALLBACK(addressbook_foldersel_cancel), NULL );
- g_signal_connect( G_OBJECT(tree_folder), "select_row",
+ g_signal_connect( G_OBJECT(tree_folder), "tree_select_row",
G_CALLBACK(addressbook_foldersel_folder_select), NULL );
g_signal_connect( G_OBJECT(tree_folder), "button_press_event",
G_CALLBACK(addressbook_foldersel_tree_button), NULL );
fName = g_strdup( ADDRITEM_NAME(folder) );
name = &fName;
- node = gtk_sctree_insert_node( tree, parentNode, NULL, name, FOLDER_SPACING,
+ node = gtk_ctree_insert_node( tree, parentNode, NULL, name, FOLDER_SPACING,
folderXpm, folderXpmMask, folderXpm, folderXpmMask,
FALSE, TRUE );
}
}
-static void addressbook_foldersel_load_data( AddressIndex *addrIndex, gchar *path, FolderPathMatch* match )
+static void addressbook_foldersel_load_data( AddressIndex *addrIndex,
+ FolderPathMatch* match )
{
AddressDataSource *ds;
GList *list, *nodeDS;
/* Add node for address book */
abf = ds->rawDataSource;
name = &dsName;
- node = gtk_sctree_insert_node( tree, NULL, NULL,
+ node = gtk_ctree_insert_node( tree, NULL, NULL,
name, FOLDER_SPACING, bookXpm,
bookXpmMask, bookXpm, bookXpmMask,
FALSE, TRUE );
}
gboolean addressbook_foldersel_selection( AddressIndex *addrIndex,
- AddressBookFile **book, ItemFolder **folder, gchar* path)
+ AddressBookFile **book, ItemFolder **folder,
+ const gchar* path)
{
+ FolderPathMatch folder_path_match = { NULL, FALSE, 0, NULL };
gboolean retVal = FALSE;
addressbook_foldersel_cancelled = FALSE;
- FolderPathMatch folder_path_match = { NULL, FALSE, 0, NULL };
if ( ! addressbook_foldersel_dlg.window )
addressbook_foldersel_create();
corresponds to what we received */
if ( path != NULL ) {
- if ( strcasecmp(path, _("Any")) == 0 || *path == '\0' )
- /* consider "Any" and "" as valid addressbook root */
+ if ( g_utf8_collate(path, _("Any")) == 0 || strcasecmp(path, "Any") ==0 || *path == '\0' )
+ /* consider "Any" (both translated or untranslated forms) and ""
+ as valid addressbook roots */
folder_path_match.matched = TRUE;
else
folder_path_match.folder_path = g_strsplit( path, "/", 256 );
}
- addressbook_foldersel_load_data( addrIndex, path, &folder_path_match );
+ addressbook_foldersel_load_data( addrIndex, &folder_path_match );
if ( folder_path_match.folder_path != NULL && folder_path_match.matched == FALSE)
g_warning("addressbook_foldersel_load_data: couldn't match book/folder path '%s'\n", path);