[easytag/wip/select-all] Improve select all action handler, bug 697515



commit f37248d86c96071e53093932fe48fb6a0ed6880b
Author: David King <amigadave amigadave com>
Date:   Sun Apr 7 23:05:56 2013 +0100

    Improve select all action handler, bug 697515
    
    As the action handler is not invoked on a widget, determine the
    currently-focused widget and call the appropriate "select all" method to
    ensure that Ctrl+A functions correctly in widgets other than the file
    list view.

 src/easytag.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/src/easytag.c b/src/easytag.c
index a24791d..c6d8eb7 100644
--- a/src/easytag.c
+++ b/src/easytag.c
@@ -1697,11 +1697,23 @@ Mini_Button_Clicked (GObject *object)
  */
 void Action_Select_All_Files (void)
 {
-    /* Save the current displayed data */
-    ET_Save_File_Data_From_UI(ETCore->ETFileDisplayed);
+    GtkWidget *focused;
 
-    Browser_List_Select_All_Files();
-    Update_Command_Buttons_Sensivity();
+    /* Use the currently-focused widget and "select all" as appropriate.
+     * https://bugzilla.gnome.org/show_bug.cgi?id=697515 */
+    focused = gtk_window_get_focus (GTK_WINDOW (MainWindow));
+    if (GTK_IS_EDITABLE (focused))
+    {
+        gtk_editable_select_region (GTK_EDITABLE (focused), 0, -1);
+    } /* TODO: Handle other tree view widgets. */
+    else
+    {
+        /* Save the current displayed data */
+        ET_Save_File_Data_From_UI (ETCore->ETFileDisplayed);
+
+        Browser_List_Select_All_Files ();
+        Update_Command_Buttons_Sensivity ();
+    }
 }
 
 


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