win32: Add default option to not add entries to registry.

This commit is contained in:
BearOso 2023-02-17 16:57:09 -06:00
parent 3c1d330169
commit 19787b12f1
5 changed files with 16 additions and 5 deletions

View File

@ -98,6 +98,7 @@
#define IDC_SFXSPEED 1072
#define IDC_SFXSPEED_SPIN 1073
#define IDC_CONFIRMSAVELOAD 1074
#define IDC_ADD_REGISTRY 1075
#define IDC_HOSTNAME 1086
#define IDC_PORTNUMBER 1087
#define IDC_CLEARHISTORY 1088

View File

@ -89,7 +89,7 @@ BEGIN
EDITTEXT IDC_DISCLAIMER,6,6,222,148,ES_MULTILINE | ES_NOHIDESEL | ES_READONLY | WS_VSCROLL,WS_EX_STATICEDGE
END
IDD_EMU_SETTINGS DIALOGEX 0, 0, 343, 228
IDD_EMU_SETTINGS DIALOGEX 0, 0, 343, 238
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU
CAPTION "APP - Emulator Settings"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
@ -111,8 +111,8 @@ BEGIN
CONTROL "Pause When Inactive",IDC_INACTIVE_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,156,96,8
CONTROL "Custom ROM Open Dialog",IDC_CUSTOMROMOPEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,168,114,8
CONTROL "Hi-Res AVI Recording",IDC_HIRESAVI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,180,114,8
DEFPUSHBUTTON "&OK",IDOK,233,205,48,14
PUSHBUTTON "&Cancel",IDCANCEL,287,205,48,14
DEFPUSHBUTTON "&OK",IDOK,233,215,48,14
PUSHBUTTON "&Cancel",IDCANCEL,287,215,48,14
COMBOBOX IDC_DIRCOMBO,42,30,53,30,CBS_DROPDOWNLIST | WS_TABSTOP
RTEXT "Directory:",IDC_LABEL_FREEZE,0,30,38,12,SS_CENTERIMAGE
RTEXT "Auto-Save S-RAM",IDC_LABEL_ASRAM,12,47,84,14,SS_CENTERIMAGE
@ -132,6 +132,7 @@ BEGIN
LTEXT "%",IDC_LABEL_SFXSPEED_2,156,138,131,14,SS_CENTERIMAGE
CONTROL "Ask for confirmation when saving/loading",IDC_CONFIRMSAVELOAD,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,192,145,8
CONTROL "Add Snes9x to registry for supported file types", IDC_ADD_REGISTRY, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 102, 204, 180, 8
END
IDD_OPEN_ROM DIALOGEX 0, 0, 430, 223

View File

@ -814,6 +814,7 @@ void WinRegisterConfigItems()
AddUIntC("RewindGranularity", GUI.rewindGranularity, 1, "rewind granularity - rewind takes a snapshot each x frames");
AddBoolC("PauseWhenInactive", GUI.InactivePause, TRUE, "true to pause Snes9x when it is not the active window");
AddBoolC("CustomRomOpenDialog", GUI.CustomRomOpen, false, "false to use standard Windows open dialog for the ROM open dialog");
AddBoolC("AddToRegistry", GUI.AddToRegistry, false, "true to add entries to registry for file type associations");
AddBoolC("AVIHiRes", GUI.AVIHiRes, false, "true to record AVI in Hi-Res scale");
AddBoolC("ConfirmSaveLoad", GUI.ConfirmSaveLoad, false, "true to ask for confirmation when saving/loading");
// AddUIntC("Language", GUI.Language, 0, "0=English, 1=Nederlands"); // NYI

View File

@ -5338,6 +5338,7 @@ INT_PTR CALLBACK DlgEmulatorProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPar
SendDlgItemMessage(hDlg, IDC_SFXSPEED_SPIN, UDM_SETPOS, 0, Settings.SuperFXClockMultiplier);
CheckDlgButton(hDlg,IDC_INACTIVE_PAUSE,GUI.InactivePause ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_CUSTOMROMOPEN,GUI.CustomRomOpen ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg, IDC_ADD_REGISTRY, GUI.AddToRegistry ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_HIRESAVI,GUI.AVIHiRes ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg, IDC_CONFIRMSAVELOAD, GUI.ConfirmSaveLoad ? BST_CHECKED : BST_UNCHECKED);
@ -5431,6 +5432,7 @@ INT_PTR CALLBACK DlgEmulatorProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPar
GUI.CustomRomOpen = (BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_CUSTOMROMOPEN));
GUI.AVIHiRes = (BST_CHECKED==IsDlgButtonChecked(hDlg, IDC_HIRESAVI));
GUI.ConfirmSaveLoad = (BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_CONFIRMSAVELOAD));
GUI.AddToRegistry = (BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_ADD_REGISTRY));
Settings.TurboSkipFrames=SendDlgItemMessage(hDlg, IDC_SPIN_TURBO_SKIP, UDM_GETPOS, 0,0);
Settings.AutoMaxSkipFrames=SendDlgItemMessage(hDlg, IDC_SPIN_MAX_SKIP, UDM_GETPOS, 0,0);
@ -7321,8 +7323,12 @@ void LoadExts(void)
curr=valid_ext;
valid_ext=valid_ext->next;
delete curr;
RegisterProgid();
RegisterExts();
if (GUI.AddToRegistry)
{
RegisterProgid();
RegisterExts();
}
}
void MakeExtFile(void)

View File

@ -260,6 +260,8 @@ struct sGUI {
// rewinding
unsigned int rewindBufferSize;
unsigned int rewindGranularity;
bool AddToRegistry;
};
//TURBO masks