comparison src/preferences.c @ 2566:034d8772d6d8

Fix #500: Geeqie doesn’t use shared thumbnail folder https://github.com/BestImageViewer/geeqie/issues/500
author Colin Clark <colin.clark@cclark.uk>
date Mon, 31 Jul 2017 14:36:29 +0100
parents ecd984e6ba99
children 78518b422e23
comparison
equal deleted inserted replaced
2565:52fa0e775bb5 2566:034d8772d6d8
1410 gtk_widget_show(vbox); 1410 gtk_widget_show(vbox);
1411 1411
1412 return vbox; 1412 return vbox;
1413 } 1413 }
1414 1414
1415 static void cache_standard_cb(GtkWidget *widget, gpointer data)
1416 {
1417 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
1418 {
1419 c_options->thumbnails.spec_standard =TRUE;
1420 c_options->thumbnails.cache_into_dirs = FALSE;
1421 }
1422 else
1423 {
1424 c_options->thumbnails.spec_standard =FALSE;
1425 }
1426 DEBUG_0("standard %d",c_options->thumbnails.spec_standard);
1427 }
1428
1429 static void cache_geeqie_cb(GtkWidget *widget, gpointer data)
1430 {
1431 if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
1432 {
1433 c_options->thumbnails.spec_standard =TRUE;
1434 c_options->thumbnails.cache_into_dirs = FALSE;
1435 }
1436 else
1437 {
1438 c_options->thumbnails.spec_standard =FALSE;
1439 }
1440 DEBUG_0("geeqie %d",c_options->thumbnails.spec_standard);
1441 }
1442
1443 static void cache_local_cb(GtkWidget *widget, gpointer data)
1444 {
1445 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
1446 {
1447 c_options->thumbnails.cache_into_dirs = TRUE;
1448 c_options->thumbnails.spec_standard =FALSE;
1449 }
1450 else
1451 {
1452 c_options->thumbnails.cache_into_dirs = FALSE;
1453 }
1454 }
1455
1415 /* general options tab */ 1456 /* general options tab */
1416 static void config_tab_general(GtkWidget *notebook) 1457 static void config_tab_general(GtkWidget *notebook)
1417 { 1458 {
1418 GtkWidget *vbox; 1459 GtkWidget *vbox;
1419 GtkWidget *hbox; 1460 GtkWidget *hbox;
1420 GtkWidget *group; 1461 GtkWidget *group;
1462 GtkWidget *group_frame;
1421 GtkWidget *subgroup; 1463 GtkWidget *subgroup;
1422 GtkWidget *button; 1464 GtkWidget *button;
1423 GtkWidget *ct_button; 1465 GtkWidget *ct_button;
1424 GtkWidget *table; 1466 GtkWidget *table;
1425 GtkWidget *spin; 1467 GtkWidget *spin;
1436 options->thumbnails.enable_caching, &c_options->thumbnails.enable_caching); 1478 options->thumbnails.enable_caching, &c_options->thumbnails.enable_caching);
1437 1479
1438 subgroup = pref_box_new(group, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); 1480 subgroup = pref_box_new(group, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP);
1439 pref_checkbox_link_sensitivity(ct_button, subgroup); 1481 pref_checkbox_link_sensitivity(ct_button, subgroup);
1440 1482
1441 button = pref_checkbox_new_int(subgroup, _("Use standard thumbnail cache, shared with other applications"), 1483 group_frame = pref_frame_new(subgroup, TRUE, _("Use Geeqie thumbnail style and cache"),
1442 options->thumbnails.spec_standard, &c_options->thumbnails.spec_standard); 1484 GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP);
1443 1485 button = pref_radiobutton_new(group_frame, NULL, get_thumbnails_cache_dir(),
1444 subgroup = pref_box_new(subgroup, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP); 1486 !options->thumbnails.spec_standard,
1445 pref_checkbox_link_sensitivity_swap(button, subgroup); 1487 G_CALLBACK(cache_geeqie_cb), NULL);
1446 1488
1447 pref_checkbox_new_int(subgroup, _("Store thumbnails in '.thumbnails' folder, local to image folder (non-standard)"), 1489 group_frame = pref_frame_new(subgroup, TRUE,
1448 options->thumbnails.cache_into_dirs, &c_options->thumbnails.cache_into_dirs); 1490 _("Store thumbnails local to image folder (non-standard)"),
1491 GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP);
1492 pref_radiobutton_new(group_frame, button, "*/.thumbnails",
1493 options->thumbnails.cache_into_dirs,
1494 G_CALLBACK(cache_local_cb), NULL);
1495
1496 group_frame = pref_frame_new(subgroup, TRUE,
1497 _("Use standard thumbnail style and cache, shared with other applications"),
1498 GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP);
1499 pref_radiobutton_new(group_frame, button, get_thumbnails_standard_cache_dir(),
1500 options->thumbnails.spec_standard,
1501 G_CALLBACK(cache_standard_cb), NULL);
1449 1502
1450 pref_checkbox_new_int(group, _("Use EXIF thumbnails when available (EXIF thumbnails may be outdated)"), 1503 pref_checkbox_new_int(group, _("Use EXIF thumbnails when available (EXIF thumbnails may be outdated)"),
1451 options->thumbnails.use_exif, &c_options->thumbnails.use_exif); 1504 options->thumbnails.use_exif, &c_options->thumbnails.use_exif);
1452 1505
1453 group = pref_group_new(vbox, FALSE, _("Slide show"), GTK_ORIENTATION_VERTICAL); 1506 group = pref_group_new(vbox, FALSE, _("Slide show"), GTK_ORIENTATION_VERTICAL);