diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-09-18 00:48:13 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-09-18 00:48:13 +0100 |
| commit | 853f658e8a95ece236438eb8e91860360e0624af (patch) | |
| tree | e513c3d778f8a1da3eab214b716751323ee3ea6f /src/tools | |
| parent | 272868a09ab7b7bd4bd9c0c531aab306feaa8b07 (diff) | |
Try to make Windows console appearance a preference.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic.cc | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 5f6a98075..e429b7a9d 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -144,20 +144,22 @@ public: , _history_position (0) , _history_separator (0) { -#if defined(DCPOMATIC_WINDOWS) && defined(DCPOMATIC_WINDOWS_CONSOLE) - AllocConsole(); - - HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE); - int hCrt = _open_osfhandle((intptr_t) handle_out, _O_TEXT); - FILE* hf_out = _fdopen(hCrt, "w"); - setvbuf(hf_out, NULL, _IONBF, 1); - *stdout = *hf_out; - - HANDLE handle_in = GetStdHandle(STD_INPUT_HANDLE); - hCrt = _open_osfhandle((intptr_t) handle_in, _O_TEXT); - FILE* hf_in = _fdopen(hCrt, "r"); - setvbuf(hf_in, NULL, _IONBF, 128); - *stdin = *hf_in; +#if defined(DCPOMATIC_WINDOWS) + if (Config::instance()->win32_console ()) { + AllocConsole(); + + HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE); + int hCrt = _open_osfhandle((intptr_t) handle_out, _O_TEXT); + FILE* hf_out = _fdopen(hCrt, "w"); + setvbuf(hf_out, NULL, _IONBF, 1); + *stdout = *hf_out; + + HANDLE handle_in = GetStdHandle(STD_INPUT_HANDLE); + hCrt = _open_osfhandle((intptr_t) handle_in, _O_TEXT); + FILE* hf_in = _fdopen(hCrt, "r"); + setvbuf(hf_in, NULL, _IONBF, 128); + *stdin = *hf_in; + } #endif wxMenuBar* bar = new wxMenuBar; |
