[MPlayer-cvslog] r38602 - in trunk/gui: dialog/preferences.c gtk-compat.h

ib subversion at mplayerhq.hu
Mon Jun 24 21:00:56 EEST 2024


Author: ib
Date: Mon Jun 24 21:00:55 2024
New Revision: 38602

Log:
Display HSPPQuality on ShowPreferences(), not on dialog creation.

Also, set a proper upper value.

Modified:
   trunk/gui/dialog/preferences.c
   trunk/gui/gtk-compat.h

Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c	Mon Jun 24 20:58:48 2024	(r38601)
+++ trunk/gui/dialog/preferences.c	Mon Jun 24 21:00:55 2024	(r38602)
@@ -1096,8 +1096,7 @@ static GtkWidget * CreatePreferences( vo
 
   gtkAddLabelColon( _(MSGTR_GUI_MaximumUsageSpareCPU),hbox5 );
 
-  if ( guiInfo.sh_video && guiInfo.Playing ) HSPPQualityadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,get_video_quality_max( guiInfo.sh_video ),1,0,0 ) );
-   else HSPPQualityadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,100,1,0,0 ) );
+  HSPPQualityadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,0,1,0,0 ) );
   HSPPQuality=gtkAddHScale( HSPPQualityadj,hbox5,0 );
 
   vbox602=gtkAddVBox(
@@ -1240,6 +1239,7 @@ static GtkWidget * CreatePreferences( vo
 void ShowPreferences( void )
 {
  GSList *list;
+ gdouble upper = 0, value = 0;
 
  if ( Preferences ) gtkRaise( Preferences );
    else Preferences=CreatePreferences();
@@ -1482,7 +1482,15 @@ void ShowPreferences( void )
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSaveWinPos ),gui_save_pos );
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBShowVideoWindow ),!gtkShowVideoWindow );
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBStopXScreenSaver ),stop_xscreensaver );
- gtk_adjustment_set_value( HSPPQualityadj,auto_quality );
+
+ if (guiInfo.sh_video && guiInfo.Playing)
+ {
+   upper = get_video_quality_max(guiInfo.sh_video);
+   value = auto_quality;
+ }
+ gtk_adjustment_set_upper(HSPPQualityadj, upper);
+ gtk_adjustment_set_value(HSPPQualityadj, value);
+ gtk_adjustment_value_changed(HSPPQualityadj);
 
  gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBPlayBar ),gtkEnablePlayBar );
  if ( !guiApp.playbarIsPresent )

Modified: trunk/gui/gtk-compat.h
==============================================================================
--- trunk/gui/gtk-compat.h	Mon Jun 24 20:58:48 2024	(r38601)
+++ trunk/gui/gtk-compat.h	Mon Jun 24 21:00:55 2024	(r38602)
@@ -33,6 +33,7 @@
 
 #if !GTK_CHECK_VERSION(2,14,0)
 #define gtk_widget_get_window(widget) widget->window
+#define gtk_adjustment_set_upper(adjustment, value) adjustment->upper = value
 #endif
 
 #if !GTK_CHECK_VERSION(2,18,0)


More information about the MPlayer-cvslog mailing list