]> uap-core.de Git - uwplayer.git/commitdiff
move random play item to radio group
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Mon, 5 Sep 2022 13:46:34 +0000 (15:46 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Mon, 5 Sep 2022 13:46:34 +0000 (15:46 +0200)
application/window.c

index 7f1158c96e2f4312232db62d0fdfbfd794b4bce2..621ada78a118bb3ae30040a43c2441fbb66ca7ee 100644 (file)
@@ -486,14 +486,12 @@ static void WindowCreateMenu(MainWindow *win, Widget parent, Arg *mbargs, int nm
     // play menu
     win->playRepeatTrackButton = createToggleMenuItem(playMenu, "playRepeatTrack", "Repeat", 'R', False, NULL, NULL, PlayRepeatCB, win);
     win->playRepeatListButton = createToggleMenuItem(playMenu, "playRepeatList", "Repeat List", 'L', False, NULL, NULL, PlayRepeatListCB, win);
+    win->playRandom = createToggleMenuItem(playMenu, "playRandom", "Random Playback", 'P', False, NULL, NULL, PlayRandomCB, win);
     win->playAutoPlayButton = createToggleMenuItem(playMenu, "playAutoNext", "Autoplay Folder", 'A', False, NULL, NULL, PlayAutoPlayCB, win);
     XtVaSetValues(win->playRepeatTrackButton, XmNindicatorType, XmONE_OF_MANY, NULL);
     XtVaSetValues(win->playRepeatListButton, XmNindicatorType, XmONE_OF_MANY, NULL);
     XtVaSetValues(win->playAutoPlayButton, XmNindicatorType, XmONE_OF_MANY, NULL);
-    
-    createMenuSeparator(playMenu);
-    
-    win->playRandom = createToggleMenuItem(playMenu, "playRandom", "Random Playback", 'P', False, NULL, NULL, PlayRandomCB, win);
+    XtVaSetValues(win->playRandom, XmNindicatorType, XmONE_OF_MANY, NULL);
     
     
     // view menu
@@ -625,8 +623,10 @@ static void PlayRepeatCB(Widget w, void *udata, void *cdata) {
     win->playlist.repeatTrack = XmToggleButtonGadgetGetState(w);
     win->playlist.repeatList = 0;
     win->playlist.autoplayFolder = 0;
+    win->playlist.random = 0;
     XtVaSetValues(win->playRepeatListButton, XmNset, 0, NULL);
     XtVaSetValues(win->playAutoPlayButton, XmNset, 0, NULL);
+    XtVaSetValues(win->playRandom, XmNset, 0, NULL);
 }
 
 static void PlayRepeatListCB(Widget w, void *udata, void *cdata) {
@@ -634,8 +634,10 @@ static void PlayRepeatListCB(Widget w, void *udata, void *cdata) {
     win->playlist.repeatList = XmToggleButtonGadgetGetState(w);
     win->playlist.repeatTrack = 0;
     win->playlist.autoplayFolder = 0;
+    win->playlist.random = 0;
     XtVaSetValues(win->playRepeatTrackButton, XmNset, 0, NULL);
     XtVaSetValues(win->playAutoPlayButton, XmNset, 0, NULL);
+    XtVaSetValues(win->playRandom, XmNset, 0, NULL);
 }
 
 static void PlayAutoPlayCB(Widget w, void *udata, void *cdata) {
@@ -643,13 +645,21 @@ static void PlayAutoPlayCB(Widget w, void *udata, void *cdata) {
     win->playlist.autoplayFolder = XmToggleButtonGadgetGetState(w);
     win->playlist.repeatTrack = 0;
     win->playlist.repeatList = 0;
+    win->playlist.random = 0;
     XtVaSetValues(win->playRepeatTrackButton, XmNset, 0, NULL);
     XtVaSetValues(win->playRepeatListButton, XmNset, 0, NULL);
+    XtVaSetValues(win->playRandom, XmNset, 0, NULL);
 }
 
 static void PlayRandomCB(Widget w, void *udata, void *cdata) {
     MainWindow *win = udata;
     win->playlist.random = XmToggleButtonGadgetGetState(w);
+    win->playlist.repeatTrack = 0;
+    win->playlist.repeatList = 0;
+    win->playlist.autoplayFolder = 0;
+    XtVaSetValues(win->playRepeatTrackButton, XmNset, 0, NULL);
+    XtVaSetValues(win->playRepeatListButton, XmNset, 0, NULL);
+    XtVaSetValues(win->playAutoPlayButton, XmNset, 0, NULL);
 }
 
 static void ViewFullscreenCB(Widget w, void *udata, void *cdata) {