|
|
1.1 root 1: /*
1.1.1.4 root 2: Hatari - dialog.c
3:
4: This file is distributed under the GNU Public License, version 2 or at
5: your option any later version. Read the file gpl.txt for details.
1.1 root 6:
1.1.1.12 root 7: Code to handle our options dialog.
1.1 root 8: */
1.1.1.13! root 9: const char Dialog_fileid[] = "Hatari dialog.c : " __DATE__ " " __TIME__;
1.1.1.3 root 10:
1.1 root 11: #include "main.h"
12: #include "configuration.h"
1.1.1.12 root 13: #include "change.h"
1.1 root 14: #include "dialog.h"
1.1.1.11 root 15: #include "log.h"
1.1.1.2 root 16: #include "sdlgui.h"
1.1.1.12 root 17: #include "screen.h"
1.1.1.13! root 18: #include "statusbar.h"
1.1 root 19:
20:
1.1.1.2 root 21: /*-----------------------------------------------------------------------*/
1.1.1.11 root 22: /**
23: * Open Property sheet Options dialog.
1.1.1.12 root 24: *
25: * We keep all our configuration details in a structure called
26: * 'ConfigureParams'. When we open our dialog we make a backup
27: * of this structure. When the user finally clicks on 'OK',
28: * we can compare and makes the necessary changes.
29: *
1.1.1.11 root 30: * Return TRUE if user chooses OK, or FALSE if cancel!
31: */
1.1.1.12 root 32: bool Dialog_DoProperty(void)
1.1 root 33: {
1.1.1.12 root 34: bool bOKDialog; /* Did user 'OK' dialog? */
35: bool bForceReset;
1.1.1.13! root 36: bool bLoadedSnapshot;
1.1.1.12 root 37: CNF_PARAMS current;
1.1 root 38:
1.1.1.12 root 39: Main_PauseEmulation(TRUE);
1.1.1.9 root 40: bForceReset = FALSE;
1.1 root 41:
1.1.1.12 root 42: /* Copy details (this is so can restore if 'Cancel' dialog) */
43: current = ConfigureParams;
44: ConfigureParams.Screen.bFullScreen = bInFullScreen;
1.1.1.13! root 45: bOKDialog = Dialog_MainDlg(&bForceReset, &bLoadedSnapshot);
! 46:
! 47: /* If a memory snapshot has been loaded, no further changes are required */
! 48: if (bLoadedSnapshot)
! 49: {
! 50: /* changes from new memory snapshot may affect also info shown in statusbar */
! 51: Statusbar_UpdateInfo();
! 52: Main_UnPauseEmulation();
! 53: return true;
! 54: }
1.1 root 55:
1.1.1.11 root 56: /* Check if reset is required and ask user if he really wants to continue then */
1.1.1.12 root 57: if (bOKDialog && !bForceReset
58: && Change_DoNeedReset(¤t, &ConfigureParams)
59: && ConfigureParams.Log.nAlertDlgLogLevel >= LOG_WARN) {
1.1.1.11 root 60: bOKDialog = DlgAlert_Query("The emulated system must be "
61: "reset to apply these changes. "
62: "Apply changes now and reset "
63: "the emulator?");
64: }
65:
66: /* Copy details to configuration */
67: if (bOKDialog) {
1.1.1.12 root 68: Change_CopyChangedParamsToConfiguration(¤t, &ConfigureParams, bForceReset);
69: } else {
70: ConfigureParams = current;
1.1.1.11 root 71: }
1.1.1.2 root 72:
1.1.1.9 root 73: Main_UnPauseEmulation();
1.1.1.2 root 74:
1.1.1.9 root 75: if (bQuitProgram)
1.1.1.11 root 76: Main_RequestQuit();
1.1.1.6 root 77:
1.1.1.9 root 78: return bOKDialog;
1.1 root 79: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.