changeset 34518:d476fbab0a28

Fix bug with selected file in file selector. If files have been deleted since the last selection, the focussed row can be out of range.
author ib
date Fri, 27 Jan 2012 14:47:18 +0000
parents 03a6ae3bee1e
children f6e2a67fa255
files gui/ui/gtk/fileselect.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/gtk/fileselect.c	Fri Jan 27 11:24:59 2012 +0000
+++ b/gui/ui/gtk/fileselect.c	Fri Jan 27 14:47:18 2012 +0000
@@ -361,6 +361,7 @@
  gtk_combo_set_popdown_strings( GTK_COMBO( fsCombo4 ),fsTopList_items );
 
  gtk_widget_grab_focus( fsFNameList );
+ if (fsLastFNameListSelected + 1 > ((GtkCList *)fsFNameList)->rows) fsLastFNameListSelected = 0;
  ((GtkCList *)fsFNameList)->focus_row = fsLastFNameListSelected;
  gtk_clist_select_row( GTK_CLIST( fsFNameList ),fsLastFNameListSelected,1 );
  fsLastFNameListSelected = 0;