bitcoin/bitcoin — pull request #4101 by cozz (2014-04-28 02:14:21+00:00)
Title: [Qt] Client restart

Adds a "Restart" option to the file and tray menu.

![restart](https://cloud.githubusercontent.com/assets/2814559/2813049/5f1c8300-ce7a-11e3-8662-2dd2eedf6368.png)

I downloaded the icon somewhere where it says it is under the LGPL license.

If an options change requires a restart, a popup appears.

![restart1](https://cloud.githubusercontent.com/assets/2814559/2813053/64045df2-ce7a-11e3-95dd-10a4c3ba29ea.png)

Also encryptwallet can now restart.

Command line options will be passed accordingly to the new process, except rescan,reindex etc.

The parent process creates a new child process and exits. This causes the child process to inherit
the open file descriptors. (Only for *nixes.) So I had to add some "fcntl" to prevent file descriptor leaks.
There could still be some leaked, for example on my system with qt5, leaked descriptors for "/dev/ati/card0"
get added every restart. But we dynamically raise file descriptor limit and exit if not enough available.
On my system the max limit is a million by default, so I doubt that this will cause a problem to anybody, and even if, we would just exit with "Not enough file descriptors available."

Windows does not have this issue, because there is a flag for this and QProcess::startDetached calls CreateProcess() with bInheritHandles=false.
I checked the qt source code and tested this with process explorer on windows, and indeed, no handle leftovers there.

Tested
- Linux (qt4.8, qt5.2)
- Windows 7 64bit qt5.2 (32 and 64 bit executables)