comparison src/layout_util.c @ 783:d6a7fb4b8e7c

replaced directory path with FileData* dir_fd
author nadvornik
date Tue, 03 Jun 2008 19:44:19 +0000
parents 477f48ba28d8
children e394184cb0f1
comparison
equal deleted inserted replaced
782:3f7a0420c293 783:d6a7fb4b8e7c
81 gint x = 0; 81 gint x = 0;
82 gint y = 0; 82 gint y = 0;
83 83
84 if (lw->path_entry && GTK_WIDGET_HAS_FOCUS(lw->path_entry)) 84 if (lw->path_entry && GTK_WIDGET_HAS_FOCUS(lw->path_entry))
85 { 85 {
86 if (event->keyval == GDK_Escape && lw->path) 86 if (event->keyval == GDK_Escape && lw->dir_fd)
87 { 87 {
88 gtk_entry_set_text(GTK_ENTRY(lw->path_entry), lw->path); 88 gtk_entry_set_text(GTK_ENTRY(lw->path_entry), lw->dir_fd->path);
89 } 89 }
90 90
91 /* the gtkaccelgroup of the window is stealing presses before they get to the entry (and more), 91 /* the gtkaccelgroup of the window is stealing presses before they get to the entry (and more),
92 * so when the some widgets have focus, give them priority (HACK) 92 * so when the some widgets have focus, give them priority (HACK)
93 */ 93 */
194 if (lw->full_screen) 194 if (lw->full_screen)
195 layout_image_full_screen_stop(lw); 195 layout_image_full_screen_stop(lw);
196 196
197 nw = layout_new(NULL, FALSE, FALSE); 197 nw = layout_new(NULL, FALSE, FALSE);
198 layout_sort_set(nw, options->file_sort.method, options->file_sort.ascending); 198 layout_sort_set(nw, options->file_sort.method, options->file_sort.ascending);
199 layout_set_path(nw, layout_get_path(lw)); 199 layout_set_fd(nw, lw->dir_fd);
200 } 200 }
201 201
202 static void layout_menu_new_cb(GtkAction *action, gpointer data) 202 static void layout_menu_new_cb(GtkAction *action, gpointer data)
203 { 203 {
204 LayoutWindow *lw = data; 204 LayoutWindow *lw = data;
219 { 219 {
220 LayoutWindow *lw = data; 220 LayoutWindow *lw = data;
221 if (lw->full_screen) 221 if (lw->full_screen)
222 layout_image_full_screen_stop(lw); 222 layout_image_full_screen_stop(lw);
223 223
224 search_new(lw->path, layout_image_get_path(lw)); 224 search_new(lw->dir_fd, layout_image_get_fd(lw));
225 } 225 }
226 226
227 static void layout_menu_dupes_cb(GtkAction *action, gpointer data) 227 static void layout_menu_dupes_cb(GtkAction *action, gpointer data)
228 { 228 {
229 LayoutWindow *lw = data; 229 LayoutWindow *lw = data;
237 { 237 {
238 LayoutWindow *lw = data; 238 LayoutWindow *lw = data;
239 if (lw->full_screen) 239 if (lw->full_screen)
240 layout_image_full_screen_stop(lw); 240 layout_image_full_screen_stop(lw);
241 241
242 pan_window_new(layout_get_path(lw)); 242 pan_window_new(lw->dir_fd);
243 } 243 }
244 244
245 static void layout_menu_print_cb(GtkAction *action, gpointer data) 245 static void layout_menu_print_cb(GtkAction *action, gpointer data)
246 { 246 {
247 LayoutWindow *lw = data; 247 LayoutWindow *lw = data;
251 251
252 static void layout_menu_dir_cb(GtkAction *action, gpointer data) 252 static void layout_menu_dir_cb(GtkAction *action, gpointer data)
253 { 253 {
254 LayoutWindow *lw = data; 254 LayoutWindow *lw = data;
255 255
256 file_util_create_dir(lw->path, layout_window(lw)); 256 file_util_create_dir(lw->dir_fd, layout_window(lw));
257 } 257 }
258 258
259 static void layout_menu_copy_cb(GtkAction *action, gpointer data) 259 static void layout_menu_copy_cb(GtkAction *action, gpointer data)
260 { 260 {
261 LayoutWindow *lw = data; 261 LayoutWindow *lw = data;
1474 1474
1475 static void layout_button_home_cb(GtkWidget *widget, gpointer data) 1475 static void layout_button_home_cb(GtkWidget *widget, gpointer data)
1476 { 1476 {
1477 LayoutWindow *lw = data; 1477 LayoutWindow *lw = data;
1478 const gchar *path = homedir(); 1478 const gchar *path = homedir();
1479 1479 if (path)
1480 if (path) layout_set_path(lw, path); 1480 {
1481 FileData *dir_fd = file_data_new_simple(path);
1482 layout_set_fd(lw, dir_fd);
1483 file_data_unref(dir_fd);
1484 }
1481 } 1485 }
1482 1486
1483 static void layout_button_refresh_cb(GtkWidget *widget, gpointer data) 1487 static void layout_button_refresh_cb(GtkWidget *widget, gpointer data)
1484 { 1488 {
1485 LayoutWindow *lw = data; 1489 LayoutWindow *lw = data;