Use QDoubleSpinBox instead of QSpinBox for the long variables
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 5 Feb 2009 14:08:40 +0000 (14:08 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 5 Feb 2009 14:08:40 +0000 (14:08 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2272 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BModulePage.py

index 83a2375f6d5814a73e01a1cb4671003491ce0111..02a743741c6b751081b3659460be149c575655a5 100644 (file)
@@ -100,15 +100,19 @@ class BModulePage(BWizardPage):
                 self._controlGroup.addControl(index, comboBox)
             else:
                 ## int, long or undefined type property
-                spinBox = QSpinBox()
+                spinBox = None
+                if bertos_utils.isLong(configurations[property]) or bertos_utils.isUnsignedLong(configurations[property]):
+                    spinBox = QDoubleSpinBox()
+                    spinBox.setDecimals(0)
+                else:
+                    spinBox = QSpinBox()
                 self.pageContent.propertyTable.setCellWidget(index, 1, spinBox)
-                if bertos_utils.isInt(configurations[property]):
-                    minimum = -32768
-                    maximmum = 32767
-                    suff = ""
-                elif bertos_utils.isLong(configurations[property]):
-                    minimum = -2147483648L
-                    maximum = 2147483647L
+                minimum = -32768
+                maximum = 32767
+                suff = ""
+                if bertos_utils.isLong(configurations[property]):
+                    minimum = -2147483648
+                    maximum = 2147483647
                     suff = "L"
                 elif bertos_utils.isUnsigned(configurations[property]):
                     minimum = 0
@@ -116,7 +120,7 @@ class BModulePage(BWizardPage):
                     suff = "U"
                 elif bertos_utils.isUnsignedLong(configurations[property]):
                     minimum = 0
-                    maximum = 4294967295L
+                    maximum = 4294967295
                     suff = "UL"
                 if "min" in configurations[property]["informations"].keys():
                     minimum = int(configurations[property]["informations"]["min"])