summaryrefslogtreecommitdiff
path: root/client/macrowindow.cc
diff options
context:
space:
mode:
authordeva <deva>2009-03-18 13:21:45 +0000
committerdeva <deva>2009-03-18 13:21:45 +0000
commit4696bba0897715cb79eb75fcb14169964e1562e2 (patch)
tree8b8da13a89f2b980e8f25cf7eb36086de34b039d /client/macrowindow.cc
parent838fbd870b3ce51fb6a7d8994d3d08f8ab65559c (diff)
Made a messagebox wrapper that does the button translation.
Diffstat (limited to 'client/macrowindow.cc')
-rw-r--r--client/macrowindow.cc35
1 files changed, 18 insertions, 17 deletions
diff --git a/client/macrowindow.cc b/client/macrowindow.cc
index 6beba85..80649a7 100644
--- a/client/macrowindow.cc
+++ b/client/macrowindow.cc
@@ -27,12 +27,13 @@
#include "macrowindow.h"
#include <QVBoxLayout>
-#include <QMessageBox>
#include <QDomDocument>
#include <QDomElement>
#include <QDomNode>
#include <QByteArray>
+#include "messagebox.h"
+
#include "widgets/widget.h"
#include "widgets/window.h"
#include "widgetbuilder.h"
@@ -168,19 +169,19 @@ void MacroWindow::commit()
if(doCommit()) {
// close();
} else {
- QMessageBox::critical(NULL, "Fejl",
- "Makroen " + macrotitle + " er ikke udfyldt korrekt, prøv igen.\n"
- , QMessageBox::Ok);
+ MessageBox::critical(NULL, "Fejl",
+ "Makroen " + macrotitle + " er ikke udfyldt korrekt, prøv igen.\n",
+ MessageBox::Ok);
}
}
void MacroWindow::reset()
{
/*
- QMessageBox::warning(NULL, tr("Reset"),
+ MessageBox::warning(NULL, tr("Reset"),
tr("Du har valgt at nulstille de indtastede data.\n"
"Er du sikker?"),
- QMessageBox::Yes | QMessageBox::Cancel);
+ MessageBox::Yes | MessageBox::Cancel);
printf("MacroWindow -> resetting...\n");
*/
QVector< Widget* >::iterator i = widgets.begin();
@@ -225,9 +226,9 @@ void MacroWindow::cont(QString name)
// new_macro("example", macro);
// close();
} else {
- QMessageBox::critical(NULL, "Fejl",
+ MessageBox::critical(NULL, "Fejl",
"Makroen " + macrotitle + " er ikke udfyldt korrekt, prøv igen.\n",
- QMessageBox::Ok);
+ MessageBox::Ok);
}
printf("%s : MacroWindow -> continuing...\n", macro.toStdString().c_str());
}
@@ -252,9 +253,9 @@ void MacroWindow::cont_nocommit(QString name)
// new_macro("example", macro);
// close();
} else {
- QMessageBox::critical(NULL, "Fejl",
+ MessageBox::critical(NULL, "Fejl",
"Makroen " + macrotitle + " er ikke udfyldt korrekt, prøv igen.\n",
- QMessageBox::Ok);
+ MessageBox::Ok);
}
printf("%s : MacroWindow -> continuing...\n", macro.toStdString().c_str());
}
@@ -351,23 +352,23 @@ void MacroWindow::collapseWrapper()
if(isCollapsed()) return;
if(waschanged) {
- switch(QMessageBox::warning(NULL,
+ switch(MessageBox::warning(NULL,
"Gem ændringerne i makroen?",
"Du har valgt at lukke makroen " + macrotitle + ".\n"
"Ønsker du at gemme inden du lukker?",
- QMessageBox::Save | QMessageBox::Close | QMessageBox::Cancel)) {
- case QMessageBox::Save:
+ MessageBox::Save | MessageBox::Close | MessageBox::Cancel)) {
+ case MessageBox::Save:
if(doCommit()) setCollapsed(true);
- else QMessageBox::critical(NULL,
+ else MessageBox::critical(NULL,
"Fejl",
"Makroen " + macrotitle + " er ikke udfyldt korrekt, prøv igen.\n",
- QMessageBox::Ok);
+ MessageBox::Ok);
break;
- case QMessageBox::Close:
+ case MessageBox::Close:
collapse();
break;
- case QMessageBox::Cancel:
+ case MessageBox::Cancel:
default:
// emit expanding(); // signal the other to close again (if any)
break;