There's a Photoshop plugin,
PTLens that can programatically correct lens distortion and CA. It's done on a profile basis, as I understand the K-7 does. If a lens is not in the database there's a straightforward method for creating a profile. I'm using it with my K20D and the 18-250 lens as well as the Sigma 10-20. Not affiliated in any way. Just a happy camper.
There's also a stand alone version if you don't have Photoshop, though when I bought my copy it didn't handle raw files. PTLens also allows for manual control, which is straighforward, but I find that I rarely need to. It runs on Windows and Intel Macs running X.5 or better.
It gets regularly updated and includes the standalone application, Lightroom/Aperture/iPhoto/Photoshop plugins or an external editor. It supports all Pentax DSLRs that have been released and all lenses with a multiplier of 1.5 or less, but not old 645 lenses.