]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/ModalDialog.hh
foundational changes; tying up some loose ends
[chaz/yoink] / src / Moof / ModalDialog.hh
index 11d9d7997916926b4fff50c25e44211af078f36d..68a6d285f99f414297d98e49a61093932fbb573c 100644 (file)
 
 #include <string>
 
 
 #include <string>
 
+#if HAVE_CONFIG_H
+#include "../config.h"
+#endif
+
 #if defined(_WIN32) || defined(__WIN32__)
 #include <windows.h>
 #elif defined(__APPLE__) && defined(__MACH__)
 #if defined(_WIN32) || defined(__WIN32__)
 #include <windows.h>
 #elif defined(__APPLE__) && defined(__MACH__)
 #include <QMessageBox>
 #endif
 
 #include <QMessageBox>
 #endif
 
+#include <Moof/Log.hh>
 #include <Moof/Resource.hh>
 
 #include <Moof/Resource.hh>
 
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 
 namespace Mf {
 
 
 namespace Mf {
 
@@ -66,13 +67,31 @@ struct ModalDialog
                CRITICAL        = 3
        };
 
                CRITICAL        = 3
        };
 
+
        std::string title;
        Type            type;
        std::string text1;
        std::string text2;
 
        std::string title;
        Type            type;
        std::string text1;
        std::string text2;
 
+
        void run() const
        {
        void run() const
        {
+               switch (type)
+               {
+                       case WARNING:
+                               logWarning("%s", text1.c_str());
+                               logWarning("%s", text2.c_str());
+                               break;
+                       case CRITICAL:
+                               logError("%s", text1.c_str());
+                               logError("%s", text2.c_str());
+                               break;
+                       default:
+                               logInfo("%s", text1.c_str());
+                               logInfo("%s", text2.c_str());
+                               break;
+               }
+
 #if USE_GTK
 
                int argc = 0;
 #if USE_GTK
 
                int argc = 0;
This page took 0.021055 seconds and 4 git commands to generate.