from PyQt4.QtCore import *
from PyQt4.QtGui import *
-from bertos_utils import loadBertosProject, bertosVersion, getToolchainName, createBertosProject
+from bertos_utils import bertosVersion, getToolchainName, createBertosProject
from BToolchainPage import BToolchainPage
from BVersionPage import BVersionPage
from BProject import BProject
import qvariant_converter
-import BModulePage
+from BModulePage import BModulePage
import bertos_utils
class BEditingDialog(QDialog):
def setupUi(self):
layout = QVBoxLayout()
- self.module_page = BModulePage.BModulePage()
+ self.module_page = BModulePage()
layout.addWidget(self.module_page)
- frequency_layout = QHBoxLayout()
- frequency_layout.addWidget(QLabel(self.tr("CPU frequency")))
- self.cpu_frequency_spinbox = QDoubleSpinBox()
- self.cpu_frequency_spinbox.setSuffix("Hz")
- self.cpu_frequency_spinbox.setRange(1, 1000000000)
- self.cpu_frequency_spinbox.setSingleStep(1000)
- self.cpu_frequency_spinbox.setDecimals(0)
- frequency_layout.addWidget(self.cpu_frequency_spinbox)
- frequency_layout.addStretch()
- layout.addLayout(frequency_layout)
+ frequency_layout = QHBoxLayout()
+ frequency_layout.addWidget(QLabel(self.tr("CPU frequency")))
+ self.cpu_frequency_spinbox = QDoubleSpinBox()
+ self.cpu_frequency_spinbox.setSuffix("Hz")
+ self.cpu_frequency_spinbox.setRange(1, 1000000000)
+ self.cpu_frequency_spinbox.setSingleStep(1000)
+ self.cpu_frequency_spinbox.setDecimals(0)
+ frequency_layout.addWidget(self.cpu_frequency_spinbox)
+ frequency_layout.addStretch()
+ layout.addLayout(frequency_layout)
button_layout = QHBoxLayout()
self.advanced_button = QToolButton()
self.setupMenu()
import exception_handler
-import BProject
+from BProject import BProject
-import BStartPage
-import BWizard
+from BWizard import BWizard
from BIntroPage import BIntroPage
from BFolderPage import BFolderPage
from BEditingDialog import BEditingDialog, BVersionDialog, BToolchainDialog
-import bertos_utils
-import const
+from const import DATA_DIR
from LoadException import VersionException, ToolchainException
def newProject():
+ QApplication.instance().project = BProject()
page_list = [BIntroPage, BFolderPage, BBoardPage, BVersionPage, BCpuPage, BToolchainPage, BModulePage, BOutputPage, BCreationPage, BFinalPage]
- wizard = BWizard.BWizard(page_list)
+ wizard = BWizard(page_list)
wizard.show()
wizard.exec_()
project = QApplication.instance().project
info_dict = {}
while(True):
try:
- QApplication.instance().project = BProject.BProject(project_file, info_dict)
+ QApplication.instance().project = BProject(project_file, info_dict)
except VersionException:
QMessageBox.critical(
None,
dialog = BEditingDialog()
dialog.exec_()
-def showStartPage():
- QApplication.instance().dialog = BStartPage.BStartPage()
- QApplication.instance().connect(QApplication.instance().dialog, SIGNAL("newProject"), newProject)
- QApplication.instance().connect(QApplication.instance().dialog, SIGNAL("editProject"), editProject)
- QApplication.instance().dialog.show()
-
def main():
app = QApplication(sys.argv)
app.settings = QSettings("Develer", "Bertos Configurator")
- app.project = BProject.BProject()
# Development utility lines, to be removed for production
- datadir = const.DATA_DIR
+ datadir = DATA_DIR
qrc, rcc = os.path.join(datadir, 'bertos.qrc'), os.path.join(datadir, 'bertos.rcc')
if not (hasattr(sys, "frozen") and sys.frozen) and newer(qrc, rcc):
os.system("rcc -binary %s -o %s" %(qrc, rcc))