Embarrassing. Third try.
- From: Richard Hult <rhult hem2 passagen se>
- To: balsa-list gnome org
- Subject: Embarrassing. Third try.
- Date: Tue, 13 Apr 1999 20:03:23 +0200
This is really starting to annoy me. It's not my day today.
Feel free to spank me ;)
Richard
? ChangeLog
Index: balsa-app.c
===================================================================
RCS file: /cvs/gnome/balsa/src/balsa-app.c,v
retrieving revision 1.106
diff -u -r1.106 balsa-app.c
--- balsa-app.c 1999/02/21 15:28:07 1.106
+++ balsa-app.c 1999/04/13 18:02:47
@@ -121,6 +121,9 @@
/* arp */
balsa_app.quote_str = NULL;
+
+ /* font */
+ balsa_app.message_font = NULL;
}
gint
Index: balsa-app.h
===================================================================
RCS file: /cvs/gnome/balsa/src/balsa-app.h,v
retrieving revision 1.53
diff -u -r1.53 balsa-app.h
--- balsa-app.h 1999/02/24 03:33:10 1.53
+++ balsa-app.h 1999/04/13 18:02:47
@@ -38,6 +38,7 @@
#define MESSAGEBOX_WIDTH 450
#define MESSAGEBOX_HEIGHT 150
+#define DEFAULT_MESSAGE_FONT "-adobe-helvetica-medium-r-normal--12-*-72-72-p-*-iso8859-1"
/* global balsa application structure */
@@ -88,6 +89,9 @@
/* arp --- string to prefix "replied to" messages. */
gchar *quote_str;
+
+ /* font used to display messages */
+ gchar *message_font;
}
balsa_app;
Index: balsa-message.c
===================================================================
RCS file: /cvs/gnome/balsa/src/balsa-message.c,v
retrieving revision 1.77
diff -u -r1.77 balsa-message.c
--- balsa-message.c 1999/04/09 04:00:47 1.77
+++ balsa-message.c 1999/04/13 18:02:48
@@ -424,7 +424,7 @@
"x", x,
"y", y,
"anchor", GTK_ANCHOR_NW,
- "font", "-adobe-helvetica-medium-r-normal--12-*-72-72-p-*-iso8859-1",
+ "font", balsa_app.message_font,
"text", text, NULL);
return new;
}
Index: pref-manager.c
===================================================================
RCS file: /cvs/gnome/balsa/src/pref-manager.c,v
retrieving revision 1.71
diff -u -r1.71 pref-manager.c
--- pref-manager.c 1999/03/03 00:59:47 1.71
+++ pref-manager.c 1999/04/13 18:02:49
@@ -46,6 +46,9 @@
#endif
/* arp */
GtkWidget *quote_str;
+
+ GtkWidget *message_font; /* font used to display messages */
+ GtkWidget *font_picker;
}
PropertyUI;
@@ -88,6 +91,7 @@
/* callbacks */
static void properties_modified_cb (GtkWidget *, GnomePropertyBox *);
+static void font_changed (GtkWidget * widget, GnomePropertyBox * pbox);
static void pop3_add_cb (GtkWidget * widget, gpointer data);
static void pop3_edit_cb (GtkWidget * widget, gpointer data);
@@ -197,6 +201,16 @@
GTK_SIGNAL_FUNC (properties_modified_cb),
pui->pbox);
+ /* message font */
+ gtk_signal_connect (GTK_OBJECT (pui->message_font), "changed",
+ GTK_SIGNAL_FUNC (font_changed),
+ pui->pbox);
+
+ gtk_signal_connect (GTK_OBJECT (pui->font_picker), "font_set",
+ GTK_SIGNAL_FUNC (font_changed),
+ pui->pbox);
+
+
/* set data and show the whole thing */
gtk_widget_show_all (GTK_WIDGET (pui->pbox));
}
@@ -263,6 +277,9 @@
balsa_app.quote_str =
g_strdup (gtk_entry_get_text (GTK_ENTRY (pui->quote_str)));
+ g_free (balsa_app.message_font);
+ balsa_app.message_font =
+ g_strdup (gtk_entry_get_text (GTK_ENTRY (pui->message_font)));
refresh_main_window ();
@@ -305,6 +322,10 @@
#endif
/* arp */
gtk_entry_set_text (GTK_ENTRY (pui->quote_str), balsa_app.quote_str);
+
+ /* message font */
+ gtk_entry_set_text (GTK_ENTRY (pui->message_font), balsa_app.message_font);
+ gtk_entry_set_position (GTK_ENTRY (pui->message_font), 0);
}
void
@@ -353,6 +374,7 @@
create_identity_page (void)
{
GtkWidget *vbox;
+ GtkWidget *frame;
GtkWidget *table;
GtkWidget *label;
GtkWidget *signature;
@@ -360,8 +382,13 @@
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
+ /* identity frame */
+ frame = gtk_frame_new (_("Identity"));
+ gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 5);
+
table = gtk_table_new (4, 2, FALSE);
- gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 5);
+ gtk_container_set_border_width (GTK_CONTAINER (table), 5);
+ gtk_container_add (GTK_CONTAINER (frame), table);
/* your name */
label = gtk_label_new (_ ("Your name:"));
@@ -476,6 +503,7 @@
frame = gtk_frame_new (_("Local Mail"));
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 5);
hbox = gtk_hbox_new (TRUE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_container_add (GTK_CONTAINER (frame), hbox);
label = gtk_label_new (_ ("Local mail directory:"));
@@ -489,6 +517,7 @@
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 5);
table1 = gtk_table_new (2, 2, FALSE);
+ gtk_container_set_border_width (GTK_CONTAINER (table1), 5);
gtk_container_add (GTK_CONTAINER (frame), table1);
gtk_widget_show (table1);
@@ -578,9 +607,8 @@
GtkWidget *vbox1;
GtkWidget *table;
GtkWidget *label;
-
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_vbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
/* Misc */
@@ -589,6 +617,7 @@
/* arp */
vbox1 = gtk_vbox_new (FALSE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox1), 5);
gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (vbox1));
pui->debug = gtk_check_button_new_with_label (_("Debug"));
@@ -609,6 +638,34 @@
gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (table), TRUE, TRUE, 2);
+ /* font picker */
+ table = gtk_table_new (1, 3, FALSE);
+
+ label = gtk_label_new (_("Font:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+ gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
+ GTK_FILL, GTK_FILL, 10, 10);
+
+ pui->message_font = gtk_entry_new ();
+ gtk_table_attach (GTK_TABLE (table), pui->message_font, 1, 2, 0, 1,
+ GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 10);
+
+ pui->font_picker = gnome_font_picker_new ();
+ gnome_font_picker_set_font_name (GNOME_FONT_PICKER (pui->font_picker),
+ gtk_entry_get_text (GTK_ENTRY (pui->message_font)));
+ gnome_font_picker_set_mode (GNOME_FONT_PICKER (pui->font_picker),
+ GNOME_FONT_PICKER_MODE_USER_WIDGET);
+
+ label = gtk_label_new (_("Browse..."));
+ gnome_font_picker_uw_set_widget (GNOME_FONT_PICKER (pui->font_picker), GTK_WIDGET (label));
+ gtk_object_set_user_data (GTK_OBJECT(pui->font_picker), GTK_OBJECT(pui->message_font));
+ gtk_object_set_user_data (GTK_OBJECT(pui->message_font), GTK_OBJECT(pui->font_picker));
+
+ gtk_table_attach (GTK_TABLE (table), pui->font_picker,
+ 2, 3, 0, 1, GTK_FILL, GTK_FILL, 5, 10);
+
+ gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (table), TRUE, TRUE, 2);
+
return vbox;
}
@@ -620,6 +677,23 @@
properties_modified_cb (GtkWidget * widget, GnomePropertyBox * pbox)
{
gnome_property_box_changed (pbox);
+}
+
+static void
+font_changed (GtkWidget * widget, GnomePropertyBox * pbox)
+{
+ gchar *font;
+ GtkWidget *peer;
+ if (GNOME_IS_FONT_PICKER (widget)){
+ font = gnome_font_picker_get_font_name (GNOME_FONT_PICKER (widget));
+ peer = gtk_object_get_user_data (GTK_OBJECT (widget));
+ gtk_entry_set_text (GTK_ENTRY (peer), font);
+ } else {
+ font = gtk_entry_get_text (GTK_ENTRY (widget));
+ peer = gtk_object_get_user_data (GTK_OBJECT (widget));
+ gnome_font_picker_set_font_name (GNOME_FONT_PICKER (peer), font);
+ properties_modified_cb (widget, pbox);
+ }
}
static void
Index: save-restore.c
===================================================================
RCS file: /cvs/gnome/balsa/src/save-restore.c,v
retrieving revision 1.88
diff -u -r1.88 save-restore.c
--- save-restore.c 1999/02/24 03:33:17 1.88
+++ save-restore.c 1999/04/13 18:02:49
@@ -685,6 +685,12 @@
else
balsa_app.quote_str = g_strdup (field);
+ /* font used to display messages */
+ if ((field = pl_dict_get_str (globals, "MessageFont")) == NULL)
+ balsa_app.message_font = g_strdup (DEFAULT_MESSAGE_FONT);
+ else
+ balsa_app.message_font = g_strdup (field);
+
return TRUE;
} /* config_global_load */
@@ -756,6 +762,12 @@
pl_dict_add_str_str (globals, "LeadinStr", balsa_app.quote_str);
else
pl_dict_add_str_str (globals, "LeadinStr", "> ");
+
+ /* message font */
+ if (balsa_app.message_font != NULL)
+ pl_dict_add_str_str (globals, "MessageFont", balsa_app.message_font);
+ else
+ pl_dict_add_str_str (globals, "MessageFont", DEFAULT_MESSAGE_FONT);
/* Add it to configuration file */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]