/*
- * (SLIK) SimpLIstic sKin functions
- * (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.
*/
#ifdef HAVE_CONFIG_H
#include "ui_tabcomp.h"
#include "ui_tree_edit.h"
#include "uri_utils.h"
+#include "utilops.h"
#define DEST_WIDTH 250
}
if (*f_ptr != '\0' && f_ptr[1] == ' ') f_ptr++; /* skip space immediately after separator */
f_ptr++;
- /* FIXME: utf8 */
+ /**
+ * @FIXME utf8 */
if (l >= i && g_ascii_strncasecmp(file + l - i, strt_ptr, i) == 0) return TRUE;
}
return FALSE;
new_directory = g_path_get_dirname(full_path);
else
new_directory = g_strdup(full_path);
-
+
gtk_entry_set_text(GTK_ENTRY(dd->entry), full_path);
dest_populate(dd, new_directory);
list = g_list_append(list, path);
- gchar **uris = uris_from_filelist(list);
+ gchar **uris = uris_from_pathlist(list);
gboolean ret = gtk_selection_data_set_uris(selection_data, uris);
- if (!ret)
+ if (!ret)
{
char *str = g_strjoinv("\r\n", uris);
ret = gtk_selection_data_set_text(selection_data, str, -1);
text = g_strdup_printf(_("About to delete the file:\n %s"), path);
generic_dialog_add_message(dd->gd, GTK_STOCK_DIALOG_QUESTION,
- _("Delete file"), text);
+ _("Delete file"), text, TRUE);
g_free(text);
gtk_widget_show(dd->gd->dialog);
{
case GDK_KEY_F10:
if (!(event->state & GDK_CONTROL_MASK)) return FALSE;
+ /* fall through */
case GDK_KEY_Menu:
dest_view_store_selection(dd, GTK_TREE_VIEW(view));
dest_popup_menu(dd, GTK_TREE_VIEW(view), 0, event->time, TRUE);
{
Dest_Data *dd = data;
gchar *path;
- gchar *buf;
- const gchar *tmp;
- gboolean from_text = FALSE;
+ GtkWidget *dialog_window;
- tmp = gtk_entry_get_text(GTK_ENTRY(dd->entry));
- if (!isname(tmp))
- {
- buf = remove_trailing_slash(tmp);
- path = g_strdup(buf);
- g_free(buf);
- buf = remove_level_from_path(path);
- from_text = TRUE;
- }
- else
+/**
+ * @FIXME on exit from the "new folder" modal dialog, focus returns to the main Geeqie
+ * window rather than the file dialog window. gtk_window_present() does not seem to
+ * function unless the window was previously minimized.
+ */
+ dialog_window = gtk_widget_get_toplevel(widget);
+ gtk_window_iconify(GTK_WINDOW(dialog_window));
+ path = new_folder(GTK_WINDOW(dialog_window), dd->path);
+ gtk_window_present(GTK_WINDOW(dialog_window));
+
+ if (path == NULL)
{
- buf = g_build_filename(dd->path, _("New folder"), NULL);
- path = unique_filename(buf, NULL, " ", FALSE);
- g_free(buf);
+ return;
}
if (!mkdir_utf8(path, 0755))
GtkListStore *store;
const gchar *text;
- if (from_text)
- {
- dest_populate(dd, buf);
- g_free(buf);
- }
-
store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(dd->d_view)));
text = filename_from_path(path);
if (dd->right_click_path) gtk_tree_path_free(dd->right_click_path);
dd->right_click_path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
- tree_edit_by_path(GTK_TREE_VIEW(dd->d_view), dd->right_click_path, 0, text,
- dest_view_rename_cb, dd);
+ gtk_entry_set_text(GTK_ENTRY(dd->entry), path);
}
+ gtk_widget_grab_focus(GTK_WIDGET(dd->entry));
+
g_free(path);
}
if (filter)
{
paned = gtk_hpaned_new();
+ DEBUG_NAME(paned);
gtk_table_attach(GTK_TABLE(table), paned, 0, 3, 1, 2,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show(paned);
store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
dd->filter_combo = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(store));
+ gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(dd->filter_combo),
+ FILTER_COLUMN_FILTER);
+
g_object_unref(store);
gtk_cell_layout_clear(GTK_CELL_LAYOUT(dd->filter_combo));
renderer = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dd->filter_combo), renderer, TRUE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dd->filter_combo), renderer,
"text", FILTER_COLUMN_NAME, NULL);
-#if 0
- gtk_combo_set_case_sensitive(GTK_COMBO(dd->filter_combo), TRUE);
-#endif
gtk_box_pack_start(GTK_BOX(hbox2), dd->filter_combo, TRUE, TRUE, 0);
gtk_widget_show(dd->filter_combo);