from BWizardPage import *
import bertos_utils
+import plugins
+
from const import *
class BOutputPage(BWizardPage):
def connectSignals(self):
"""
- Connects the signals with the related slots.
+ Overload of the BWizardPage connectSignals method.
+ """
+ for plugin in self._plugin_dict:
+ self.connect(plugin, SIGNAL("stateChanged(int)"), self.modeChecked)
+
+ def setupUi(self):
+ """
+ Overload of the BWizardPage setupUi method.
"""
- self.connect(self.pageContent.codeliteCheckBox, SIGNAL("stateChanged(int)"), lambda checked: self.modeChecked(checked, "codelite"))
+ self._plugin_dict = {}
+ layout = QVBoxLayout()
+ for plugin in self.availablePlugins():
+ check = QCheckBox(plugin)
+ layout.addWidget(check)
+ check.setCheckState(Qt.Checked)
+ self._plugin_dict[check] = plugin
+ widget = QWidget()
+ widget.setLayout(layout)
+ self.pageContent.scrollArea.setWidget(widget)
def reloadData(self):
"""
Overload of the BWizardPage reloadData method.
"""
- output = []
- if self.pageContent.codeliteCheckBox.isChecked():
- output.append("codelite")
- else:
- if "codelite" in output:
- output.remove("codelite")
- self.setProjectInfo("OUTPUT", output)
-
+ self.modeChecked()
+
####
## Slots ##
- def modeChecked(self, checked, value):
+ def modeChecked(self):
"""
Slot called when one of the mode checkbox is checked. It stores it.
"""
- output_list = self.projectInfo("OUTPUT")
- if checked == Qt.Checked:
- output_list.append(value)
- else:
- output_list.remove(value)
- self.setProjectInfo("OUTPUT", output_list)
+ plugins = []
+ for checkBox, plugin in self._plugin_dict.items():
+ if checkBox.checkState() == Qt.Checked:
+ plugins.append(plugin)
+ self.setProjectInfo("OUTPUT", plugins)
- ####
\ No newline at end of file
+ ####
+
+ def availablePlugins(self):
+ return plugins.__all__
\ No newline at end of file
<rect>
<x>0</x>
<y>0</y>
- <width>359</width>
- <height>372</height>
+ <width>349</width>
+ <height>270</height>
</rect>
</property>
<property name="sizePolicy">
<property name="windowTitle">
<string>Form</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_5">
+ <layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
</widget>
</item>
<item>
- <widget class="QFrame" name="frame_4">
- <property name="enabled">
+ <widget class="QScrollArea" name="scrollArea">
+ <property name="widgetResizable">
<bool>true</bool>
</property>
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_4">
- <item>
- <widget class="QCheckBox" name="codeliteCheckBox">
- <property name="text">
- <string>CodeLite project</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_4">
- <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>
- <item>
- <widget class="QLabel" name="codeliteLabel">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="text">
- <string>CodeLite project files and configurations</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
+ <widget class="QWidget" name="scrollAreaWidgetContents">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>321</width>
+ <height>152</height>
+ </rect>
+ </property>
+ </widget>
</widget>
</item>
</layout>