Commit Graph

121 Commits

Author SHA1 Message Date
Andy McFadden 06eeabc8a4 Switch to system font
Switch the remaining dialogs to the system font.  This required
minor adjustments in a couple of places.

Also, remove the remnants of the ChooseDir dialog.
2015-01-15 16:10:08 -08:00
Andy McFadden 829e275b23 Tweak "open file" behavior
For a file with ".shk" extension, prioritize disk image over NuFX
file archive.  The disk image code won't accept it if it has more
than one entry, and it's pretty rare for somebody to want to open
a single-disk archive in file mode.

Ideally all single-disk archives are named ".sdk", but there's
probably a lot that are just named ".shk", so this will probably
be more convenient.
2015-01-15 15:45:31 -08:00
Andy McFadden b5169033a1 Update progress dialogs
Do the Mac OS Roman conversion in a couple of places.  Fix the
NuFX extraction progress, which got all blinky after the wide char
update.
2015-01-15 15:35:34 -08:00
Andy McFadden 0861b7ead4 Simplify 2015-01-15 14:21:01 -08:00
Andy McFadden 8c34eb1213 Volume name and font fixes
More volume name MOR conversions.  I think I got them all.

This also switches the "archive info", "add files", and "extract
files" dialogs to use the System Font.  We were using "MS Sans
Serif" before, which looks a bit ratty on Windows 7 because it
doesn't take advantage of ClearType.  (Apparently the ClearType
version is "Microsoft Sans Serif", though when you set the "use
system font" boolean to true it changes the font name to "MS Shell
Dlg".)  The old font also seems to be missing certain glyphs, e.g.
my HFS volume name had 'TM' in it, but that just showed up as a box
(which is why, in case you were wondering, these changes ended up
together).

The new font seems to work equally well on WinXP, so I may enable
it for all dialogs in a follow-up change.  As far as I can tell it
has the same font metrics -- I haven't seen anything weird looking
in the dialogs I've updated so far.

Also, bumped the version to 4.0.0-b3.
2015-01-15 11:35:48 -08:00
Andy McFadden 87a7411dda Unicode conversion for volume name in volume copier
We needed to convert the volume name correctly for the volume list
and the progress dialogs when copying to or from a file.  This
shouldn't affect how anything works, but it looks nicer with HFS
volumes that have non-ASCII characters.
2015-01-15 10:48:35 -08:00
Andy McFadden bb24f51ccb Fix subvol charset handling
We weren't doing a MOR-to-UNI conversion on the sub-volume name, so
HFS volumes with non-ASCII characters didn't look right.

This also relocates the character-conversion code to a new source
file.  It's currently part of the reformat lib, though it arguably
belongs in util (but that would introduce a new dependency
between reformat and util).
2015-01-15 10:34:45 -08:00
Andy McFadden cc93d4ab92 File open tweaks
- Remove *.* from AppleSingle filter spec, since "all files" now
  works just fine.
- Make "all files" the default if nothing is configured.
2015-01-13 22:14:07 -08:00
Andy McFadden b40054bf26 Minor help file updates
Added AppleSingle note to "archive info" help page.
Added a missing pop-up help entry.
Added a README with instructions for regenerating help.
2015-01-13 17:47:57 -08:00
Andy McFadden e7e2459e5e Add Gutenberg to ImageFormatDialog pop-up
Used for "confirm disk image format".
2015-01-13 17:11:22 -08:00
Andy McFadden a2962e976f Handle cancellation
Don't show an error if the user has "confirm disk image format"
selected and cancels out of the dialog.
2015-01-13 16:48:08 -08:00
Andy McFadden 814872966e Rewrote "open archive" logic
The previous code was a stickler for only opening files whose type
matched what was selected in the filter pop-up.  The original goal
was to allow you to choose whether a BXY or SDK file was interpreted
as Binary II, ShrinkIt, or disk image, since they could go either
way.  Unfortunately, its refusal to consider types other than what
was selected made it kind of annoying.

The new code will start by trying to open the file with the selected
filter, so that it's still possible to choose how SDK and BXY files
are opened.  However, it now continues on, trying all other types
before finally giving up.

If the generic ("*.*") filter is selected, CiderPress will start by
trying to open the file as a disk image.

This seems to produce good results with a variety of known and
unknown files.
2015-01-13 15:54:10 -08:00
Andy McFadden 432b1c4cc6 Fix overwrite dialog
Was setting the original pathname improperly, so when attempting
to add a file to a NuFX archive the "do you want to overwrite
existing entry?" dialog contained gibberish.
2015-01-13 15:47:18 -08:00
Andy McFadden b3780261c4 Minor tweaks 2015-01-13 13:43:48 -08:00
Andy McFadden ed2d16a016 Nudge 2015-01-13 13:28:02 -08:00
Andy McFadden fd37bfd261 Reimplement ChooseDirDialog
The previous version was written to work on Win98+, and used the
rather gnarly ShellTree class.  Since we no longer support Win98,
we can now use CShellManager::BrowseForFolder(), which does exactly
what we want without all the ugly code (and it looks nicer, and it
integrates better with the rest of the system).

We can also get rid of NewFolderDialog, which only existed to allow
the user to create a folder when trudging through ShellTree.

This required "upgrading" the main app object from CWinApp to
CWinAppEx, but that appears to be benign.  Tested on WinXP and it
all seems fine.
2015-01-13 13:25:34 -08:00
Andy McFadden 7cd92a7fdd Version bump to 4.0.0b1 2015-01-12 18:18:28 -08:00
Andy McFadden b409d613fa Placate EOL hobgoblins 2015-01-12 18:06:38 -08:00
Andy McFadden 5946481b4e Add AppleSingle support
This handles version 1 and 2, and copes with the broken files
created by the Mac OS X "applesingle" command-line tool (which is
unable to decode the broken files it creates).

I get the sense that many AppleSingle files don't end with ".AS", so
the filespec includes "*.*" as well.

Some AppleSingle files don't include a filename.  In that case, we
use the file's name as the entry name, minus any ".as" extension.
The current implementation doesn't convert from Unicode to Mac OS
Roman, so non-ASCII characters are mishandled unless the file was
generated by GS/ShrinkIt.  (We assume version 1 AppleSingle files
use MOR name strings.)

Also, version bump to 4.0.0d3.
2015-01-12 17:49:59 -08:00
Andy McFadden 84ba460957 Minor cleanup 2015-01-11 16:11:44 -08:00
Andy McFadden 0d5bfa593f Don't enable fields when archive is read-only
"Edit attributes" on a read-only archive was enabling the file and
aux type fields inappropriately as part of the ProDOS vs. HFS file
type handling.
2015-01-11 15:50:55 -08:00
Andy McFadden 125d128b36 Show Gutenberg files as "Gutenb" in the content list 2015-01-09 18:36:05 -08:00
Andy McFadden 00e6b3ab5e Improve filename handling when reading from archives
This updates GenericEntry's filename handling to be more careful
about Mac OS Roman vs. Unicode.  Most of the work is still done with
a CP-1252 conversion instead of MOR, but we now do a proper
conversion on the "display name", so we see the right thing in the
content list and file viewer.

Copy & paste, disk-to-file-archive, and file-archive-to-disk
conversions should work (correctly) as before.  Extracted files will
still have "_" or "%AA" instead of a Unicode TRADE MARK SIGN, but
that's fine for now -- we can extract and re-add the files losslessly.

The filenames are now stored in CStrings rather than WCHAR*.

Also, fixed a bad initializer in the file-archive-to-disk conversion
dialog.
2015-01-08 17:57:20 -08:00
Andy McFadden b79498da50 Improve filename handling when adding files
Most of this change is a conversion of the old FileDetails struct
into a new LocalFileDetails class.  The new class keeps the
members private, and keeps the Unicode and MOR representations of
the string separate.

The NuFX and DiskImg libraries don't support UTF-16 filenames,
so we stil can't add files with non-CP-1252 filenames, but we're
a step closer.

Also, update NufxLib with a couple of fixes from the main project.

Also, fix handling of "%00" when adding files.

Also, mark most of the A2FileDOS fields private.  Not sure why
they weren't.
2015-01-08 14:16:20 -08:00
Andy McFadden d94b707489 Use more integers with explicit widths
Updated some structs and a few DiskImg APIs, primarily file type,
aux type, and access flags.
2015-01-04 18:20:59 -08:00
Andy McFadden 84706d7ea4 Update NufxLib snapshot to v3.0.0d2
This integrates the latest NufxLib sources, and updates CiderPress
to work with the API changes.
2015-01-04 11:29:51 -08:00
Andy McFadden 4dd0c9339d Quick stab at Unicode for AWGS/Teach
This tweaks the output for AWGS and Teach Text to convert from Mac
OS Roman to Unicode, rather than Windows code page 1252.

It would be slightly more efficient (and possibly a bit more legible
in the RTF file) if we left the "good" conversions alone, e.g.
continue to use the CP1252 character for "E with acute", instead of
converting to U+00C9.  That might leave us at the mercy of the code
page converter in some random RTF reader, though, so it's probably
best to just use the official Unicode values.
2014-12-18 17:33:09 -08:00
Andy McFadden 13c38be4aa Tweak error reporting 2014-12-17 15:45:28 -08:00
Andy McFadden 7b70767a1f Better error message when extracting files
The file extraction dialog allows you to select file parts, so you
can choose to exclude resource forks or just extract disk images.  If
you don't choose any parts, nothing will extract, and you get a
confusingly generic message about nothing matching the criteria.

This adds a specific error message for the case where no parts are
selected.
2014-12-17 13:31:50 -08:00
Andy McFadden ac721baf2b Merge branch 'master' of https://github.com/salfter/ciderpress into salfter-master 2014-12-17 11:33:37 -08:00
Scott Alfter 0960e23f47 found where nlist.data.txt was hiding; updated postbuild.bat accordingly 2014-12-17 11:17:23 -08:00
Scott Alfter 022c88dfad fix post-build, add missing file 2014-12-17 09:27:37 -08:00
Andy McFadden a902beb6ba Specify a custom class name for main frame
DeployMaster can detect whether or not CiderPress is currently
running by checking for the presence of a window with a specific class
name.  The default class name is generated differently each time, so
we need to set a custom class name.

Also, bumped version to 4.0.0d2.
2014-12-17 08:55:20 -08:00
Andy McFadden d42b9c6dc0 Add CheckedLoadString
The static analyzer was annoyed that the return value from calls to
CString::LoadString() was being ignored.  This adds a wrapper
function that checks the value and logs a failure message if the
string can't be found.
2014-12-16 11:04:31 -08:00
Andy McFadden ef708f563e Move file association handling back into the app
The DeployMaster installer issue prevents the user from seeing more
than nine of the 18 file extensions that CiderPress wants to handle,
and I don't want to go stomping on file associations without some
way to disable the behavior.  So this returns to the previous behavior,
where CiderPress directly manages the file associations.

The CiderPress app is not able to modify HKEY_LOCAL_MACHINE (which
it used to do via HKEY_CLASSES_ROOT) on recent versions of Windows --
tested in Win7, but it probably broke with Vista.  So now we do
everything in HKEY_CURRENT_USER.  This works, more or less.

We're not looking at the Windows shell overrides, which are made
in yet another set of registry entries, so there are multiple
reasons why the values reported by the Edit Associations dialog may
now be inaccurate.  I still favor eliminating the dialog as a
long-term strategy.

I took the opportunity to do some code cleanup in the registry code.
I also added calls to SHChangeNotify() to tell the Windows shell when
file associations change, so Windows Explorer windows get updated
promptly.
2014-12-15 21:57:09 -08:00
Andy McFadden 2709efe53b Fix up version number 2014-12-12 10:31:16 -08:00
Andy McFadden 4638d03d6c Shift responsibility for file associations to the installer
In the past, CiderPress managed its own file associations.  This is
the feature that launches CiderPress when you double-click on a ".shk"
file.  The installer ran "CiderPress -install" and "-uninstall" during
installation and removal to give CP a chance to establish and clean
up the necessary registry entries.

The code built with VS6 works fine.  The code built with VS2013 fails
with an access denied error.  It appears there have been some access
policy changes, and the older code is getting "grandfathered in".  This
is really something that the installer ought to be handling, though,
so rather than figure out how to fix CiderPress, I'm removing the
file type association code from CiderPress and letting DeployMaster
handle it.

This may be slightly less convenient for anyone who had reason to
change type associations frequently.  Modern versions of Windows have
relatively easy to use control panel UIs for adjusting types, and
the "advanced installation" feature of DeployMaster allows you to
un-check the types that you don't want to have associated with
CiderPress.

(...with one minor hitch: DeployMaster 4.2.2 only shows the first 9
associations, and CiderPress has 18.)

This change renders most of the registry-handling code obsolete, as
well as the "-install" / "-uninstall" handling.  I'm 99% sure I want
to go this way, but I'm keeping things #ifdefed rather than deleted
for the moment.
2014-12-11 14:22:39 -08:00
Andy McFadden a5fa12b332 Fix copy & paste
Some of the code was mis-handling wide character filenames.

A direct copy & paste should be using the 8-bit form of the filename,
but that's a deeper fix.

Also, changed some types to use explicit integer width specifiers.
2014-12-10 17:10:13 -08:00
Andy McFadden be8d3a4911 WinXP compatibility update
This changes the Platform Toolset configuration from "Visual Studio
2013 (v120)" to "Visual Studio 2013 - Windows XP (v120_xp)".  Without
this change, executables built by VS2013 will not run on WinXP.

To actually run on WinXP, we also need to install the redistributable
msvcr120.dll and mfc120u.dll, both of which are fairly large.  The
installation package has more than doubled in size.

At some point we may want to drop WinXP support -- Microsoft declared
end-of-life on April 8 2014 -- but if the only penalty is a 2MB increase
in installer size, we might as well keep supporting WinXP users.
2014-12-10 11:57:41 -08:00
Andy McFadden 759f0d820f WinHelp to HtmlHelp conversion, part 2
This updates the various dialogs to use the new functions.  The help
system should be fully functional now.
2014-12-09 14:10:52 -08:00
Andy McFadden 250d1043e3 WinHelp to HtmlHelp conversion, part 1
The original version of CiderPress used a WinHelp help file, built
with an application called HelpMatic Pro.  This app used a proprietary
format, and had no facility for exporting to "raw" HPJ + RTF files, so
I decompiled the HLP and imported it into HelpScribble.

Using HelpScribble, I cleaned up the help file formatting a little,
fixed up the table of contents, and exported as "raw" HtmlHelp (HHP,
HHK, HHC, and a whole bunch of HTML).  I also split the pop-up help
text, which isn't supported by HelpScribble, into a separate text file
that Microsoft's HTML Help Workshop understands.

I'm checking in the files that HTML Help Workshop needs to generate a
CHM, so anyone can update the help text.  I'm also checking in the CHM
file, rather than adding the help workshop to the build, so that it's
not necessary to download and configure the help workshop to build
CiderPress.

This change adds all of the updated help, but only updates the Help and
question mark button actions for one specific dialog.  A subsequent
change will update the rest of the dialogs.

This change is essentially upgrading us from a totally obsolete help
system to a nearly-obsolete help system, but the systems are similar
enough to make this a useful half-step on the way to something else.
The code will centralize help activation in a pair of functions in the
main app class, so any future improvements should be more limited in
scope.

This also adds a build step to copy the CHM to the execution directory.
2014-12-08 22:40:56 -08:00
Andy McFadden d23a3b1ad8 Replace place-holder strings
The NufxLib and diskimg libraries want narrow strings for certain
things, notably for the "storage name", i.e. how the name will appear
on the disk image or in the file archive.  We need to convert from
Windows UTF-16 to an Apple II filesystem-specific 8-bit character
representation.

We used to just pass narrow strings all the way through, so we didn't
need any intermediate storage to hold the conversion.  Now we do.  In
some cases there's nowhere good to put it.  The initial UTF-16
conversion changes just dropped in some place-holder strings.

This corrects the behavior, though in a couple of cases we're adding
kluges on top of code that was already badly bent from its original
intent (as initially conceived, CiderPress wasn't going to handle disk
images, just ShrinkIt archives).  It's not pretty, but it should work
for now.
2014-12-04 17:05:48 -08:00
Andy McFadden 94beec0639 File selection dialog update, part 2
This updates the main app to use the new dialog, and removes the
old code.
2014-12-03 16:10:03 -08:00
Andy McFadden b2cd857031 File selection dialog update, part 1
This adds a replacement for the SelectFilesDialog class.  It has
been updated to use Explorer-style dialogs, which are a bit nicer
than the old-style dialogs.  Hopefully this will eliminate some of the
brain damage, like the disappearing Accept button.

This change only updates MDC.  A second change will update the main
app and remove the old code.

Also, updated the MDC version to 3.0.0, and changed the web site
linked in the Help menu from faddensoft.com to a2ciderpress.com.
2014-12-02 17:39:56 -08:00
Andy McFadden c78017b1d2 More source code shuffling
Moved comments and return types, switched to uint types, added
"override" keyword.
2014-11-25 14:34:14 -08:00
Andy McFadden aa3145856c Use types with explicit sizes
Focusing on the diskimg library this time, which deals with a lot of
filesystem structures that have specific widths.

This is still a bit lax in places, e.g. using "long" for lengths.
Should either specify a bit width or use di_off_t.

Also, added "override" keyword where appropriate.

Also, bumped library version to 5.0.0.
2014-11-24 15:57:25 -08:00
Andy McFadden edb7c13120 Fix diskimg OpenImage
The OpenImage method had an overload that took void*.  This turns out
to be a bad idea, because void* matches any pointer type that didn't
match something else.  So the WCHAR* filenames were going to the "open
from buffer" method rather than the "open from file" variant.

A less important issue is whether open-from-buffer should take a const
or non-const pointer.  If the "readOnly" boolean flag is not set, then
the contents can be altered and const is inappropriate.  The best course
seems to be to drop the boolean flag as an argument, and just have two
different methods.
2014-11-23 10:34:57 -08:00
Andy McFadden d8223dbcfd Relocate method comments
This moves method comments from the .cpp file to the .h file,
where users of the methods can find them.  This also makes it
possible for the IDE to show the comments when you mouse-hover over
the method name, though Visual Studio is a bit weak in this regard.

Also, added "override" keywords on overridden methods.  Reasonably
current versions of popular compilers seem to support this.

Also, don't have the return type on a separate line in the .cpp file.
The motivation for the practice -- quickly finding a method definition
with "^name" -- is less useful in C++ than C, and modern IDEs provide
more convenient ways to do the same thing.

Also, do some more conversion from unsigned types to uintXX_t.

This commit is primarily for the "app" directory.
2014-11-21 22:33:39 -08:00
Andy McFadden 8f61f84585 Use types with explicit sizes
Much of what the "reformat" code does involves processing data that is
8, 16, or 32 bits.  We want to use size-specific types from stdint.h
(e.g. uint16_t) rather than "unsigned short".

This was a quick pass to replace the various "unsigned" declarations.
More can be done here and elsewhere.
2014-11-20 18:10:18 -08:00
Andy McFadden d60a6dbcfa Fix some issues identified by static analyzer
Includes "printf format" annotation on debug log function.
2014-11-19 14:54:24 -08:00
Andy McFadden f8017fdee3 Minor fixes
- Drop strcasecmp / strncasecmp defines; just use the VC++ version.
- Fix LOG_WARNING vs. LOG_WARN.
- Fix crash when NiftyList data file not available.
2014-11-18 17:10:23 -08:00
Andy McFadden af429c8bb9 Remove vestigial .cvsignore 2014-11-18 15:08:53 -08:00
Andy McFadden 3f9561f2d5 Define _CRT_SECURE_NO_WARNINGS and _CRT_NONSTDC_NO_DEPRECATE
There's probably some value in using the "secure" versions of the
various string functions, but I don't want to deal with it right
now.  We won't use them for the stuff that builds under Linux
anyway (diskimg, nufxlib).

This largely eliminates warnings from VC++.
2014-11-18 14:55:13 -08:00
Andy McFadden 9a67e7b1d3 Minor fixes
Fix release build.

Eliminate a few warnings.
2014-11-18 14:30:51 -08:00
Andy McFadden f6647b9978 Convert WSMG to LOG
Mostly a bulk conversion of debug messages, primarily with sed:

 sed -e 's/\(WMSG[0-9]\)\(.*\)\(\\n"\)/LOGI\2"/'

This removes the '\n' from the end of the log messages, and sets
them all to "info" severity.

We want to prefix each line with file/line and/or a timestamp,
so it doesn't make sense to have a partial line, and there's no
value in embedding the '\n' in every string.
2014-11-18 14:16:35 -08:00
Andy McFadden bf5e2bce50 Change "nil" to "NULL" 2014-11-17 21:37:36 -08:00
Andy McFadden d21ba553ab Added new logging macros
Visual Studio figured out variadic macros around 2005, so we can
finally replace the explicit-arg-count debug log macros.

Also, fixed some include guards.

Also, bumped version to 4.0.0d1.
2014-11-17 18:07:07 -08:00
Andy McFadden 51b5f00f5c Large set of changes to restore CiderPress build.
CiderPress and MDC now compile, and execute far enough to open
their respective "about" boxes, but I doubt they'll do much
more than that.

* Switch from MBCS to UNICODE APIs

Microsoft switched to UTF-16 (by way of UCS-2) a long time ago,
and the support for MBCS seems to be getting phased out.  So it's
time to switch to wide strings.

This is a bit awkward for CiderPress because it works with disk
and file archives with 8-bit filenames, and I want NufxLib and
DiskImgLib to continue to work on Linux (which has largely taken
the UTF-8 approach to Unicode).  The libraries will continue to
work with 8-bit filenames, with CiderPress/MDC doing the
conversion at the appropriate point.

There were a couple of places where strings from a structure
handed back by one of the libraries were used directly in the UI,
or vice-versa, which is a problem because we have nowhere to
store the result of the conversion.  These currently have fixed
place-holder "xyzzy" strings.

All UI strings are now wide.

Various format strings now use "%ls" and "%hs" to explicitly
specify wide and narrow.  This doesn't play well with gcc, so
only the Windows-specific parts use those.

* Various updates to vcxproj files

The project-file conversion had some cruft that is now largely
gone.  The build now has a common output directory for the EXEs
and libraries, avoiding the old post-build copy steps.

* Added zlib 1.2.8 and nufxlib 2.2.2 source snapshots

The old "prebuilts" directory is now gone.  The libraries are now
built as part of building the apps.

I added a minimal set of files for zlib, and a full set for nufxlib.
The Linux-specific nufxlib goodies are included for the benefit of
the Linux utilities, which are currently broken (don't build).

* Replace symbols used for include guards

Symbols with a leading "__" are reserved.
2014-11-16 21:01:53 -08:00
Andy McFadden 63b9996009 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.
2014-11-03 16:26:53 -08:00
Andy McFadden b11f10dddf Visual Studio 2013 update
This updates the project files for Visual Studio 2013, and removes
the old Visual Studio 6 (1998) project files.  The update tool had
a number of complaints (see UpgradeLog.htm) that may need to be
addressed.

Also, replaced .cvsignore with .gitignore.

Visual Studio reports 1886 build errors, nearly all of them due to
the switch from MBCS to Unicode.  The former is no longer
supported "out of the box", and its use is discouraged, so we're
going to bite the bullet and use wide characters in the UI.
2014-11-03 14:05:07 -08:00
David Schmidt 7dd253754d Recognize host TEXT files as such 2012-05-14 17:32:19 +00:00
David Schmidt 5637461d8a Add vestigal support for Gutenberg Word Processor formatting 2009-01-05 02:11:31 +00:00
David Schmidt abd3515424 Adding read capability for Gutenberg word processor formatted disks 2009-01-04 22:23:04 +00:00
Andy McFadden aa89adb2d9 Tweaks for 3.0.1 release. 2009-01-04 19:19:05 +00:00
David Schmidt fcf3be8249 Ignoring some locally-produced build artifacts 2009-01-04 17:00:48 +00:00
Andy McFadden 732cd85ce5 CP/M: added support for Microsoft Softcard "data only" disks.
CP/M: correctly identify 3.x disks
Updated some copyright notices.
2009-01-03 19:02:13 +00:00
Andy McFadden dbfb6be713 Minor update to help files and version. 2009-01-02 18:55:23 +00:00
David Schmidt a4524898f9 Add Apple /// Business BASIC file support 2008-12-16 03:35:37 +00:00
David Schmidt b5d96e53fa Ignore intermediate build artifacts 2008-12-16 02:55:16 +00:00
David Schmidt 535a38c4e1 Ignore intermediate build artifacts 2008-12-16 02:48:27 +00:00
Andy McFadden 0d7d1b67e0 initial import 2007-03-27 17:47:10 +00:00