mirror of
https://github.com/fadden/ciderpress.git
synced 2024-10-06 01:56:20 +00:00
Normalize indentation and EOL
This updates all source files to use spaces instead of tabs for indentation. It also normalizes the end-of-line markers to be Windows-style CRLF, and ensures that all files end with EOL. No substantive changes were made; "diff -w" is empty.
This commit is contained in:
parent
b11f10dddf
commit
63b9996009
1090
app/ACUArchive.cpp
1090
app/ACUArchive.cpp
File diff suppressed because it is too large
Load Diff
336
app/ACUArchive.h
336
app/ACUArchive.h
@ -19,41 +19,41 @@ class AcuArchive;
|
||||
*/
|
||||
class AcuEntry : public GenericEntry {
|
||||
public:
|
||||
AcuEntry(AcuArchive* pArchive) :
|
||||
fpArchive(pArchive), fIsSqueezed(false), fOffset(-1)
|
||||
{}
|
||||
virtual ~AcuEntry(void) {}
|
||||
AcuEntry(AcuArchive* pArchive) :
|
||||
fpArchive(pArchive), fIsSqueezed(false), fOffset(-1)
|
||||
{}
|
||||
virtual ~AcuEntry(void) {}
|
||||
|
||||
// retrieve thread data
|
||||
virtual int ExtractThreadToBuffer(int which, char** ppText, long* pLength,
|
||||
CString* pErrMsg) const;
|
||||
virtual int ExtractThreadToFile(int which, FILE* outfp, ConvertEOL conv,
|
||||
ConvertHighASCII convHA, CString* pErrMsg) const;
|
||||
virtual long GetSelectionSerial(void) const { return -1; } // doesn't matter
|
||||
// retrieve thread data
|
||||
virtual int ExtractThreadToBuffer(int which, char** ppText, long* pLength,
|
||||
CString* pErrMsg) const;
|
||||
virtual int ExtractThreadToFile(int which, FILE* outfp, ConvertEOL conv,
|
||||
ConvertHighASCII convHA, CString* pErrMsg) const;
|
||||
virtual long GetSelectionSerial(void) const { return -1; } // doesn't matter
|
||||
|
||||
virtual bool GetFeatureFlag(Feature feature) const {
|
||||
if (feature == kFeaturePascalTypes || feature == kFeatureDOSTypes ||
|
||||
feature == kFeatureHasSimpleAccess)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
virtual bool GetFeatureFlag(Feature feature) const {
|
||||
if (feature == kFeaturePascalTypes || feature == kFeatureDOSTypes ||
|
||||
feature == kFeatureHasSimpleAccess)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
NuError TestEntry(CWnd* pMsgWnd);
|
||||
NuError TestEntry(CWnd* pMsgWnd);
|
||||
|
||||
bool GetSqueezed(void) const { return fIsSqueezed; }
|
||||
void SetSqueezed(bool val) { fIsSqueezed = val; }
|
||||
long GetOffset(void) const { return fOffset; }
|
||||
void SetOffset(long offset) { fOffset = offset; }
|
||||
bool GetSqueezed(void) const { return fIsSqueezed; }
|
||||
void SetSqueezed(bool val) { fIsSqueezed = val; }
|
||||
long GetOffset(void) const { return fOffset; }
|
||||
void SetOffset(long offset) { fOffset = offset; }
|
||||
|
||||
private:
|
||||
NuError CopyData(FILE* outfp, ConvertEOL conv, ConvertHighASCII convHA,
|
||||
CString* pMsg) const;
|
||||
//NuError BNYUnSqueeze(ExpandBuffer* outExp) const;
|
||||
NuError CopyData(FILE* outfp, ConvertEOL conv, ConvertHighASCII convHA,
|
||||
CString* pMsg) const;
|
||||
//NuError BNYUnSqueeze(ExpandBuffer* outExp) const;
|
||||
|
||||
AcuArchive* fpArchive; // holds FILE* for archive
|
||||
bool fIsSqueezed;
|
||||
long fOffset;
|
||||
AcuArchive* fpArchive; // holds FILE* for archive
|
||||
bool fIsSqueezed;
|
||||
long fOffset;
|
||||
};
|
||||
|
||||
|
||||
@ -62,161 +62,161 @@ private:
|
||||
*/
|
||||
class AcuArchive : public GenericArchive {
|
||||
public:
|
||||
AcuArchive(void) : fIsReadOnly(false), fFp(nil)
|
||||
{}
|
||||
virtual ~AcuArchive(void) { (void) Close(); }
|
||||
AcuArchive(void) : fIsReadOnly(false), fFp(nil)
|
||||
{}
|
||||
virtual ~AcuArchive(void) { (void) Close(); }
|
||||
|
||||
// One-time initialization; returns an error string.
|
||||
static CString AppInit(void);
|
||||
// One-time initialization; returns an error string.
|
||||
static CString AppInit(void);
|
||||
|
||||
virtual OpenResult Open(const char* filename, bool readOnly,
|
||||
CString* pErrMsg);
|
||||
virtual CString New(const char* filename, const void* options);
|
||||
virtual CString Flush(void) { return ""; }
|
||||
virtual CString Reload(void);
|
||||
virtual bool IsReadOnly(void) const { return fIsReadOnly; };
|
||||
virtual bool IsModified(void) const { return false; }
|
||||
virtual void GetDescription(CString* pStr) const { *pStr = "AppleLink ACU"; }
|
||||
virtual bool BulkAdd(ActionProgressDialog* pActionProgress,
|
||||
const AddFilesDialog* pAddOpts)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool AddDisk(ActionProgressDialog* pActionProgress,
|
||||
const AddFilesDialog* pAddOpts)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool CreateSubdir(CWnd* pMsgWnd, GenericEntry* pParentEntry,
|
||||
const char* newName)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool TestSelection(CWnd* pMsgWnd, SelectionSet* pSelSet);
|
||||
virtual bool DeleteSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool RenameSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool RenameVolume(CWnd* pMsgWnd, DiskFS* pDiskFS,
|
||||
const char* newName)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual CString TestVolumeName(const DiskFS* pDiskFS,
|
||||
const char* newName) const
|
||||
{ ASSERT(false); return "!"; }
|
||||
virtual CString TestPathName(const GenericEntry* pGenericEntry,
|
||||
const CString& basePath, const CString& newName, char newFssep) const
|
||||
{ ASSERT(false); return "!"; }
|
||||
virtual bool RecompressSelection(CWnd* pMsgWnd, SelectionSet* pSelSet,
|
||||
const RecompressOptionsDialog* pRecompOpts)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual XferStatus XferSelection(CWnd* pMsgWnd, SelectionSet* pSelSet,
|
||||
ActionProgressDialog* pActionProgress, const XferFileOptions* pXferOpts)
|
||||
{ ASSERT(false); return kXferFailed; }
|
||||
virtual bool GetComment(CWnd* pMsgWnd, const GenericEntry* pEntry,
|
||||
CString* pStr)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool SetComment(CWnd* pMsgWnd, GenericEntry* pEntry,
|
||||
const CString& str)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool DeleteComment(CWnd* pMsgWnd, GenericEntry* pEntry)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool SetProps(CWnd* pMsgWnd, GenericEntry* pEntry,
|
||||
const FileProps* pProps)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual void PreferencesChanged(void) {}
|
||||
virtual long GetCapability(Capability cap);
|
||||
virtual OpenResult Open(const char* filename, bool readOnly,
|
||||
CString* pErrMsg);
|
||||
virtual CString New(const char* filename, const void* options);
|
||||
virtual CString Flush(void) { return ""; }
|
||||
virtual CString Reload(void);
|
||||
virtual bool IsReadOnly(void) const { return fIsReadOnly; };
|
||||
virtual bool IsModified(void) const { return false; }
|
||||
virtual void GetDescription(CString* pStr) const { *pStr = "AppleLink ACU"; }
|
||||
virtual bool BulkAdd(ActionProgressDialog* pActionProgress,
|
||||
const AddFilesDialog* pAddOpts)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool AddDisk(ActionProgressDialog* pActionProgress,
|
||||
const AddFilesDialog* pAddOpts)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool CreateSubdir(CWnd* pMsgWnd, GenericEntry* pParentEntry,
|
||||
const char* newName)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool TestSelection(CWnd* pMsgWnd, SelectionSet* pSelSet);
|
||||
virtual bool DeleteSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool RenameSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool RenameVolume(CWnd* pMsgWnd, DiskFS* pDiskFS,
|
||||
const char* newName)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual CString TestVolumeName(const DiskFS* pDiskFS,
|
||||
const char* newName) const
|
||||
{ ASSERT(false); return "!"; }
|
||||
virtual CString TestPathName(const GenericEntry* pGenericEntry,
|
||||
const CString& basePath, const CString& newName, char newFssep) const
|
||||
{ ASSERT(false); return "!"; }
|
||||
virtual bool RecompressSelection(CWnd* pMsgWnd, SelectionSet* pSelSet,
|
||||
const RecompressOptionsDialog* pRecompOpts)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual XferStatus XferSelection(CWnd* pMsgWnd, SelectionSet* pSelSet,
|
||||
ActionProgressDialog* pActionProgress, const XferFileOptions* pXferOpts)
|
||||
{ ASSERT(false); return kXferFailed; }
|
||||
virtual bool GetComment(CWnd* pMsgWnd, const GenericEntry* pEntry,
|
||||
CString* pStr)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool SetComment(CWnd* pMsgWnd, GenericEntry* pEntry,
|
||||
const CString& str)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool DeleteComment(CWnd* pMsgWnd, GenericEntry* pEntry)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual bool SetProps(CWnd* pMsgWnd, GenericEntry* pEntry,
|
||||
const FileProps* pProps)
|
||||
{ ASSERT(false); return false; }
|
||||
virtual void PreferencesChanged(void) {}
|
||||
virtual long GetCapability(Capability cap);
|
||||
|
||||
friend class AcuEntry;
|
||||
friend class AcuEntry;
|
||||
|
||||
private:
|
||||
virtual CString Close(void) {
|
||||
if (fFp != nil) {
|
||||
fclose(fFp);
|
||||
fFp = nil;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
virtual void XferPrepare(const XferFileOptions* pXferOpts)
|
||||
{ ASSERT(false); }
|
||||
virtual CString XferFile(FileDetails* pDetails, unsigned char** pDataBuf,
|
||||
long dataLen, unsigned char** pRsrcBuf, long rsrcLen)
|
||||
{ ASSERT(false); return "!"; }
|
||||
virtual void XferAbort(CWnd* pMsgWnd)
|
||||
{ ASSERT(false); }
|
||||
virtual void XferFinish(CWnd* pMsgWnd)
|
||||
{ ASSERT(false); }
|
||||
virtual CString Close(void) {
|
||||
if (fFp != nil) {
|
||||
fclose(fFp);
|
||||
fFp = nil;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
virtual void XferPrepare(const XferFileOptions* pXferOpts)
|
||||
{ ASSERT(false); }
|
||||
virtual CString XferFile(FileDetails* pDetails, unsigned char** pDataBuf,
|
||||
long dataLen, unsigned char** pRsrcBuf, long rsrcLen)
|
||||
{ ASSERT(false); return "!"; }
|
||||
virtual void XferAbort(CWnd* pMsgWnd)
|
||||
{ ASSERT(false); }
|
||||
virtual void XferFinish(CWnd* pMsgWnd)
|
||||
{ ASSERT(false); }
|
||||
|
||||
virtual ArchiveKind GetArchiveKind(void) { return kArchiveACU; }
|
||||
virtual NuError DoAddFile(const AddFilesDialog* pAddOpts,
|
||||
FileDetails* pDetails)
|
||||
{ ASSERT(false); return kNuErrGeneric; }
|
||||
virtual ArchiveKind GetArchiveKind(void) { return kArchiveACU; }
|
||||
virtual NuError DoAddFile(const AddFilesDialog* pAddOpts,
|
||||
FileDetails* pDetails)
|
||||
{ ASSERT(false); return kNuErrGeneric; }
|
||||
|
||||
enum {
|
||||
kAcuMaxFileName = 256, // nice big number
|
||||
enum {
|
||||
kAcuMaxFileName = 256, // nice big number
|
||||
|
||||
kAcuMasterHeaderLen = 20,
|
||||
kAcuEntryHeaderLen = 54,
|
||||
};
|
||||
kAcuMasterHeaderLen = 20,
|
||||
kAcuEntryHeaderLen = 54,
|
||||
};
|
||||
|
||||
/*
|
||||
* The header at the front of an ACU archive.
|
||||
*/
|
||||
typedef struct AcuMasterHeader {
|
||||
unsigned short fileCount;
|
||||
unsigned short unknown1; // 0x01 00 -- might be "version 1?"
|
||||
unsigned char fZink[6]; // "fZink", low ASCII
|
||||
unsigned char unknown2[11]; // 0x01 36 00 00 00 00 00 00 00 00 dd
|
||||
} AcuMasterHeader;
|
||||
/*
|
||||
* The header at the front of an ACU archive.
|
||||
*/
|
||||
typedef struct AcuMasterHeader {
|
||||
unsigned short fileCount;
|
||||
unsigned short unknown1; // 0x01 00 -- might be "version 1?"
|
||||
unsigned char fZink[6]; // "fZink", low ASCII
|
||||
unsigned char unknown2[11]; // 0x01 36 00 00 00 00 00 00 00 00 dd
|
||||
} AcuMasterHeader;
|
||||
|
||||
/*
|
||||
* An entry in an ACU archive. Each archive is essentially a stream
|
||||
* of files; only the "filesToFollow" value gives any indication that
|
||||
* something else follows this entry.
|
||||
*
|
||||
* We read this from the archive and then unpack the interesting parts
|
||||
* into GenericEntry fields in an AcuEntry.
|
||||
*/
|
||||
struct AcuFileEntry;
|
||||
friend struct AcuFileEntry;
|
||||
typedef struct AcuFileEntry {
|
||||
unsigned char compressionType;
|
||||
unsigned short dataChecksum; // ??
|
||||
unsigned short blockCount; // total blocks req'd to hold file
|
||||
unsigned long dataStorageLen; // length of data within archive
|
||||
unsigned short access;
|
||||
unsigned short fileType;
|
||||
unsigned long auxType;
|
||||
unsigned char storageType;
|
||||
unsigned long dataEof;
|
||||
unsigned short prodosModDate;
|
||||
unsigned short prodosModTime;
|
||||
NuDateTime modWhen; // computed from previous two fields
|
||||
unsigned short prodosCreateDate;
|
||||
unsigned short prodosCreateTime;
|
||||
NuDateTime createWhen; // computed from previous two fields
|
||||
unsigned short fileNameLen;
|
||||
unsigned short headerChecksum; // ??
|
||||
char fileName[kAcuMaxFileName+1];
|
||||
/*
|
||||
* An entry in an ACU archive. Each archive is essentially a stream
|
||||
* of files; only the "filesToFollow" value gives any indication that
|
||||
* something else follows this entry.
|
||||
*
|
||||
* We read this from the archive and then unpack the interesting parts
|
||||
* into GenericEntry fields in an AcuEntry.
|
||||
*/
|
||||
struct AcuFileEntry;
|
||||
friend struct AcuFileEntry;
|
||||
typedef struct AcuFileEntry {
|
||||
unsigned char compressionType;
|
||||
unsigned short dataChecksum; // ??
|
||||
unsigned short blockCount; // total blocks req'd to hold file
|
||||
unsigned long dataStorageLen; // length of data within archive
|
||||
unsigned short access;
|
||||
unsigned short fileType;
|
||||
unsigned long auxType;
|
||||
unsigned char storageType;
|
||||
unsigned long dataEof;
|
||||
unsigned short prodosModDate;
|
||||
unsigned short prodosModTime;
|
||||
NuDateTime modWhen; // computed from previous two fields
|
||||
unsigned short prodosCreateDate;
|
||||
unsigned short prodosCreateTime;
|
||||
NuDateTime createWhen; // computed from previous two fields
|
||||
unsigned short fileNameLen;
|
||||
unsigned short headerChecksum; // ??
|
||||
char fileName[kAcuMaxFileName+1];
|
||||
|
||||
// possibilities for mystery fields:
|
||||
// - OS type (note ProDOS is $00)
|
||||
// - forked file support
|
||||
} AcuFileEntry;
|
||||
// possibilities for mystery fields:
|
||||
// - OS type (note ProDOS is $00)
|
||||
// - forked file support
|
||||
} AcuFileEntry;
|
||||
|
||||
/* known compression types */
|
||||
enum CompressionType {
|
||||
kAcuCompNone = 0,
|
||||
kAcuCompSqueeze = 3,
|
||||
};
|
||||
/* known compression types */
|
||||
enum CompressionType {
|
||||
kAcuCompNone = 0,
|
||||
kAcuCompSqueeze = 3,
|
||||
};
|
||||
|
||||
int LoadContents(void);
|
||||
int ReadMasterHeader(int* pNumEntries);
|
||||
NuError ReadFileHeader(AcuFileEntry* pEntry);
|
||||
void DumpFileHeader(const AcuFileEntry* pEntry);
|
||||
int CreateEntry(const AcuFileEntry* pEntry);
|
||||
int LoadContents(void);
|
||||
int ReadMasterHeader(int* pNumEntries);
|
||||
NuError ReadFileHeader(AcuFileEntry* pEntry);
|
||||
void DumpFileHeader(const AcuFileEntry* pEntry);
|
||||
int CreateEntry(const AcuFileEntry* pEntry);
|
||||
|
||||
bool IsDir(const AcuFileEntry* pEntry);
|
||||
NuError AcuRead(void* buf, size_t nbyte);
|
||||
NuError AcuSeek(long offset);
|
||||
void AcuConvertDateTime(unsigned short prodosDate,
|
||||
unsigned short prodosTime, NuDateTime* pWhen);
|
||||
bool IsDir(const AcuFileEntry* pEntry);
|
||||
NuError AcuRead(void* buf, size_t nbyte);
|
||||
NuError AcuSeek(long offset);
|
||||
void AcuConvertDateTime(unsigned short prodosDate,
|
||||
unsigned short prodosTime, NuDateTime* pWhen);
|
||||
|
||||
FILE* fFp;
|
||||
bool fIsReadOnly;
|
||||
FILE* fFp;
|
||||
bool fIsReadOnly;
|
||||
};
|
||||
|
||||
#endif /*__ACU_ARCHIVE__*/
|
@ -19,22 +19,22 @@
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(AboutDialog, CDialog)
|
||||
ON_BN_CLICKED(IDC_ABOUT_CREDITS, OnAboutCredits)
|
||||
//ON_BN_CLICKED(IDC_ABOUT_ENTER_REG, OnEnterReg)
|
||||
ON_BN_CLICKED(IDC_ABOUT_CREDITS, OnAboutCredits)
|
||||
//ON_BN_CLICKED(IDC_ABOUT_ENTER_REG, OnEnterReg)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
static const char* kVersionExtra =
|
||||
#ifdef _DEBUG
|
||||
" _DEBUG"
|
||||
" _DEBUG"
|
||||
#else
|
||||
""
|
||||
""
|
||||
#endif
|
||||
#ifdef _DEBUG_LOG
|
||||
" _LOG"
|
||||
" _LOG"
|
||||
#else
|
||||
""
|
||||
""
|
||||
#endif
|
||||
;
|
||||
;
|
||||
|
||||
/*
|
||||
* Update the static strings with DLL version numbers.
|
||||
@ -42,75 +42,75 @@ static const char* kVersionExtra =
|
||||
BOOL
|
||||
AboutDialog::OnInitDialog(void)
|
||||
{
|
||||
NuError nerr;
|
||||
long major, minor, bug;
|
||||
CString newVersion, tmpStr;
|
||||
CStatic* pStatic;
|
||||
//CString versionFmt;
|
||||
NuError nerr;
|
||||
long major, minor, bug;
|
||||
CString newVersion, tmpStr;
|
||||
CStatic* pStatic;
|
||||
//CString versionFmt;
|
||||
|
||||
/* CiderPress version string */
|
||||
pStatic = (CStatic*) GetDlgItem(IDC_CIDERPRESS_VERS_TEXT);
|
||||
ASSERT(pStatic != nil);
|
||||
pStatic->GetWindowText(tmpStr);
|
||||
newVersion.Format(tmpStr,
|
||||
kAppMajorVersion, kAppMinorVersion, kAppBugVersion,
|
||||
kAppDevString, kVersionExtra);
|
||||
pStatic->SetWindowText(newVersion);
|
||||
/* CiderPress version string */
|
||||
pStatic = (CStatic*) GetDlgItem(IDC_CIDERPRESS_VERS_TEXT);
|
||||
ASSERT(pStatic != nil);
|
||||
pStatic->GetWindowText(tmpStr);
|
||||
newVersion.Format(tmpStr,
|
||||
kAppMajorVersion, kAppMinorVersion, kAppBugVersion,
|
||||
kAppDevString, kVersionExtra);
|
||||
pStatic->SetWindowText(newVersion);
|
||||
|
||||
/* grab the static text control with the NufxLib version info */
|
||||
pStatic = (CStatic*) GetDlgItem(IDC_NUFXLIB_VERS_TEXT);
|
||||
ASSERT(pStatic != nil);
|
||||
nerr = NuGetVersion(&major, &minor, &bug, NULL, NULL);
|
||||
ASSERT(nerr == kNuErrNone);
|
||||
/* grab the static text control with the NufxLib version info */
|
||||
pStatic = (CStatic*) GetDlgItem(IDC_NUFXLIB_VERS_TEXT);
|
||||
ASSERT(pStatic != nil);
|
||||
nerr = NuGetVersion(&major, &minor, &bug, NULL, NULL);
|
||||
ASSERT(nerr == kNuErrNone);
|
||||
|
||||
pStatic->GetWindowText(tmpStr);
|
||||
newVersion.Format(tmpStr, major, minor, bug);
|
||||
pStatic->SetWindowText(newVersion);
|
||||
pStatic->GetWindowText(tmpStr);
|
||||
newVersion.Format(tmpStr, major, minor, bug);
|
||||
pStatic->SetWindowText(newVersion);
|
||||
|
||||
/* grab the static text control with the DiskImg version info */
|
||||
pStatic = (CStatic*) GetDlgItem(IDC_DISKIMG_VERS_TEXT);
|
||||
ASSERT(pStatic != nil);
|
||||
DiskImgLib::Global::GetVersion(&major, &minor, &bug);
|
||||
/* grab the static text control with the DiskImg version info */
|
||||
pStatic = (CStatic*) GetDlgItem(IDC_DISKIMG_VERS_TEXT);
|
||||
ASSERT(pStatic != nil);
|
||||
DiskImgLib::Global::GetVersion(&major, &minor, &bug);
|
||||
|
||||
pStatic->GetWindowText(tmpStr);
|
||||
newVersion.Format(tmpStr, major, minor, bug);
|
||||
pStatic->SetWindowText(newVersion);
|
||||
pStatic->GetWindowText(tmpStr);
|
||||
newVersion.Format(tmpStr, major, minor, bug);
|
||||
pStatic->SetWindowText(newVersion);
|
||||
|
||||
/* set the zlib version */
|
||||
pStatic = (CStatic*) GetDlgItem(IDC_ZLIB_VERS_TEXT);
|
||||
ASSERT(pStatic != nil);
|
||||
pStatic->GetWindowText(tmpStr);
|
||||
newVersion.Format(tmpStr, zlibVersion());
|
||||
pStatic->SetWindowText(newVersion);
|
||||
/* set the zlib version */
|
||||
pStatic = (CStatic*) GetDlgItem(IDC_ZLIB_VERS_TEXT);
|
||||
ASSERT(pStatic != nil);
|
||||
pStatic->GetWindowText(tmpStr);
|
||||
newVersion.Format(tmpStr, zlibVersion());
|
||||
pStatic->SetWindowText(newVersion);
|
||||
|
||||
/* and, finally, the ASPI version */
|
||||
pStatic = (CStatic*) GetDlgItem(IDC_ASPI_VERS_TEXT);
|
||||
ASSERT(pStatic != nil);
|
||||
if (DiskImgLib::Global::GetHasASPI()) {
|
||||
CString versionStr;
|
||||
DWORD version = DiskImgLib::Global::GetASPIVersion();
|
||||
versionStr.Format("%d.%d.%d.%d",
|
||||
version & 0x0ff,
|
||||
(version >> 8) & 0xff,
|
||||
(version >> 16) & 0xff,
|
||||
(version >> 24) & 0xff);
|
||||
pStatic->GetWindowText(tmpStr);
|
||||
newVersion.Format(tmpStr, versionStr);
|
||||
} else {
|
||||
newVersion.LoadString(IDS_ASPI_NOT_LOADED);
|
||||
}
|
||||
pStatic->SetWindowText(newVersion);
|
||||
/* and, finally, the ASPI version */
|
||||
pStatic = (CStatic*) GetDlgItem(IDC_ASPI_VERS_TEXT);
|
||||
ASSERT(pStatic != nil);
|
||||
if (DiskImgLib::Global::GetHasASPI()) {
|
||||
CString versionStr;
|
||||
DWORD version = DiskImgLib::Global::GetASPIVersion();
|
||||
versionStr.Format("%d.%d.%d.%d",
|
||||
version & 0x0ff,
|
||||
(version >> 8) & 0xff,
|
||||
(version >> 16) & 0xff,
|
||||
(version >> 24) & 0xff);
|
||||
pStatic->GetWindowText(tmpStr);
|
||||
newVersion.Format(tmpStr, versionStr);
|
||||
} else {
|
||||
newVersion.LoadString(IDS_ASPI_NOT_LOADED);
|
||||
}
|
||||
pStatic->SetWindowText(newVersion);
|
||||
|
||||
//ShowRegistrationInfo();
|
||||
{
|
||||
CWnd* pWnd = GetDlgItem(IDC_ABOUT_ENTER_REG);
|
||||
if (pWnd != nil) {
|
||||
pWnd->EnableWindow(FALSE);
|
||||
pWnd->ShowWindow(FALSE);
|
||||
}
|
||||
}
|
||||
//ShowRegistrationInfo();
|
||||
{
|
||||
CWnd* pWnd = GetDlgItem(IDC_ABOUT_ENTER_REG);
|
||||
if (pWnd != nil) {
|
||||
pWnd->EnableWindow(FALSE);
|
||||
pWnd->ShowWindow(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
return CDialog::OnInitDialog();
|
||||
return CDialog::OnInitDialog();
|
||||
}
|
||||
|
||||
#if 0
|
||||
@ -123,64 +123,64 @@ AboutDialog::OnInitDialog(void)
|
||||
void
|
||||
AboutDialog::ShowRegistrationInfo(void)
|
||||
{
|
||||
/*
|
||||
* Pull out the registration info. We shouldn't need to do much in the
|
||||
* way of validation, since it should have been validated either before
|
||||
* the program finished initializing or before we wrote the values into
|
||||
* the registry. It's always possible that somebody went and messed with
|
||||
* the registry while we were running -- perhaps a different instance of
|
||||
* CiderPress -- but that should be rare enough that we don't have to
|
||||
* worry about the occasional ugliness.
|
||||
*/
|
||||
const int kDay = 24 * 60 * 60;
|
||||
CString user, company, reg, versions, expire;
|
||||
CWnd* pUserWnd;
|
||||
CWnd* pCompanyWnd;
|
||||
//CWnd* pExpireWnd;
|
||||
/*
|
||||
* Pull out the registration info. We shouldn't need to do much in the
|
||||
* way of validation, since it should have been validated either before
|
||||
* the program finished initializing or before we wrote the values into
|
||||
* the registry. It's always possible that somebody went and messed with
|
||||
* the registry while we were running -- perhaps a different instance of
|
||||
* CiderPress -- but that should be rare enough that we don't have to
|
||||
* worry about the occasional ugliness.
|
||||
*/
|
||||
const int kDay = 24 * 60 * 60;
|
||||
CString user, company, reg, versions, expire;
|
||||
CWnd* pUserWnd;
|
||||
CWnd* pCompanyWnd;
|
||||
//CWnd* pExpireWnd;
|
||||
|
||||
pUserWnd = GetDlgItem(IDC_REG_USER_NAME);
|
||||
ASSERT(pUserWnd != nil);
|
||||
pCompanyWnd = GetDlgItem(IDC_REG_COMPANY_NAME);
|
||||
ASSERT(pCompanyWnd != nil);
|
||||
//pExpireWnd = GetDlgItem(IDC_REG_EXPIRES);
|
||||
//ASSERT(pExpireWnd != nil);
|
||||
pUserWnd = GetDlgItem(IDC_REG_USER_NAME);
|
||||
ASSERT(pUserWnd != nil);
|
||||
pCompanyWnd = GetDlgItem(IDC_REG_COMPANY_NAME);
|
||||
ASSERT(pCompanyWnd != nil);
|
||||
//pExpireWnd = GetDlgItem(IDC_REG_EXPIRES);
|
||||
//ASSERT(pExpireWnd != nil);
|
||||
|
||||
if (gMyApp.fRegistry.GetRegistration(&user, &company, ®, &versions,
|
||||
&expire) == 0)
|
||||
{
|
||||
if (reg.IsEmpty()) {
|
||||
/* not registered, show blank stuff */
|
||||
CString unreg;
|
||||
unreg.LoadString(IDS_ABOUT_UNREGISTERED);
|
||||
pUserWnd->SetWindowText(unreg);
|
||||
pCompanyWnd->SetWindowText("");
|
||||
if (gMyApp.fRegistry.GetRegistration(&user, &company, ®, &versions,
|
||||
&expire) == 0)
|
||||
{
|
||||
if (reg.IsEmpty()) {
|
||||
/* not registered, show blank stuff */
|
||||
CString unreg;
|
||||
unreg.LoadString(IDS_ABOUT_UNREGISTERED);
|
||||
pUserWnd->SetWindowText(unreg);
|
||||
pCompanyWnd->SetWindowText("");
|
||||
|
||||
/* show expire date */
|
||||
time_t expireWhen;
|
||||
expireWhen = atol(expire);
|
||||
if (expireWhen > 0) {
|
||||
CString expireStr;
|
||||
time_t now = time(nil);
|
||||
expireStr.Format(IDS_REG_EVAL_REM,
|
||||
((expireWhen - now) + kDay-1) / kDay);
|
||||
/* leave pUserWnd and pCompanyWnd set to defaults */
|
||||
pCompanyWnd->SetWindowText(expireStr);
|
||||
} else {
|
||||
pCompanyWnd->SetWindowText(_T("Has already expired!"));
|
||||
}
|
||||
} else {
|
||||
/* show registration info */
|
||||
pUserWnd->SetWindowText(user);
|
||||
pCompanyWnd->SetWindowText(company);
|
||||
//pExpireWnd->SetWindowText("");
|
||||
/* show expire date */
|
||||
time_t expireWhen;
|
||||
expireWhen = atol(expire);
|
||||
if (expireWhen > 0) {
|
||||
CString expireStr;
|
||||
time_t now = time(nil);
|
||||
expireStr.Format(IDS_REG_EVAL_REM,
|
||||
((expireWhen - now) + kDay-1) / kDay);
|
||||
/* leave pUserWnd and pCompanyWnd set to defaults */
|
||||
pCompanyWnd->SetWindowText(expireStr);
|
||||
} else {
|
||||
pCompanyWnd->SetWindowText(_T("Has already expired!"));
|
||||
}
|
||||
} else {
|
||||
/* show registration info */
|
||||
pUserWnd->SetWindowText(user);
|
||||
pCompanyWnd->SetWindowText(company);
|
||||
//pExpireWnd->SetWindowText("");
|
||||
|
||||
/* remove "Enter Registration" button */
|
||||
CWnd* pWnd = GetDlgItem(IDC_ABOUT_ENTER_REG);
|
||||
if (pWnd != nil) {
|
||||
pWnd->EnableWindow(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* remove "Enter Registration" button */
|
||||
CWnd* pWnd = GetDlgItem(IDC_ABOUT_ENTER_REG);
|
||||
if (pWnd != nil) {
|
||||
pWnd->EnableWindow(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -191,7 +191,7 @@ AboutDialog::ShowRegistrationInfo(void)
|
||||
void
|
||||
AboutDialog::OnAboutCredits(void)
|
||||
{
|
||||
WinHelp(HELP_TOPIC_CREDITS, HELP_CONTEXT /*HELP_CONTEXTPOPUP*/);
|
||||
WinHelp(HELP_TOPIC_CREDITS, HELP_CONTEXT /*HELP_CONTEXTPOPUP*/);
|
||||
}
|
||||
|
||||
#if 0
|
||||
@ -201,8 +201,8 @@ AboutDialog::OnAboutCredits(void)
|
||||
void
|
||||
AboutDialog::OnEnterReg(void)
|
||||
{
|
||||
if (EnterRegDialog::GetRegInfo(this) == 0) {
|
||||
ShowRegistrationInfo();
|
||||
}
|
||||
if (EnterRegDialog::GetRegInfo(this) == 0) {
|
||||
ShowRegistrationInfo();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -18,20 +18,20 @@
|
||||
*/
|
||||
class AboutDialog : public CDialog {
|
||||
public:
|
||||
AboutDialog(CWnd* pParentWnd = NULL) :
|
||||
CDialog(IDD_ABOUTDLG, pParentWnd)
|
||||
{}
|
||||
AboutDialog(CWnd* pParentWnd = NULL) :
|
||||
CDialog(IDD_ABOUTDLG, pParentWnd)
|
||||
{}
|
||||
|
||||
protected:
|
||||
// overrides
|
||||
virtual BOOL OnInitDialog(void);
|
||||
// overrides
|
||||
virtual BOOL OnInitDialog(void);
|
||||
|
||||
afx_msg void OnAboutCredits(void);
|
||||
afx_msg void OnEnterReg(void);
|
||||
afx_msg void OnAboutCredits(void);
|
||||
afx_msg void OnEnterReg(void);
|
||||
|
||||
//void ShowRegistrationInfo(void);
|
||||
//void ShowRegistrationInfo(void);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif /*__ABOUT_DIALOG__*/
|
@ -12,7 +12,7 @@
|
||||
#include "Main.h"
|
||||
|
||||
BEGIN_MESSAGE_MAP(ActionProgressDialog, ProgressCancelDialog)
|
||||
//ON_MESSAGE(WMU_START, OnStart)
|
||||
//ON_MESSAGE(WMU_START, OnStart)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/*
|
||||
@ -21,79 +21,79 @@ END_MESSAGE_MAP()
|
||||
BOOL
|
||||
ActionProgressDialog::OnInitDialog(void)
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
WMSG1("Action is %d\n", fAction);
|
||||
WMSG1("Action is %d\n", fAction);
|
||||
|
||||
CenterWindow(AfxGetMainWnd());
|
||||
CenterWindow(AfxGetMainWnd());
|
||||
|
||||
CWnd* pWnd;
|
||||
CWnd* pWnd;
|
||||
|
||||
// clear the filename fields
|
||||
pWnd = GetDlgItem(IDC_PROG_ARC_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(_T("-"));
|
||||
pWnd = GetDlgItem(IDC_PROG_FILE_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(_T("-"));
|
||||
// clear the filename fields
|
||||
pWnd = GetDlgItem(IDC_PROG_ARC_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(_T("-"));
|
||||
pWnd = GetDlgItem(IDC_PROG_FILE_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(_T("-"));
|
||||
|
||||
pWnd->SetFocus(); // get the focus off the Cancel button
|
||||
pWnd->SetFocus(); // get the focus off the Cancel button
|
||||
|
||||
if (fAction == kActionExtract) {
|
||||
/* defaults are correct */
|
||||
} else if (fAction == kActionRecompress) {
|
||||
CString tmpStr;
|
||||
pWnd = GetDlgItem(IDC_PROG_VERB);
|
||||
ASSERT(pWnd != nil);
|
||||
tmpStr.LoadString(IDS_NOW_EXPANDING);
|
||||
pWnd->SetWindowText(tmpStr);
|
||||
if (fAction == kActionExtract) {
|
||||
/* defaults are correct */
|
||||
} else if (fAction == kActionRecompress) {
|
||||
CString tmpStr;
|
||||
pWnd = GetDlgItem(IDC_PROG_VERB);
|
||||
ASSERT(pWnd != nil);
|
||||
tmpStr.LoadString(IDS_NOW_EXPANDING);
|
||||
pWnd->SetWindowText(tmpStr);
|
||||
|
||||
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
||||
ASSERT(pWnd != nil);
|
||||
tmpStr.LoadString(IDS_NOW_COMPRESSING);
|
||||
pWnd->SetWindowText(tmpStr);
|
||||
} else if (fAction == kActionAdd || fAction == kActionAddDisk ||
|
||||
fAction == kActionConvFile || fAction == kActionConvDisk)
|
||||
{
|
||||
CString tmpStr;
|
||||
pWnd = GetDlgItem(IDC_PROG_VERB);
|
||||
ASSERT(pWnd != nil);
|
||||
tmpStr.LoadString(IDS_NOW_ADDING);
|
||||
pWnd->SetWindowText(tmpStr);
|
||||
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
||||
ASSERT(pWnd != nil);
|
||||
tmpStr.LoadString(IDS_NOW_COMPRESSING);
|
||||
pWnd->SetWindowText(tmpStr);
|
||||
} else if (fAction == kActionAdd || fAction == kActionAddDisk ||
|
||||
fAction == kActionConvFile || fAction == kActionConvDisk)
|
||||
{
|
||||
CString tmpStr;
|
||||
pWnd = GetDlgItem(IDC_PROG_VERB);
|
||||
ASSERT(pWnd != nil);
|
||||
tmpStr.LoadString(IDS_NOW_ADDING);
|
||||
pWnd->SetWindowText(tmpStr);
|
||||
|
||||
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
||||
ASSERT(pWnd != nil);
|
||||
tmpStr.LoadString(IDS_ADDING_AS);
|
||||
pWnd->SetWindowText(tmpStr);
|
||||
} else if (fAction == kActionDelete) {
|
||||
CString tmpStr;
|
||||
pWnd = GetDlgItem(IDC_PROG_VERB);
|
||||
ASSERT(pWnd != nil);
|
||||
tmpStr.LoadString(IDS_NOW_DELETING);
|
||||
pWnd->SetWindowText(tmpStr);
|
||||
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
||||
ASSERT(pWnd != nil);
|
||||
tmpStr.LoadString(IDS_ADDING_AS);
|
||||
pWnd->SetWindowText(tmpStr);
|
||||
} else if (fAction == kActionDelete) {
|
||||
CString tmpStr;
|
||||
pWnd = GetDlgItem(IDC_PROG_VERB);
|
||||
ASSERT(pWnd != nil);
|
||||
tmpStr.LoadString(IDS_NOW_DELETING);
|
||||
pWnd->SetWindowText(tmpStr);
|
||||
|
||||
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
||||
pWnd->DestroyWindow();
|
||||
pWnd = GetDlgItem(IDC_PROG_FILE_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(_T(""));
|
||||
} else if (fAction == kActionTest) {
|
||||
CString tmpStr;
|
||||
pWnd = GetDlgItem(IDC_PROG_VERB);
|
||||
ASSERT(pWnd != nil);
|
||||
tmpStr.LoadString(IDS_NOW_TESTING);
|
||||
pWnd->SetWindowText(tmpStr);
|
||||
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
||||
pWnd->DestroyWindow();
|
||||
pWnd = GetDlgItem(IDC_PROG_FILE_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(_T(""));
|
||||
} else if (fAction == kActionTest) {
|
||||
CString tmpStr;
|
||||
pWnd = GetDlgItem(IDC_PROG_VERB);
|
||||
ASSERT(pWnd != nil);
|
||||
tmpStr.LoadString(IDS_NOW_TESTING);
|
||||
pWnd->SetWindowText(tmpStr);
|
||||
|
||||
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
||||
pWnd->DestroyWindow();
|
||||
pWnd = GetDlgItem(IDC_PROG_FILE_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(_T(""));
|
||||
} else {
|
||||
ASSERT(false);
|
||||
}
|
||||
pWnd = GetDlgItem(IDC_PROG_TOFROM);
|
||||
pWnd->DestroyWindow();
|
||||
pWnd = GetDlgItem(IDC_PROG_FILE_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(_T(""));
|
||||
} else {
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -102,25 +102,25 @@ ActionProgressDialog::OnInitDialog(void)
|
||||
void
|
||||
ActionProgressDialog::SetArcName(const char* str)
|
||||
{
|
||||
CString oldStr;
|
||||
CString oldStr;
|
||||
|
||||
CWnd* pWnd = GetDlgItem(IDC_PROG_ARC_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->GetWindowText(oldStr);
|
||||
if (oldStr != str)
|
||||
pWnd->SetWindowText(str);
|
||||
CWnd* pWnd = GetDlgItem(IDC_PROG_ARC_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->GetWindowText(oldStr);
|
||||
if (oldStr != str)
|
||||
pWnd->SetWindowText(str);
|
||||
}
|
||||
|
||||
const CString
|
||||
ActionProgressDialog::GetFileName(void)
|
||||
{
|
||||
CString str;
|
||||
CString str;
|
||||
|
||||
CWnd* pWnd = GetDlgItem(IDC_PROG_FILE_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->GetWindowText(str);
|
||||
CWnd* pWnd = GetDlgItem(IDC_PROG_FILE_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->GetWindowText(str);
|
||||
|
||||
return str;
|
||||
return str;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -129,13 +129,13 @@ ActionProgressDialog::GetFileName(void)
|
||||
void
|
||||
ActionProgressDialog::SetFileName(const char* str)
|
||||
{
|
||||
CString oldStr;
|
||||
CString oldStr;
|
||||
|
||||
CWnd* pWnd = GetDlgItem(IDC_PROG_FILE_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->GetWindowText(oldStr);
|
||||
if (oldStr != str)
|
||||
pWnd->SetWindowText(str);
|
||||
CWnd* pWnd = GetDlgItem(IDC_PROG_FILE_NAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->GetWindowText(oldStr);
|
||||
if (oldStr != str)
|
||||
pWnd->SetWindowText(str);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -146,12 +146,12 @@ ActionProgressDialog::SetFileName(const char* str)
|
||||
int
|
||||
ActionProgressDialog::SetProgress(int perc)
|
||||
{
|
||||
ASSERT(perc >= 0 && perc <= 100);
|
||||
MainWindow* pMainWin = (MainWindow*)::AfxGetMainWnd();
|
||||
ASSERT(perc >= 0 && perc <= 100);
|
||||
MainWindow* pMainWin = (MainWindow*)::AfxGetMainWnd();
|
||||
|
||||
/* solicit input */
|
||||
pMainWin->PeekAndPump();
|
||||
/* solicit input */
|
||||
pMainWin->PeekAndPump();
|
||||
|
||||
return ProgressCancelDialog::SetProgress(perc *
|
||||
(kProgressResolution/100));
|
||||
return ProgressCancelDialog::SetProgress(perc *
|
||||
(kProgressResolution/100));
|
||||
}
|
||||
|
@ -16,50 +16,50 @@
|
||||
*/
|
||||
class ActionProgressDialog : public ProgressCancelDialog {
|
||||
public:
|
||||
typedef enum {
|
||||
kActionUnknown = 0,
|
||||
kActionAdd,
|
||||
kActionAddDisk,
|
||||
kActionExtract,
|
||||
kActionDelete,
|
||||
kActionTest,
|
||||
kActionRecompress,
|
||||
kActionConvDisk,
|
||||
kActionConvFile,
|
||||
} Action;
|
||||
typedef enum {
|
||||
kActionUnknown = 0,
|
||||
kActionAdd,
|
||||
kActionAddDisk,
|
||||
kActionExtract,
|
||||
kActionDelete,
|
||||
kActionTest,
|
||||
kActionRecompress,
|
||||
kActionConvDisk,
|
||||
kActionConvFile,
|
||||
} Action;
|
||||
|
||||
ActionProgressDialog(void) {
|
||||
fAction = kActionUnknown;
|
||||
//fpSelSet = nil;
|
||||
//fpOptionsDlg = nil;
|
||||
fCancel = false;
|
||||
//fResult = 0;
|
||||
}
|
||||
virtual ~ActionProgressDialog(void) {}
|
||||
ActionProgressDialog(void) {
|
||||
fAction = kActionUnknown;
|
||||
//fpSelSet = nil;
|
||||
//fpOptionsDlg = nil;
|
||||
fCancel = false;
|
||||
//fResult = 0;
|
||||
}
|
||||
virtual ~ActionProgressDialog(void) {}
|
||||
|
||||
BOOL Create(Action action, CWnd* pParentWnd = NULL) {
|
||||
fAction = action;
|
||||
pParentWnd->EnableWindow(FALSE);
|
||||
return ProgressCancelDialog::Create(&fCancel, IDD_ACTION_PROGRESS,
|
||||
IDC_PROG_PROGRESS, pParentWnd);
|
||||
}
|
||||
void Cleanup(CWnd* pParentWnd) {
|
||||
pParentWnd->EnableWindow(TRUE);
|
||||
DestroyWindow();
|
||||
}
|
||||
BOOL Create(Action action, CWnd* pParentWnd = NULL) {
|
||||
fAction = action;
|
||||
pParentWnd->EnableWindow(FALSE);
|
||||
return ProgressCancelDialog::Create(&fCancel, IDD_ACTION_PROGRESS,
|
||||
IDC_PROG_PROGRESS, pParentWnd);
|
||||
}
|
||||
void Cleanup(CWnd* pParentWnd) {
|
||||
pParentWnd->EnableWindow(TRUE);
|
||||
DestroyWindow();
|
||||
}
|
||||
|
||||
void SetArcName(const char* str);
|
||||
void SetFileName(const char* str);
|
||||
const CString GetFileName(void);
|
||||
int SetProgress(int perc);
|
||||
void SetArcName(const char* str);
|
||||
void SetFileName(const char* str);
|
||||
const CString GetFileName(void);
|
||||
int SetProgress(int perc);
|
||||
|
||||
private:
|
||||
virtual BOOL OnInitDialog(void);
|
||||
virtual BOOL OnInitDialog(void);
|
||||
|
||||
Action fAction;
|
||||
bool fCancel;
|
||||
Action fAction;
|
||||
bool fCancel;
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif /*__ACTIONPROGRESSDIALOG__*/
|
||||
|
3542
app/Actions.cpp
3542
app/Actions.cpp
File diff suppressed because it is too large
Load Diff
@ -11,9 +11,9 @@
|
||||
#include "AddClashDialog.h"
|
||||
|
||||
BEGIN_MESSAGE_MAP(AddClashDialog, CDialog)
|
||||
ON_BN_CLICKED(IDC_CLASH_RENAME, OnRename)
|
||||
ON_BN_CLICKED(IDC_CLASH_SKIP, OnSkip)
|
||||
//ON_WM_HELPINFO()
|
||||
ON_BN_CLICKED(IDC_CLASH_RENAME, OnRename)
|
||||
ON_BN_CLICKED(IDC_CLASH_SKIP, OnSkip)
|
||||
//ON_WM_HELPINFO()
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/*
|
||||
@ -22,17 +22,17 @@ END_MESSAGE_MAP()
|
||||
BOOL
|
||||
AddClashDialog::OnInitDialog(void)
|
||||
{
|
||||
CWnd* pWnd;
|
||||
CWnd* pWnd;
|
||||
|
||||
pWnd = GetDlgItem(IDC_CLASH_WINNAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(fWindowsName);
|
||||
pWnd = GetDlgItem(IDC_CLASH_WINNAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(fWindowsName);
|
||||
|
||||
pWnd = GetDlgItem(IDC_CLASH_STORAGENAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(fStorageName);
|
||||
pWnd = GetDlgItem(IDC_CLASH_STORAGENAME);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(fStorageName);
|
||||
|
||||
return CDialog::OnInitDialog();
|
||||
return CDialog::OnInitDialog();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -41,20 +41,20 @@ AddClashDialog::OnInitDialog(void)
|
||||
void
|
||||
AddClashDialog::OnSkip(void)
|
||||
{
|
||||
fDoRename = false;
|
||||
CDialog::OnOK();
|
||||
fDoRename = false;
|
||||
CDialog::OnOK();
|
||||
}
|
||||
void
|
||||
AddClashDialog::OnRename(void)
|
||||
{
|
||||
RenameOverwriteDialog dlg;
|
||||
RenameOverwriteDialog dlg;
|
||||
|
||||
dlg.fNewFileSource = fWindowsName;
|
||||
dlg.fExistingFile = fStorageName;
|
||||
dlg.fNewName = fStorageName;
|
||||
if (dlg.DoModal() == IDOK) {
|
||||
fNewName = dlg.fNewName;
|
||||
fDoRename = true;
|
||||
CDialog::OnOK();
|
||||
}
|
||||
dlg.fNewFileSource = fWindowsName;
|
||||
dlg.fExistingFile = fStorageName;
|
||||
dlg.fNewName = fStorageName;
|
||||
if (dlg.DoModal() == IDOK) {
|
||||
fNewName = dlg.fNewName;
|
||||
fDoRename = true;
|
||||
CDialog::OnOK();
|
||||
}
|
||||
}
|
||||
|
@ -14,26 +14,26 @@
|
||||
*/
|
||||
class AddClashDialog : public CDialog {
|
||||
public:
|
||||
AddClashDialog(CWnd* pParentWnd = nil) :
|
||||
CDialog(IDD_ADD_CLASH, pParentWnd)
|
||||
{
|
||||
fDoRename = false;
|
||||
}
|
||||
~AddClashDialog(void) {}
|
||||
AddClashDialog(CWnd* pParentWnd = nil) :
|
||||
CDialog(IDD_ADD_CLASH, pParentWnd)
|
||||
{
|
||||
fDoRename = false;
|
||||
}
|
||||
~AddClashDialog(void) {}
|
||||
|
||||
CString fWindowsName;
|
||||
CString fStorageName;
|
||||
CString fWindowsName;
|
||||
CString fStorageName;
|
||||
|
||||
bool fDoRename; // if "false", skip this file
|
||||
CString fNewName;
|
||||
bool fDoRename; // if "false", skip this file
|
||||
CString fNewName;
|
||||
|
||||
private:
|
||||
afx_msg void OnRename(void);
|
||||
afx_msg void OnSkip(void);
|
||||
afx_msg void OnRename(void);
|
||||
afx_msg void OnSkip(void);
|
||||
|
||||
virtual BOOL OnInitDialog(void);
|
||||
virtual BOOL OnInitDialog(void);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif /*__ADDCLASHDIALOG__*/
|
||||
|
@ -26,91 +26,91 @@
|
||||
bool
|
||||
AddFilesDialog::MyDataExchange(bool saveAndValidate)
|
||||
{
|
||||
CWnd* pWnd;
|
||||
CWnd* pWnd;
|
||||
|
||||
if (saveAndValidate) {
|
||||
if (GetDlgButtonCheck(this, IDC_ADDFILES_NOPRESERVE) == BST_CHECKED)
|
||||
fTypePreservation = kPreserveNone;
|
||||
else if (GetDlgButtonCheck(this, IDC_ADDFILES_PRESERVE) == BST_CHECKED)
|
||||
fTypePreservation = kPreserveTypes;
|
||||
else if (GetDlgButtonCheck(this, IDC_ADDFILES_PRESERVEPLUS) == BST_CHECKED)
|
||||
fTypePreservation = kPreserveAndExtend;
|
||||
else {
|
||||
ASSERT(false);
|
||||
fTypePreservation = kPreserveNone;
|
||||
}
|
||||
if (saveAndValidate) {
|
||||
if (GetDlgButtonCheck(this, IDC_ADDFILES_NOPRESERVE) == BST_CHECKED)
|
||||
fTypePreservation = kPreserveNone;
|
||||
else if (GetDlgButtonCheck(this, IDC_ADDFILES_PRESERVE) == BST_CHECKED)
|
||||
fTypePreservation = kPreserveTypes;
|
||||
else if (GetDlgButtonCheck(this, IDC_ADDFILES_PRESERVEPLUS) == BST_CHECKED)
|
||||
fTypePreservation = kPreserveAndExtend;
|
||||
else {
|
||||
ASSERT(false);
|
||||
fTypePreservation = kPreserveNone;
|
||||
}
|
||||
|
||||
if (GetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLNONE) == BST_CHECKED)
|
||||
fConvEOL = kConvEOLNone;
|
||||
else if (GetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLTYPE) == BST_CHECKED)
|
||||
fConvEOL = kConvEOLType;
|
||||
else if (GetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLTEXT) == BST_CHECKED)
|
||||
fConvEOL = kConvEOLAuto;
|
||||
else if (GetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLALL) == BST_CHECKED)
|
||||
fConvEOL = kConvEOLAll;
|
||||
else {
|
||||
ASSERT(false);
|
||||
fConvEOL = kConvEOLNone;
|
||||
}
|
||||
if (GetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLNONE) == BST_CHECKED)
|
||||
fConvEOL = kConvEOLNone;
|
||||
else if (GetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLTYPE) == BST_CHECKED)
|
||||
fConvEOL = kConvEOLType;
|
||||
else if (GetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLTEXT) == BST_CHECKED)
|
||||
fConvEOL = kConvEOLAuto;
|
||||
else if (GetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLALL) == BST_CHECKED)
|
||||
fConvEOL = kConvEOLAll;
|
||||
else {
|
||||
ASSERT(false);
|
||||
fConvEOL = kConvEOLNone;
|
||||
}
|
||||
|
||||
fIncludeSubfolders =
|
||||
(GetDlgButtonCheck(this, IDC_ADDFILES_INCLUDE_SUBFOLDERS) == BST_CHECKED);
|
||||
fStripFolderNames =
|
||||
(GetDlgButtonCheck(this, IDC_ADDFILES_STRIP_FOLDER) == BST_CHECKED);
|
||||
fOverwriteExisting =
|
||||
(GetDlgButtonCheck(this, IDC_ADDFILES_OVERWRITE) == BST_CHECKED);
|
||||
fIncludeSubfolders =
|
||||
(GetDlgButtonCheck(this, IDC_ADDFILES_INCLUDE_SUBFOLDERS) == BST_CHECKED);
|
||||
fStripFolderNames =
|
||||
(GetDlgButtonCheck(this, IDC_ADDFILES_STRIP_FOLDER) == BST_CHECKED);
|
||||
fOverwriteExisting =
|
||||
(GetDlgButtonCheck(this, IDC_ADDFILES_OVERWRITE) == BST_CHECKED);
|
||||
|
||||
pWnd = GetDlgItem(IDC_ADDFILES_PREFIX);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->GetWindowText(fStoragePrefix);
|
||||
pWnd = GetDlgItem(IDC_ADDFILES_PREFIX);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->GetWindowText(fStoragePrefix);
|
||||
|
||||
if (!ValidateStoragePrefix())
|
||||
return false;
|
||||
if (!ValidateStoragePrefix())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
} else {
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_NOPRESERVE,
|
||||
fTypePreservation == kPreserveNone);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_PRESERVE,
|
||||
fTypePreservation == kPreserveTypes);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_PRESERVEPLUS,
|
||||
fTypePreservation == kPreserveAndExtend);
|
||||
return true;
|
||||
} else {
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_NOPRESERVE,
|
||||
fTypePreservation == kPreserveNone);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_PRESERVE,
|
||||
fTypePreservation == kPreserveTypes);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_PRESERVEPLUS,
|
||||
fTypePreservation == kPreserveAndExtend);
|
||||
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLNONE,
|
||||
fConvEOL == kConvEOLNone);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLTYPE,
|
||||
fConvEOL == kConvEOLType);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLTEXT,
|
||||
fConvEOL == kConvEOLAuto);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLALL,
|
||||
fConvEOL == kConvEOLAll);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLNONE,
|
||||
fConvEOL == kConvEOLNone);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLTYPE,
|
||||
fConvEOL == kConvEOLType);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLTEXT,
|
||||
fConvEOL == kConvEOLAuto);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_CONVEOLALL,
|
||||
fConvEOL == kConvEOLAll);
|
||||
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_INCLUDE_SUBFOLDERS,
|
||||
fIncludeSubfolders != FALSE);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_STRIP_FOLDER,
|
||||
fStripFolderNames != FALSE);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_OVERWRITE,
|
||||
fOverwriteExisting != FALSE);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_INCLUDE_SUBFOLDERS,
|
||||
fIncludeSubfolders != FALSE);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_STRIP_FOLDER,
|
||||
fStripFolderNames != FALSE);
|
||||
SetDlgButtonCheck(this, IDC_ADDFILES_OVERWRITE,
|
||||
fOverwriteExisting != FALSE);
|
||||
|
||||
pWnd = GetDlgItem(IDC_ADDFILES_PREFIX);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(fStoragePrefix);
|
||||
if (!fStoragePrefixEnable)
|
||||
pWnd->EnableWindow(FALSE);
|
||||
pWnd = GetDlgItem(IDC_ADDFILES_PREFIX);
|
||||
ASSERT(pWnd != nil);
|
||||
pWnd->SetWindowText(fStoragePrefix);
|
||||
if (!fStoragePrefixEnable)
|
||||
pWnd->EnableWindow(FALSE);
|
||||
|
||||
if (!fStripFolderNamesEnable) {
|
||||
::EnableControl(this, IDC_ADDFILES_STRIP_FOLDER, false);
|
||||
}
|
||||
if (!fStripFolderNamesEnable) {
|
||||
::EnableControl(this, IDC_ADDFILES_STRIP_FOLDER, false);
|
||||
}
|
||||
|
||||
if (!fConvEOLEnable) {
|
||||
::EnableControl(this, IDC_ADDFILES_CONVEOLNONE, false);
|
||||
::EnableControl(this, IDC_ADDFILES_CONVEOLTYPE, false);
|
||||
::EnableControl(this, IDC_ADDFILES_CONVEOLTEXT, false);
|
||||
::EnableControl(this, IDC_ADDFILES_CONVEOLALL, false);
|
||||
}
|
||||
if (!fConvEOLEnable) {
|
||||
::EnableControl(this, IDC_ADDFILES_CONVEOLNONE, false);
|
||||
::EnableControl(this, IDC_ADDFILES_CONVEOLTYPE, false);
|
||||
::EnableControl(this, IDC_ADDFILES_CONVEOLTEXT, false);
|
||||
::EnableControl(this, IDC_ADDFILES_CONVEOLALL, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -119,19 +119,19 @@ AddFilesDialog::MyDataExchange(bool saveAndValidate)
|
||||
bool
|
||||
AddFilesDialog::ValidateStoragePrefix(void)
|
||||
{
|
||||
if (fStoragePrefix.IsEmpty())
|
||||
return true;
|
||||
if (fStoragePrefix.IsEmpty())
|
||||
return true;
|
||||
|
||||
const char kFssep = PathProposal::kDefaultStoredFssep;
|
||||
if (fStoragePrefix[0] == kFssep || fStoragePrefix.Right(1) == kFssep) {
|
||||
CString errMsg;
|
||||
errMsg.Format("The storage prefix may not start or end with '%c'.",
|
||||
kFssep);
|
||||
MessageBox(errMsg, m_ofn.lpstrTitle, MB_OK | MB_ICONWARNING);
|
||||
return false;
|
||||
}
|
||||
const char kFssep = PathProposal::kDefaultStoredFssep;
|
||||
if (fStoragePrefix[0] == kFssep || fStoragePrefix.Right(1) == kFssep) {
|
||||
CString errMsg;
|
||||
errMsg.Format("The storage prefix may not start or end with '%c'.",
|
||||
kFssep);
|
||||
MessageBox(errMsg, m_ofn.lpstrTitle, MB_OK | MB_ICONWARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -141,13 +141,13 @@ AddFilesDialog::ValidateStoragePrefix(void)
|
||||
UINT
|
||||
AddFilesDialog::MyOnCommand(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (wParam) {
|
||||
case IDHELP:
|
||||
OnIDHelp();
|
||||
return 1;
|
||||
default:
|
||||
return SelectFilesDialog::MyOnCommand(wParam, lParam);
|
||||
}
|
||||