This commit is contained in:
Wengier
2021-06-17 04:29:17 -04:00
parent f7c75efbf7
commit 0f4eaf98a4
2 changed files with 8 additions and 6 deletions

View File

@@ -635,7 +635,8 @@ int macosx_yesno(const char *title, const char *message) {
[alert setMessageText:[NSString stringWithFormat:@"%s",title]];
[alert setInformativeText:[NSString stringWithFormat:@"%s",message]];
[alert setAlertStyle:NSInformationalAlertStyle];
return [alert runModal];
int res = [alert runModal];
return res==NSAlertFirstButtonReturn?1:0;
}
int macosx_yesnocancel(const char *title, const char *message) {
@@ -646,5 +647,6 @@ int macosx_yesnocancel(const char *title, const char *message) {
[alert setMessageText:[NSString stringWithFormat:@"%s",title]];
[alert setInformativeText:[NSString stringWithFormat:@"%s",message]];
[alert setAlertStyle:NSInformationalAlertStyle];
return [alert runModal];
int res = [alert runModal];
return res==NSAlertFirstButtonReturn?1:(res==NSAlertSecondButtonReturn?0:-1);
}

View File

@@ -271,7 +271,7 @@ extern bool has_touch_bar_support;
bool macosx_detect_nstouchbar(void);
void macosx_init_touchbar(void);
void macosx_GetWindowDPI(ScreenSizeInfo &info);
bool macosx_yesno(const char *title, const char *message);
int macosx_yesno(const char *title, const char *message);
int macosx_yesnocancel(const char *title, const char *message);
std::string macosx_prompt_folder(const char *default_folder);
void GetClipboard(std::string* result);
@@ -12705,14 +12705,14 @@ int main(int argc, char* argv[]) SDL_MAIN_NOEXCEPT {
#if defined(MACOSX)
std::string path = macosx_prompt_folder(default_folder);
if (path.empty()) {
if (macosx_yesno("Run DOSBox-X?", quitstr)==1001) {
if (!macosx_yesno("Run DOSBox-X?", quitstr)) {
fprintf(stderr,"No path chosen by user, exiting\n");
return 1;
}
} else if (workdiropt == "default") {
int ans=macosx_yesnocancel("DOSBox-X working directory", confirmstr);
if (ans == 1000) {workdirsave=1;workdirsaveas=path;}
else if (ans == 1001) workdirsave=2;
if (ans == 1) {workdirsave=1;workdirsaveas=path;}
else if (ans == 0) workdirsave=2;
}
#elif defined(WIN32) && !defined(HX_DOS)
std::wstring path = win32_prompt_folder(default_folder);