/*
* Geeqie
* (C) 2006 John Ellis
- * Copyright (C) 2008 - 2009 The Geeqie Team
+ * Copyright (C) 2008 - 2012 The Geeqie Team
*
* Author: John Ellis
*
SortModeType mode;
SortActionType action;
gchar *filter_key;
-
+
SortSelectionType selection;
GtkWidget *folder_group;
history_list_free_key(SORT_KEY_COLLECTIONS);
bookmark_list_set_key(bookmarks, SORT_KEY_COLLECTIONS);
- dir_fd = file_data_new_simple(get_collections_dir());
+ dir_fd = file_data_new_dir(get_collections_dir());
filelist_read(dir_fd, &list, NULL);
file_data_unref(dir_fd);
GList *list;
gchar *src_dir;
- list = g_list_append(NULL, file_data_new_simple(sd->undo_dest));
+ list = g_list_append(NULL, file_data_new_group(sd->undo_dest));
src_dir = remove_level_from_path(sd->undo_src);
file_util_move_simple(list, src_dir, sd->lw->window);
g_free(src_dir);
}
break;
case BAR_SORT_COPY:
- file_util_delete(file_data_new_simple(sd->undo_dest), NULL, button);
+ file_util_delete(file_data_new_group(sd->undo_dest), NULL, button);
break;
default:
/* undo external command */
- file_util_delete(file_data_new_simple(sd->undo_dest), NULL, button);
+ file_util_delete(file_data_new_group(sd->undo_dest), NULL, button);
break;
}
if (isfile(sd->undo_src))
{
- layout_image_set_fd(sd->lw, file_data_new_simple(sd->undo_src));
+ layout_image_set_fd(sd->lw, file_data_new_group(sd->undo_src));
}
bar_sort_undo_set(sd, NULL, NULL, NULL);
source = work->data;
work = work->next;
- collect_manager_remove(file_data_new_simple(source), sd->undo_dest);
+ collect_manager_remove(file_data_new_group(source), sd->undo_dest);
}
bar_sort_undo_set(sd, NULL, NULL, NULL);
sd->lw = lw;
sd->action = action;
-
+
if (sd->action == BAR_SORT_FILTER && (!filter_key || !filter_key[0]))
{
sd->action = BAR_SORT_COPY;
}
-
+
sd->selection = selection;
sd->undo_src = NULL;
sd->undo_dest = NULL;
gtk_box_pack_start(GTK_BOX(sd->vbox), label, FALSE, FALSE, 0);
gtk_widget_show(label);
- combo = gtk_combo_box_new_text();
+ combo = gtk_combo_box_text_new();
gtk_box_pack_start(GTK_BOX(sd->vbox), combo, FALSE, FALSE, 0);
gtk_widget_show(combo);
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Folders"));
- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Collections"));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Folders"));
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Collections"));
g_signal_connect(G_OBJECT(combo), "changed",
G_CALLBACK(bar_sort_mode_cb), sd);
gboolean select = FALSE;
work = work->next;
-
+
if (!editor_is_filter(editor->key)) continue;
-
+
key = g_strdup(editor->key);
if (sd->action == BAR_SORT_FILTER && strcmp(key, filter_key) == 0)
{
select = TRUE;
have_filter = TRUE;
}
-
+
button = pref_radiobutton_new(sd->folder_group, buttongrp,
editor->name, select,
G_CALLBACK(bar_sort_set_filter_cb), sd);
g_object_set_data_full(G_OBJECT(button), "filter_key", key, bar_sort_edit_button_free);
}
g_list_free(editors_list);
-
+
if (sd->action == BAR_SORT_FILTER && !have_filter) sd->action = BAR_SORT_COPY;
sd->collection_group = pref_box_new(sd->vbox, FALSE, GTK_ORIENTATION_VERTICAL, 0);
GtkWidget *bar_sort_new_from_config(LayoutWindow *lw, const gchar **attribute_names, const gchar **attribute_values)
{
GtkWidget *bar;
-
+
gboolean enabled = TRUE;
gint action = 0;
gint mode = 0;
if (READ_INT_CLAMP_FULL("selection", selection, 0, BAR_SORT_SELECTION_COUNT - 1)) continue;
if (READ_CHAR_FULL("filter_key", filter_key)) continue;
- DEBUG_1("unknown attribute %s = %s", option, value);
+ log_printf("unknown attribute %s = %s\n", option, value);
}
bar = bar_sort_new(lw, action, mode, selection, filter_key);
sd = g_object_get_data(G_OBJECT(bar), "bar_sort_data");
if (!sd) return;
- WRITE_STRING("<bar_sort\n");
- indent++;
- write_bool_option(outstr, indent, "enabled", GTK_WIDGET_VISIBLE(bar));
+ WRITE_NL(); WRITE_STRING("<bar_sort ");
+ write_bool_option(outstr, indent, "enabled", gtk_widget_get_visible(bar));
WRITE_INT(*sd, mode);
WRITE_INT(*sd, action);
WRITE_INT(*sd, selection);
WRITE_CHAR(*sd, filter_key);
- indent--;
- WRITE_STRING("/>\n");
+ WRITE_STRING("/>");
}