2011-10-07 [colin] 3.7.10cvs21
[claws.git] / src / plugins / pgpcore / prefs_gpg.c
index ffdb1062918558147035f3d296450488f84f47f8..5c149ff00970918b236c21801505e0b60f14b48c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2004-2007 the Claws Mail team
+ * Copyright (C) 2004-2011 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
@@ -22,8 +22,8 @@
 #include <glib/gi18n.h>
 
 #include "defs.h"
-#include "utils.h"
 #include "gtk/gtkutils.h"
+#include "utils.h" 
 #include "prefs.h"
 #include "prefs_gtk.h"
 #include "prefs_gpg.h"
@@ -84,13 +84,11 @@ static void prefs_gpg_create_widget_func(PrefsPage *_page,
        GtkWidget *hbox1;
        GtkWidget *vbox1, *vbox2;
        GtkWidget *label_expire1;
-       GtkObject *spinbtn_store_passphrase_adj;
+       GtkAdjustment *spinbtn_store_passphrase_adj;
        GtkWidget *spinbtn_store_passphrase;
        GtkWidget *label_expire2;
        GtkWidget *frame_passphrase;
-       GtkTooltips *tooltips;
-       
-       tooltips = gtk_tooltips_new();
+       CLAWS_TIP_DECL();
 
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
@@ -126,7 +124,7 @@ static void prefs_gpg_create_widget_func(PrefsPage *_page,
        gtk_box_pack_start (GTK_BOX (hbox1), label_expire1, FALSE, FALSE, 0);
 
        spinbtn_store_passphrase_adj =
-           gtk_adjustment_new(1, 0, 1440, 1, 10, 10);
+           gtk_adjustment_new(1, 0, 1440, 1, 10, 0);
        spinbtn_store_passphrase =
            gtk_spin_button_new(GTK_ADJUSTMENT
                                (spinbtn_store_passphrase_adj), 1, 0);
@@ -134,10 +132,9 @@ static void prefs_gpg_create_widget_func(PrefsPage *_page,
        gtk_box_pack_start(GTK_BOX(hbox1), spinbtn_store_passphrase, FALSE,
                           FALSE, 0);
        gtk_widget_set_size_request(spinbtn_store_passphrase, 64, -1);
-       gtk_tooltips_set_tip(tooltips, spinbtn_store_passphrase,
+       CLAWS_SET_TIP(spinbtn_store_passphrase,
                             _
-                            ("Setting to '0' will store the passphrase for the whole session"),
-                            NULL);
+                            ("Setting to '0' will store the passphrase for the whole session"));
        gtk_spin_button_set_numeric(GTK_SPIN_BUTTON
                                    (spinbtn_store_passphrase), TRUE);
 
@@ -447,9 +444,11 @@ void prefs_gpg_save_config(void)
                prefs_file_close_revert(pfile);
                return;
        }
-       fprintf(pfile->fp, "\n");
-
-       prefs_file_close(pfile);
+        if (fprintf(pfile->fp, "\n") < 0) {
+               FILE_OP_ERROR(rcpath, "fprintf");
+               prefs_file_close_revert(pfile);
+       } else
+               prefs_file_close(pfile);
 }
 
 struct GPGAccountConfig *prefs_gpg_account_get_config(PrefsAccount *account)
@@ -594,7 +593,7 @@ gboolean prefs_gpg_should_skip_encryption_warning(const gchar *systemid)
        systems = g_strsplit(prefs_gpg_get_config()->skip_encryption_warning,
                                ",", -1);
        while (systems && systems[i]) {
-               printf(" cmp %s %s\n", systems[i], systemid);
+               debug_print(" cmp %s %s\n", systems[i], systemid);
                if (!strcmp(systems[i],systemid)) {
                        g_strfreev(systems);
                        return TRUE;