[nautilus] nautilus-view: select text after showing the dialog



commit 10a96ee39eadb19e1ec46393c3f79c96d271de0a
Author: Carlos Soriano <csoriano gnome org>
Date:   Tue May 5 20:30:15 2015 +0200

    nautilus-view: select text after showing the dialog
    
    Until patch on bug 748805 is accepted or we figure a different recommended way,
    we have to select the entry after showing the dialog, since the entry selects
    all the text on focus, withouth taking into account previous selection.

 src/nautilus-view.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 2adf89c..9f3763c 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -1752,12 +1752,6 @@ nautilus_view_rename_dialog_new (NautilusView *view,
        else
                gtk_label_set_text (GTK_LABEL (label_file_name), _("File name"));
        gtk_entry_set_text (GTK_ENTRY (dialog_data->name_entry), nautilus_file_get_name (target_file));
-       /* Select the name part withouth the file extension */
-       eel_filename_get_rename_region (nautilus_file_get_name (target_file),
-                                        &start_offset, &end_offset);
-       gtk_editable_select_region (GTK_EDITABLE (dialog_data->name_entry),
-                                    start_offset, end_offset);
-
        gtk_builder_connect_signals (builder, dialog_data);
 
        g_signal_connect (dialog_data->dialog,
@@ -1766,6 +1760,12 @@ nautilus_view_rename_dialog_new (NautilusView *view,
                           user_data);
 
        gtk_widget_show_all (dialog_data->dialog);
+       /* Select the name part withouth the file extension */
+       eel_filename_get_rename_region (nautilus_file_get_name (target_file),
+                                        &start_offset, &end_offset);
+       gtk_editable_select_region (GTK_EDITABLE (dialog_data->name_entry),
+                                    start_offset, end_offset);
+
         /* Update the ok button status */
         nautilus_view_file_name_dialog_validate_name (dialog_data);
 


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