#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;
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);