/** * This functions sets up the actual font and then displays the main dialog. */ int Dialog_MainDlg(bool *bReset, bool *bLoadedSnapshot) { int retbut=0; bool bOldMouseVisibility; int nOldMouseX, nOldMouseY; char *psNewCfg; *bReset = false; *bLoadedSnapshot = false; if (SDLGui_SetScreen()) return false; SDLGui_CenterDlg(maindlg); maindlg[MAINDLG_NORESET].state |= SG_SELECTED; maindlg[MAINDLG_RESET].state &= ~SG_SELECTED; // prefs = new Prefs(ThePrefs); do { retbut = SDLGui_DoDialog(maindlg, NULL); switch (retbut) { case MAINDLG_ABOUT: Dialog_AboutDlg(); break; case MAINDLG_FLOPPYS: DlgFloppy_Main(); break; case MAINDLG_VIDEO: Dialog_VideoDlg(); break; case MAINDLG_MISC: Dialog_MiscDlg(); break; case MAINDLG_JOYSTICK: Dialog_JoyDlg(); break; case MAINDLG_SOUND: Dialog_SoundDlg(); break; case MAINDLG_LOADCFG: /* strcpy(sConfigFileName, ".frodorc"); psNewCfg = SDLGui_FileSelect(sConfigFileName, NULL, false); if (psNewCfg) { prefs->Load(psNewCfg); TheC64->NewPrefs(prefs); ThePrefs = *prefs; strcpy(sConfigFileName, psNewCfg); free(psNewCfg); } */ break; case MAINDLG_SAVECFG: /* strcpy(sConfigFileName, ".frodorc"); psNewCfg = SDLGui_FileSelect(sConfigFileName, NULL, true); if (psNewCfg) { strcpy(sConfigFileName, psNewCfg); prefs->Save(sConfigFileName); free(psNewCfg); } */ break; case MAINDLG_SNAPSHOT: Dialog_SnapshotDlg(); break; case MAINDLG_QUIT: bQuitProgram = true; break; } /* if(ThePrefs!=*prefs){ printf("pref change \n"); TheC64->NewPrefs(prefs); ThePrefs = *prefs; } */ gui_poll_events(); } while (retbut != MAINDLG_OK && retbut != MAINDLG_CANCEL && retbut != SDLGUI_QUIT && retbut != SDLGUI_ERROR && !bQuitProgram); if (maindlg[MAINDLG_RESET].state & SG_SELECTED) *bReset = true; //delete prefs; return (retbut == MAINDLG_OK); }
/** * This functions sets up the actual font and then displays the main dialog. */ int Dialog_MainDlg(bool *bReset, bool *bLoadedSnapshot) { int retbut=0; bool bOldMouseVisibility; int nOldMouseX, nOldMouseY; char *psNewCfg; *bReset = false; *bLoadedSnapshot = false; if (SDLGui_SetScreen(/*sdlscrn*/)) return false; SDLGui_CenterDlg(maindlg); maindlg[MAINDLG_NORESET].state |= SG_SELECTED; maindlg[MAINDLG_RESET].state &= ~SG_SELECTED; do { retbut = SDLGui_DoDialog(maindlg, NULL); switch (retbut) { case MAINDLG_ABOUT: Dialog_AboutDlg(); break; case MAINDLG_FLOPPYS: DlgFloppy_Main(); break; case MAINDLG_HARDDISK: DlgHardDisk_Main(); break; case MAINDLG_ROM: DlgRom_Main(); break; case MAINDLG_VIDEO: Dialog_VideoDlg(); break; case MAINDLG_SYSTEM: Dialog_SystemDlg(); break; case MAINDLG_MEMORY: if (Dialog_MemDlg()) { /* Memory snapshot has been loaded - leave GUI immediately */ *bLoadedSnapshot = true; //Main_WarpMouse(nOldMouseX, nOldMouseY); return true; } break; case MAINDLG_MISC: Dialog_MiscDlg(); break; case MAINDLG_JOYSTICK: Dialog_JoyDlg(); break; case MAINDLG_SOUND: Dialog_SoundDlg(); break; case MAINDLG_LOADCFG: strcpy(sConfigFileName, ".uaerc"); psNewCfg = SDLGui_FileSelect(sConfigFileName, NULL, false); if (psNewCfg) { default_prefs(& changed_prefs, 0); changed_prefs.chipmem_size = 0; changed_prefs.bogomem_size = 0; unmount_all_hdfs(); int ret = cfgfile_load (& changed_prefs, psNewCfg, NULL,1,0); if (ret) { check_prefs_changed_cpu(); check_prefs_changed_audio(); check_prefs_changed_custom(); MUSTRESET_CFG=1; } strcpy(sConfigFileName, psNewCfg); } break; case MAINDLG_QUIT: bQuitProgram = true; break; } gui_poll_events(); } while (retbut != MAINDLG_OK && retbut != MAINDLG_CANCEL && retbut != SDLGUI_QUIT && retbut != SDLGUI_ERROR && !bQuitProgram); if (maindlg[MAINDLG_RESET].state & SG_SELECTED) *bReset = true; return (retbut == MAINDLG_OK); }