From 6afe92e834bebe7fa3cbc441444652f917419df6 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 23 May 2005 18:42:50 +0000 Subject: Error message windows is now modal with mainwindow as its parent. --- ChangeLog | 1 + src/info_gui.cc | 11 +++++++++++ src/info_gui.h | 2 ++ src/miav.cc | 11 ++++++++++- 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7ec01f5..4635ea7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ New Features: Bug Fixes: - Free of NULL input queue removed. - Name is overwritten with a message, if non-valid cpr is used. + - Error messagebox is now model with mainwindow as its parent. ======================================= May 22 2005 - MIaV version 0.2.2 diff --git a/src/info_gui.cc b/src/info_gui.cc index 4536ed3..52bfa5c 100644 --- a/src/info_gui.cc +++ b/src/info_gui.cc @@ -53,6 +53,17 @@ InfoGui::~InfoGui() { } +void InfoGui::setParent(QWidget *p) +{ + pthread_mutex_lock(&mutex); + // Beginning of safezone + + parent = p; + + // End of safezone + pthread_mutex_unlock(&mutex); +} + void InfoGui::error(char *fmt, ...) { char buf[1024]; diff --git a/src/info_gui.h b/src/info_gui.h index 6a5c97b..6547496 100644 --- a/src/info_gui.h +++ b/src/info_gui.h @@ -60,6 +60,8 @@ public: void warn(char* fmt, ...); void info(char* fmt, ...); + void setParent(QWidget *p); + private: QApplication *qapp; QWidget *parent; diff --git a/src/miav.cc b/src/miav.cc index c3f08fe..12c63be 100644 --- a/src/miav.cc +++ b/src/miav.cc @@ -31,6 +31,9 @@ /* * $Log$ + * Revision 1.11 2005/05/23 18:42:50 deva + * Error message windows is now modal with mainwindow as its parent. + * * Revision 1.10 2005/05/22 15:49:22 deva * Added multithreaded encoding support. * @@ -80,6 +83,7 @@ enum { */ int grab(int argc, char *argv[]) { #ifdef USE_GUI + QApplication miav_grab( argc, argv ); InfoGui info(&miav_grab, NULL); @@ -87,10 +91,15 @@ int grab(int argc, char *argv[]) { MainWindow mainwindow(&miav_grab); miav_grab.setMainWidget( &mainwindow ); + + info.setParent(&mainwindow); return miav_grab.exec(); + #else /* USE_GUI */ - printf("Error: MIaV was not compiled with GUI support...\n"); + + fprintf(stderr, "Error: MIaV was not compiled with GUI support...\n"); return 0; + #endif /* USE_GUI */ } -- cgit v1.2.3