Merge branch '0.5.x' into 0.6.0.x
[novacoin.git] / src / qt / bitcoin.cpp
index 5e79f6e..3450bb4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * W.J. van der Laan 20011-2012
+ * W.J. van der Laan 2011-2012
  */
 #include "bitcoingui.h"
 #include "clientmodel.h"
@@ -36,12 +36,19 @@ int MyMessageBox(const std::string& message, const std::string& caption, int sty
 
 int ThreadSafeMessageBox(const std::string& message, const std::string& caption, int style, wxWindow* parent, int x, int y)
 {
+    bool modal = style & wxMODAL;
+
+    if (modal)
+        while (!guiref)
+            sleep(1);
+
     // Message from network thread
     if(guiref)
     {
         QMetaObject::invokeMethod(guiref, "error", Qt::QueuedConnection,
                                    Q_ARG(QString, QString::fromStdString(caption)),
-                                   Q_ARG(QString, QString::fromStdString(message)));
+                                   Q_ARG(QString, QString::fromStdString(message)),
+                                   Q_ARG(bool, modal));
     }
     else
     {
@@ -126,6 +133,9 @@ std::string _(const char* psz)
 #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++)
     {
@@ -144,6 +154,7 @@ int main(int argc, char *argv[])
             }
         }
     }
+#endif
 
     // Internal string conversion is all UTF-8
     QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
@@ -245,6 +256,10 @@ int main(int argc, char *argv[])
 
                 // Place this here as guiref has to be defined if we dont want to lose URLs
                 ipcInit();
+
+#if !defined(MAC_OSX) && !defined(WIN32)
+// TODO: implement qtipcserver.cpp for Mac and Windows
+
                 // Check for URL in argv
                 for (int i = 1; i < argc; i++)
                 {
@@ -259,7 +274,7 @@ int main(int argc, char *argv[])
                         }
                     }
                 }
-
+#endif
                 app.exec();
 
                 guiref = 0;