diff options
author | deva <deva> | 2005-05-03 09:22:12 +0000 |
---|---|---|
committer | deva <deva> | 2005-05-03 09:22:12 +0000 |
commit | 2bef4cb3d3230915e5e673f10910ff8f520a0c19 (patch) | |
tree | cb027efa35cc46c63ece8b60116b70e6680516c3 /src/info_gui.cc | |
parent | fc6b6c4981bfeb94055a43c4b9eebc979f0370b8 (diff) |
Implemented the gui part of the info object.
Diffstat (limited to 'src/info_gui.cc')
-rw-r--r-- | src/info_gui.cc | 34 |
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); } |