*Fixed OGG Menu Crash after changing the path

This commit is contained in:
dimok321 2009-06-06 19:39:48 +00:00
parent cfb976a35a
commit e1523224e8
2 changed files with 16 additions and 4 deletions

View File

@ -1,4 +1,3 @@
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include "menu.h" #include "menu.h"
@ -997,16 +996,19 @@ int MenuSettings()
optionBrowser2.SetEffect(EFFECT_FADE, 20); optionBrowser2.SetEffect(EFFECT_FADE, 20);
while(optionBrowser2.GetEffect() > 0) usleep(50); while(optionBrowser2.GetEffect() > 0) usleep(50);
char * oggfile; char * oggfile;
oggfile = strrchr(Settings.ogg_path, '/')+1;
while(!exit) while(!exit)
{ {
VIDEO_WaitVSync (); VIDEO_WaitVSync ();
if(!strcmp("notset", Settings.ogg_path) || !strcmp("",Settings.oggload_path)) bool returnhere = true;
if(!strcmp("notset", Settings.ogg_path))
options2.SetValue(0, "%s", LANGUAGE.Standard); options2.SetValue(0, "%s", LANGUAGE.Standard);
else { else {
oggfile = strrchr(Settings.ogg_path, '/')+1;
options2.SetValue(0, "%s", oggfile); options2.SetValue(0, "%s", oggfile);
} }
@ -1066,7 +1068,6 @@ int MenuSettings()
w.SetEffect(EFFECT_FADE, -20); w.SetEffect(EFFECT_FADE, -20);
while(w.GetEffect()>0) usleep(50); while(w.GetEffect()>0) usleep(50);
mainWindow->Remove(&w); mainWindow->Remove(&w);
bool returnhere = true;
while(returnhere) while(returnhere)
returnhere = MenuOGG(); returnhere = MenuOGG();
HaltGui(); HaltGui();

View File

@ -180,6 +180,11 @@ bool MenuOGG()
while(!returnhere) while(!returnhere)
{ {
if(shutdown == 1)
Sys_Shutdown();
if(reset == 1)
Sys_Reboot();
if (backBtn.GetState() == STATE_CLICKED) { if (backBtn.GetState() == STATE_CLICKED) {
if(nothingchanged == 1 && countoggs > 0) { if(nothingchanged == 1 && countoggs > 0) {
if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) { if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
@ -188,6 +193,7 @@ bool MenuOGG()
bgMusic->PlayOggFile(Settings.ogg_path); bgMusic->PlayOggFile(Settings.ogg_path);
} }
} }
backBtn.ResetState();
break; break;
} }
@ -425,6 +431,11 @@ int MenuLanguageSelect()
while(!returnhere) while(!returnhere)
{ {
if(shutdown == 1)
Sys_Shutdown();
if(reset == 1)
Sys_Reboot();
if (backBtn.GetState() == STATE_CLICKED) { if (backBtn.GetState() == STATE_CLICKED) {
backBtn.ResetState(); backBtn.ResetState();