SS preference "Save and Quit" button

This commit is contained in:
kanjitalk755 2019-02-02 19:53:00 +09:00
parent 10de3e7239
commit 805ba753b2
4 changed files with 778 additions and 4440 deletions

View File

@ -106,7 +106,7 @@ static uint32 fs_data = 0; // Mac address of global data
static char FS_NAME[32], VOLUME_NAME[32];
// This directory is our root (read from prefs)
static const char *RootPath;
static char RootPath[MAX_PATH_LENGTH];
static bool ready = false;
static struct stat root_stat;
@ -196,7 +196,7 @@ static uint32 get_creation_time(const char *path)
{
if (path == NULL)
return 0;
if (path == RootPath) {
if (!strcmp(path, RootPath)) {
static uint32 root_crtime = UINT_MAX;
if (root_crtime == UINT_MAX)
root_crtime = do_get_creation_time(path);
@ -435,7 +435,11 @@ void ExtFSInit(void)
p->guest_name[31] = 0;
// Find path for root
if ((RootPath = PrefsFindString("extfs")) != NULL) {
*RootPath = 0;
const char *path = PrefsFindString("extfs");
if (path != NULL) {
strncpy(RootPath, path, MAX_PATH_LENGTH - 1);
RootPath[MAX_PATH_LENGTH - 1] = 0;
if (stat(RootPath, &root_stat))
return;
if (!S_ISDIR(root_stat.st_mode))

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -30,6 +30,8 @@
#include <unistd.h>
#include "SDL.h"
// NSInteger was added in 10.5 SDK.
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
#if __LP64__ || NS_BUILD_32_LIKE_64
@ -478,6 +480,10 @@ static NSString *makeRelativeIfNecessary(NSString *path)
[[self window] close];
[NSApp stopModal];
cancelWasClicked = NO;
// quit
SDL_Event event = { .type = SDL_QUIT };
SDL_PushEvent(&event);
}
- (BOOL) cancelWasClicked