summaryrefslogtreecommitdiff
blob: 798a3a8721111c2ae7aebb31387cdac834b8fe61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Index: kexi/plugins/forms/kexidataprovider.cpp
===================================================================
--- kexi/plugins/forms/kexidataprovider.cpp	(revision 542130)
+++ kexi/plugins/forms/kexidataprovider.cpp	(revision 542131)
@@ -92,7 +92,8 @@
  	for (KexiFormDataItemInterfaceToIntMap::ConstIterator it = m_fieldNumbersForDataItems.constBegin(); 
 		it!=m_fieldNumbersForDataItems.constEnd(); ++it)
 	{
-		kexipluginsdbg << "fill data of '" << it.key()->dataSource() <<  "' at idx=" << it.data() << endl;
+		kexipluginsdbg << "fill data of '" << it.key()->dataSource() <<  "' at idx=" << it.data() 
+			<< " data=" << row.at(it.data()) << endl;
 		it.key()->setValue( row.at(it.data()) );
 	}
 }
Index: kexi/plugins/forms/widgets/kexidbautofield.cpp
===================================================================
--- kexi/plugins/forms/widgets/kexidbautofield.cpp	(revision 542130)
+++ kexi/plugins/forms/widgets/kexidbautofield.cpp	(revision 542131)
@@ -446,8 +446,11 @@
 		@todo look at makeFirstCharacterUpperCaseInAutoLabels setting [bool]
 		(see doc/dev/settings.txt) */
 			if (!text.isEmpty()) {
-				realText = text[0].upper();
-				realText += (text.mid(1) + ": ");
+				realText = text[0].upper() + text.mid(1);
+				if (m_widgetType!=Boolean) {
+//! @todo ":" suffix looks weird for checkbox; remove this condition when [x] is displayed _after_ label
+					realText += ": ";
+				}
 			}
 		}
 		else
Index: kexi/plugins/forms/widgets/kexidbcheckbox.cpp
===================================================================
--- kexi/plugins/forms/widgets/kexidbcheckbox.cpp	(revision 542130)
+++ kexi/plugins/forms/widgets/kexidbcheckbox.cpp	(revision 542131)
@@ -27,7 +27,9 @@
  : QCheckBox(text, parent, name), KexiFormDataItemInterface()
 {
 	m_invalidState = false;
+//! todo: tristate 
 	setTristate(true);
+	setFocusPolicy(QWidget::StrongFocus);
 	connect(this, SIGNAL(stateChanged(int)), this, SLOT(slotStateChanged(int)));
 }
 
@@ -56,13 +58,16 @@
 
 void KexiDBCheckBox::setValueInternal(const QVariant &add, bool )
 {
-	setState( add.isNull() ? NoChange : (add.toBool() ? On : Off) );
+//	setState( add.isNull() ? NoChange : (add.toBool() ? On : Off) );
+	setState( m_origValue.isNull() ? NoChange : (m_origValue.toBool() ? On : Off) );
 }
 
 QVariant
 KexiDBCheckBox::value()
 {
-	return QVariant( isChecked(), 3 );
+	if (state()==NoChange)
+		return QVariant();
+	return QVariant(state()==On, 1);
 }
 
 void KexiDBCheckBox::slotStateChanged(int )