[MPlayer-cvslog] r38319 - in trunk/gui/dialog: fileselect.c playlist.c

ib subversion at mplayerhq.hu
Tue Oct 5 12:51:40 EEST 2021


Author: ib
Date: Tue Oct  5 12:51:40 2021
New Revision: 38319

Log:
Prefer the "clicked" button signal to the "released" signal.

The "clicked" button signal is commonly used throughout and
there is no special need for the "released" signal.

This now also allows to cancel the playlist dialog by pressing
the escape key.

Modified:
   trunk/gui/dialog/fileselect.c
   trunk/gui/dialog/playlist.c

Modified: trunk/gui/dialog/fileselect.c
==============================================================================
--- trunk/gui/dialog/fileselect.c	Tue Oct  5 12:46:22 2021	(r38318)
+++ trunk/gui/dialog/fileselect.c	Tue Oct  5 12:51:40 2021	(r38319)
@@ -537,7 +537,7 @@ static gboolean fs_fsFNameList_event(Gtk
     if (event->type == GDK_BUTTON_RELEASE && bevent->button == 2) {
         if (gtk_clist_get_selection_info(GTK_CLIST(widget), bevent->x, bevent->y, &row, &col)) {
             fsSelectedFile = gtk_clist_get_row_data(GTK_CLIST(widget), row);
-            gtk_button_released(GTK_BUTTON(fsOk));
+            gtk_button_clicked(GTK_BUTTON(fsOk));
 
             return TRUE;
         }
@@ -556,7 +556,7 @@ static void fs_fsFNameList_select_row(Gt
     fsSelectedFile = gtk_clist_get_row_data(clist, row);
 
     if (event && event->type == GDK_BUTTON_PRESS)
-        gtk_button_released(GTK_BUTTON(fsOk));
+        gtk_button_clicked(GTK_BUTTON(fsOk));
 }
 
 static void fs_Up_released(GtkButton *button, gpointer user_data)
@@ -704,16 +704,16 @@ static gboolean fs_key_release_event(Gtk
     case GDK_Escape:
 
         if (GTK_IS_SCROLLED_WINDOW(widget))
-            gtk_button_released(GTK_BUTTON(fsCancel));
+            gtk_button_clicked(GTK_BUTTON(fsCancel));
 
         break;
 
     case GDK_Return:
 
         if (GTK_IS_SCROLLED_WINDOW(widget))
-            gtk_button_released(GTK_BUTTON(fsOk));
+            gtk_button_clicked(GTK_BUTTON(fsOk));
         else if (GTK_IS_BUTTON(widget))
-            gtk_button_released(GTK_BUTTON(widget));
+            gtk_button_clicked(GTK_BUTTON(widget));
         else if (GTK_IS_ENTRY(widget))
             gtk_widget_grab_focus(fsFNameList);
 
@@ -722,7 +722,7 @@ static gboolean fs_key_release_event(Gtk
     case GDK_BackSpace:
 
         if (GTK_IS_SCROLLED_WINDOW(widget)) {
-            gtk_button_released(GTK_BUTTON(fsUp));
+            gtk_button_clicked(GTK_BUTTON(fsUp));
             gtk_widget_grab_focus(fsFNameList);
         }
 
@@ -841,11 +841,11 @@ static GtkWidget *CreateFileSelect(void)
     gtk_signal_connect(GTK_OBJECT(fsFilterCombo), "key-release-event", GTK_SIGNAL_FUNC(fs_key_release_event), NULL);
     gtk_signal_connect(GTK_OBJECT(fsPathCombo), "changed", GTK_SIGNAL_FUNC(fs_fsPathCombo_changed), fsPathCombo);
     gtk_signal_connect(GTK_OBJECT(fsPathCombo), "key-release-event", GTK_SIGNAL_FUNC(fs_key_release_event), NULL);
-    gtk_signal_connect(GTK_OBJECT(fsUp), "released", GTK_SIGNAL_FUNC(fs_Up_released), fsFNameList);
+    gtk_signal_connect(GTK_OBJECT(fsUp), "clicked", GTK_SIGNAL_FUNC(fs_Up_released), fsFNameList);
     gtk_signal_connect(GTK_OBJECT(fsUp), "key-release-event", GTK_SIGNAL_FUNC(fs_key_release_event), NULL);
-    gtk_signal_connect(GTK_OBJECT(fsOk), "released", GTK_SIGNAL_FUNC(fs_Ok_released), fsCombo4);
+    gtk_signal_connect(GTK_OBJECT(fsOk), "clicked", GTK_SIGNAL_FUNC(fs_Ok_released), fsCombo4);
     gtk_signal_connect(GTK_OBJECT(fsOk), "key-release-event", GTK_SIGNAL_FUNC(fs_key_release_event), NULL);
-    gtk_signal_connect(GTK_OBJECT(fsCancel), "released", GTK_SIGNAL_FUNC(fs_Cancel_released), NULL);
+    gtk_signal_connect(GTK_OBJECT(fsCancel), "clicked", GTK_SIGNAL_FUNC(fs_Cancel_released), NULL);
     gtk_signal_connect(GTK_OBJECT(fsCancel), "key-release-event", GTK_SIGNAL_FUNC(fs_key_release_event), NULL);
     gtk_signal_connect(GTK_OBJECT(fsFNameList), "select-row", (GtkSignalFunc)fs_fsFNameList_select_row, NULL);
     gtk_signal_connect(GTK_OBJECT(fsFNameList), "event", (GtkSignalFunc)fs_fsFNameList_event, NULL);

Modified: trunk/gui/dialog/playlist.c
==============================================================================
--- trunk/gui/dialog/playlist.c	Tue Oct  5 12:46:22 2021	(r38318)
+++ trunk/gui/dialog/playlist.c	Tue Oct  5 12:51:40 2021	(r38319)
@@ -576,13 +576,13 @@ static GtkWidget * CreatePlaylist( void
   sigEvent=gtk_signal_connect( GTK_OBJECT( CLSelected ),"event",GTK_SIGNAL_FUNC( plEvent ),GINT_TO_POINTER(1) );
   gtk_signal_connect( GTK_OBJECT( CLSelected ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),GINT_TO_POINTER(1) );
 
-  gtk_signal_connect( GTK_OBJECT( Add ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),GINT_TO_POINTER(3) );
+  gtk_signal_connect( GTK_OBJECT( Add ),"clicked",GTK_SIGNAL_FUNC( plButtonReleased ),GINT_TO_POINTER(3) );
   gtk_signal_connect( GTK_OBJECT( Add ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),GINT_TO_POINTER(3) );
-  gtk_signal_connect( GTK_OBJECT( Remove ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),GINT_TO_POINTER(2) );
+  gtk_signal_connect( GTK_OBJECT( Remove ),"clicked",GTK_SIGNAL_FUNC( plButtonReleased ),GINT_TO_POINTER(2) );
   gtk_signal_connect( GTK_OBJECT( Remove ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),GINT_TO_POINTER(2) );
-  gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),GINT_TO_POINTER(1) );
+  gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( plButtonReleased ),GINT_TO_POINTER(1) );
   gtk_signal_connect( GTK_OBJECT( Ok ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),GINT_TO_POINTER(1) );
-  gtk_signal_connect( GTK_OBJECT( Cancel ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),GINT_TO_POINTER(0) );
+  gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( plButtonReleased ),GINT_TO_POINTER(0) );
   gtk_signal_connect( GTK_OBJECT( Cancel ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),GINT_TO_POINTER(0) );
 
   gtk_window_add_accel_group( GTK_WINDOW( Playlist ),accel_group );


More information about the MPlayer-cvslog mailing list