summaryrefslogtreecommitdiff
path: root/src/info_gui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/info_gui.cc')
-rw-r--r--src/info_gui.cc34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/info_gui.cc b/src/info_gui.cc
index 0718021..376a19f 100644
--- a/src/info_gui.cc
+++ b/src/info_gui.cc
@@ -39,8 +39,12 @@
#include <stdio.h>
#include <stdarg.h>
-InfoGui::InfoGui(): Info()
+#include "messagebox.h"
+
+InfoGui::InfoGui(QApplication *a, QWidget *p): Info()
{
+ qapp = a;
+ parent = p;
}
InfoGui::~InfoGui()
@@ -60,6 +64,18 @@ void InfoGui::error(char *fmt, ...)
vsprintf(buf, fmt, argp);
va_end(argp);
+ fprintf(stderr, "<!"); fflush(stderr);
+ qapp->lock();
+ fprintf(stderr, "!"); fflush(stderr);
+ MessageBox(parent,
+ TXT_ERROR_TITLE,
+ buf,
+ TYPE_OK,
+ ICON_ERROR).exec();
+ fprintf(stderr, "!"); fflush(stderr);
+ qapp->unlock();
+ fprintf(stderr, "!>"); fflush(stderr);
+
// End of safezone
pthread_mutex_unlock(&mutex);
}
@@ -77,6 +93,14 @@ void InfoGui::warn(char *fmt, ...)
vsprintf(buf, fmt, argp);
va_end(argp);
+ qapp->lock();
+ MessageBox(parent,
+ TXT_WARNING_TITLE,
+ buf,
+ TYPE_OK,
+ ICON_WARNING).exec();
+ qapp->unlock();
+
// End of safezone
pthread_mutex_unlock(&mutex);
}
@@ -94,6 +118,14 @@ void InfoGui::info(char *fmt, ...)
vsprintf(buf, fmt, argp);
va_end(argp);
+ qapp->lock();
+ MessageBox(parent,
+ TXT_INFO_TITLE,
+ buf,
+ TYPE_OK,
+ ICON_INFO).exec();
+ qapp->unlock();
+
// End of safezone
pthread_mutex_unlock(&mutex);
}