Add the automaticFix checkbox (default checked)
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 19 Feb 2009 17:17:35 +0000 (17:17 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 19 Feb 2009 17:17:35 +0000 (17:17 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2364 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BModulePage.py
wizard/ui/module_select.ui

index 17812cd991ce394445a80ec71892d55c25871b3f..b8b5222653cb08fc48ef43ac7b7a9bab2d24a72c 100644 (file)
@@ -232,24 +232,24 @@ class BModulePage(BWizardPage):
         modules[selectedModule]["enabled"] = True
         self._projectInfoStore("MODULES", modules)
         depends = self._projectInfoRetrieve("MODULES")[selectedModule]["depends"]
-        unsatisfied = self.selectDependencyCheck(selectedModule)
+        unsatisfied = []
+        if self.pageContent.automaticFix.isChecked():
+            unsatisfied = self.selectDependencyCheck(selectedModule)
         if len(unsatisfied) > 0:
-            message = self.tr("The module %1 needs the following modules:\n%2.\n\nDo you want to resolve automatically the problem?")
-            message = message.arg(selectedModule).arg(", ".join(unsatisfied))
-            choice = QMessageBox.warning(self, self.tr("Dependency error"), message, QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)
-            if choice == QMessageBox.Yes:
-                for module in unsatisfied:
-                    modules = self._projectInfoRetrieve("MODULES")
-                    modules[module]["enabled"] = True
-                for index in range(self.pageContent.moduleTable.rowCount()):
-                    if unicode(self.pageContent.moduleTable.item(index, 1).text()) in unsatisfied:
-                        self._buttonGroup.button(index).setChecked(True)
+            for module in unsatisfied:
+                modules = self._projectInfoRetrieve("MODULES")
+                modules[module]["enabled"] = True
+            for index in range(self.pageContent.moduleTable.rowCount()):
+                if unicode(self.pageContent.moduleTable.item(index, 1).text()) in unsatisfied:
+                    self._buttonGroup.button(index).setChecked(True)
     
     def _moduleUnselected(self, unselectedModule):
         modules = self._projectInfoRetrieve("MODULES")
         modules[unselectedModule]["enabled"] = False
         self._projectInfoStore("MODULES", modules)
-        unsatisfied = self.unselectDependencyCheck(unselectedModule)
+        unsatisfied = []
+        if self.pageContent.automaticFix.isChecked():
+            unsatisfied = self.unselectDependencyCheck(unselectedModule)
         if len(unsatisfied) > 0:
             message = self.tr("The module %1 is needed by the following modules:\n%2.\n\nDo you want to resolve automatically the problem?")
             message = message.arg(unselectedModule).arg(", ".join(unsatisfied))
index 370e321263008df0d6c44f644fb0aa852b195aec..b2d3faa6d03738723d1b93de0b5bc1426f632326 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>621</width>
-    <height>428</height>
+    <width>466</width>
+    <height>366</height>
    </rect>
   </property>
   <property name="sizePolicy" >
   </property>
   <layout class="QHBoxLayout" name="horizontalLayout" >
    <item>
-    <widget class="QTableWidget" name="moduleTable" >
-     <property name="maximumSize" >
-      <size>
-       <width>150</width>
-       <height>16777215</height>
-      </size>
-     </property>
-     <property name="editTriggers" >
-      <set>QAbstractItemView::NoEditTriggers</set>
-     </property>
-     <property name="selectionMode" >
-      <enum>QAbstractItemView::SingleSelection</enum>
-     </property>
-     <property name="selectionBehavior" >
-      <enum>QAbstractItemView::SelectRows</enum>
-     </property>
-     <property name="showGrid" >
-      <bool>false</bool>
-     </property>
-    </widget>
+    <layout class="QVBoxLayout" name="verticalLayout_3" >
+     <item>
+      <widget class="QCheckBox" name="automaticFix" >
+       <property name="minimumSize" >
+        <size>
+         <width>150</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="maximumSize" >
+        <size>
+         <width>150</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <property name="text" >
+        <string>Correct conflicts
+automatically</string>
+       </property>
+       <property name="checked" >
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QTableWidget" name="moduleTable" >
+       <property name="minimumSize" >
+        <size>
+         <width>150</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="maximumSize" >
+        <size>
+         <width>150</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <property name="editTriggers" >
+        <set>QAbstractItemView::NoEditTriggers</set>
+       </property>
+       <property name="selectionMode" >
+        <enum>QAbstractItemView::SingleSelection</enum>
+       </property>
+       <property name="selectionBehavior" >
+        <enum>QAbstractItemView::SelectRows</enum>
+       </property>
+       <property name="showGrid" >
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+    </layout>
    </item>
    <item>
     <layout class="QVBoxLayout" name="verticalLayout" >