158
159
return GTK_WIDGET (preferences);
161
#if GTK_CHECK_VERSION (2, 16, 0)
163
midori_preferences_homepage_icon_press_cb (GtkWidget* button,
164
GtkEntryIconPosition position,
166
MidoriWebSettings* settings)
169
163
midori_preferences_homepage_current_clicked_cb (GtkWidget* button,
170
164
MidoriWebSettings* settings)
173
166
GtkWidget* preferences = gtk_widget_get_toplevel (button);
174
167
GtkWidget* browser = katze_object_get_object (preferences, "transient-for");
200
midori_preferences_delete_cookies_toggled_cb (GtkToggleButton* button,
201
MidoriWebSettings* settings)
203
gboolean toggled = gtk_toggle_button_get_active (button);
204
g_object_set (settings, "accept-cookies",
205
toggled ? MIDORI_ACCEPT_COOKIES_SESSION : MIDORI_ACCEPT_COOKIES_ALL, NULL);
209
midori_preferences_delete_cookies_changed_cb (GtkComboBox* combo,
210
MidoriWebSettings* settings)
212
gint active = gtk_combo_box_get_active (combo);
216
case 0: max_age = 0; break;
217
case 1: max_age = 1; break;
218
case 2: max_age = 7; break;
219
case 3: max_age = 30; break;
220
case 4: max_age = 365; break;
224
g_object_set (settings, "maximum-cookie-age", max_age, NULL);
229
194
midori_preferences_toolbutton_clicked_cb (GtkWidget* toolbutton,
326
291
#define SPANNED_ADD(__widget) \
327
292
katze_preferences_add_widget (_preferences, __widget, "spanned")
328
293
/* Page "General" */
329
PAGE_NEW (GTK_STOCK_HOME, _("General"));
330
FRAME_NEW (_("Startup"));
294
PAGE_NEW (GTK_STOCK_HOME, _("Startup"));
331
296
label = katze_property_label (settings, "load-on-startup");
332
297
INDENTED_ADD (label);
333
298
button = katze_property_proxy (settings, "load-on-startup", NULL);
334
299
SPANNED_ADD (button);
335
300
label = katze_property_label (settings, "homepage");
336
301
INDENTED_ADD (label);
337
entry = katze_property_proxy (settings, "homepage", NULL);
302
entry = katze_property_proxy (settings, "homepage", "address");
338
303
SPANNED_ADD (entry);
339
304
if (parent && katze_object_has_property (parent, "uri"))
341
#if GTK_CHECK_VERSION (2, 16, 0)
342
gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
343
GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_JUMP_TO);
344
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
345
GTK_ENTRY_ICON_SECONDARY, _("Use current page as homepage"));
346
g_signal_connect (entry, "icon-press",
347
G_CALLBACK (midori_preferences_homepage_icon_press_cb), settings);
307
button = gtk_button_new_with_mnemonic (_("Use _current page"));
349
button = gtk_button_new ();
350
label = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_BUTTON);
351
gtk_button_set_image (GTK_BUTTON (button), label);
352
gtk_widget_set_tooltip_text (button, _("Use current page as homepage"));
309
label = gtk_label_new (NULL);
310
INDENTED_ADD (label);
311
button = gtk_button_new_with_label (_("Use current page as homepage"));
353
313
g_signal_connect (button, "clicked",
354
314
G_CALLBACK (midori_preferences_homepage_current_clicked_cb), settings);
355
315
SPANNED_ADD (button);
358
button = katze_property_proxy (settings, "show-crash-dialog", NULL);
359
INDENTED_ADD (button);
360
button = katze_property_proxy (settings, "speed-dial-in-new-tabs", NULL);
361
SPANNED_ADD (button);
362
FRAME_NEW (_("Transfers"));
364
label = katze_property_label (settings, "download-folder");
365
INDENTED_ADD (label);
366
button = katze_property_proxy (settings, "download-folder", "folder");
367
SPANNED_ADD (button);
370
318
/* Page "Appearance" */
371
319
PAGE_NEW (GTK_STOCK_SELECT_FONT, _("Appearance"));
372
FRAME_NEW (_("Font settings"));
374
322
label = gtk_label_new (_("Default Font Family"));
323
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
375
324
INDENTED_ADD (label);
376
325
button = katze_property_proxy (settings, "default-font-family", "font");
377
326
gtk_widget_set_tooltip_text (button, _("The default font family used to display text"));
436
387
if (button != NULL)
437
388
INDENTED_ADD (button);
438
390
button = katze_property_label (settings, "preferred-languages");
439
391
INDENTED_ADD (button);
440
392
entry = katze_property_proxy (settings, "preferred-languages", "languages");
441
393
SPANNED_ADD (entry);
395
label = katze_property_label (settings, "download-folder");
396
INDENTED_ADD (label);
397
button = katze_property_proxy (settings, "download-folder", "folder");
398
SPANNED_ADD (button);
443
401
/* Page "Interface" */
444
PAGE_NEW (GTK_STOCK_CONVERT, _("Interface"));
445
FRAME_NEW (_("Navigationbar"));
402
PAGE_NEW (GTK_STOCK_CONVERT, _("Browsing"));
447
INDENTED_ADD (katze_property_label (settings, "toolbar-style"));
448
button = katze_property_proxy (settings, "toolbar-style", NULL);
449
SPANNED_ADD (button);
404
if (!g_getenv ("DESKTOP_SESSION"))
407
INDENTED_ADD (katze_property_label (settings, "toolbar-style"));
408
button = katze_property_proxy (settings, "toolbar-style", NULL);
409
SPANNED_ADD (button);
451
FRAME_NEW (_("Browsing"));
452
413
label = katze_property_label (settings, "open-new-pages-in");
453
414
INDENTED_ADD (label);
454
415
button = katze_property_proxy (settings, "open-new-pages-in", NULL);
463
424
INDENTED_ADD (button);
464
425
button = katze_property_proxy (settings, "open-tabs-in-the-background", NULL);
465
426
SPANNED_ADD (button);
468
/* Page "Applications" */
469
PAGE_NEW (GTK_STOCK_CONVERT, _("Applications"));
470
FRAME_NEW (_("External applications"));
471
429
label = katze_property_label (settings, "text-editor");
472
430
INDENTED_ADD (label);
473
431
entry = katze_property_proxy (settings, "text-editor", "application-text/plain");
474
432
SPANNED_ADD (entry);
475
label = katze_property_label (settings, "download-manager");
476
INDENTED_ADD (label);
477
entry = katze_property_proxy (settings, "download-manager", "application-FileTransfer");
479
433
label = katze_property_label (settings, "news-aggregator");
480
434
INDENTED_ADD (label);
481
435
entry = katze_property_proxy (settings, "news-aggregator", "application-News");
485
439
/* Page "Network" */
486
440
PAGE_NEW (GTK_STOCK_NETWORK, _("Network"));
487
FRAME_NEW (_("Network"));
489
443
label = katze_property_label (settings, "proxy-type");
490
444
INDENTED_ADD (label);
491
445
button = katze_property_proxy (settings, "proxy-type", NULL);
492
446
SPANNED_ADD (button);
493
447
label = gtk_label_new (_("Hostname"));
448
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
494
449
INDENTED_ADD (label);
495
450
entry = katze_property_proxy (settings, "http-proxy", NULL);
496
451
SPANNED_ADD (entry);
498
453
G_CALLBACK (midori_preferences_notify_proxy_type_cb), entry);
499
454
midori_preferences_notify_proxy_type_cb (settings, NULL, entry);
456
#if WEBKIT_CHECK_VERSION (1, 3, 11)
457
label = katze_property_label (settings, "maximum-cache-size");
458
INDENTED_ADD (label);
459
button = katze_property_proxy (settings, "maximum-cache-size", NULL);
460
SPANNED_ADD (button);
461
label = gtk_label_new (_("MB"));
462
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
501
465
label = katze_property_label (settings, "identify-as");
502
466
INDENTED_ADD (label);
503
467
button = katze_property_proxy (settings, "identify-as", "custom-user-agent");
504
468
SPANNED_ADD (button);
507
PAGE_NEW (GTK_STOCK_INDEX, _("Privacy"));
508
FRAME_NEW (_("Web Cookies"));
509
button = gtk_check_button_new_with_mnemonic (_("Delete cookies when quitting Midori"));
510
INDENTED_ADD (button);
511
if (katze_object_get_enum (settings, "accept-cookies") == MIDORI_ACCEPT_COOKIES_SESSION)
512
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
513
g_signal_connect (button, "toggled",
514
G_CALLBACK (midori_preferences_delete_cookies_toggled_cb), settings);
515
button = gtk_combo_box_new_text ();
516
gtk_combo_box_append_text (GTK_COMBO_BOX (button), _("Delete old cookies after 1 hour"));
517
gtk_combo_box_append_text (GTK_COMBO_BOX (button), _("Delete old cookies after 1 day"));
518
gtk_combo_box_append_text (GTK_COMBO_BOX (button), _("Delete old cookies after 1 week"));
519
gtk_combo_box_append_text (GTK_COMBO_BOX (button), _("Delete old cookies after 1 month"));
520
gtk_combo_box_append_text (GTK_COMBO_BOX (button), _("Delete old cookies after 1 year"));
522
gint max_age = katze_object_get_int (settings, "maximum-cookie-age");
526
case 0: active = 0; break;
527
case 1: active = 1; break;
528
case 7: active = 2; break;
529
case 30: active = 3; break;
530
case 365: active = 4; break;
534
gtk_combo_box_set_active (GTK_COMBO_BOX (button), active);
536
g_signal_connect (button, "changed",
537
G_CALLBACK (midori_preferences_delete_cookies_changed_cb), settings);
538
SPANNED_ADD (button);
540
gchar* markup = g_strdup_printf ("<span size=\"smaller\">%s</span>",
541
_("Cookies store login data, saved games, "
542
"or user profiles for advertisement purposes."));
543
label = gtk_label_new (NULL);
544
gtk_label_set_markup (GTK_LABEL (label), markup);
548
#if WEBKIT_CHECK_VERSION (1, 1, 13)
549
INDENTED_ADD (katze_property_proxy (settings, "enable-offline-web-application-cache", NULL));
551
#if WEBKIT_CHECK_VERSION (1, 1, 8)
552
SPANNED_ADD (katze_property_proxy (settings, "enable-html5-local-storage", NULL));
553
#if !WEBKIT_CHECK_VERSION (1, 1, 14)
554
INDENTED_ADD (katze_property_proxy (settings, "enable-html5-database", NULL));
557
FRAME_NEW (_("History"));
558
button = katze_property_label (settings, "maximum-history-age");
559
INDENTED_ADD (button);
560
button = katze_property_proxy (settings, "maximum-history-age", NULL);
561
SPANNED_ADD (button);
562
label = gtk_label_new (_("days"));