fix bug 4239, 'Preferences: Text Options Header Display modal is not modal' (sic)
[claws.git] / src / editgroup.c
index c5809df421d4e69739b827d6b6e7e53f8d98acbb..c1c96c36b5bb561b0e845a0592823f5815119357 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2012 Hiroyuki Yamamoto 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
@@ -19,6 +19,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include "config.h"
+#include "claws-features.h"
 #endif
 
 #include "defs.h"
@@ -214,6 +215,7 @@ static void edit_group_to_avail( GtkWidget *widget, gpointer data ) {
 
 static gboolean edit_group_list_group_button( GtkCMCList *clist, GdkEventButton *event, gpointer data ) {
        if( ! event ) return FALSE;
+       if( event->window != clist->clist_window ) return FALSE;
 
        if( event->button == 1 ) {
                if( event->type == GDK_2BUTTON_PRESS ) {
@@ -225,6 +227,7 @@ static gboolean edit_group_list_group_button( GtkCMCList *clist, GdkEventButton
 
 static gboolean edit_group_list_avail_button( GtkCMCList *clist, GdkEventButton *event, gpointer data ) {
        if( ! event ) return FALSE;
+       if( event->window != clist->clist_window ) return FALSE;
 
        if( event->button == 1 ) {
                if( event->type == GDK_2BUTTON_PRESS ) {
@@ -292,6 +295,7 @@ static void addressbook_edit_group_create( gboolean *cancelled ) {
        gtk_container_set_border_width(GTK_CONTAINER(window), 0);
        gtk_window_set_title(GTK_WINDOW(window), _("Edit Group Data"));
        gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
+       gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG);
        g_signal_connect(G_OBJECT(window), "delete_event",
                         G_CALLBACK(edit_group_delete_event),
                         cancelled);
@@ -351,18 +355,17 @@ static void addressbook_edit_group_create( gboolean *cancelled ) {
 
        clist_group = gtk_sctree_new_with_titles( GROUP_N_COLS, 0, titles );
        gtk_container_add( GTK_CONTAINER(clist_swin), clist_group );
-       gtk_cmctree_set_line_style(GTK_CMCTREE(clist_group), GTK_CMCTREE_LINES_NONE);
        gtk_cmctree_set_expander_style(GTK_CMCTREE(clist_group),
                             GTK_CMCTREE_EXPANDER_TRIANGLE);
        gtk_sctree_set_stripes(GTK_SCTREE(clist_group), prefs_common.use_stripes_in_summaries);
-       gtk_cmclist_set_selection_mode( GTK_CMCLIST(clist_group), GTK_SELECTION_EXTENDED );
+       gtk_cmclist_set_selection_mode( GTK_CMCLIST(clist_group), GTK_SELECTION_MULTIPLE );
        gtk_cmclist_set_column_width( GTK_CMCLIST(clist_group), GROUP_COL_NAME, GROUP_COL_WIDTH_NAME );
        gtk_cmclist_set_column_width( GTK_CMCLIST(clist_group), GROUP_COL_EMAIL, GROUP_COL_WIDTH_EMAIL );
        gtk_cmclist_set_compare_func( GTK_CMCLIST(clist_group), edit_group_list_compare_func );
        gtk_cmclist_set_auto_sort( GTK_CMCLIST(clist_group), TRUE );
 
        for( i = 0; i < GROUP_N_COLS; i++ )
-               gtkut_widget_set_can_focus(GTK_CMCLIST(clist_group)->column[i].button, FALSE);
+               gtk_widget_set_can_focus(GTK_CMCLIST(clist_group)->column[i].button, FALSE);
 
        /* Available list */
        vboxl = gtk_vbox_new( FALSE, 0 );
@@ -384,17 +387,16 @@ static void addressbook_edit_group_create( gboolean *cancelled ) {
 
        clist_avail = gtk_sctree_new_with_titles( GROUP_N_COLS, 0, titles );
        gtk_container_add( GTK_CONTAINER(clist_swin), clist_avail );
-       gtk_cmctree_set_line_style(GTK_CMCTREE(clist_avail), GTK_CMCTREE_LINES_NONE);
        gtk_cmctree_set_expander_style(GTK_CMCTREE(clist_avail),
                             GTK_CMCTREE_EXPANDER_TRIANGLE);
-       gtk_cmclist_set_selection_mode( GTK_CMCLIST(clist_avail), GTK_SELECTION_EXTENDED );
+       gtk_cmclist_set_selection_mode( GTK_CMCLIST(clist_avail), GTK_SELECTION_MULTIPLE );
        gtk_cmclist_set_column_width( GTK_CMCLIST(clist_avail), GROUP_COL_NAME, GROUP_COL_WIDTH_NAME );
        gtk_cmclist_set_column_width( GTK_CMCLIST(clist_avail), GROUP_COL_EMAIL, GROUP_COL_WIDTH_EMAIL );
        gtk_cmclist_set_compare_func( GTK_CMCLIST(clist_avail), edit_group_list_compare_func );
        gtk_cmclist_set_auto_sort( GTK_CMCLIST(clist_avail), TRUE );
 
        for( i = 0; i < GROUP_N_COLS; i++ )
-               gtkut_widget_set_can_focus(GTK_CMCLIST(clist_avail)->column[i].button, FALSE);
+               gtk_widget_set_can_focus(GTK_CMCLIST(clist_avail)->column[i].button, FALSE);
 
        /* Status line */
        hsbox = gtk_hbox_new(FALSE, 0);
@@ -505,8 +507,7 @@ ItemGroup *addressbook_edit_group( AddressBookFile *abf, ItemFolder *parent, Ite
 
        listEMail = addrbook_get_available_email_list( abf, group );
        edit_group_load_clist( groupeditdlg.clist_avail, listEMail );
-       mgu_clear_list( listEMail );
-       listEMail = NULL;
+       g_list_free( listEMail );
        gtk_cmclist_select_row( groupeditdlg.clist_group, 0, 0 );
        gtk_cmclist_select_row( groupeditdlg.clist_avail, 0, 0 );