summaryrefslogtreecommitdiff
path: root/client/widgets/multilist.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/multilist.cc')
-rw-r--r--client/widgets/multilist.cc33
1 files changed, 13 insertions, 20 deletions
diff --git a/client/widgets/multilist.cc b/client/widgets/multilist.cc
index 3d03ce5..e261b52 100644
--- a/client/widgets/multilist.cc
+++ b/client/widgets/multilist.cc
@@ -126,36 +126,23 @@ void MultiList::changed()
DEBUG(multilist, "Multilist innerwidget was changed\n");
}
-
-bool MultiList::preValid()
+bool MultiList::preCommit()
{
- return list->count() != 0;
-
- /*
if(innerwidget_has_changes) {
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?",
- MessageBox::Save | MessageBox::Close | MessageBox::Cancel)) {
- case MessageBox::Save:
- if(innerwidget && innerwidget->valid()) {
- add();
- } else {
- return false;
- }
- break;
- case MessageBox::Close:
+ tr("Inner widget changed."),
+ tr("The inner widget changed, and you didn't add it to the list.\n"
+ "Do you want to continue and discard the change?"),
+ MessageBox::Ignore | MessageBox::Cancel)) {
+ case MessageBox::Ignore:
break;
case MessageBox::Cancel:
default:
- // FIXME: How to we actually block the commit and return to the editor?
return false;
- break;
}
}
+
return true;
- */
}
QString MultiList::value()
@@ -218,6 +205,12 @@ void MultiList::add()
}
}
+void MultiList::setValues()
+{
+ Widget::setValues();
+ innerwidget_has_changes = false;
+}
+
bool MultiList::setKeyboardFocus()
{
if(innerwidget) return innerwidget->setKeyboardFocus();