#include "ui_menu.h"
#include "ui_misc.h"
#include "rcfile.h"
+#include "window.h"
/*
*-------------------------------------------------------------------
*/
-typedef enum {
- BAR_SORT_MODE_FOLDER = 0,
- BAR_SORT_MODE_COLLECTION,
- BAR_SORT_MODE_COUNT
-} SortModeType;
-
-typedef enum {
- BAR_SORT_COPY = 0,
- BAR_SORT_MOVE,
- BAR_SORT_FILTER,
- BAR_SORT_ACTION_COUNT
-} SortActionType;
-
-typedef enum {
- BAR_SORT_SELECTION_IMAGE = 0,
- BAR_SORT_SELECTION_SELECTED,
- BAR_SORT_SELECTION_COUNT
-} SortSelectionType;
-
typedef struct _SortData SortData;
struct _SortData
{
work = g_list_append(work, file_data_new_group(delete_list->data));
delete_list = delete_list->next;
}
+ options->file_ops.safe_delete_enable = TRUE;
file_util_delete(NULL, work, button);
}
break;
bar_sort_set_action(sd, BAR_SORT_FILTER, key);
}
+static void bar_filter_help_cb(GenericDialog *gd, gpointer data)
+{
+ help_window_show("GuidePluginsConfig.html#Geeqieextensions");
+}
+
+static gboolean bar_filter_message_cb(GtkWidget *widget, GdkEventButton *event, gpointer data)
+{
+ GenericDialog *gd;
+
+ if (event->button != MOUSE_BUTTON_RIGHT) return FALSE;
+
+ gd = generic_dialog_new(_("Sort Manager Operations"),
+ "sort_manager_operations", NULL, TRUE, NULL, NULL);
+ generic_dialog_add_message(gd, GTK_STOCK_DIALOG_INFO,
+ "Sort Manager Operations", _("Additional operations utilising plugins\nmay be included by setting:\n\nX-Geeqie-Filter=true\n\nin the plugin file."), TRUE);
+ generic_dialog_add_button(gd, GTK_STOCK_HELP, NULL, bar_filter_help_cb, TRUE);
+ generic_dialog_add_button(gd, GTK_STOCK_OK, NULL, NULL, TRUE);
+
+ gtk_widget_show(gd->dialog);
+
+ return TRUE;
+}
+
static void bar_sort_set_selection(SortData *sd, SortSelectionType selection)
{
sd->selection = selection;
bar_sort_add_cancel_cb, sd);
file_dialog_add_button(sd->dialog, GTK_STOCK_OK, NULL, bar_sort_add_ok_cb, TRUE);
- generic_dialog_add_message(GENERIC_DIALOG(sd->dialog), NULL, title, NULL);
+ generic_dialog_add_message(GENERIC_DIALOG(sd->dialog), NULL, title, NULL, FALSE);
if (sd->mode == BAR_SORT_MODE_FOLDER)
{
GtkWidget *combo;
GList *editors_list, *work;
gboolean have_filter;
+ GtkWidget *button;
if (!lw) return NULL;
sd->undo_collection = NULL;
sd->vbox = gtk_vbox_new(FALSE, PREF_PAD_GAP);
+ DEBUG_NAME(sd->vbox);
g_object_set_data(G_OBJECT(sd->vbox), "bar_sort_data", sd);
g_signal_connect(G_OBJECT(sd->vbox), "destroy",
G_CALLBACK(bar_sort_destroy), sd);
G_CALLBACK(bar_sort_mode_cb), sd);
sd->folder_group = pref_box_new(sd->vbox, FALSE, GTK_ORIENTATION_VERTICAL, 0);
+ DEBUG_NAME(sd->folder_group);
buttongrp = pref_radiobutton_new(sd->folder_group, NULL,
_("Copy"), (sd->action == BAR_SORT_COPY),
G_CALLBACK(bar_sort_set_copy_cb), sd);
- pref_radiobutton_new(sd->folder_group, buttongrp,
+ g_signal_connect(G_OBJECT(buttongrp), "button_press_event", G_CALLBACK(bar_filter_message_cb), NULL);
+ button = pref_radiobutton_new(sd->folder_group, buttongrp,
_("Move"), (sd->action == BAR_SORT_MOVE),
G_CALLBACK(bar_sort_set_move_cb), sd);
+ g_signal_connect(G_OBJECT(button), "button_press_event", G_CALLBACK(bar_filter_message_cb), NULL);
have_filter = FALSE;
button = pref_radiobutton_new(sd->folder_group, buttongrp,
editor->name, select,
G_CALLBACK(bar_sort_set_filter_cb), sd);
+ g_signal_connect(G_OBJECT(button), "button_press_event", G_CALLBACK(bar_filter_message_cb), NULL);
g_object_set_data_full(G_OBJECT(button), "filter_key", key, bar_sort_edit_button_free);
}
G_CALLBACK(bar_sort_set_selection_selected_cb), sd);
sd->bookmarks = bookmark_list_new(SORT_KEY_FOLDERS, bar_sort_bookmark_select, sd);
+ DEBUG_NAME(sd->bookmarks);
gtk_box_pack_start(GTK_BOX(sd->vbox), sd->bookmarks, TRUE, TRUE, 0);
gtk_widget_show(sd->bookmarks);
tbar = pref_toolbar_new(sd->vbox, GTK_TOOLBAR_ICONS);
+ DEBUG_NAME(tbar);
sd->add_button = pref_toolbar_button(tbar, GTK_STOCK_ADD, NULL, FALSE,
_("Add Bookmark"),
{
GtkWidget *bar;
+ bar = bar_sort_new(lw, lw->options.action, lw->options.mode, lw->options.selection, lw->options.filter_key);
+
+ if (lw->bar_sort_enabled) gtk_widget_show(bar);
+ return bar;
+}
+
+/**
+ * @brief Sets the bar_sort_enabled flag
+ * @param lw
+ * @param attribute_names
+ * @param attribute_values
+ *
+ * Called from rcfile when processing geeqierc.xml on start-up.
+ * It is necessary to set the bar_sort_enabled flag because
+ * the sort manager and desktop files are set up in the idle loop, and
+ * setup is not yet completed during initialisation.
+ * The flag is checked in layout_editors_reload_idle_cb.
+ */
+void bar_sort_cold_start(LayoutWindow *lw, const gchar **attribute_names, const gchar **attribute_values)
+{
gboolean enabled = TRUE;
gint action = 0;
gint mode = 0;
log_printf("unknown attribute %s = %s\n", option, value);
}
- bar = bar_sort_new(lw, action, mode, selection, filter_key);
+
+ lw->options.action = action;
+ lw->options.mode = mode;
+ lw->options.selection = selection;
+ lw->options.filter_key = g_strdup(filter_key);
+ lw->bar_sort_enabled = enabled;
g_free(filter_key);
- if (enabled) gtk_widget_show(bar);
- return bar;
}
GtkWidget *bar_sort_new_default(LayoutWindow *lw)