Revision 2164 src/prefs_common_dialog.c

View differences:

prefs_common_dialog.c
1 1
/*
2 2
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3
 * Copyright (C) 1999-2008 Hiroyuki Yamamoto
3
 * Copyright (C) 1999-2009 Hiroyuki Yamamoto
4 4
 *
5 5
 * This program is free software; you can redistribute it and/or modify
6 6
 * it under the terms of the GNU General Public License as published by
......
233 233
	GtkWidget *button_extsend;
234 234
} extcmd;
235 235

  
236
static struct UpdateCheck {
237
	GtkWidget *checkbtn_autoupdate;
238
	GtkWidget *checkbtn_useproxy;
239
	GtkWidget *entry_proxyhost;
240
} update_check;
241

  
236 242
static struct Advanced {
237 243
	GtkWidget *checkbtn_strict_cache_check;
238 244

  
......
540 546
	{"ext_sendmail_cmd", &extcmd.entry_extsend,
541 547
	 prefs_set_data_from_entry, prefs_set_entry},
542 548

  
549
	/* Update check */
550
	{"auto_update_check", &update_check.checkbtn_autoupdate,
551
	 prefs_set_data_from_toggle, prefs_set_toggle},
552
	{"use_http_proxy", &update_check.checkbtn_useproxy,
553
	 prefs_set_data_from_toggle, prefs_set_toggle},
554
	{"http_proxy_host", &update_check.entry_proxyhost,
555
	 prefs_set_data_from_entry, prefs_set_entry},
556

  
543 557
	/* Advanced */
544 558
	{"strict_cache_check", &advanced.checkbtn_strict_cache_check,
545 559
	 prefs_set_data_from_toggle, prefs_set_toggle},
......
567 581
static void prefs_details_create	(void);
568 582
static GtkWidget *prefs_other_create	(void);
569 583
static GtkWidget *prefs_extcmd_create	(void);
584
static GtkWidget *prefs_update_create	(void);
570 585
static GtkWidget *prefs_advanced_create	(void);
571 586

  
572 587
static void prefs_common_set_encoding_optmenu	(GtkOptionMenu	*optmenu,
......
2168 2183

  
2169 2184
	GtkWidget *other_wid;
2170 2185
	GtkWidget *extcmd_wid;
2186
	GtkWidget *update_wid;
2171 2187
	GtkWidget *advanced_wid;
2172 2188

  
2173 2189
	vbox1 = gtk_vbox_new (FALSE, VSPACING);
......
2268 2284
	extcmd_wid = prefs_extcmd_create();
2269 2285
	gtk_box_pack_start(GTK_BOX(vbox_tab), extcmd_wid, FALSE, FALSE, 0);
2270 2286

  
2287
	APPEND_SUB_NOTEBOOK(notebook, vbox_tab, _("Update"));
2288
	update_wid = prefs_update_create();
2289
	gtk_box_pack_start(GTK_BOX(vbox_tab), update_wid, FALSE, FALSE, 0);
2290

  
2271 2291
	APPEND_SUB_NOTEBOOK(notebook, vbox_tab, _("Advanced"));
2272 2292
	advanced_wid = prefs_advanced_create();
2273 2293
	gtk_box_pack_start(GTK_BOX(vbox_tab), advanced_wid, FALSE, FALSE, 0);
......
2581 2601
	return vbox1;
2582 2602
}
2583 2603

  
2604
static GtkWidget *prefs_update_create(void)
2605
{
2606
	GtkWidget *vbox1;
2607
	GtkWidget *vbox2;
2608
	GtkWidget *checkbtn_autoupdate;
2609
	GtkWidget *checkbtn_useproxy;
2610
	GtkWidget *label;
2611
	GtkWidget *entry_proxyhost;
2612

  
2613
	vbox1 = gtk_vbox_new (FALSE, VSPACING);
2614
	gtk_widget_show (vbox1);
2615

  
2616
#ifndef G_OS_WIN32
2617
	label = gtk_label_new (_("Update check requires 'curl' command."));
2618
	gtk_widget_show (label);
2619
	gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
2620
	gtk_box_pack_start (GTK_BOX (vbox1), label, FALSE, FALSE, 0);
2621
#endif
2622

  
2623
	vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
2624
	gtk_widget_show (vbox2);
2625
	gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2626

  
2627
	PACK_CHECK_BUTTON (vbox2, checkbtn_autoupdate,
2628
			   _("Enable auto update check"));
2629
	PACK_CHECK_BUTTON (vbox2, checkbtn_useproxy,
2630
			   _("Use HTTP proxy"));
2631

  
2632
	label = gtk_label_new (_("HTTP proxy host (hostname:port):"));
2633
	gtk_widget_show (label);
2634
	gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
2635
	gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0);
2636

  
2637
	entry_proxyhost = gtk_entry_new ();
2638
	gtk_widget_show (entry_proxyhost);
2639
	gtk_box_pack_start (GTK_BOX (vbox2), entry_proxyhost, FALSE, FALSE, 0);
2640

  
2641
	SET_TOGGLE_SENSITIVITY(checkbtn_useproxy, label);
2642
	SET_TOGGLE_SENSITIVITY(checkbtn_useproxy, entry_proxyhost);
2643

  
2644
	update_check.checkbtn_autoupdate = checkbtn_autoupdate;
2645
	update_check.checkbtn_useproxy = checkbtn_useproxy;
2646
	update_check.entry_proxyhost = entry_proxyhost;
2647

  
2648
	return vbox1;
2649
}
2650

  
2584 2651
static GtkWidget *prefs_advanced_create(void)
2585 2652
{
2586 2653
	GtkWidget *vbox1;

Also available in: Unified diff