rstudio/rstudio — pull request #114 by jmcphers (2014-06-05 23:31:58+00:00)
Title: Package pane improvements for Packrat

This change has two main effects:
- Show packrat status in the packages pane when packrat mode is on.
- Restore (to the greatest degree reasonable) the existing code and appearance of the packages pane when packrat mode is off.

The former is largely accomplished by using `list_packages_packrat`, a new RPC that returns an augmented version of the data returned by `list_packages` (`PackageInfo` -> `PackratPackageInfo`).

The latter uses a few more if statements than I'd like. In most circumstances I think better architecture would use a class derived from `PackagesPane` to extend the pane with Packrat-specific actions and logic, but since this class is not instantiated directly it's a little less obvious how to create the right instance at runtime (later we'd also need to swap instances out on the fly); let me know if you feel the current approach needs rethinking.