Add the toolchain selection page stub
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 22 Dec 2008 16:11:31 +0000 (16:11 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 22 Dec 2008 16:11:31 +0000 (16:11 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2118 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BToolchainPage.py [new file with mode: 0644]
wizard/toolchain_select.ui [new file with mode: 0644]

diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py
new file mode 100644 (file)
index 0000000..e052db2
--- /dev/null
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+# encoding: utf-8
+#
+# Copyright 2008 Develer S.r.l. (http://www.develer.com/)
+# All rights reserved.
+#
+# $Id:$
+#
+# Author: Lorenzo Berni <duplo@develer.com>
+#
+
+from BWizardPage import *
+
+class BToolchainPage(BWizardPage):
+    
+    def __init__(self):
+        BWizardPage.__init__(self, "toolchain_select.ui")
+        self.setTitle(self.tr("Select toolchain"))
+        self._setupUi()
+        self._connectSignals()
+    
+    def _setupUi(self):
+        path = self._settingsRetrieve("path_search").toBool()
+        if not path is None:
+            self.pageContent.pathBox.setChecked(path)
+        else:
+            self.pageContent.pathBox.setChecked(False)
+        customPath = self._settingsRetrieve("custom_dir").toBool()
+        if not customPath is None:
+            self.pageContent.customDirBox.setChecked(customPath)
+        else:
+            self.pageContent.customDirBox.setChecked(False)
+        self._updateUi()
+    
+    def _updateUi(self):
+        if self.pageContent.customDirBox.isChecked():
+            self._enableCustomDir()
+        else:
+            self._disableCustomDir()
+        if self.pageContent.pathBox.isChecked() or (self.pageContent.customDirBox.isChecked() and self.pageContent.customDirList.count() != 0):
+            self.pageContent.doSearchButton.setEnabled(True)
+        else:
+            self.pageContent.doSearchButton.setEnabled(False)
+        
+    def _disableCustomDir(self):
+        self.pageContent.customDirList.setEnabled(False)
+        self.pageContent.addDirButton.setEnabled(False)
+        self.pageContent.removeDirButton.setEnabled(False)
+    
+    def _enableCustomDir(self):
+        self.pageContent.customDirList.setEnabled(True)
+        self.pageContent.addDirButton.setEnabled(True)
+        self.pageContent.removeDirButton.setEnabled(True)
+    
+    def _toSearchSubpage(self):
+        self.pageContent.pageSelector.setCurrentIndex(1)
+    
+    def _toSelectionSubpage(self):
+        self.pageContent.pageSelector.setCurrentIndex(0)
+    
+    def _connectSignals(self):
+        self.connect(self.pageContent.pathBox, SIGNAL("clicked()"), self._updateUi)
+        self.connect(self.pageContent.customDirBox, SIGNAL("clicked()"), self._updateUi)
+        self.connect(self.pageContent.searchButton, SIGNAL("clicked()"), self._toSearchSubpage)
+        self.connect(self.pageContent.cancelButton, SIGNAL("clicked()"), self._toSelectionSubpage)
\ No newline at end of file
diff --git a/wizard/toolchain_select.ui b/wizard/toolchain_select.ui
new file mode 100644 (file)
index 0000000..79a64b2
--- /dev/null
@@ -0,0 +1,351 @@
+<ui version="4.0" >
+ <class>Form</class>
+ <widget class="QWidget" name="Form" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>428</width>
+    <height>367</height>
+   </rect>
+  </property>
+  <property name="sizePolicy" >
+   <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle" >
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_5" >
+   <item>
+    <widget class="QStackedWidget" name="pageSelector" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="currentIndex" >
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="page" >
+      <layout class="QVBoxLayout" name="verticalLayout_6" >
+       <item>
+        <widget class="QListWidget" name="toolchainList" />
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout" >
+         <item>
+          <widget class="QToolButton" name="addButton" >
+           <property name="minimumSize" >
+            <size>
+             <width>26</width>
+             <height>26</height>
+            </size>
+           </property>
+           <property name="maximumSize" >
+            <size>
+             <width>26</width>
+             <height>26</height>
+            </size>
+           </property>
+           <property name="text" >
+            <string/>
+           </property>
+           <property name="icon" >
+            <iconset resource="bertos.qrc" >
+             <normaloff>:/images/listadd.png</normaloff>:/images/listadd.png</iconset>
+           </property>
+           <property name="iconSize" >
+            <size>
+             <width>16</width>
+             <height>16</height>
+            </size>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="removeButton" >
+           <property name="minimumSize" >
+            <size>
+             <width>26</width>
+             <height>26</height>
+            </size>
+           </property>
+           <property name="maximumSize" >
+            <size>
+             <width>26</width>
+             <height>26</height>
+            </size>
+           </property>
+           <property name="text" >
+            <string/>
+           </property>
+           <property name="icon" >
+            <iconset resource="bertos.qrc" >
+             <normaloff>:/images/listremove.png</normaloff>:/images/listremove.png</iconset>
+           </property>
+           <property name="iconSize" >
+            <size>
+             <width>16</width>
+             <height>16</height>
+            </size>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QToolButton" name="checkButton" >
+           <property name="minimumSize" >
+            <size>
+             <width>26</width>
+             <height>26</height>
+            </size>
+           </property>
+           <property name="maximumSize" >
+            <size>
+             <width>26</width>
+             <height>26</height>
+            </size>
+           </property>
+           <property name="text" >
+            <string/>
+           </property>
+           <property name="icon" >
+            <iconset resource="bertos.qrc" >
+             <normaloff>:/images/ok.png</normaloff>:/images/ok.png</iconset>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer" >
+           <property name="orientation" >
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0" >
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QToolButton" name="searchButton" >
+           <property name="minimumSize" >
+            <size>
+             <width>26</width>
+             <height>26</height>
+            </size>
+           </property>
+           <property name="maximumSize" >
+            <size>
+             <width>16777215</width>
+             <height>26</height>
+            </size>
+           </property>
+           <property name="text" >
+            <string>Search</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="page_2" >
+      <layout class="QVBoxLayout" name="verticalLayout_2" >
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_5" >
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout" >
+           <item>
+            <widget class="QCheckBox" name="pathBox" >
+             <property name="sizePolicy" >
+              <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="text" >
+              <string>Search in PATH</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QCheckBox" name="customDirBox" >
+             <property name="text" >
+              <string>Search in custom directories</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_4" >
+           <item>
+            <spacer name="horizontalSpacer_4" >
+             <property name="orientation" >
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0" >
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QToolButton" name="cancelButton" >
+             <property name="minimumSize" >
+              <size>
+               <width>0</width>
+               <height>26</height>
+              </size>
+             </property>
+             <property name="maximumSize" >
+              <size>
+               <width>16777215</width>
+               <height>26</height>
+              </size>
+             </property>
+             <property name="text" >
+              <string>Cancel</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QToolButton" name="doSearchButton" >
+             <property name="minimumSize" >
+              <size>
+               <width>0</width>
+               <height>26</height>
+              </size>
+             </property>
+             <property name="maximumSize" >
+              <size>
+               <width>16777215</width>
+               <height>26</height>
+              </size>
+             </property>
+             <property name="text" >
+              <string>Search</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_3" >
+         <item>
+          <spacer name="horizontalSpacer_3" >
+           <property name="orientation" >
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeType" >
+            <enum>QSizePolicy::Fixed</enum>
+           </property>
+           <property name="sizeHint" stdset="0" >
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QGroupBox" name="groupBox" >
+           <property name="title" >
+            <string/>
+           </property>
+           <layout class="QVBoxLayout" name="verticalLayout_4" >
+            <item>
+             <layout class="QVBoxLayout" name="verticalLayout_3" >
+              <item>
+               <widget class="QListWidget" name="customDirList" />
+              </item>
+              <item>
+               <layout class="QHBoxLayout" name="horizontalLayout_2" >
+                <item>
+                 <widget class="QToolButton" name="addDirButton" >
+                  <property name="minimumSize" >
+                   <size>
+                    <width>26</width>
+                    <height>26</height>
+                   </size>
+                  </property>
+                  <property name="maximumSize" >
+                   <size>
+                    <width>26</width>
+                    <height>26</height>
+                   </size>
+                  </property>
+                  <property name="text" >
+                   <string/>
+                  </property>
+                  <property name="icon" >
+                   <iconset resource="bertos.qrc" >
+                    <normaloff>:/images/listadd.png</normaloff>:/images/listadd.png</iconset>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <widget class="QToolButton" name="removeDirButton" >
+                  <property name="minimumSize" >
+                   <size>
+                    <width>26</width>
+                    <height>26</height>
+                   </size>
+                  </property>
+                  <property name="maximumSize" >
+                   <size>
+                    <width>26</width>
+                    <height>26</height>
+                   </size>
+                  </property>
+                  <property name="text" >
+                   <string/>
+                  </property>
+                  <property name="icon" >
+                   <iconset resource="bertos.qrc" >
+                    <normaloff>:/images/listremove.png</normaloff>:/images/listremove.png</iconset>
+                  </property>
+                 </widget>
+                </item>
+                <item>
+                 <spacer name="horizontalSpacer_2" >
+                  <property name="orientation" >
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0" >
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+               </layout>
+              </item>
+             </layout>
+            </item>
+           </layout>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="bertos.qrc" />
+ </resources>
+ <connections/>
+</ui>