Fix #130: Doubled path in thumbnail preferences
[geeqie.git] / src / cache_maint.c
index 429f9d4..2e5a7bb 100644 (file)
@@ -1,13 +1,22 @@
 /*
- * Geeqie
- * (C) 2006 John Ellis
- * Copyright (C) 2008 - 2012 The Geeqie Team
+ * Copyright (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
  *
  * Author: John Ellis
  *
- * This software is released under the GNU General Public License (GNU GPL).
- * Please read the included file COPYING for more information.
- * This software comes with no warranty of any kind, use at your own risk!
+ * 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 2 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, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include "main.h"
@@ -23,6 +32,7 @@
 #include "ui_spinner.h"
 #include "ui_tabcomp.h"
 #include "ui_utildlg.h"
+#include "window.h"
 
 
 typedef struct _CMData CMData;
@@ -449,7 +459,7 @@ static void cache_maint_copied(FileData *fd)
 void cache_notify_cb(FileData *fd, NotifyType type, gpointer data)
 {
        if (!(type & NOTIFY_CHANGE) || !fd->change) return;
-       
+
        DEBUG_1("Notify cache_maint: %s %04x", fd->path, type);
        switch (fd->change->type)
                {
@@ -940,6 +950,9 @@ static void cache_manager_standard_process(GtkWidget *widget, gboolean clear)
 
        cd->progress = gtk_progress_bar_new();
        gtk_progress_bar_set_text(GTK_PROGRESS_BAR(cd->progress), _("click start to begin"));
+#if GTK_CHECK_VERSION(3,0,0)
+       gtk_progress_bar_set_show_text(GTK_PROGRESS_BAR(cd->progress), TRUE);
+#endif
        gtk_box_pack_start(GTK_BOX(cd->gd->vbox), cd->progress, FALSE, FALSE, 0);
        gtk_widget_show(cd->progress);
 
@@ -1020,19 +1033,21 @@ static void cache_manager_close_cb(GenericDialog *gd, gpointer data)
        cache_manager = NULL;
 }
 
+static void cache_manager_help_cb(GenericDialog *gd, gpointer data)
+{
+       help_window_show("GuideReferenceManagement.html");
+}
+
 static GtkWidget *cache_manager_location_label(GtkWidget *group, const gchar *subdir)
 {
        GtkWidget *label;
        gchar *buf;
-       gchar *path;
 
-       path = g_build_filename(homedir(), subdir, NULL);
-       buf = g_strdup_printf(_("Location: %s"), path);
-       g_free(path);
+       buf = g_strdup_printf(_("Location: %s"), subdir);
        label = pref_label_new(group, buf);
        g_free(buf);
        gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-       
+
        return label;
 }
 
@@ -1043,6 +1058,7 @@ void cache_manager_show(void)
        GtkWidget *button;
        GtkWidget *table;
        GtkSizeGroup *sizegroup;
+       gchar *path;
 
        if (cache_manager)
                {
@@ -1061,6 +1077,8 @@ void cache_manager_show(void)
        gd->cancel_cb = cache_manager_close_cb;
        generic_dialog_add_button(gd, GTK_STOCK_CLOSE, NULL,
                                  cache_manager_close_cb, FALSE);
+       generic_dialog_add_button(gd, GTK_STOCK_HELP, NULL,
+                                 cache_manager_help_cb, FALSE);
 
        generic_dialog_add_message(gd, NULL, _("Cache and Data Maintenance"), NULL);
 
@@ -1085,7 +1103,9 @@ void cache_manager_show(void)
 
        group = pref_group_new(gd->vbox, FALSE, _("Shared thumbnail cache"), GTK_ORIENTATION_VERTICAL);
 
-       cache_manager_location_label(group, THUMB_FOLDER_GLOBAL);
+       path = g_build_filename(homedir(), THUMB_FOLDER_GLOBAL, NULL);
+       cache_manager_location_label(group, path);
+       g_free(path);
 
        table = pref_table_new(group, 2, 2, FALSE, FALSE);