From 4696bba0897715cb79eb75fcb14169964e1562e2 Mon Sep 17 00:00:00 2001
From: deva <deva>
Date: Wed, 18 Mar 2009 13:21:45 +0000
Subject: Made a messagebox wrapper that does the button translation.

---
 client/widgets/metawidget.cc |  6 +++---
 client/widgets/multilist.cc  | 17 +++++++++--------
 2 files changed, 12 insertions(+), 11 deletions(-)

(limited to 'client/widgets')

diff --git a/client/widgets/metawidget.cc b/client/widgets/metawidget.cc
index c085f10..5491790 100644
--- a/client/widgets/metawidget.cc
+++ b/client/widgets/metawidget.cc
@@ -29,7 +29,7 @@
 #include <QHBoxLayout>
 #include <QVBoxLayout>
 
-#include <QMessageBox>
+#include "messagebox.h"
 
 #include "widgetbuilder.h"
 #include "formatparser.h"
@@ -120,10 +120,10 @@ bool MetaWidget::isValid()
     while (i != widgets.end()) {
       Widget* w = *i;
       if(w->isValid() == false) {
-        QMessageBox::critical(NULL, "Fejl",
+        MessageBox::critical(NULL, "Fejl",
                               "Et af inputfelterne (" + w->getName()
                               + ") er ikke udfyldt korrekt, pr�v igen.\n"
-                              , QMessageBox::Ok);
+                              , MessageBox::Ok);
         return false;
       }
       i++;
diff --git a/client/widgets/multilist.cc b/client/widgets/multilist.cc
index 4d34691..87f4975 100644
--- a/client/widgets/multilist.cc
+++ b/client/widgets/multilist.cc
@@ -26,12 +26,13 @@
  */
 #include "multilist.h"
 
-#include <QMessageBox>
 #include <QHBoxLayout>
 #include <QVBoxLayout>
 #include <QGridLayout>
 #include <QPushButton>
 
+#include "messagebox.h"
+
 #include "widgetbuilder.h"
 
 #include "common.h"
@@ -127,25 +128,25 @@ void MultiList::changed()
 bool MultiList::isValid()
 {
   if(innerwidget_has_changes) {
-    switch(QMessageBox::warning(NULL,
+    switch(MessageBox::warning(NULL,
                                 "Gem �ndringerne i listen?",
                                 "Der er lavet en �ndring som ikke er tilf�jet til listen.\n"
                                 "�nsker du at tilf�je �ndringen til listen inden du gemmer makroen?",
-                                QMessageBox::Save | QMessageBox::Close | QMessageBox::Cancel)) {
-    case QMessageBox::Save:
+                                MessageBox::Save | MessageBox::Close | MessageBox::Cancel)) {
+    case MessageBox::Save:
       if(innerwidget && innerwidget->isValid()) {
         add();
       } else {
-        QMessageBox::critical(NULL,
+        MessageBox::critical(NULL,
                               "Fejl",
                               "Der er fejl i �ndringen, og den kan ikke tilf�jes til listen.\n",
-                              QMessageBox::Ok);
+                              MessageBox::Ok);
         return false;
       }
       break;
-    case QMessageBox::Close:
+    case MessageBox::Close:
       break;
-    case QMessageBox::Cancel:
+    case MessageBox::Cancel:
     default:
       // FIXME: How to we actually block the commit and return to the editor?
       return false;
-- 
cgit v1.2.3