From 52f6cdf5bec880f69f89b6e568b690090e1b1a7a Mon Sep 17 00:00:00 2001 From: CaH4e3 Date: Wed, 5 May 2010 08:22:31 +0000 Subject: [PATCH] make previous fixes more windows specific ;) why not let windows handle this instead of doing it by own hand? filled all defext options for all save dialogs --- src/drivers/win/cdlogger.cpp | 10 +++------- src/drivers/win/memview.cpp | 1 + src/drivers/win/memwatch.cpp | 1 + src/drivers/win/tracer.cpp | 2 +- src/drivers/win/wave.cpp | 1 + 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/drivers/win/cdlogger.cpp b/src/drivers/win/cdlogger.cpp index aad6a875..481a400a 100644 --- a/src/drivers/win/cdlogger.cpp +++ b/src/drivers/win/cdlogger.cpp @@ -245,8 +245,8 @@ void SaveCDLogFileAs(){ ofn.hInstance=fceu_hInstance; ofn.lpstrTitle="Save Code Data Log File As..."; ofn.lpstrFilter=filter; + ofn.lpstrDefExt = "cdl"; strcpy(nameo,GetRomName()); - strcat(nameo,".cdl"); ofn.lpstrFile=nameo; ofn.nMaxFile=256; ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; @@ -329,17 +329,13 @@ void SaveStrippedRom(){ //this is based off of iNesSave() ofn.lpstrTitle="Save Stripped File As..."; if (GameInfo->type==GIT_NSF) { ofn.lpstrFilter=NSFfilter; + ofn.lpstrDefExt = "nsf"; } else { ofn.lpstrFilter=NESfilter; + ofn.lpstrDefExt = "nes"; } strcpy(sromfilename,GetRomName()); - if (GameInfo->type==GIT_NSF) { - strcat(sromfilename,"_cdl.nsf"); - } - else { - strcat(sromfilename,"_cdl.nes"); - } ofn.lpstrFile=sromfilename; ofn.nMaxFile=256; ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; diff --git a/src/drivers/win/memview.cpp b/src/drivers/win/memview.cpp index eb954015..06d1520b 100644 --- a/src/drivers/win/memview.cpp +++ b/src/drivers/win/memview.cpp @@ -294,6 +294,7 @@ void SaveRomAs() ofn.hInstance=fceu_hInstance; ofn.lpstrTitle="Save Nes ROM as..."; ofn.lpstrFilter=filter; + ofn.lpstrDefExt="nes"; strcpy(nameo,GetRomName()); ofn.lpstrFile=nameo; ofn.nMaxFile=256; diff --git a/src/drivers/win/memwatch.cpp b/src/drivers/win/memwatch.cpp index 9d72c23b..e3601c9b 100644 --- a/src/drivers/win/memwatch.cpp +++ b/src/drivers/win/memwatch.cpp @@ -406,6 +406,7 @@ static void SaveMemWatch() ofn.hInstance=fceu_hInstance; ofn.lpstrTitle="Save Memory Watch As..."; ofn.lpstrFilter=filter; + ofn.lpstrDefExt="txt"; char nameo[2048]; if (!memwLastFilename[0]) strcpy(nameo,GetRomName()); diff --git a/src/drivers/win/tracer.cpp b/src/drivers/win/tracer.cpp index 01af99d4..d90b38a9 100644 --- a/src/drivers/win/tracer.cpp +++ b/src/drivers/win/tracer.cpp @@ -591,8 +591,8 @@ void ShowLogDirDialog(void){ ofn.hInstance=fceu_hInstance; ofn.lpstrTitle="Log Trace As..."; ofn.lpstrFilter=filter; + ofn.lpstrDefExt="log"; strcpy(nameo,GetRomName()); - strcat(nameo,"_log.txt"); ofn.lpstrFile=nameo; ofn.nMaxFile=256; ofn.Flags=OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY; diff --git a/src/drivers/win/wave.cpp b/src/drivers/win/wave.cpp index 826eb90e..f5f2382e 100644 --- a/src/drivers/win/wave.cpp +++ b/src/drivers/win/wave.cpp @@ -44,6 +44,7 @@ bool CreateSoundSave() ofn.hInstance=fceu_hInstance; ofn.lpstrTitle="Log Sound As..."; ofn.lpstrFilter=filter; + ofn.lpstrDefExt="wav"; strcpy(nameo,GetRomName()); ofn.lpstrFile=nameo; ofn.nMaxFile=256;