bitcoin/bitcoin — pull request #3488 by laanwj (2014-01-05 11:55:30+00:00)
Title: ui: Fix GUI initialization order

Fixes at least #3478. @diapolo can you please help testing?

Splits and documents the phases:
1. Parse command-line options. These take precedence over anything else.
2. Basic Qt initialization (not dependent on parameters or configuration)
3. Application identification
4. Initialization of translations
5. Now that settings and translations are available, ask user for data directory
6. Determine availability of data directory and parse bitcoin.conf
7. URI IPC sending
8. Main GUI initialization

Splits command line parsing logic from ipcSendCommandLine into ipcParseCommandLine, as isTestNet() can only be overridden in the early stages before choosing a data directory. Sending however needs to happen after choosing a data directory.

Tested:
- URI handling to running testnet and mainnet instances
- URI handling with custom data directories
- URI handling for testnet URIs launches testnet GUI
- `-choosedatadir` can be used to provide custom data directories