diff options
author | deva <deva> | 2009-03-18 13:21:45 +0000 |
---|---|---|
committer | deva <deva> | 2009-03-18 13:21:45 +0000 |
commit | 4696bba0897715cb79eb75fcb14169964e1562e2 (patch) | |
tree | 8b8da13a89f2b980e8f25cf7eb36086de34b039d /client/widgets | |
parent | 838fbd870b3ce51fb6a7d8994d3d08f8ab65559c (diff) |
Made a messagebox wrapper that does the button translation.
Diffstat (limited to 'client/widgets')
-rw-r--r-- | client/widgets/metawidget.cc | 6 | ||||
-rw-r--r-- | client/widgets/multilist.cc | 17 |
2 files changed, 12 insertions, 11 deletions
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; |