Overload of the BWizardPage setupUi method.
"""
self._plugin_dict = {}
- layout = QVBoxLayout()
+ scrollLayout = QVBoxLayout()
+ group, check = self.createNewOutput("BeRTOS Build System",
+ "Classic BeRTOS makefile based project",
+ True, False)
+ scrollLayout.addWidget(group)
for plugin in self.availablePlugins():
- check = QCheckBox(plugin)
- layout.addWidget(check)
- check.setCheckState(Qt.Checked)
+ module = bertos_utils.loadPlugin(plugin)
+ group, check = self.createNewOutput(module.PLUGIN_NAME,
+ module.PLUGIN_DESCRIPTION,
+ True, True)
+ scrollLayout.addWidget(group)
self._plugin_dict[check] = plugin
+ scrollLayout.addStretch()
widget = QWidget()
- widget.setLayout(layout)
+ widget.setLayout(scrollLayout)
self.pageContent.scrollArea.setWidget(widget)
def reloadData(self):
####
def availablePlugins(self):
- return plugins.__all__
\ No newline at end of file
+ """
+ Returns the list of the available plugins.
+ """
+ return plugins.__all__
+
+ def createNewOutput(self, name, description, checked=True, enabled=True):
+ """
+ Create a groupBox for the given pieces of information. Returns the
+ groupBox and the checkBox
+ """
+ check = QCheckBox(description)
+ if checked:
+ check.setCheckState(Qt.Checked)
+ else:
+ check.setCheckState(Qt.Unchecked)
+ groupLayout = QVBoxLayout()
+ groupLayout.addWidget(check)
+ group = QGroupBox(name)
+ group.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum)
+ group.setLayout(groupLayout)
+ group.setEnabled(enabled)
+ return group, check
\ No newline at end of file
# Files for selected plugins
relevants_files = {}
for plugin in project_info.info("OUTPUT"):
- module = getattr(__import__("plugins", {}, {}, [plugin]), plugin)
+ module = loadPlugin(plugin)
relevants_files[plugin] = module.createProject(project_info)
project_info.setInfo("RELEVANTS_FILES", relevants_files)
+def loadPlugin(plugin):
+ """
+ Returns the given plugin module.
+ """
+ return getattr(__import__("plugins", {}, {}, [plugin]), plugin)
+
def mkGenerator(project_info, makefile):
"""
Generates the mk file for the current project.
import const
+## Plugin interface ##
+
+PLUGIN_NAME = "CodeLite"
+
+PLUGIN_DESCRIPTION = "Create CodeLite project files"
+
+def createProject(project_info):
+ """
+ Function that creates codelite projects and return the project relevant file.
+ """
+ directory = project_info.info("PROJECT_PATH")
+ prjdir = directory + "/" + os.path.basename(directory)
+ workspace = codeliteWorkspaceGenerator(project_info)
+ open(directory + "/" + os.path.basename(prjdir) + ".workspace", "w").write(workspace)
+ project = codeliteProjectGenerator(project_info)
+ open(directory + "/" + os.path.basename(prjdir) + ".project", "w").write(project)
+ return directory + "/" + os.path.basename(prjdir) + ".workspace"
+
+####
+
def clFiles(file_dict, directory):
"""
Creates the list of the lines for the files founded in file_dict, using
while template.find("$project") != -1:
template = template.replace("$project", project_name)
return template
-
-def createProject(project_info):
- """
- Function that creates codelite projects and return the project relevant file.
- """
- directory = project_info.info("PROJECT_PATH")
- prjdir = directory + "/" + os.path.basename(directory)
- workspace = codeliteWorkspaceGenerator(project_info)
- open(directory + "/" + os.path.basename(prjdir) + ".workspace", "w").write(workspace)
- project = codeliteProjectGenerator(project_info)
- open(directory + "/" + os.path.basename(prjdir) + ".project", "w").write(project)
- return directory + "/" + os.path.basename(prjdir) + ".workspace"
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="QFrame" name="frame">
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QCheckBox" name="standardCheckBox">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>BeRTOS build system</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <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="QLabel" name="bbsLabel">
- <property name="text">
- <string>Classic BeRTOS makefile based project</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
<item>
<widget class="QScrollArea" name="scrollArea">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<x>0</x>
<y>0</y>
<width>321</width>
- <height>152</height>
+ <height>242</height>
</rect>
</property>
</widget>