fix bug 4239, 'Preferences: Text Options Header Display modal is not modal' (sic)
[claws.git] / src / expldifdlg.c
index ac0166bf72880642dc4ee3a0b1d593981c8cea89..0b3e5dfb33dfe8329efda7a83295a577cc8712c4 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2003-2012 Match Grun and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2003-2015 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
@@ -14,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 /*
@@ -23,6 +22,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include "config.h"
+#include "claws-features.h"
 #endif
 
 #include "defs.h"
@@ -164,7 +164,7 @@ static gboolean exp_ldif_move_file( void ) {
        AlertValue aval;
 
        sFile = gtk_editable_get_chars( GTK_EDITABLE(expldif_dlg.entryLdif), 0, -1 );
-       g_strchug( sFile ); g_strchomp( sFile );
+       g_strstrip( sFile );
        gtk_entry_set_text( GTK_ENTRY(expldif_dlg.entryLdif), sFile );
        exportldif_parse_filespec( _exportCtl_, sFile );
 
@@ -177,7 +177,8 @@ static gboolean exp_ldif_move_file( void ) {
        if( errFlag ) return FALSE;
 
        /* Test for directory */
-       if( exportldif_test_dir( _exportCtl_ ) ) {
+       if( g_file_test(_exportCtl_->dirOutput,
+                               G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR) ) {
                return TRUE;
        }
 
@@ -187,7 +188,7 @@ static gboolean exp_ldif_move_file( void ) {
                "does not exist. OK to create new directory?" ),
                _exportCtl_->dirOutput );
        aval = alertpanel( _("Create Directory" ),
-               msg, GTK_STOCK_NO, GTK_STOCK_YES, NULL );
+               msg, GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST );
        g_free( msg );
        if( aval != G_ALERTALTERNATE ) return FALSE;
 
@@ -198,8 +199,8 @@ static gboolean exp_ldif_move_file( void ) {
                        "Could not create output directory for LDIF file:\n%s" ),
                        reason );
                aval = alertpanel_full(_("Failed to Create Directory"), msg,
-                                      GTK_STOCK_CLOSE, NULL, NULL, FALSE,
-                                      NULL, ALERT_ERROR, G_ALERTDEFAULT);
+                                      GTK_STOCK_CLOSE, NULL, NULL, ALERTFOCUS_FIRST, FALSE,
+                                      NULL, ALERT_ERROR);
                g_free( msg );
                return FALSE;
        }
@@ -219,7 +220,7 @@ static gboolean exp_ldif_move_dn( void ) {
 
        /* Set suffix */
        suffix = gtk_editable_get_chars( GTK_EDITABLE(expldif_dlg.entrySuffix), 0, -1 );
-       g_strchug( suffix ); g_strchomp( suffix );
+       g_strstrip( suffix );
 
        /* Set RDN format */
        id = combobox_get_active_data(GTK_COMBO_BOX(expldif_dlg.optmenuRDN));
@@ -243,7 +244,7 @@ static gboolean exp_ldif_move_dn( void ) {
                                "for an LDAP server. Are you sure you wish " \
                                "to proceed without a suffix?"
                         ),
-                       GTK_STOCK_NO, GTK_STOCK_YES, NULL );
+                       GTK_STOCK_NO, GTK_STOCK_YES, NULL, ALERTFOCUS_FIRST );
                if( aval != G_ALERTALTERNATE ) {
                        gtk_widget_grab_focus( expldif_dlg.entrySuffix );
                        errFlag = TRUE;
@@ -608,7 +609,7 @@ static void export_ldif_page_finish( gint pageNum, gchar *pageLbl ) {
 
        /* First row */
        top = 0;
-       label = gtk_label_new( _( "Address Book :" ) );
+       label = gtk_label_new( _( "Address Book:" ) );
        gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
        gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
 
@@ -618,7 +619,7 @@ static void export_ldif_page_finish( gint pageNum, gchar *pageLbl ) {
 
        /* Second row */
        top++;
-       label = gtk_label_new( _( "File Name :" ) );
+       label = gtk_label_new( _( "File Name:" ) );
        gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
        gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
 
@@ -653,6 +654,7 @@ static void export_ldif_dialog_create( void ) {
        gtk_window_set_title( GTK_WINDOW(window),
                _("Export Address Book to LDIF File") );
        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(export_ldif_delete_event),
                         NULL );