From: Luke Dashjr Date: Mon, 16 Apr 2012 01:15:48 +0000 (-0400) Subject: Merge branch '0.5.x' into 0.6.0.x X-Git-Tag: v0.4.0-unstable~129^2~1^2~18^2~15 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=3374c3ef094b328e6c6957fdaf5a9abff0c53a33 Merge branch '0.5.x' into 0.6.0.x Conflicts: src/qt/bitcoin.cpp src/qt/bitcoingui.cpp src/qt/guiutil.cpp src/qt/guiutil.h src/qt/sendcoinsdialog.cpp src/qt/sendcoinsdialog.h src/util.cpp --- 3374c3ef094b328e6c6957fdaf5a9abff0c53a33 diff --cc src/qt/bitcoin.cpp index 71e2daf,b7c8a45..c7f0092 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@@ -8,7 -8,7 +8,8 @@@ #include "headers.h" #include "init.h" +#include "qtipcserver.h" + #include "util.h" #include #include @@@ -130,33 -120,17 +131,42 @@@ std::string _(const char* psz return QCoreApplication::translate("bitcoin-core", psz).toStdString(); } + /* Handle runaway exceptions. Shows a message box with the problem and quits the program. + */ + static void handleRunawayException(std::exception *e) + { + PrintExceptionContinue(e, "Runaway exception"); + QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occured. Bitcoin can no longer continue safely and will quit.") + QString("\n\n") + QString::fromStdString(strMiscWarning)); + exit(1); + } + +#ifndef BITCOIN_QT_TEST int main(int argc, char *argv[]) { +#if !defined(MAC_OSX) && !defined(WIN32) +// TODO: implement qtipcserver.cpp for Mac and Windows + + // Do this early as we don't want to bother initializing if we are just calling IPC + for (int i = 1; i < argc; i++) + { + if (strlen(argv[i]) > 7 && strncasecmp(argv[i], "bitcoin:", 8) == 0) + { + const char *strURI = argv[i]; + try { + boost::interprocess::message_queue mq(boost::interprocess::open_only, BITCOINURI_QUEUE_NAME); + if(mq.try_send(strURI, strlen(strURI), 0)) + exit(0); + else + break; + } + catch (boost::interprocess::interprocess_exception &ex) { + break; + } + } + } +#endif + + // Internal string conversion is all UTF-8 QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); QTextCodec::setCodecForCStrings(QTextCodec::codecForTr()); diff --cc src/qt/bitcoingui.cpp index 4a9b420,778acd1..1c4d665 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@@ -1,9 -1,12 +1,12 @@@ /* * Qt4 bitcoin GUI. * - * W.J. van der Laan 2011 - * The Bitcoin Developers 2011 + * W.J. van der Laan 20011-2012 + * The Bitcoin Developers 20011-2012 */ + + #include "checkpoints.h" + #include "bitcoingui.h" #include "transactiontablemodel.h" #include "addressbookpage.h" diff --cc src/util.cpp index 08752e6,5b59ead..5ba6504 --- a/src/util.cpp +++ b/src/util.cpp @@@ -4,7 -4,17 +4,18 @@@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" #include "strlcpy.h" +#include + + // Work around clang compilation problem in Boost 1.46: + // /usr/include/boost/program_options/detail/config_file.hpp:163:17: error: call to function 'to_internal' that is neither visible in the template definition nor found by argument-dependent lookup + // See also: http://stackoverflow.com/questions/10020179/compilation-fail-in-boost-librairies-program-options + // http://clang.debian.net/status.php?version=3.0&key=CANNOT_FIND_FUNCTION + namespace boost { + namespace program_options { + std::string to_internal(const std::string&); + } + } + #include #include #include