Esempio n. 1
0
static int flagload(const TCHAR *ext, const TCHAR *title, BOOL force) {

	int		ret;
	int		id;
	TCHAR	path[MAX_PATH];
	TCHAR	buf[1024];

	getstatfilename(path, ext, NELEMENTS(path));
	winuienter();
	id = IDYES;
	ret = statsave_check(path, buf, NELEMENTS(buf));
	if (ret & (~STATFLAG_DISKCHG)) {
		MessageBox(hWndMain, _T("Couldn't restart"), title,
										MB_OK | MB_ICONSTOP);
		id = IDNO;
	}
	else if ((!force) && (ret & STATFLAG_DISKCHG)) {
		TCHAR buf2[1024 + 256];
		wsprintf(buf2, _T("Conflict!\n\n%s\nContinue?"), buf);
		id = MessageBox(hWndMain, buf2, title,
										MB_YESNOCANCEL | MB_ICONQUESTION);
	}
	if (id == IDYES) {
		statsave_load(path);
	}
	sysmng_workclockreset();
	sysmng_updatecaption();
	winuileave();
	return(id);
}
Esempio n. 2
0
File: np2.c Progetto: utamaro/np2.js
static int flagload(const char *ext, const char *title, BOOL force) {

	int		ret;
	int		id;
	char	path[MAX_PATH];
	char	buf[1024];
	char	buf2[1024 + 256];

	getstatfilename(path, ext, sizeof(path));
	id = DID_YES;
	ret = statsave_check(path, buf, sizeof(buf));
#ifndef EMSCRIPTEN
	if (ret & (~STATFLAG_DISKCHG)) {
		menumbox("Couldn't restart", title, MBOX_OK | MBOX_ICONSTOP);
		id = DID_NO;
	}
	else if ((!force) && (ret & STATFLAG_DISKCHG)) {
		SPRINTF(buf2, "Conflict!\n\n%s\nContinue?", buf);
		id = menumbox(buf2, title, MBOX_YESNOCAN | MBOX_ICONQUESTION);
	}
#endif
	if (id == DID_YES) {
		statsave_load(path);
	}
	return(id);
}
Esempio n. 3
0
static int flagload(const char *ext, BOOL force) {

	char	path[MAX_PATH];
	char	buf[1024];
	int		r;
	int		ret;

	getstatfilename(path, ext, sizeof(path));
	r = statsave_check(path, buf, sizeof(buf));
	if (r & (~STATFLAG_DISKCHG)) {
		ResumeErrorDialogProc();
		ret = IDCANCEL;
	}
	else if ((!force) && (r & STATFLAG_DISKCHG)) {
		ret = ResumeWarningDialogProc(buf);
	}
	else {
		ret = IDOK;
	}
	if (ret == IDOK) {
		statsave_load(path);
	}
	return(ret);
}
Esempio n. 4
0
static int flagload(const OEMCHAR *ext, const OEMCHAR *title, BOOL force) {

	int		ret;
	int		id;
	OEMCHAR	path[MAX_PATH];
	OEMCHAR	buf[1024];
	OEMCHAR	buf2[1024 + 256];

	getstatfilename(path, ext, NELEMENTS(path));
	id = DID_YES;
	ret = statsave_check(path, buf, NELEMENTS(buf));
	if (ret & (~STATFLAG_DISKCHG)) {
		menumbox(OEMTEXT("Couldn't restart"), title, MBOX_OK | MBOX_ICONSTOP);
		id = DID_NO;
	}
	else if ((!force) && (ret & STATFLAG_DISKCHG)) {
		OEMSPRINTF(buf2, OEMTEXT("Conflict!\n\n%s\nContinue?"), buf);
		id = menumbox(buf2, title, MBOX_YESNOCAN | MBOX_ICONQUESTION);
	}
	if (id == DID_YES) {
		statsave_load(path);
	}
	return(id);
}