fixed saving of file_view_type
authorVladimir Nadvornik <nadvornik@suse.cz>
Tue, 10 Mar 2009 22:52:12 +0000 (22:52 +0000)
committerVladimir Nadvornik <nadvornik@suse.cz>
Tue, 10 Mar 2009 22:52:12 +0000 (22:52 +0000)
src/layout.c
src/layout_util.c
src/typedefs.h
src/view_dir.c
src/view_file.c

index f1642a6..4c1d4e1 100644 (file)
@@ -841,7 +841,7 @@ static void layout_list_thumb_cb(ViewFile *vf, gdouble val, const gchar *text, g
 
 static GtkWidget *layout_list_new(LayoutWindow *lw)
 {
-       lw->vf = vf_new(lw->file_view_type, NULL);
+       lw->vf = vf_new(lw->options.file_view_type, NULL);
        vf_set_layout(lw->vf, lw);
 
        vf_set_status_func(lw->vf, layout_list_status_cb, lw);
@@ -849,7 +849,7 @@ static GtkWidget *layout_list_new(LayoutWindow *lw)
 
        vf_marks_set(lw->vf, lw->options.show_marks);
 
-       switch (lw->file_view_type)
+       switch (lw->options.file_view_type)
        {
        case FILEVIEW_ICON:
                break;
@@ -1235,10 +1235,10 @@ void layout_views_set(LayoutWindow *lw, DirViewType dir_view_type, FileViewType
 {
        if (!layout_valid(&lw)) return;
 
-       if (lw->options.dir_view_type == dir_view_type && lw->file_view_type == file_view_type) return;
+       if (lw->options.dir_view_type == dir_view_type && lw->options.file_view_type == file_view_type) return;
 
        lw->options.dir_view_type = dir_view_type;
-       lw->file_view_type = file_view_type;
+       lw->options.file_view_type = file_view_type;
 
        layout_style_set(lw, -1, NULL);
 }
@@ -1248,7 +1248,7 @@ gint layout_views_get(LayoutWindow *lw, DirViewType *dir_view_type, FileViewType
        if (!layout_valid(&lw)) return FALSE;
 
        *dir_view_type = lw->options.dir_view_type;
-       *file_view_type = lw->file_view_type;
+       *file_view_type = lw->options.file_view_type;
 
        return TRUE;
 }
index 5bbae04..7b18f0e 100644 (file)
@@ -580,7 +580,7 @@ static void layout_menu_view_dir_as_cb(GtkRadioAction *action, GtkRadioAction *c
        LayoutWindow *lw = data;
 
        layout_exit_fullscreen(lw);
-       layout_views_set(lw, (DirViewType) gtk_radio_action_get_current_value(action), lw->file_view_type);
+       layout_views_set(lw, (DirViewType) gtk_radio_action_get_current_value(action), lw->options.file_view_type);
 }
 
 static void layout_menu_view_in_new_window_cb(GtkAction *action, gpointer data)
@@ -1852,7 +1852,7 @@ static void layout_util_sync_views(LayoutWindow *lw)
        radio_action_set_current_value(GTK_RADIO_ACTION(action), lw->options.dir_view_type);
 
        action = gtk_action_group_get_action(lw->action_group, "ViewIcons");
-       gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->file_view_type);
+       gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.file_view_type);
 
        action = gtk_action_group_get_action(lw->action_group, "FloatTools");
        gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.tools_float);
@@ -1885,7 +1885,7 @@ void layout_util_sync_thumb(LayoutWindow *lw)
 
        action = gtk_action_group_get_action(lw->action_group, "Thumbnails");
        gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), lw->options.show_thumbnails);
-       g_object_set(action, "sensitive", (lw->file_view_type == FILEVIEW_LIST), NULL);
+       g_object_set(action, "sensitive", (lw->options.file_view_type == FILEVIEW_LIST), NULL);
 }
 
 void layout_util_sync(LayoutWindow *lw)
index 7c2cf2c..9e6af43 100644 (file)
@@ -599,7 +599,7 @@ struct _LayoutWindow
        LayoutLocation file_location;
 
        ViewFile *vf;
-       FileViewType file_view_type;
+//     FileViewType file_view_type;
 
        GtkWidget *file_view;
 
index d0dda92..376c086 100644 (file)
@@ -473,7 +473,7 @@ static void vd_pop_submenu_dir_view_as_cb(GtkWidget *widget, gpointer data)
        ViewDir *vd = data;
 
        DirViewType new_type = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget), VIEW_DIR_AS_SUBMENU_KEY));
-       layout_views_set(vd->layout, new_type, vd->layout->file_view_type);
+       layout_views_set(vd->layout, new_type, vd->layout->options.file_view_type);
 }
 
 static void vd_pop_menu_refresh_cb(GtkWidget *widget, gpointer data)
index 5024a12..f0d059b 100644 (file)
@@ -444,7 +444,7 @@ static void vf_pop_menu_toggle_view_type_cb(GtkWidget *widget, gpointer data)
        
        if (!vf->layout) return;
 
-       switch (vf->layout->file_view_type)
+       switch (vf->type)
        {
        case FILEVIEW_LIST:
                layout_views_set(vf->layout, vf->layout->options.dir_view_type, FILEVIEW_ICON);