[gnome-commander] Select the first entry in search result if there is one, fixes bgo#749869



commit 923d5f841ebdc0a30049f8e200fdb027f60e8a18
Author: Mamoru TASAKA <mtasaka fedoraproject org>
Date:   Wed May 27 21:34:40 2015 +0200

    Select the first entry in search result if there is one, fixes bgo#749869
    
    Signed-off-by: Uwe Scholz <uwescholz src gnome org>

 src/dialogs/gnome-cmd-search-dialog.cc |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-search-dialog.cc b/src/dialogs/gnome-cmd-search-dialog.cc
index f9e0bf9..f648d82 100644
--- a/src/dialogs/gnome-cmd-search-dialog.cc
+++ b/src/dialogs/gnome-cmd-search-dialog.cc
@@ -535,7 +535,15 @@ static gboolean update_search_status_widgets (SearchData *data)
        gtk_dialog_set_default_response (*data->dialog, GnomeCmdSearchDialog::GCMD_RESPONSE_FIND);
        
         if (matches)
-            gtk_widget_grab_focus (*data->dialog->priv->result_list);         // set focus to result list
+       {
+           GnomeCmdFileList *fl = data->dialog->priv->result_list;
+           gtk_widget_grab_focus (*fl);         // set focus to result list
+           // select one file, as matches is non-zero, there should be at least one entry
+           if (!fl->get_focused_file())
+           {
+               fl->select_row(0);
+           }
+       }
     }
 
     return FALSE;    // returning FALSE here stops the timeout callbacks


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]