0.8.7claws8
authorChristoph Hohmann <reboot@gmx.ch>
Wed, 25 Dec 2002 13:46:41 +0000 (13:46 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Wed, 25 Dec 2002 13:46:41 +0000 (13:46 +0000)
* src/Makefile.am
* src/account.[ch]
* src/addrbook.c
* src/addressbook.c
* src/addrindex.c
* src/filtering.c
* src/folder.c
* src/matcher.c
* src/prefs.[ch]                ** REMOVE **
* src/prefs_account.c
* src/prefs_actions.c
* src/prefs_common.c
* src/prefs_customheader.c
* src/prefs_display_header.c
* src/prefs_filtering.c
* src/prefs_folder_item.c
* src/prefs_gtk.[ch]            ** NEW **
* src/prefs_matcher.c
* src/prefs_scoring.c
* src/prefs_summary_column.c
* src/procmime.c
* src/selective_download.c
* src/toolbar.c
* src/common/Makefile.am
* src/common/prefs.[ch] ** NEW **
        split prefs.[ch] into prefs_gtk.[ch] and common/prefs.[ch]

30 files changed:
ChangeLog.claws
configure.in
doc/src/ui_seperation.txt
src/Makefile.am
src/account.c
src/account.h
src/addrbook.c
src/addressbook.c
src/addrindex.c
src/common/Makefile.am
src/common/prefs.c [new file with mode: 0644]
src/common/prefs.h [new file with mode: 0644]
src/filtering.c
src/folder.c
src/matcher.c
src/prefs_account.c
src/prefs_actions.c
src/prefs_common.c
src/prefs_customheader.c
src/prefs_display_header.c
src/prefs_filtering.c
src/prefs_folder_item.c
src/prefs_gtk.c [moved from src/prefs.c with 88% similarity]
src/prefs_gtk.h [moved from src/prefs.h with 95% similarity]
src/prefs_matcher.c
src/prefs_scoring.c
src/prefs_summary_column.c
src/procmime.c
src/selective_download.c
src/toolbar.c

index 4924684..71614c2 100644 (file)
@@ -1,3 +1,32 @@
+2002-12-25 [christoph] 0.8.7claws8
+
+       * src/Makefile.am
+       * src/account.[ch]
+       * src/addrbook.c
+       * src/addressbook.c
+       * src/addrindex.c
+       * src/filtering.c
+       * src/folder.c
+       * src/matcher.c
+       * src/prefs.[ch]                ** REMOVE **
+       * src/prefs_account.c
+       * src/prefs_actions.c
+       * src/prefs_common.c
+       * src/prefs_customheader.c
+       * src/prefs_display_header.c
+       * src/prefs_filtering.c
+       * src/prefs_folder_item.c
+       * src/prefs_gtk.[ch]            ** NEW **
+       * src/prefs_matcher.c
+       * src/prefs_scoring.c
+       * src/prefs_summary_column.c
+       * src/procmime.c
+       * src/selective_download.c
+       * src/toolbar.c
+       * src/common/Makefile.am
+       * src/common/prefs.[ch]         ** NEW **
+               split prefs.[ch] into prefs_gtk.[ch] and common/prefs.[ch]
+
 2002-12-24 [alfons]    0.8.7claws7
 
        * src/summaryview.c
 2002-12-13 [christoph] 0.8.6claws109
 
        * src/Makefile.am
-       * src/manage_window.[ch]
+       * src/manage_window.[ch]        ** REMOVE **
        * src/gtk/Makefile.am
-       * src/gtk/manage_window.[ch]
+       * src/gtk/manage_window.[ch]    ** NEW **
                move manage_window files to gtk directory
 
 2002-12-13 [christoph] 0.8.6claws108
 
        * src/Makefile.am
-       * src/gtkshruler.[ch]
+       * src/gtkshruler.[ch]           ** REMOVE **
        * src/gtk/Makefile.am
-       * src/gtk/gtkshruler.[ch]
+       * src/gtk/gtkshruler.[ch]       ** NEW **
                move gtkshruler files to gtk directory
 
 2002-12-13 [christoph] 0.8.6claws107
index 7e4b0d7..032894b 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=7
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws7
+EXTRA_VERSION=claws8
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 92c56fd..3baefe7 100644 (file)
@@ -35,3 +35,6 @@ gtkstext.[ch]         gtk/gtkstext.[ch]       ok
 gtkshruler.[ch]                gtk/gtkshruler.[ch]     ok
 
 manage_window.[ch]     gtk/manage_window.[ch]  ok
+
+prefs.[ch]             common/prefs.[ch]       
+                       prefs_gtk.[ch]          not completed
index a2f77fd..e677a5f 100644 (file)
@@ -21,7 +21,7 @@ sylpheed_SOURCES = \
        compose.c compose.h \
        menu.c menu.h \
        stock_pixmap.c stock_pixmap.h \
-       prefs.c prefs.h \
+       prefs_gtk.c prefs_gtk.h \
        prefs_common.c prefs_common.h \
        prefs_account.c prefs_account.h \
        prefs_folder_item.c prefs_folder_item.h \
index 1f07e69..3c72e1f 100644 (file)
@@ -35,7 +35,7 @@
 #include "folderview.h"
 #include "folder.h"
 #include "account.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "prefs_account.h"
 #include "prefs_folder_item.h"
 #include "compose.h"
index ba0e90b..697dd01 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <glib.h>
 
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "prefs_account.h"
 #include "folder.h"
 
index c721955..ed53f6e 100644 (file)
@@ -35,7 +35,7 @@
 #include "adbookbase.h"
 
 #ifndef DEV_STANDALONE
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "codeconv.h"
 #endif
 
index ab55463..d95540b 100644 (file)
@@ -54,7 +54,7 @@
 #include "menu.h"
 #include "stock_pixmap.h"
 #include "xml.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "procmime.h"
 #include "utils.h"
 #include "gtkutils.h"
index 141c514..373929c 100644 (file)
@@ -38,7 +38,7 @@
 #include "xml.h"
 
 #ifndef DEV_STANDALONE
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "codeconv.h"
 #endif
 
index bab7bca..76f9b68 100644 (file)
@@ -1,14 +1,14 @@
 noinst_LTLIBRARIES = libsylpheedcommon.la
 
 libsylpheedcommon_la_SOURCES = \
-       intl.h \
-       defs.h \
-       version.h \
        base64.c base64.h \
+       defs.h \
        hooks.c hooks.h \
+       intl.h \
        log.c log.h \
        md5.c md5.h \
        nntp.c nntp.h \
+       prefs.c prefs.h \
        quoted-printable.c quoted-printable.h \
        session.c session.h \
        smtp.c smtp.h \
@@ -18,6 +18,7 @@ libsylpheedcommon_la_SOURCES = \
        sylpheed.c sylpheed.h \
        template.c template.h \
        utils.c utils.h \
+       version.h \
        uuencode.c uuencode.h
 
 INCLUDES = \
diff --git a/src/common/prefs.c b/src/common/prefs.c
new file mode 100644 (file)
index 0000000..0238fb0
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2002 Hiroyuki Yamamoto
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <glib.h>
+
+#include "prefs.h"
+#include "utils.h"
+
+PrefFile *prefs_write_open(const gchar *path)
+{
+       PrefFile *pfile;
+       gchar *tmppath;
+       FILE *fp;
+
+       g_return_val_if_fail(path != NULL, NULL);
+
+       if (prefs_is_readonly(path)) {
+               g_warning("no permission - %s\n", path);
+               return NULL;
+       }
+
+       tmppath = g_strconcat(path, ".tmp", NULL);
+       if ((fp = fopen(tmppath, "wb")) == NULL) {
+               FILE_OP_ERROR(tmppath, "fopen");
+               g_free(tmppath);
+               return NULL;
+       }
+
+       if (change_file_mode_rw(fp, tmppath) < 0)
+               FILE_OP_ERROR(tmppath, "chmod");
+
+       g_free(tmppath);
+
+       pfile = g_new(PrefFile, 1);
+       pfile->fp = fp;
+       pfile->path = g_strdup(path);
+
+       return pfile;
+}
+
+gint prefs_write_close(PrefFile *pfile)
+{
+       FILE *fp;
+       gchar *path;
+       gchar *tmppath;
+       gchar *bakpath = NULL;
+
+       g_return_val_if_fail(pfile != NULL, -1);
+
+       fp = pfile->fp;
+       path = pfile->path;
+       g_free(pfile);
+
+       tmppath = g_strconcat(path, ".tmp", NULL);
+       if (fclose(fp) == EOF) {
+               FILE_OP_ERROR(tmppath, "fclose");
+               unlink(tmppath);
+               g_free(path);
+               g_free(tmppath);
+               return -1;
+       }
+
+       if (is_file_exist(path)) {
+               bakpath = g_strconcat(path, ".bak", NULL);
+               if (rename(path, bakpath) < 0) {
+                       FILE_OP_ERROR(path, "rename");
+                       unlink(tmppath);
+                       g_free(path);
+                       g_free(tmppath);
+                       g_free(bakpath);
+                       return -1;
+               }
+       }
+
+       if (rename(tmppath, path) < 0) {
+               FILE_OP_ERROR(tmppath, "rename");
+               unlink(tmppath);
+               g_free(path);
+               g_free(tmppath);
+               g_free(bakpath);
+               return -1;
+       }
+
+       g_free(path);
+       g_free(tmppath);
+       g_free(bakpath);
+       return 0;
+}
+
+gint prefs_write_close_revert(PrefFile *pfile)
+{
+       gchar *tmppath;
+
+       g_return_val_if_fail(pfile != NULL, -1);
+
+       tmppath = g_strconcat(pfile->path, ".tmp", NULL);
+       fclose(pfile->fp);
+       if (unlink(tmppath) < 0) FILE_OP_ERROR(tmppath, "unlink");
+       g_free(tmppath);
+       g_free(pfile->path);
+       g_free(pfile);
+
+       return 0;
+}
+
+gboolean prefs_is_readonly(const gchar * path)
+{
+       if (path == NULL)
+               return TRUE;
+
+       return (access(path, W_OK) != 0 && access(path, F_OK) == 0);
+}
+
+gboolean prefs_rc_is_readonly(const gchar * rcfile)
+{
+       gboolean result;
+       gchar * rcpath;
+
+       if (rcfile == NULL)
+               return TRUE;
+
+       rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, rcfile, NULL);
+       result = prefs_is_readonly(rcpath);
+       g_free(rcpath);
+
+       return result;
+}
diff --git a/src/common/prefs.h b/src/common/prefs.h
new file mode 100644 (file)
index 0000000..a66b380
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2002 Hiroyuki Yamamoto
+ *
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef PREFS_H
+#define PREFS_H 1
+
+#include <stdio.h>
+
+typedef struct _PrefFile       PrefFile;
+
+struct _PrefFile {
+       FILE *fp;
+       gchar *path;
+};
+
+PrefFile *prefs_write_open     (const gchar    *path);
+gint prefs_write_close         (PrefFile       *pfile);
+gint prefs_write_close_revert  (PrefFile       *pfile);
+gboolean prefs_is_readonly     (const gchar    *path);
+gboolean prefs_rc_is_readonly  (const gchar    *rcfile);
+
+#endif
index ce3adf9..20a4b0c 100644 (file)
@@ -29,7 +29,7 @@
 #include "procheader.h"
 #include "matcher.h"
 #include "filtering.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "compose.h"
 
 #define PREFSBUFSIZE           1024
index de8a42c..962fd20 100644 (file)
@@ -41,7 +41,7 @@
 #include "utils.h"
 #include "xml.h"
 #include "codeconv.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "account.h"
 #include "filtering.h"
 #include "scoring.h"
index 295a63e..8a0427d 100644 (file)
@@ -27,7 +27,7 @@
 #include "matcher.h"
 #include "intl.h"
 #include "matcher_parser.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 
 struct _MatchParser {
        gint id;
index d7f512f..b54b383 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "intl.h"
 #include "main.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "prefs_account.h"
 #include "prefs_customheader.h"
 #include "account.h"
index 9f50625..c1db9f1 100644 (file)
@@ -37,7 +37,7 @@
 #include <unistd.h>
 
 #include "intl.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "inc.h"
 #include "utils.h"
 #include "gtkutils.h"
index a31673b..6192cef 100644 (file)
@@ -36,7 +36,7 @@
 
 #include "intl.h"
 #include "main.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "prefs_common.h"
 #include "prefs_display_header.h"
 #include "prefs_summary_column.h"
index d460c21..de70575 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "intl.h"
 #include "main.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "prefs_customheader.h"
 #include "prefs_common.h"
 #include "prefs_account.h"
index 4e09762..a210f98 100644 (file)
@@ -32,7 +32,7 @@
 #include <errno.h>
 
 #include "intl.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "prefs_display_header.h"
 #include "prefs_common.h"
 #include "manage_window.h"
index 460fc27..504157e 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "intl.h"
 #include "main.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "prefs_matcher.h"
 #include "prefs_filtering.h"
 #include "prefs_common.h"
index 229fc9e..c7b02a6 100644 (file)
@@ -33,7 +33,7 @@
 #include "summaryview.h"
 #include "menu.h"
 #include "account.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "manage_window.h"
 #include "utils.h"
 #include "addr_compl.h"
similarity index 88%
rename from src/prefs.c
rename to src/prefs_gtk.c
index f57aea7..e6330a6 100644 (file)
@@ -31,6 +31,7 @@
 #include "intl.h"
 #include "main.h"
 #include "prefs.h"
+#include "prefs_gtk.h"
 #include "utils.h"
 #include "gtkutils.h"
 
@@ -258,103 +259,6 @@ gint prefs_write_param(PrefParam *param, FILE *fp)
        return 0;
 }
 
-PrefFile *prefs_write_open(const gchar *path)
-{
-       PrefFile *pfile;
-       gchar *tmppath;
-       FILE *fp;
-
-       g_return_val_if_fail(path != NULL, NULL);
-
-       if (prefs_is_readonly(path)) {
-               g_warning("no permission - %s\n", path);
-               return NULL;
-       }
-
-       tmppath = g_strconcat(path, ".tmp", NULL);
-       if ((fp = fopen(tmppath, "wb")) == NULL) {
-               FILE_OP_ERROR(tmppath, "fopen");
-               g_free(tmppath);
-               return NULL;
-       }
-
-       if (change_file_mode_rw(fp, tmppath) < 0)
-               FILE_OP_ERROR(tmppath, "chmod");
-
-       g_free(tmppath);
-
-       pfile = g_new(PrefFile, 1);
-       pfile->fp = fp;
-       pfile->path = g_strdup(path);
-
-       return pfile;
-}
-
-gint prefs_write_close(PrefFile *pfile)
-{
-       FILE *fp;
-       gchar *path;
-       gchar *tmppath;
-       gchar *bakpath = NULL;
-
-       g_return_val_if_fail(pfile != NULL, -1);
-
-       fp = pfile->fp;
-       path = pfile->path;
-       g_free(pfile);
-
-       tmppath = g_strconcat(path, ".tmp", NULL);
-       if (fclose(fp) == EOF) {
-               FILE_OP_ERROR(tmppath, "fclose");
-               unlink(tmppath);
-               g_free(path);
-               g_free(tmppath);
-               return -1;
-       }
-
-       if (is_file_exist(path)) {
-               bakpath = g_strconcat(path, ".bak", NULL);
-               if (rename(path, bakpath) < 0) {
-                       FILE_OP_ERROR(path, "rename");
-                       unlink(tmppath);
-                       g_free(path);
-                       g_free(tmppath);
-                       g_free(bakpath);
-                       return -1;
-               }
-       }
-
-       if (rename(tmppath, path) < 0) {
-               FILE_OP_ERROR(tmppath, "rename");
-               unlink(tmppath);
-               g_free(path);
-               g_free(tmppath);
-               g_free(bakpath);
-               return -1;
-       }
-
-       g_free(path);
-       g_free(tmppath);
-       g_free(bakpath);
-       return 0;
-}
-
-gint prefs_write_close_revert(PrefFile *pfile)
-{
-       gchar *tmppath;
-
-       g_return_val_if_fail(pfile != NULL, -1);
-
-       tmppath = g_strconcat(pfile->path, ".tmp", NULL);
-       fclose(pfile->fp);
-       if (unlink(tmppath) < 0) FILE_OP_ERROR(tmppath, "unlink");
-       g_free(tmppath);
-       g_free(pfile->path);
-       g_free(pfile);
-
-       return 0;
-}
-
 void prefs_set_default(PrefParam *param)
 {
        gint i;
@@ -787,26 +691,3 @@ void prefs_set_spinbtn(PrefParam *pparam)
                          pparam->type);
        }
 }
-
-gboolean prefs_is_readonly(const gchar * path)
-{
-       if (path == NULL)
-               return TRUE;
-
-       return (access(path, W_OK) != 0 && access(path, F_OK) == 0);
-}
-
-gboolean prefs_rc_is_readonly(const gchar * rcfile)
-{
-       gboolean result;
-       gchar * rcpath;
-
-       if (rcfile == NULL)
-               return TRUE;
-
-       rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, rcfile, NULL);
-       result = prefs_is_readonly(rcpath);
-       g_free(rcpath);
-
-       return result;
-}
similarity index 95%
rename from src/prefs.h
rename to src/prefs_gtk.h
index 18291c2..f5de74f 100644 (file)
@@ -17,8 +17,8 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#ifndef __PREFS_H__
-#define __PREFS_H__
+#ifndef __PREFS_GTK_H__
+#define __PREFS_GTK_H__
 
 #include <glib.h>
 #include <gtk/gtkwidget.h>
@@ -30,9 +30,9 @@
 #include <stdio.h>
 
 typedef struct _PrefParam      PrefParam;
-typedef struct _PrefFile       PrefFile;
 typedef struct _PrefsDialog    PrefsDialog;
 
+#include "prefs.h"
 #include "account.h"
 
 #define VSPACING               10
@@ -65,11 +65,6 @@ struct _PrefParam {
        WidgetSetFunc  widget_set_func;
 };
 
-struct _PrefFile {
-       FILE *fp;
-       gchar *path;
-};
-
 struct _PrefsDialog 
 {
        GtkWidget *window;
@@ -171,7 +166,5 @@ void prefs_set_data_from_toggle     (PrefParam      *pparam);
 void prefs_set_toggle          (PrefParam      *pparam);
 void prefs_set_data_from_spinbtn(PrefParam     *pparam);
 void prefs_set_spinbtn         (PrefParam      *pparam);
-gboolean prefs_is_readonly(const gchar * path);
-gboolean prefs_rc_is_readonly(const gchar * rcfile);
 
 #endif /* __PREFS_H__ */
index a810068..d3eba5f 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "intl.h"
 #include "main.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "prefs_matcher.h"
 #include "prefs_common.h"
 #include "mainwindow.h"
index 6f85c18..c8cd52b 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "intl.h"
 #include "main.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "prefs_matcher.h"
 #include "prefs_scoring.h"
 #include "prefs_common.h"
index b06026a..ff270a6 100644 (file)
@@ -33,7 +33,7 @@
 #include <gdk/gdkkeysyms.h>
 
 #include "intl.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "prefs_common.h"
 #include "prefs_summary_column.h"
 #include "manage_window.h"
index e481db5..5b2d569 100644 (file)
@@ -46,7 +46,7 @@
 #  include "rfc2015.h"
 #endif
 
-#include "prefs.h"
+#include "prefs_gtk.h"
 
 static GHashTable *procmime_get_mime_type_table        (void);
 
index 34e2e97..cdba6c3 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "intl.h"
 #include "main.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "account.h"
 #include "mainwindow.h"
 #include "manage_window.h"
index e9f2dc5..c78741d 100644 (file)
@@ -41,7 +41,7 @@
 #include "utils.h"
 #include "xml.h"
 #include "mgutils.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "codeconv.h"
 #include "stock_pixmap.h"
 #include "manage_window.h"