+2002-08-07
+
+ * src/socket.[ch]: fixed the linking failure when IPv6 is enabled.
+ * src/select-keys.c: modified key selection dialog.
+
+2002-08-07
+
+ * src/socket.[ch]: my_gethostbyname(): new.
+ * src/utils.c: get_domain_name(): return FQDN instead of short
+ hostname (thanks to Bob Woodside).
+ * src/template.c: made the debug messages less verbose.
+
2002-08-06
* src/prefs_common.[ch]: removed obsolete default sign key setting.
+2002-08-07 [paul] 0.8.1claws32
+
+ * sync with 0.8.1.cvs17
+ see ChangeLog 2002-08-07
+
2002-08-07 [colin] 0.8.1claws31
* src/news.c
+2002-08-07
+
+ * src/socket.[ch]: IPv6 ¤¬Í¸ú¤Ê¾ì¹ç¤Ë¥ê¥ó¥¯¤Ë¼ºÇÔ¤¹¤ë¤Î¤ò½¤Àµ¡£
+ * src/select-keys.c: ¥¡¼ÁªÂò¥À¥¤¥¢¥í¥°¤ò½¤Àµ¡£
+
+2002-08-07
+
+ * src/socket.[ch]: my_gethostbyname(): ¿·µ¬¡£
+ * src/utils.c: get_domain_name(): û¤¤¥Û¥¹¥È̾¤ÎÂå¤ï¤ê¤Ë FQDN ¤ò
+ ÊÖ¤¹¤è¤¦¤Ë¤·¤¿(Bob Woodside ¤µ¤ó thanks)¡£
+ * src/template.c: ¥Ç¥Ð¥Ã¥°¥á¥Ã¥»¡¼¥¸¤Î¾éĹÅÙ¤ò²¼¤²¤¿¡£
+
2002-08-06
* src/prefs_common.[ch]: obsolete ¤Ê¥Ç¥Õ¥©¥ë¥È½ð̾¸°¤ÎÀßÄê¤òºï½ü¡£
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws31
+EXTRA_VERSION=claws32
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target
#include "utils.h"
#include "gtkutils.h"
#include "inputdialog.h"
+#include "manage_window.h"
#define DIM(v) (sizeof(v)/sizeof((v)[0]))
#define DIMof(type,member) DIM(((type *)0)->member)
struct select_keys_s sk;
GpgmeError err;
- memset ( &sk, 0, sizeof sk);
+ memset (&sk, 0, sizeof sk);
err = gpgme_recipients_new (&sk.rset);
if (err) {
GtkWidget *scrolledwin;
GtkWidget *clist;
GtkWidget *label;
- GtkWidget *other_btn, *select_btn, *cancel_btn;
+ GtkWidget *select_btn, *cancel_btn, *other_btn;
const char *titles[N_COL_TITLES];
g_assert (!sk->window);
window = gtk_window_new (GTK_WINDOW_DIALOG);
- gtk_widget_set_usize (window, 500, 320);
+ gtk_widget_set_usize (window, 520, 280);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
gtk_window_set_title (GTK_WINDOW (window), _("Select Keys"));
gtk_window_set_modal (GTK_WINDOW (window), TRUE);
GTK_SIGNAL_FUNC (delete_event_cb), sk);
gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
GTK_SIGNAL_FUNC (key_pressed_cb), sk);
+ MANAGE_WINDOW_SIGNALS_CONNECT (window);
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_add (GTK_CONTAINER (window), vbox);
label = gtk_label_new ( "" );
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-
hbox = gtk_hbox_new (FALSE, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 2);
-
scrolledwin = gtk_scrolled_window_new (NULL, NULL);
gtk_box_pack_start (GTK_BOX (hbox), scrolledwin, TRUE, TRUE, 0);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwin),
clist = gtk_clist_new_with_titles (N_COL_TITLES, (char**)titles);
gtk_container_add (GTK_CONTAINER (scrolledwin), clist);
- gtk_clist_set_column_width (GTK_CLIST(clist), COL_ALGO, 40);
- gtk_clist_set_column_width (GTK_CLIST(clist), COL_KEYID, 60);
- gtk_clist_set_column_width (GTK_CLIST(clist), COL_NAME, 100);
- gtk_clist_set_column_width (GTK_CLIST(clist), COL_EMAIL, 100);
+ gtk_clist_set_column_width (GTK_CLIST(clist), COL_ALGO, 72);
+ gtk_clist_set_column_width (GTK_CLIST(clist), COL_KEYID, 76);
+ gtk_clist_set_column_width (GTK_CLIST(clist), COL_NAME, 130);
+ gtk_clist_set_column_width (GTK_CLIST(clist), COL_EMAIL, 130);
gtk_clist_set_column_width (GTK_CLIST(clist), COL_VALIDITY, 20);
gtk_clist_set_selection_mode (GTK_CLIST(clist), GTK_SELECTION_BROWSE);
gtk_signal_connect (GTK_OBJECT(GTK_CLIST(clist)->column[COL_NAME].button),
gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtkut_button_set_create (&bbox,
- &other_btn, _("Other"),
&select_btn, _("Select"),
- &cancel_btn, _("Cancel"));
+ &cancel_btn, _("Cancel"),
+ &other_btn, _("Other"));
gtk_box_pack_end (GTK_BOX (hbox), bbox, FALSE, FALSE, 0);
gtk_widget_grab_default (select_btn);
- gtk_signal_connect (GTK_OBJECT (other_btn), "clicked",
- GTK_SIGNAL_FUNC (other_btn_cb), sk);
gtk_signal_connect (GTK_OBJECT (select_btn), "clicked",
GTK_SIGNAL_FUNC (select_btn_cb), sk);
gtk_signal_connect (GTK_OBJECT(cancel_btn), "clicked",
GTK_SIGNAL_FUNC (cancel_btn_cb), sk);
-
+ gtk_signal_connect (GTK_OBJECT (other_btn), "clicked",
+ GTK_SIGNAL_FUNC (other_btn_cb), sk);
vbox2 = gtk_vbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, FALSE, 0);
gtk_widget_show_all (window);
+
sk->window = window;
sk->toplabel = GTK_LABEL (label);
sk->clist = GTK_CLIST (clist);
static void
open_dialog (struct select_keys_s *sk)
{
- if ( !sk->window )
+ if (!sk->window)
create_dialog (sk);
+ manage_window_set_transient (GTK_WINDOW (sk->window));
sk->okay = 0;
sk->sort_column = N_COL_TITLES; /* use an invalid value */
sk->sort_type = GTK_SORT_ASCENDING;
g_return_if_fail (sk);
uid = input_dialog ( _("Add key"),
- _("Enter another user or key ID\n"),
+ _("Enter another user or key ID:"),
NULL );
if (!uid)
return;
return ret;
}
+struct hostent *my_gethostbyname(const gchar *hostname)
+{
+ struct hostent *hp;
+ void (*prev_handler)(gint);
+ guint timeout_secs = IO_TIMEOUT;
+
+ alarm(0);
+ prev_handler = signal(SIGALRM, timeout_handler);
+ if (sigsetjmp(jmpenv, 1)) {
+ alarm(0);
+ signal(SIGALRM, prev_handler);
+ fprintf(stderr, "%s: host lookup timed out.\n", hostname);
+ errno = 0;
+ return NULL;
+ }
+ alarm(timeout_secs);
+
+ if ((hp = gethostbyname(hostname)) == NULL) {
+ alarm(0);
+ signal(SIGALRM, prev_handler);
+ fprintf(stderr, "%s: unknown host.\n", hostname);
+ errno = 0;
+ return NULL;
+ }
+
+ alarm(0);
+ signal(SIGALRM, prev_handler);
+
+ return hp;
+}
+
#ifndef INET6
static gint my_inet_aton(const gchar *hostname, struct in_addr *inp)
{
ad.sin_port = htons(port);
if (!my_inet_aton(hostname, &ad.sin_addr)) {
- void (*prev_handler)(gint);
-
- alarm(0);
- prev_handler = signal(SIGALRM, timeout_handler);
- if (sigsetjmp(jmpenv, 1)) {
- alarm(0);
- signal(SIGALRM, prev_handler);
- fprintf(stderr, "%s: host lookup timed out.\n", hostname);
- errno = 0;
- return -1;
- }
- alarm(timeout_secs);
-
- if ((hp = gethostbyname(hostname)) == NULL) {
- alarm(0);
- signal(SIGALRM, prev_handler);
+ if ((hp = my_gethostbyname(hostname)) == NULL) {
fprintf(stderr, "%s: unknown host.\n", hostname);
errno = 0;
return -1;
}
- alarm(0);
- signal(SIGALRM, prev_handler);
-
if (hp->h_length != 4 && hp->h_length != 8) {
fprintf(stderr, "illegal address length received for host %s\n", hostname);
errno = 0;
#include <glib.h>
#include <gdk/gdk.h> /* ugly, just needed for the GdkInputCondition et al. */
+#include <netdb.h>
typedef struct _SockInfo SockInfo;
gint sock_set_nonblocking_mode (SockInfo *sock, gboolean nonblock);
gboolean sock_is_nonblocking_mode (SockInfo *sock);
-SockInfo *sock_connect_nb (const gchar *hostname, gushort port);
+struct hostent *my_gethostbyname (const gchar *hostname);
+
SockInfo *sock_connect (const gchar *hostname, gushort port);
SockInfo *sock_connect_cmd (const gchar *hostname, const gchar *tunnelcmd);
gchar buf[BUFFSIZE];
gint bytes_read;
- debug_print(_("%s:%d loading template from %s\n"), __FILE__, __LINE__, filename);
-
if ((fp = fopen(filename, "rb")) == NULL) {
FILE_OP_ERROR(filename, "fopen");
return NULL;
GSList *tmpl_list = NULL;
path = get_template_dir();
- debug_print(_("%s:%d reading templates dir %s\n"), __FILE__, __LINE__, path);
+ debug_print("%s:%d reading templates dir %s\n",
+ __FILE__, __LINE__, path);
if (!is_dir_exist(path)) {
if (make_dir(path) < 0)
if (*de->d_name == '.') continue;
filename = g_strconcat(path, G_DIR_SEPARATOR_S, de->d_name, NULL);
- debug_print(_("%s:%d found file %s\n"), __FILE__, __LINE__, filename);
if (stat(filename, &s) != 0 || !S_ISREG(s.st_mode) ) {
- debug_print(_("%s:%d %s is not an ordinary file\n"),
- __FILE__, __LINE__, filename);
+ debug_print("%s:%d %s is not an ordinary file\n",
+ __FILE__, __LINE__, filename);
continue;
}
FILE *fp;
gint tmpl_num;
+ debug_print("%s:%d writing templates\n", __FILE__, __LINE__);
+
path = get_template_dir();
if (!is_dir_exist(path)) {
return;
}
- debug_print(_("%s:%d writing template \"%s\" to %s\n"),
- __FILE__, __LINE__, tmpl->name, filename);
fprintf(fp, "Name: %s\n", tmpl->name);
if (tmpl->subject && *tmpl->subject != '\0')
fprintf(fp, "Subject: %s\n", tmpl->subject);
if (tmpl->to && *tmpl->to != '\0')
fprintf(fp, "To: %s\n", tmpl->to);
fputs("\n", fp);
- fwrite(tmpl->value, sizeof(gchar) * strlen(tmpl->value), 1,
- fp);
+ fwrite(tmpl->value, sizeof(gchar) * strlen(tmpl->value), 1, fp);
fclose(fp);
}
}
#include <string.h>
#include <ctype.h>
#include <errno.h>
-#include <netdb.h>
#if (HAVE_WCTYPE_H && HAVE_WCHAR_H)
# include <wchar.h>
#include "intl.h"
#include "utils.h"
+#include "socket.h"
#include "statusbar.h"
#include "logwindow.h"
gchar *get_domain_name(void)
{
static gchar *domain_name = NULL;
- struct hostent *myfqdn = NULL;
if (!domain_name) {
- gchar buf[BUFFSIZE] = "";
+ gchar buf[128] = "";
+ struct hostent *hp;
if (gethostname(buf, sizeof(buf)) < 0) {
perror("gethostname");
- strcpy(buf, "unknown");
- } else {
- myfqdn = gethostbyname(buf);
- if (myfqdn != NULL) {
- memset(buf, '\0', strlen(buf));
- strcpy(buf, myfqdn->h_name);
- } else {
- perror("gethostbyname");
- strcpy(buf, "unknown");
- }
- }
-
- domain_name = g_strdup(buf);
+ domain_name = "unknown";
+ } else {
+ buf[sizeof(buf) - 1] = '\0';
+ if ((hp = my_gethostbyname(buf)) == NULL) {
+ perror("gethostbyname");
+ domain_name = g_strdup(buf);
+ } else {
+ domain_name = g_strdup(hp->h_name);
+ }
+ }
+
+ debug_print("domain name = %s\n", domain_name);
}
return domain_name;