6edf2f5fe8
* claws-features.h.in * configure.ac * Makefile.am * src/account.c * src/action.c * src/addr_compl.c * src/addrcustomattr.c * src/addrduplicates.c * src/addressadd.c * src/addressbook.c * src/addressbook_foldersel.c * src/addrgather.c * src/addrindex.c * src/alertpanel.c * src/autofaces.c * src/browseldap.c * src/codeconv.c * src/codeconv.h * src/compose.c * src/crash.c * src/customheader.c * src/displayheader.c * src/editaddress.c * src/editaddress_other_attributes_ldap.c * src/editbook.c * src/editgroup.c * src/editjpilot.c * src/editldap.c * src/editldap_basedn.c * src/edittags.c * src/editvcard.c * src/exphtmldlg.c * src/expldifdlg.c * src/export.c * src/exporthtml.c * src/exportldif.c * src/folder.c * src/folder_item_prefs.c * src/grouplistdialog.c * src/headerview.c * src/image_viewer.c * src/imap.c * src/imap_gtk.c * src/imap_gtk.h * src/import.c * src/importldif.c * src/importmutt.c * src/importpine.c * src/inc.c * src/inc.h * src/jpilot.c * src/jpilot.h * src/ldapctrl.c * src/ldaplocate.c * src/ldapquery.c * src/ldapserver.c * src/ldapupdate.c * src/ldaputil.c * src/main.c * src/manual.c * src/matcher.c * src/mbox.c * src/message_search.c * src/messageview.h * src/mh.c * src/mh_gtk.c * src/mimeview.c * src/msgcache.c * src/msgcache.h * src/news.c * src/news_gtk.c * src/news_gtk.h * src/noticeview.c * src/partial_download.c * src/partial_download.h * src/pop.c * src/pop.h * src/prefs_account.c * src/prefs_account.h * src/prefs_actions.c * src/prefs_common.c * src/prefs_common.h * src/prefs_compose_writing.c * src/prefs_customheader.c * src/prefs_display_header.c * src/prefs_ext_prog.c * src/prefs_filtering.c * src/prefs_filtering_action.c * src/prefs_folder_column.c * src/prefs_folder_item.c * src/prefs_fonts.c * src/prefs_gtk.c * src/prefs_image_viewer.c * src/prefs_logging.c * src/prefs_matcher.c * src/prefs_message.c * src/prefs_msg_colors.c * src/prefs_other.c * src/prefs_quote.c * src/prefs_receive.c * src/prefs_send.c * src/prefs_spelling.c * src/prefs_summaries.c * src/prefs_summary_column.c * src/prefs_summary_open.c * src/prefs_toolbar.c * src/prefs_wrapping.c * src/printing.c * src/printing.h * src/procheader.c * src/procmime.c * src/procmime.h * src/procmsg.h * src/quote_fmt.c * src/recv.c * src/send_message.c * src/setup.c * src/ssl_manager.c * src/statusbar.c * src/summary_search.c * src/textview.c * src/textview.h * src/toolbar.c * src/undo.c * src/unmime.c * src/uri_opener.c * src/wizard.c * src/common/claws.c * src/common/defs.h * src/common/hooks.c * src/common/log.c * src/common/log.h * src/common/plugin.c * src/common/prefs.c * src/common/session.c * src/common/session.h * src/common/smtp.c * src/common/smtp.h * src/common/socket.c * src/common/socket.h * src/common/ssl.c * src/common/ssl.h * src/common/ssl_certificate.c * src/common/ssl_certificate.h * src/common/string_match.c * src/common/tags.c * src/common/timing.h * src/common/utils.c * src/common/utils.h * src/etpan/etpan-thread-manager.c * src/etpan/imap-thread.c * src/etpan/nntp-thread.c * src/gtk/about.c * src/gtk/combobox.c * src/gtk/description_window.c * src/gtk/filesel.c * src/gtk/gtkaspell.c * src/gtk/gtkaspell.h * src/gtk/gtkshruler.c * src/gtk/gtkunit.c * src/gtk/gtkutils.c * src/gtk/gtkutils.h * src/gtk/gtkvscrollbutton.c * src/gtk/icon_legend.c * src/gtk/inputdialog.c * src/gtk/logwindow.c * src/gtk/menu.c * src/gtk/pluginwindow.c * src/gtk/pluginwindow.h * src/gtk/prefswindow.c * src/gtk/progressdialog.c * src/gtk/quicksearch.c * src/gtk/spell_entry.c * src/gtk/spell_entry.h * src/gtk/sslcertwindow.c * src/gtk/sslcertwindow.h * src/plugins/bogofilter/bogofilter.c * src/plugins/bogofilter/bogofilter_gtk.c * src/plugins/dillo_viewer/dillo_prefs.c * src/plugins/dillo_viewer/dillo_viewer.c * src/plugins/pgpcore/pgp_viewer.c * src/plugins/pgpcore/plugin.c * src/plugins/pgpcore/sgpgme.c * src/plugins/pgpinline/pgpinline.c * src/plugins/pgpinline/plugin.c * src/plugins/pgpmime/pgpmime.c * src/plugins/pgpmime/plugin.c * src/plugins/smime/plugin.c * src/plugins/smime/smime.c * src/plugins/spamassassin/libspamc.c * src/plugins/spamassassin/spamassassin.c * src/plugins/spamassassin/spamassassin_gtk.c * src/plugins/trayicon/trayicon.c * src/plugins/trayicon/trayicon_prefs.c Specify Claws compile-time features in a specific header
286 lines
9.9 KiB
C
286 lines
9.9 KiB
C
/*
|
|
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
|
|
* Copyright (C) 2003-2012 Hiroyuki Yamamoto & 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
|
|
* the Free Software Foundation; either version 3 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, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
*/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
# include "config.h"
|
|
#include "claws-features.h"
|
|
#endif
|
|
|
|
#include "defs.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include <glib.h>
|
|
#include <glib/gi18n.h>
|
|
#include <gtk/gtk.h>
|
|
#include <gdk/gdkkeysyms.h>
|
|
|
|
#include "prefs_common.h"
|
|
#include "prefs_gtk.h"
|
|
|
|
#include "gtk/prefswindow.h"
|
|
|
|
typedef struct _FontsPage
|
|
{
|
|
PrefsPage page;
|
|
|
|
GtkWidget *window; /* do not modify */
|
|
|
|
GtkWidget *entry_folderview_smallfont;
|
|
GtkWidget *entry_folderview_normalfont;
|
|
GtkWidget *entry_folderview_boldfont;
|
|
GtkWidget *entry_messageviewfont;
|
|
GtkWidget *derive_from_normalfont_checkbutton;
|
|
GtkWidget *print_checkbutton;
|
|
GtkWidget *entry_messageprintfont;
|
|
} FontsPage;
|
|
|
|
static void prefs_fonts_create_widget(PrefsPage *_page, GtkWindow *window,
|
|
gpointer data)
|
|
{
|
|
FontsPage *prefs_fonts = (FontsPage *) _page;
|
|
|
|
GtkWidget *table;
|
|
GtkWidget *entry_folderview_smallfont;
|
|
GtkWidget *entry_folderview_normalfont;
|
|
GtkWidget *entry_folderview_boldfont;
|
|
GtkWidget *entry_messageviewfont;
|
|
GtkWidget *tmplabel;
|
|
GtkWidget *entry_messageprintfont;
|
|
GtkWidget *print_checkbutton;
|
|
GtkWidget *derive_from_normalfont_checkbutton;
|
|
GtkWidget *vbox;
|
|
gint row = 0;
|
|
|
|
table = gtk_table_new(10, 2, FALSE);
|
|
gtk_widget_show(table);
|
|
gtk_container_set_border_width(GTK_CONTAINER(table), VBOX_BORDER);
|
|
gtk_table_set_row_spacings(GTK_TABLE(table), 4);
|
|
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
|
|
|
|
/* normal font label */
|
|
tmplabel = gtk_label_new (_("Folder and Message Lists"));
|
|
gtk_widget_show (tmplabel);
|
|
gtk_table_attach (GTK_TABLE (table), tmplabel, 0, 1, row, row+1,
|
|
(GtkAttachOptions) GTK_FILL,
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
gtk_label_set_justify(GTK_LABEL(tmplabel), GTK_JUSTIFY_RIGHT);
|
|
gtk_misc_set_alignment(GTK_MISC(tmplabel), 1, 0.5);
|
|
|
|
/* normal font button */
|
|
entry_folderview_normalfont = gtk_font_button_new_with_font (prefs_common.normalfont);
|
|
g_object_set(G_OBJECT(entry_folderview_normalfont),
|
|
"use-font", TRUE,
|
|
NULL);
|
|
gtk_widget_show (entry_folderview_normalfont);
|
|
gtk_table_attach (GTK_TABLE (table), entry_folderview_normalfont, 1, 2, row, row+1,
|
|
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
row++;
|
|
|
|
/* message font label */
|
|
tmplabel = gtk_label_new (_("Message"));
|
|
gtk_widget_show (tmplabel);
|
|
gtk_table_attach (GTK_TABLE (table), tmplabel, 0, 1, row, row+1,
|
|
(GtkAttachOptions) GTK_FILL,
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
gtk_label_set_justify(GTK_LABEL(tmplabel), GTK_JUSTIFY_RIGHT);
|
|
gtk_misc_set_alignment(GTK_MISC(tmplabel), 1, 0.5);
|
|
|
|
/* message font button */
|
|
entry_messageviewfont = gtk_font_button_new_with_font (prefs_common.textfont);
|
|
g_object_set(G_OBJECT(entry_messageviewfont),
|
|
"use-font", TRUE,
|
|
NULL);
|
|
gtk_widget_show (entry_messageviewfont);
|
|
gtk_table_attach (GTK_TABLE (table), entry_messageviewfont, 1, 2, row, row+1,
|
|
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
row++;
|
|
|
|
vbox = gtk_vbox_new(FALSE, VSPACING_NARROW);
|
|
gtk_widget_show(vbox);
|
|
gtk_table_attach (GTK_TABLE (table), vbox, 0, 4, row, row+1,
|
|
(GtkAttachOptions) GTK_FILL,
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
row++;
|
|
|
|
/* derive from normal font check button */
|
|
derive_from_normalfont_checkbutton = gtk_check_button_new_with_label(_("Derive small and bold fonts from Folder and Message Lists font"));
|
|
gtk_widget_show(derive_from_normalfont_checkbutton);
|
|
gtk_table_attach (GTK_TABLE (table), derive_from_normalfont_checkbutton, 0, 2, row, row+1,
|
|
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(derive_from_normalfont_checkbutton),
|
|
prefs_common.derive_from_normal_font);
|
|
row++;
|
|
|
|
/* small font label */
|
|
tmplabel = gtk_label_new (_("Small"));
|
|
gtk_widget_show (tmplabel);
|
|
gtk_table_attach (GTK_TABLE (table), tmplabel, 0, 1, row, row+1,
|
|
(GtkAttachOptions) GTK_FILL,
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
gtk_label_set_justify(GTK_LABEL(tmplabel), GTK_JUSTIFY_RIGHT);
|
|
gtk_misc_set_alignment(GTK_MISC(tmplabel), 1, 0.5);
|
|
SET_TOGGLE_SENSITIVITY_REVERSE (derive_from_normalfont_checkbutton, tmplabel);
|
|
|
|
/* small font button */
|
|
entry_folderview_smallfont = gtk_font_button_new_with_font (prefs_common.smallfont);
|
|
g_object_set(G_OBJECT(entry_folderview_smallfont),
|
|
"use-font", TRUE,
|
|
NULL);
|
|
gtk_widget_show (entry_folderview_smallfont);
|
|
gtk_table_attach (GTK_TABLE (table), entry_folderview_smallfont, 1, 2, row, row+1,
|
|
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
SET_TOGGLE_SENSITIVITY_REVERSE (derive_from_normalfont_checkbutton, entry_folderview_smallfont);
|
|
row++;
|
|
|
|
/* bold font label */
|
|
tmplabel = gtk_label_new (_("Bold"));
|
|
gtk_widget_show (tmplabel);
|
|
gtk_table_attach (GTK_TABLE (table), tmplabel, 0, 1, row, row+1,
|
|
(GtkAttachOptions) GTK_FILL,
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
gtk_label_set_justify(GTK_LABEL(tmplabel), GTK_JUSTIFY_RIGHT);
|
|
gtk_misc_set_alignment(GTK_MISC(tmplabel), 1, 0.5);
|
|
SET_TOGGLE_SENSITIVITY_REVERSE (derive_from_normalfont_checkbutton, tmplabel);
|
|
|
|
/* bold font button */
|
|
entry_folderview_boldfont = gtk_font_button_new_with_font (prefs_common.boldfont);
|
|
g_object_set(G_OBJECT(entry_folderview_boldfont),
|
|
"use-font", TRUE,
|
|
NULL);
|
|
gtk_widget_show (entry_folderview_boldfont);
|
|
gtk_table_attach (GTK_TABLE (table), entry_folderview_boldfont, 1, 2, row, row+1,
|
|
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
SET_TOGGLE_SENSITIVITY_REVERSE (derive_from_normalfont_checkbutton, entry_folderview_boldfont);
|
|
row++;
|
|
|
|
/* print check button */
|
|
print_checkbutton = gtk_check_button_new_with_label(_("Use different font for printing"));
|
|
gtk_widget_show(print_checkbutton);
|
|
gtk_table_attach (GTK_TABLE (table), print_checkbutton, 0, 2, row, row+1,
|
|
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(print_checkbutton),
|
|
prefs_common.use_different_print_font);
|
|
row++;
|
|
|
|
/* print font label */
|
|
tmplabel = gtk_label_new (_("Message Printing"));
|
|
gtk_widget_show (tmplabel);
|
|
gtk_table_attach (GTK_TABLE (table), tmplabel, 0, 1, row, row+1,
|
|
(GtkAttachOptions) GTK_FILL,
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
gtk_label_set_justify(GTK_LABEL(tmplabel), GTK_JUSTIFY_RIGHT);
|
|
gtk_misc_set_alignment(GTK_MISC(tmplabel), 1, 0.5);
|
|
SET_TOGGLE_SENSITIVITY (print_checkbutton, tmplabel);
|
|
|
|
/* print font button */
|
|
entry_messageprintfont = gtk_font_button_new_with_font (prefs_common.printfont);
|
|
g_object_set(G_OBJECT(entry_messageprintfont),
|
|
"use-font", TRUE,
|
|
NULL);
|
|
gtk_widget_show (entry_messageprintfont);
|
|
gtk_table_attach (GTK_TABLE (table), entry_messageprintfont, 1, 2, row, row+1,
|
|
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
|
(GtkAttachOptions) (0), 0, 0);
|
|
SET_TOGGLE_SENSITIVITY (print_checkbutton, entry_messageprintfont);
|
|
row++;
|
|
|
|
prefs_fonts->window = GTK_WIDGET(window);
|
|
prefs_fonts->entry_folderview_smallfont = entry_folderview_smallfont;
|
|
prefs_fonts->entry_folderview_normalfont = entry_folderview_normalfont;
|
|
prefs_fonts->entry_folderview_boldfont = entry_folderview_boldfont;
|
|
prefs_fonts->entry_messageviewfont = entry_messageviewfont;
|
|
prefs_fonts->derive_from_normalfont_checkbutton = derive_from_normalfont_checkbutton;
|
|
prefs_fonts->entry_messageprintfont = entry_messageprintfont;
|
|
prefs_fonts->print_checkbutton = print_checkbutton;
|
|
|
|
prefs_fonts->page.widget = table;
|
|
}
|
|
|
|
static void prefs_fonts_save(PrefsPage *_page)
|
|
{
|
|
FontsPage *fonts = (FontsPage *) _page;
|
|
|
|
g_free(prefs_common.boldfont);
|
|
prefs_common.boldfont = g_strdup(gtk_font_button_get_font_name
|
|
(GTK_FONT_BUTTON(fonts->entry_folderview_boldfont)));
|
|
|
|
g_free(prefs_common.normalfont);
|
|
prefs_common.normalfont = g_strdup(gtk_font_button_get_font_name
|
|
(GTK_FONT_BUTTON(fonts->entry_folderview_normalfont)));
|
|
|
|
g_free(prefs_common.smallfont);
|
|
prefs_common.smallfont = g_strdup(gtk_font_button_get_font_name
|
|
(GTK_FONT_BUTTON(fonts->entry_folderview_smallfont)));
|
|
|
|
g_free(prefs_common.textfont);
|
|
prefs_common.textfont = g_strdup(gtk_font_button_get_font_name
|
|
(GTK_FONT_BUTTON(fonts->entry_messageviewfont)));
|
|
|
|
prefs_common.derive_from_normal_font = gtk_toggle_button_get_active
|
|
(GTK_TOGGLE_BUTTON(fonts->derive_from_normalfont_checkbutton));
|
|
|
|
g_free(prefs_common.printfont);
|
|
prefs_common.printfont = g_strdup(gtk_font_button_get_font_name
|
|
(GTK_FONT_BUTTON(fonts->entry_messageprintfont)));
|
|
prefs_common.use_different_print_font = gtk_toggle_button_get_active
|
|
(GTK_TOGGLE_BUTTON(fonts->print_checkbutton));
|
|
|
|
main_window_reflect_prefs_all();
|
|
}
|
|
|
|
static void prefs_fonts_destroy_widget(PrefsPage *_page)
|
|
{
|
|
/* FontsPage *fonts = (FontsPage *) _page; */
|
|
|
|
}
|
|
|
|
FontsPage *prefs_fonts;
|
|
|
|
void prefs_fonts_init(void)
|
|
{
|
|
FontsPage *page;
|
|
static gchar *path[3];
|
|
|
|
path[0] = _("Display");
|
|
path[1] = _("Fonts");
|
|
path[2] = NULL;
|
|
|
|
page = g_new0(FontsPage, 1);
|
|
page->page.path = path;
|
|
page->page.create_widget = prefs_fonts_create_widget;
|
|
page->page.destroy_widget = prefs_fonts_destroy_widget;
|
|
page->page.save_page = prefs_fonts_save;
|
|
page->page.weight = 135.0;
|
|
prefs_gtk_register_page((PrefsPage *) page);
|
|
prefs_fonts = page;
|
|
}
|
|
|
|
void prefs_fonts_done(void)
|
|
{
|
|
prefs_gtk_unregister_page((PrefsPage *) prefs_fonts);
|
|
g_free(prefs_fonts);
|
|
}
|