From ebfe4e2a1c03abfa0ef23f523f9a6d64feb3e736 Mon Sep 17 00:00:00 2001 From: zeromus Date: Mon, 30 Jun 2008 00:19:47 +0000 Subject: [PATCH] fix up the readonly checkbox behavior in the replay dialog --- src/drivers/win/replay.cpp | 12 ++++-------- src/movie.h | 1 - 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/drivers/win/replay.cpp b/src/drivers/win/replay.cpp index aeaad2c0..90256cc5 100644 --- a/src/drivers/win/replay.cpp +++ b/src/drivers/win/replay.cpp @@ -107,8 +107,7 @@ void UpdateReplayDialog(HWND hwndDlg) char *fn=GetReplayPath(hwndDlg); // remember the previous setting for the read-only checkbox - if(IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHECK_READONLY))) - replayReadOnlySetting = (SendDlgItemMessage(hwndDlg, IDC_CHECK_READONLY, BM_GETCHECK, 0, 0) == BST_CHECKED); + replayReadOnlySetting = (SendDlgItemMessage(hwndDlg, IDC_CHECK_READONLY, BM_GETCHECK, 0, 0) == BST_CHECKED); EnableWindow(GetDlgItem(hwndDlg,IDC_BUTTON_METADATA),FALSE); @@ -126,6 +125,8 @@ void UpdateReplayDialog(HWND hwndDlg) SetDlgItemText(hwndDlg,IDC_EDIT_STOPFRAME,tmp); stopframeWasEditedByUser = false; + EnableWindow(GetDlgItem(hwndDlg,IDC_CHECK_READONLY),TRUE); + div = (FCEUI_GetCurrentVidSystem(0,0)) ? 50 : 60; // PAL timing info.num_frames += (div>>1); // round up sprintf(tmp, "%02d:%02d:%02d", (info.num_frames/(div*60*60)), (info.num_frames/(div*60))%60, (info.num_frames/div) % 60); @@ -134,8 +135,7 @@ void UpdateReplayDialog(HWND hwndDlg) sprintf(tmp, "%u", (unsigned)info.rerecord_count); SetWindowTextA(GetDlgItem(hwndDlg,IDC_LABEL_UNDOCOUNT), tmp); // rerecord - EnableWindow(GetDlgItem(hwndDlg,IDC_CHECK_READONLY),(info.read_only)? FALSE : TRUE); // disable read-only checkbox if the file access is read-only - SendDlgItemMessage(hwndDlg,IDC_CHECK_READONLY,BM_SETCHECK,info.read_only ? BST_CHECKED : (replayReadOnlySetting ? BST_CHECKED : BST_UNCHECKED), 0); + SendDlgItemMessage(hwndDlg,IDC_CHECK_READONLY,BM_SETCHECK,(replayReadOnlySetting ? BST_CHECKED : BST_UNCHECKED), 0); SetWindowText(GetDlgItem(hwndDlg,IDC_LABEL_RECORDEDFROM),info.poweron ? "Power-On" : (info.reset?"Soft-Reset":"Savestate")); @@ -545,10 +545,6 @@ BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP // restore focus to the dialog SetFocus(GetDlgItem(hwndDlg, IDC_COMBO_FILENAME)); UpdateReplayDialog(hwndDlg); -// if (ofn.Flags & OFN_READONLY) -// SendDlgItemMessage(hwndDlg, IDC_CHECK_READONLY, BM_SETCHECK, BST_CHECKED, 0); -// else -// SendDlgItemMessage(hwndDlg, IDC_CHECK_READONLY, BM_SETCHECK, BST_UNCHECKED, 0); } free(pn); diff --git a/src/movie.h b/src/movie.h index 9eb34ad9..d3ab7c45 100644 --- a/src/movie.h +++ b/src/movie.h @@ -35,7 +35,6 @@ typedef struct uint32 rerecord_count; bool poweron, pal, nosynchack; bool reset; //mbg 6/21/08 - this flag isnt used anymore.. but maybe one day we can scan it out of the first record in the movie file - int read_only; uint32 emu_version_used; // 9813 = 0.98.13 MD5DATA md5_of_rom_used; std::string name_of_rom_used;