[MPlayer-cvslog] r38294 - in trunk/gui/dialog: dialog.h menu.c msgbox.c

ib subversion at mplayerhq.hu
Mon Mar 1 16:09:43 EET 2021


Author: ib
Date: Mon Mar  1 16:09:43 2021
New Revision: 38294

Log:
Don't consider the help message texts to be text constants.

Add new function AddMenuItemEllipsis() to add an ellipsis.

Modified:
   trunk/gui/dialog/dialog.h
   trunk/gui/dialog/menu.c
   trunk/gui/dialog/msgbox.c

Modified: trunk/gui/dialog/dialog.h
==============================================================================
--- trunk/gui/dialog/dialog.h	Mon Mar  1 16:05:38 2021	(r38293)
+++ trunk/gui/dialog/dialog.h	Mon Mar  1 16:09:43 2021	(r38294)
@@ -22,8 +22,6 @@
 #include <gtk/gtk.h>
 #include <X11/Xlib.h>
 
-#define ELLIPSIS "…"
-
 /// MessageBox types
 enum {
     MSGBOX_INFORMATION,

Modified: trunk/gui/dialog/menu.c
==============================================================================
--- trunk/gui/dialog/menu.c	Mon Mar  1 16:05:38 2021	(r38293)
+++ trunk/gui/dialog/menu.c	Mon Mar  1 16:09:43 2021	(r38294)
@@ -130,6 +130,18 @@ static GtkWidget * AddMenuItem( GtkWidge
  return Item;
 }
 
+static GtkWidget * AddMenuItemEllipsis( GtkWidget *Menu, const guint8 *icon, const char *label, int message )
+{
+ GtkWidget * item;
+ gchar * text;
+
+ text = g_strconcat( label,"…",NULL );
+ item = AddMenuItem( Menu,icon,text,message );
+ g_free( text );
+
+ return item;
+}
+
 static GtkWidget * AddSubMenu( GtkWidget *Menu, const guint8 *icon, const char *label )
 {
  GtkWidget * Label = NULL;
@@ -433,7 +445,7 @@ GtkWidget * CreatePopUpMenu( int wType )
   AddMenuItem( Menu, about_png, MSGTR_GUI_AboutMPlayer, evAbout );
   AddSeparator( Menu );
    SubMenu=AddSubMenu( Menu, open_png, MSGTR_GUI_Open );
-    AddMenuItem( SubMenu, file_png, MSGTR_GUI_File ELLIPSIS, evLoadPlay );
+    AddMenuItemEllipsis( SubMenu, file_png, MSGTR_GUI_File, evLoadPlay );
 #ifdef CONFIG_CDDA
     AddMenuItem( SubMenu, cd_play_png, MSGTR_GUI_CD, evPlayCD );
     CDSubMenu=AddSubMenu( Menu, cd_png, MSGTR_GUI_CD );
@@ -516,16 +528,16 @@ GtkWidget * CreatePopUpMenu( int wType )
        }
 #endif
 #if defined(CONFIG_LIBCDIO) || defined(CONFIG_DVDREAD)
-    AddMenuItem( SubMenu, image_png, MSGTR_GUI_Image ELLIPSIS, evPlayImage );
+    AddMenuItemEllipsis( SubMenu, image_png, MSGTR_GUI_Image, evPlayImage );
 #endif
-    AddMenuItem( SubMenu, url_png, MSGTR_GUI_URL ELLIPSIS, evLoadURL );
+    AddMenuItemEllipsis( SubMenu, url_png, MSGTR_GUI_URL, evLoadURL );
 #ifdef CONFIG_TV
     AddMenuItem( SubMenu, tv_png, MSGTR_GUI_TV, evPlayTV );
 #endif
     AddSeparator( SubMenu );
-    D = AddMenuItem( SubMenu, audio_track_load_png, MSGTR_GUI_AudioTrack ELLIPSIS, evLoadAudioFile );
+    D = AddMenuItemEllipsis( SubMenu, audio_track_load_png, MSGTR_GUI_AudioTrack, evLoadAudioFile );
     gtk_widget_set_sensitive( D, !guiInfo.Playing );
-    D = AddMenuItem( SubMenu, subtitle_load_png, MSGTR_GUI_Subtitle ELLIPSIS, evLoadSubtitle );
+    D = AddMenuItemEllipsis( SubMenu, subtitle_load_png, MSGTR_GUI_Subtitle, evLoadSubtitle );
     gtk_widget_set_sensitive( D, !guiInfo.Playing );
    SubMenu=AddSubMenu( Menu, play_png, MSGTR_GUI_Playback );
     D = AddMenuItem( SubMenu, play_png, MSGTR_GUI_Play, evPlay );

Modified: trunk/gui/dialog/msgbox.c
==============================================================================
--- trunk/gui/dialog/msgbox.c	Mon Mar  1 16:05:38 2021	(r38293)
+++ trunk/gui/dialog/msgbox.c	Mon Mar  1 16:09:43 2021	(r38294)
@@ -54,7 +54,7 @@ static GtkWidget * CreateMessageBox( voi
 
  MessageBox=gtk_window_new( GTK_WINDOW_TOPLEVEL );
  gtk_widget_set_events( MessageBox,GDK_EXPOSURE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_VISIBILITY_NOTIFY_MASK );
- gtk_window_set_title( GTK_WINDOW( MessageBox ),"MPlayer " ELLIPSIS );
+ gtk_window_set_title( GTK_WINDOW( MessageBox ),"MPlayer …");
  gtk_window_set_position( GTK_WINDOW( MessageBox ),GTK_WIN_POS_CENTER );
  gtk_window_set_modal( GTK_WINDOW( MessageBox ),TRUE );
  gtk_window_set_policy( GTK_WINDOW( MessageBox ),FALSE,FALSE,TRUE );


More information about the MPlayer-cvslog mailing list