diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-05-11 02:22:17 -0700 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-05-11 02:22:17 -0700 |
commit | 508471bbc0b43a8d5cabeae5c429f8416b9a1e99 (patch) | |
tree | ea403e070f23a3b82720fe827607c5b402a02d3d /src/qt/guiutil.cpp | |
parent | b66737e6dfe993a17c60fdf06a301a7fe71fa298 (diff) | |
parent | 4d3dda5d9f90d8aafb70c7e59beb27ec42d26790 (diff) |
Merge pull request #1247 from Diapolo/Win_open_debug_logfile
Windows: open debug.log file via Bitcoin-Qt
Diffstat (limited to 'src/qt/guiutil.cpp')
-rw-r--r-- | src/qt/guiutil.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 3b8f8c76f8..9a7d42fa08 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -17,6 +17,24 @@ #include <QDesktopServices> #include <QThread> +#include <boost/filesystem.hpp> + +#ifdef WIN32 +#ifdef _WIN32_WINNT +#undef _WIN32_WINNT +#endif +#define _WIN32_WINNT 0x0501 +#ifdef _WIN32_IE +#undef _WIN32_IE +#endif +#define _WIN32_IE 0x0501 +#define WIN32_LEAN_AND_MEAN 1 +#ifndef NOMINMAX +#define NOMINMAX +#endif +#include "shlwapi.h" +#endif + namespace GUIUtil { QString dateTimeStr(const QDateTime &date) @@ -214,6 +232,17 @@ bool isObscured(QWidget *w) && checkPoint(QPoint(w->width()/2, w->height()/2), w)); } +void openDebugLogfile() +{ + boost::filesystem::path pathDebug = GetDataDir() / "debug.log"; + +#ifdef WIN32 + if (boost::filesystem::exists(pathDebug)) + /* Open debug.log with the associated application */ + ShellExecuteA((HWND)0, (LPCSTR)"open", (LPCSTR)pathDebug.string().c_str(), NULL, NULL, SW_SHOWNORMAL); +#endif +} + ToolTipToRichTextFilter::ToolTipToRichTextFilter(int size_threshold, QObject *parent): size_threshold(size_threshold), QObject(parent) { |