+2001-08-29
+
+ * src/compose.c: compose_queue(): added AID: to the queueing header.
+ * src/send.c: send_message_queue(): look for AID: header, and use
+ the server specified in the account instead of SSV: header.
+
+2001-08-28
+
+ * applied the XML string table patch from Alfons Hoogervorst that
+ stores strings in a hash table and minimizes memory allocations
+ (thanks!).
+ * src/stringtable.[ch]: new.
+ removed all G and g_ prefix from type and function names since
+ they're not official GLib symbol names.
+ string_table_insert_string(): fixed a bug that might refer to an
+ invalid pointer on lookup, and also made a bit of optimization.
+
2001-08-27
* merged the color label feature from the claws branch (thanks to
* src/summaryview.[ch]: added color label support.
* src/procmsg.h: added color label flags to the permanent flags.
* updated to gettext 0.10.39.
+ * src/summaryview.[ch]: put the color label menu item to ItemFactory.
+ * sylpheed.desktop: added for GNOME.
+ * configure.in: added AC_MSG_CHECKING() for some options.
+ Output the configuration results when configure is finished.
2001-08-27
+2001-08-29 [paul]
+
+ * configure.in
+ change to version 0.5.3claws6
+
+ * sync with sylpheed 0.5.3cvs10
+ src/stringtable.[ch]: New Files
+
2001-08-27 [paul]
* src/mainwindow.c
+2001-08-29
+
+ * src/compose.c: compose_queue(): ¥¥å¡¼¥¤¥ó¥°¥Ø¥Ã¥À¤Ë AID: ¤òÄɲá£
+ * src/send.c: send_message_queue(): AID: ¥Ø¥Ã¥À¤òõ¤·¡¢ SSV: ¤Î
+ Âå¤ï¤ê¤Ë¥¢¥«¥¦¥ó¥È¤Ç»ØÄꤵ¤ì¤¿¥µ¡¼¥Ð¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+
+2001-08-28
+
+ * ʸ»úÎó¤ò¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ËÊݸ¤·¡¢¥á¥â¥ê³ÎÊݤòºÇ¾®²½¤¹¤ë Alfons
+ Hoogervorst ¤µ¤ó¤«¤é¤Î XML string table ¥Ñ¥Ã¥Á¤òŬÍÑ(thanks!)¡£
+ * src/stringtable.[ch]: ¿·µ¬¡£
+ official ¤Ê GLib ¤Î¥·¥ó¥Ü¥ë̾¤Ç¤Ï¤Ê¤¤¤¿¤á·¿¤È´Ø¿ô̾¤«¤éÁ´¤Æ¤Î
+ G ¤È g_ ¥×¥ì¥Õ¥£¥¯¥¹¤òºï½ü¡£
+ string_table_insert_string(): ¸¡º÷»þ¤Ë̵¸ú¤Ê¥Ý¥¤¥ó¥¿¤ò»²¾È¤¹¤ë
+ ²ÄǽÀ¤Î¤¢¤Ã¤¿¥Ð¥°¤ò½¤Àµ¤·¡¢¤Þ¤¿¾¯¤·ºÇŬ²½¤·¤¿¡£
+
2001-08-27
* claws ¥Ö¥é¥ó¥Á¤«¤é¥«¥é¡¼¥é¥Ù¥ëµ¡Ç½¤ò¥Þ¡¼¥¸(Satoshi Nagayasu ¤µ¤ó
* src/summaryview.[ch]: ¥«¥é¡¼¥é¥Ù¥ë¤ËÂбþ¡£
* src/procmsg.h: ±Ê³¥Õ¥é¥°¤Ë¥«¥é¡¼¥é¥Ù¥ë¥Õ¥é¥°¤òÄɲá£
* gettext 0.10.39 ¤Ë¹¹¿·¡£
+ * src/summaryview.[ch]: ¥«¥é¡¼¥é¥Ù¥ë¤Î¥á¥Ë¥å¡¼¹àÌܤò ItemFactory
+ ¤ËÃÖ¤¤¤¿¡£
+ * sylpheed.desktop: GNOME ÍѤËÄɲá£
+ * configure.in: ¤¤¤¯¤Ä¤«¤Î¥ª¥×¥·¥ç¥ó¤Ë AC_MSG_CHECKING() ¤òÄɲá£
+ configure ¤¬´°Î»¤·¤¿¤È¤¤ËÀßÄê·ë²Ì¤ò½ÐÎϤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
2001-08-27
MICRO_VERSION=3
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws5
+EXTRA_VERSION=claws6
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl
AC_ARG_ENABLE(gpgme,
[ --enable-gpgme Enable GnuPG support using GPGME [default=no]],
[ac_cv_enable_gpgme=$enableval], [ac_cv_enable_gpgme=no])
+AC_MSG_CHECKING([whether to use GPGME])
if test $ac_cv_enable_gpgme = yes; then
- AM_PATH_GPGME(0.2.1, AC_DEFINE(USE_GPGME), [use_gpgme=no])
+ AC_MSG_RESULT(yes)
+ AM_PATH_GPGME(0.2.1, AC_DEFINE(USE_GPGME), [use_gpgme=no
+ ac_cv_enable_gpgme=no])
+else
+ AC_MSG_RESULT(no)
fi
-dnl Use OpenSSL for SSL connections
-AC_MSG_CHECKING([whether to use ssl])
+dnl Check for OpenSSL
AC_ARG_ENABLE(ssl,
[ --enable-ssl Enable SSL support using OpenSSL [default=no]],
[ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=no])
+AC_MSG_CHECKING([whether to use OpenSSL])
if test $ac_cv_enable_ssl = yes; then
AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
-fi
-
-if test $ac_cv_enable_ssl = yes; then
- AC_MSG_CHECKING([whether to openssl is available])
- LIBS="$LIBS -lssl"
+ AC_MSG_CHECKING([if openssl is available])
+ LIBS="$LIBS -lssl -lcrypto"
AC_TRY_LINK([
#include <openssl/opensslv.h>
-], [ return(OPENSSL_VERSION_NUMBER); ],
+], [ return OPENSSL_VERSION_NUMBER; ],
[ AC_MSG_RESULT(yes)
AC_DEFINE(USE_SSL) ],
- [ AC_MSG_RESULT(no)
+ [ AC_MSG_RESULT(no)
LIBS="$ac_save_LIBS" ])
+else
+ AC_MSG_RESULT(no)
fi
dnl Check for X-Face support
[ --disable-compface Do not use compface (X-Face)],
[ac_cv_disable_compface=disable], [ac_cv_disable_compface=no])
if test "$ac_cv_disable_compface" = no; then
- AC_CHECK_LIB(compface, uncompface)
+ AC_CHECK_LIB(compface, uncompface,,[ac_cv_disable_compface=disable])
fi
dnl for JPilot support in addressbook
[ --disable-jconv Do not use libjconv],
[ac_cv_disable_jconv=disable], [ac_cv_disable_jconv=no])
if test "$ac_cv_disable_jconv" = no; then
- AC_CHECK_LIB(jconv, jconv_alloc_conv)
+ AC_CHECK_LIB(jconv, jconv_alloc_conv,,[ac_cv_disable_jconv=disable])
fi
AC_CHECK_LIB(xpg4, setlocale)
dnl AC_CHECK_LIB(kcc, KCC_filter)
-dnl for GThread support
+dnl for GThread support (currently disabled)
dnl AC_ARG_ENABLE(threads,
dnl [ --enable-threads Enable multithread support [default=no]],
dnl [use_threads=$enableval], [use_threads=no])
[ac_cv_enableipv6=$enableval], [ac_cv_enableipv6=no])
dnl automated checks for IPv6 support.
+AC_MSG_CHECKING([whether to use IPv6])
if test x"$ac_cv_enableipv6" = xyes; then
+ AC_MSG_RESULT(yes)
AC_MSG_CHECKING([for IPv6 support])
AC_CACHE_VAL(ac_cv_ipv6,[
AC_TRY_COMPILE([#define INET6
AC_MSG_RESULT($ac_cv_ipv6)
if test $ac_cv_ipv6 = yes; then
AC_DEFINE(INET6)
+ else
+ AC_MSG_WARN(*** IPv6 will not be supported ***)
+ ac_cv_enableipv6=no
fi
+else
+ AC_MSG_RESULT(no)
fi
dnl check if gdk / gtk was compiled with USE_XIM
libkcc/Makefile
src/Makefile
manual/Makefile
-manual/ja/Makefile
manual/en/Makefile
+manual/ja/Makefile
])
+
+dnl Output the configuration summary
+echo ""
+echo "$PACKAGE $VERSION"
+echo ""
+if test "$ac_cv_disable_gdk_pixbuf" = no; then
+ echo "gdk-pixbuf : yes"
+ echo "gdk_imlib : no"
+else
+ echo "gdk-pixbuf : no"
+ if test "$ac_cv_disable_imlib" = no; then
+ echo "gdk_imlib : yes"
+ else
+ echo "gdk_imlib : no"
+ fi
+fi
+echo "GPGME : $ac_cv_enable_gpgme"
+echo "OpenSSL : $ac_cv_enable_ssl"
+if test "$ac_cv_disable_compface" = no; then
+ echo "compface : yes"
+else
+ echo "compface : no"
+fi
+if test "$ac_cv_disable_jconv" = no; then
+ echo "libjconv : yes"
+else
+ echo "libjconv : no"
+fi
+echo "IPv6 : $ac_cv_enableipv6"
+echo ""
+echo "The binary will be installed in $prefix/bin"
+echo ""
+echo "Configure finished, type 'make' to build."
src/automaton.c
src/base64.c
src/codeconv.c
+src/colorlabel.c
src/compose.c
src/editjpilot.c
src/editldap.c
src/import.c
src/inc.c
src/inputdialog.c
-src/labelcolors.c
src/logwindow.c
src/main.c
src/mainwindow.c
sigstatus.c sigstatus.h \
simple-gettext.c \
manual.c manual.h \
+ stringtable.c stringtable.h \
gtkstext.c gtkstext.h \
scoring.c scoring.h \
prefs_folder_item.c prefs_folder_item.h \
for (cur = compose->to_list->next; cur != NULL; cur = cur->next)
fprintf(fp, ",<%s>", (gchar *)cur->data);
fprintf(fp, "\n");
+ /* Sylpheed account ID */
+ fprintf(fp, "AID:%d\n", compose->account->account_id);
fprintf(fp, "\n");
while (fgets(buf, sizeof(buf), src_fp) != NULL) {
#include "folder.h"
#include "filtering.h"
#include "addr_compl.h"
-#include "labelcolors.h"
+#include "colorlabel.h"
static struct Filtering {
GtkWidget *window;
{
Q_SENDER = 0,
Q_SMTPSERVER = 1,
- Q_RECIPIENTS = 2
+ Q_RECIPIENTS = 2,
+ Q_ACCOUNT_ID = 3
};
static gint send_message_with_command(GSList *to_list, gchar * mailcmd,
static HeaderEntry qentry[] = {{"S:", NULL, FALSE},
{"SSV:", NULL, FALSE},
{"R:", NULL, FALSE},
+ {"AID:", NULL, FALSE},
{NULL, NULL, FALSE}};
FILE *fp;
gint val;
GSList *to_list = NULL;
gchar buf[BUFFSIZE];
gint hnum;
+ PrefsAccount *ac = NULL;
g_return_val_if_fail(file != NULL, -1);
case Q_RECIPIENTS:
to_list = address_list_append(to_list, p);
break;
+ case Q_ACCOUNT_ID:
+ ac = account_find_from_id(atoi(p));
+ break;
default:
}
}
- if (!to_list || !from || !server) {
+ if (!to_list || !from) {
g_warning(_("Queued message header is broken.\n"));
val = -1;
} else {
gushort port;
gchar *domain;
- PrefsAccount *ac;
- ac = account_find_from_smtp_server(from, server);
if (!ac) {
- g_warning(_("Account not found. Using current account...\n"));
- ac = cur_account;
+ ac = account_find_from_smtp_server(from, server);
+ if (!ac) {
+ g_warning(_("Account not found. "
+ "Using current account...\n"));
+ ac = cur_account;
+ }
}
if (ac) {
domain = ac->set_domain ? ac->domain : NULL;
#if USE_SSL
val = send_message_smtp
- (to_list, from, server, port, domain,
+ (to_list, from, ac->smtp_server, port, domain,
ac->userid, ac->passwd, ac->use_smtp_auth,
ac->ssl_smtp, fp);
#else
val = send_message_smtp
- (to_list, from, server, port, domain,
+ (to_list, from, ac->smtp_server, port, domain,
ac->userid, ac->passwd, ac->use_smtp_auth, fp);
#endif
} else {
--- /dev/null
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2001 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.
+ */
+
+#include <glib.h>
+#include <string.h>
+
+#include "stringtable.h"
+#include "utils.h"
+
+/* alfons - hashed string table (I wasn't content with GStringChunk;
+ * can't recall why :-) */
+
+#define XXX_DEBUG \
+ debug_print
+
+typedef struct StringEntry_ {
+ gint ref_count;
+ gchar *string;
+} StringEntry;
+
+static StringEntry *string_entry_new(const gchar *str)
+{
+ StringEntry *entry;
+
+ entry = g_new0(StringEntry, 1);
+ entry->ref_count = 1;
+ entry->string = g_strdup(str);
+ return entry;
+}
+
+static void string_entry_free(StringEntry *entry)
+{
+ g_return_if_fail(entry != NULL);
+ g_return_if_fail(entry->string);
+
+ g_free(entry->string);
+ g_free(entry);
+}
+
+StringTable *string_table_new(void)
+{
+ StringTable *strtable;
+
+ strtable = g_new0(StringTable, 1);
+ g_return_val_if_fail(strtable != NULL, NULL);
+ strtable->hash_table = g_hash_table_new(g_str_hash, g_str_equal);
+ g_return_val_if_fail(strtable->hash_table, NULL);
+ return strtable;
+}
+
+gchar *string_table_lookup_string(StringTable *table, gchar *str)
+{
+ StringEntry *entry = g_hash_table_lookup(table->hash_table,
+ (gconstpointer)str);
+ if (!entry) {
+ return NULL;
+ } else {
+ return entry->string;
+ }
+}
+
+gchar *string_table_insert_string(StringTable *table, gchar *str)
+{
+ gchar *key = NULL;
+ StringEntry *entry = NULL;
+
+ if (g_hash_table_lookup_extended
+ (table->hash_table, str, (gpointer *)&key, (gpointer *)&entry)) {
+ entry->ref_count++;
+ XXX_DEBUG ("ref++ for %s (%d)\n", entry->string, entry->ref_count);
+ } else {
+ entry = string_entry_new(str);
+ XXX_DEBUG ("inserting %s\n", str);
+ /* insert entry->string instead of str, since it can be
+ * invalid pointer after this. */
+ g_hash_table_insert(table->hash_table, entry->string, entry);
+ }
+
+ return entry->string;
+}
+
+void string_table_free_string(StringTable *table, gchar *str)
+{
+ StringEntry *entry;
+
+ entry = g_hash_table_lookup(table->hash_table, str);
+
+ if (entry) {
+ entry->ref_count--;
+ if (entry->ref_count <= 0) {
+ XXX_DEBUG ("refcount of string %s dropped to zero\n", entry->string);
+ g_hash_table_remove(table->hash_table, str);
+ g_free(entry->string);
+ g_free(entry);
+ } else {
+ XXX_DEBUG ("ref-- for %s (%d)\n", entry->string, entry->ref_count);
+ }
+ }
+}
+
+static gboolean string_table_remove_for_each_fn(gchar *key, StringEntry *entry,
+ gpointer user_data)
+{
+ g_return_val_if_fail(key != NULL, TRUE);
+ g_return_val_if_fail(entry != NULL, TRUE);
+
+ g_free(entry->string);
+ g_free(entry);
+
+ return TRUE;
+}
+
+void string_table_free(StringTable *table)
+{
+ g_return_if_fail(table != NULL);
+ g_return_if_fail(table->hash_table != NULL);
+
+ g_hash_table_foreach_remove(table->hash_table,
+ (GHRFunc)string_table_remove_for_each_fn,
+ NULL);
+ g_hash_table_destroy(table->hash_table);
+ g_free(table);
+}
+
+static void string_table_stats_for_each_fn(gchar *key, StringEntry *entry,
+ guint *totals)
+{
+ if (entry->ref_count > 1) {
+ *totals += strlen(key) * (entry->ref_count - 1);
+ }
+}
+
+void string_table_get_stats(StringTable *table)
+{
+ guint totals = 0;
+
+ g_hash_table_foreach(table->hash_table,
+ (GHFunc)string_table_stats_for_each_fn, &totals);
+ XXX_DEBUG ("TOTAL UNSPILLED %d (%dK)\n", totals, totals / 1024);
+}
--- /dev/null
+/*
+ * sylpheed -- a gtk+ based, lightweight, and fast e-mail client
+ * copyright (c) 1999-2001 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 STRINGTABLE_H__
+#define STRINGTABLE_H__
+
+#include <glib.h>
+
+typedef struct {
+ GHashTable *hash_table;
+} StringTable;
+
+StringTable *string_table_new (void);
+void string_table_free (StringTable *table);
+
+gchar *string_table_lookup_string (StringTable *table, gchar *str);
+gchar *string_table_insert_string (StringTable *table, gchar *str);
+void string_table_free_string (StringTable *table, gchar *str);
+
+void string_table_get_stats (StringTable *table);
+
+#endif /* STRINGTABLE_H__ */
#endif
{N_("/_Mark/Ignore thread"), NULL, summary_ignore_thread, 0, NULL},
{N_("/_Mark/Unignore thread"), NULL, summary_unignore_thread, 0, NULL},
+ {N_("/Color la_bel"), NULL, NULL, 0, NULL},
{N_("/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Reply"), NULL, summary_reply_cb, COMPOSE_REPLY, NULL},
}
if (summaryview->folder_item->folder->type != F_NEWS) {
- if (summaryview->folder_item->stype != F_TRASH)
- menu_set_sensitive(ifactory, "/Delete", TRUE);
menu_set_sensitive(ifactory, "/Move...", TRUE);
menu_set_sensitive(ifactory, "/Copy...", TRUE);
+ if (summaryview->folder_item->stype != F_TRASH)
+ menu_set_sensitive(ifactory, "/Delete", TRUE);
}
- gtk_widget_set_sensitive(summaryview->colorlabel_menu_item, TRUE);
menu_set_sensitive(ifactory, "/Execute", TRUE);
+ menu_set_sensitive(ifactory, "/Mark", TRUE);
+ menu_set_sensitive(ifactory, "/Mark/Mark", TRUE);
+ menu_set_sensitive(ifactory, "/Mark/Unmark", TRUE);
+
+ menu_set_sensitive(ifactory, "/Mark/Mark as unread", TRUE);
+ menu_set_sensitive(ifactory, "/Mark/Mark as read", TRUE);
+#if MARK_ALL_READ
+ menu_set_sensitive(ifactory, "/Mark/Mark all read", TRUE);
+#endif
+ menu_set_sensitive(ifactory, "/Mark/Ignore thread", TRUE);
+ menu_set_sensitive(ifactory, "/Mark/Unignore thread", TRUE);
+
+ menu_set_sensitive(ifactory, "/Color label", TRUE);
+
sens = (selection == SUMMARY_SELECTED_MULTIPLE) ? FALSE : TRUE;
menu_set_sensitive(ifactory, "/Reply", sens);
menu_set_sensitive(ifactory, "/Reply to sender", sens);
menu_set_sensitive(ifactory, "/Save as...", sens);
menu_set_sensitive(ifactory, "/Print...", TRUE);
- menu_set_sensitive(ifactory, "/Mark", TRUE);
-
- menu_set_sensitive(ifactory, "/Mark/Mark", TRUE);
- menu_set_sensitive(ifactory, "/Mark/Unmark", TRUE);
-
- menu_set_sensitive(ifactory, "/Mark/Mark as unread", TRUE);
- menu_set_sensitive(ifactory, "/Mark/Mark as read", TRUE);
-#if MARK_ALL_READ
- menu_set_sensitive(ifactory, "/Mark/Mark all read", TRUE);
-#endif
- menu_set_sensitive(ifactory, "/Mark/Ignore thread", TRUE);
- menu_set_sensitive(ifactory, "/Mark/Unignore thread", TRUE);
-
menu_set_sensitive(ifactory, "/Select all", TRUE);
if (summaryview->folder_item->folder->account)
/* color label */
-#define LABEL_COLORS_ELEMS colorlabel_get_color_count()
+#define N_COLOR_LABELS colorlabel_get_color_count()
static void summary_colorlabel_menu_item_activate_cb(GtkWidget *widget,
gpointer data)
prev_style = ctree_style;
style = gtk_style_copy(prev_style);
- if (color_index < 0 || color_index >= LABEL_COLORS_ELEMS) {
+ if (color_index < 0 || color_index >= N_COLOR_LABELS) {
color_index = 0;
color.red = ctree_style->fg[GTK_STATE_NORMAL].red;
color.green = ctree_style->fg[GTK_STATE_NORMAL].green;
labelcolor);
}
-static void summary_colorlabel_menu_item_activate_item_cb(GtkMenuItem *label_menu_item,
+static void summary_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_item,
gpointer data)
{
SummaryView *summaryview;
- GtkMenuShell *label_menu;
+ GtkMenuShell *menu;
GtkCheckMenuItem **items;
gint n;
GList *cur, *sel;
sel = GTK_CLIST(summaryview->ctree)->selection;
if (!sel) return;
- label_menu = GTK_MENU_SHELL(summaryview->colorlabel_menu);
- g_return_if_fail(label_menu != NULL);
+ menu = GTK_MENU_SHELL(summaryview->colorlabel_menu);
+ g_return_if_fail(menu != NULL);
- Xalloca(items, (LABEL_COLORS_ELEMS + 1) * sizeof(GtkWidget *), return);
+ Xalloca(items, (N_COLOR_LABELS + 1) * sizeof(GtkWidget *), return);
/* NOTE: don't return prematurely because we set the "dont_toggle"
* state for check menu items */
- gtk_object_set_data(GTK_OBJECT(label_menu), "dont_toggle",
+ gtk_object_set_data(GTK_OBJECT(menu), "dont_toggle",
GINT_TO_POINTER(1));
/* clear items. get item pointers. */
- for (n = 0, cur = label_menu->children; cur != NULL; cur = cur->next) {
+ for (n = 0, cur = menu->children; cur != NULL; cur = cur->next) {
if (GTK_IS_CHECK_MENU_ITEM(cur->data)) {
gtk_check_menu_item_set_state
(GTK_CHECK_MENU_ITEM(cur->data), FALSE);
}
}
- if (n == (LABEL_COLORS_ELEMS + 1)) {
+ if (n == (N_COLOR_LABELS + 1)) {
/* iterate all messages and set the state of the appropriate
* items */
for (; sel != NULL; sel = sel->next) {
MsgInfo *msginfo;
- gint menu_item;
+ gint clabel;
msginfo = gtk_ctree_node_get_row_data
(GTK_CTREE(summaryview->ctree),
GTK_CTREE_NODE(sel->data));
if (msginfo) {
- menu_item = MSG_GET_COLORLABEL_VALUE(msginfo->flags);
- if (!items[menu_item]->active)
+ clabel = MSG_GET_COLORLABEL_VALUE(msginfo->flags);
+ if (!items[clabel]->active)
gtk_check_menu_item_set_state
- (items[menu_item], TRUE);
+ (items[clabel], TRUE);
}
}
} else
g_warning("invalid number of color elements (%d)\n", n);
/* reset "dont_toggle" state */
- gtk_object_set_data(GTK_OBJECT(label_menu), "dont_toggle",
+ gtk_object_set_data(GTK_OBJECT(menu), "dont_toggle",
GINT_TO_POINTER(0));
}
static void summary_colorlabel_menu_create(SummaryView *summaryview)
{
- const gint LABEL_MENU_POS = 5;
- GtkWidget *label_menu_item;
- GtkWidget *label_menu;
+ GtkWidget *label_menuitem;
+ GtkWidget *menu;
GtkWidget *item;
gint i;
- label_menu_item = gtk_menu_item_new_with_label(_("Color label"));
- gtk_menu_insert(GTK_MENU(summaryview->popupmenu), label_menu_item,
- LABEL_MENU_POS);
- gtk_signal_connect(GTK_OBJECT(label_menu_item), "activate",
+ label_menuitem = gtk_item_factory_get_item(summaryview->popupfactory,
+ "/Color label");
+ gtk_signal_connect(GTK_OBJECT(label_menuitem), "activate",
GTK_SIGNAL_FUNC(summary_colorlabel_menu_item_activate_item_cb),
summaryview);
- gtk_widget_show(label_menu_item);
- summaryview->colorlabel_menu_item = label_menu_item;
+ gtk_widget_show(label_menuitem);
- label_menu = gtk_menu_new();
+ menu = gtk_menu_new();
/* create sub items. for the menu item activation callback we pass the
* index of label_colors[] as data parameter. for the None color we
* can always get back the SummaryView pointer. */
item = gtk_check_menu_item_new_with_label(_("None"));
- gtk_menu_append(GTK_MENU(label_menu), item);
+ gtk_menu_append(GTK_MENU(menu), item);
gtk_signal_connect(GTK_OBJECT(item), "activate",
GTK_SIGNAL_FUNC(summary_colorlabel_menu_item_activate_cb),
GUINT_TO_POINTER(0));
gtk_widget_show(item);
item = gtk_menu_item_new();
- gtk_menu_append(GTK_MENU(label_menu), item);
+ gtk_menu_append(GTK_MENU(menu), item);
gtk_widget_show(item);
/* create pixmap/label menu items */
- for (i = 0; i < LABEL_COLORS_ELEMS; i++) {
+ for (i = 0; i < N_COLOR_LABELS; i++) {
item = colorlabel_create_check_color_menu_item(i);
- gtk_menu_append(GTK_MENU(label_menu), item);
+ gtk_menu_append(GTK_MENU(menu), item);
gtk_signal_connect(GTK_OBJECT(item), "activate",
GTK_SIGNAL_FUNC(summary_colorlabel_menu_item_activate_cb),
GUINT_TO_POINTER(i + 1));
gtk_widget_show(item);
}
- gtk_widget_show(label_menu);
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(label_menu_item), label_menu);
- summaryview->colorlabel_menu = label_menu;
+ gtk_widget_show(menu);
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(label_menuitem), menu);
+ summaryview->colorlabel_menu = menu;
}
/* callback functions */
GtkWidget *toggle_arrow;
GtkWidget *popupmenu;
GtkWidget *colorlabel_menu;
- GtkWidget *colorlabel_menu_item;
GtkItemFactory *popupfactory;
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 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
#include <ctype.h>
#include "xml.h"
+#include "main.h"
#include "utils.h"
+#define SPARSE_MEMORY
+/* if this is defined all attr.names and tag.names are stored
+ * in a hash table */
+#if defined(SPARSE_MEMORY)
+#include "stringtable.h"
+
+static StringTable *xml_string_table;
+
+static void xml_string_table_create(void)
+{
+ if (xml_string_table == NULL)
+ xml_string_table = string_table_new();
+}
+#define XML_STRING_ADD(str) \
+ string_table_insert_string(xml_string_table, (str))
+#define XML_STRING_FREE(str) \
+ string_table_free_string(xml_string_table, (str))
+
+#define XML_STRING_TABLE_CREATE() \
+ xml_string_table_create()
+
+#else /* !SPARSE_MEMORY */
+
+#define XML_STRING_ADD(str) \
+ g_strdup(str)
+#define XML_STRING_FREE(str) \
+ g_free(str)
+
+#define XML_STRING_TABLE_CREATE()
+
+#endif /* SPARSE_MEMORY */
+
static void xml_free_tag (XMLTag *tag);
static gint xml_get_parenthesis (XMLFile *file,
gchar *buf,
g_return_val_if_fail(path != NULL, NULL);
+ XML_STRING_TABLE_CREATE();
+
newfile = g_new(XMLFile, 1);
newfile->fp = fopen(path, "r");
node = xml_build_tree(file, NULL, file->level);
xml_close_file(file);
+
+#if defined(SPARSE_MEMORY)
+ if (debug_mode)
+ string_table_get_stats(xml_string_table);
+#endif
+
return node;
}
while (*bufp != '\0' && !isspace(*bufp)) bufp++;
if (*bufp == '\0') {
- tag->tag = g_strdup(buf);
+ tag->tag = XML_STRING_ADD(buf);
return 0;
} else {
*bufp++ = '\0';
- tag->tag = g_strdup(buf);
+ tag->tag = XML_STRING_ADD(buf);
}
/* parse attributes ( name=value ) */
xml_unescape_str(attr_value);
attr = g_new(XMLAttr, 1);
- attr->name = g_strdup(attr_name);
+ attr->name = XML_STRING_ADD(attr_name);
attr->value = g_strdup(attr_value);
- tag->attr = g_list_append(tag->attr, attr);
+ tag->attr = g_list_append(tag->attr, attr);
}
return 0;
GList *list;
new_tag = g_new(XMLTag, 1);
- new_tag->tag = g_strdup(tag->tag);
+ new_tag->tag = XML_STRING_ADD(tag->tag);
new_tag->attr = NULL;
for (list = tag->attr; list != NULL; list = list->next) {
attr = xml_copy_attr((XMLAttr *)list->data);
XMLAttr *new_attr;
new_attr = g_new(XMLAttr, 1);
- new_attr->name = g_strdup(attr->name);
+ new_attr->name = XML_STRING_ADD(attr->name);
new_attr->value = g_strdup(attr->value);
return new_attr;
{
if (!tag) return;
- g_free(tag->tag);
+ XML_STRING_FREE(tag->tag);
while (tag->attr != NULL) {
XMLAttr *attr = (XMLAttr *)tag->attr->data;
- g_free(attr->name);
+ XML_STRING_FREE(attr->name);
g_free(attr->value);
g_free(attr);
tag->attr = g_list_remove(tag->attr, tag->attr->data);
-[desktop Entry]
+[Desktop Entry]
Name=Sylpheed
-Comment=Sylpheed Mail
+Name[ja]=Sylpheed
+Comment=E-Mail client
+Comment[ja]=ÅŻҥ᡼¥ë¥¯¥é¥¤¥¢¥ó¥È
Exec=sylpheed
Icon=sylpheed.png
Terminal=0
-Type=Application
+Type=Internet