/*
- * Geeqie
- * (C) 2006 John Ellis
- * Copyright (C) 2008 - 2010 The Geeqie Team
+ * Copyright (C) 2004 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"
#include "bar_sort.h"
SortModeType mode;
SortActionType action;
gchar *filter_key;
-
+
SortSelectionType selection;
GtkWidget *folder_group;
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 (!sd) return;
WRITE_NL(); WRITE_STRING("<bar_sort ");
-#if GTK_CHECK_VERSION(2,20,0)
write_bool_option(outstr, indent, "enabled", gtk_widget_get_visible(bar));
-#else
- write_bool_option(outstr, indent, "enabled", GTK_WIDGET_VISIBLE(bar));
-#endif
WRITE_INT(*sd, mode);
WRITE_INT(*sd, action);
WRITE_INT(*sd, selection);