else: import sip sip.setapi('QString', 2) sip.setapi('QVariant', 2) from PyQt4.QtCore import * from PyQt4.QtGui import * import os if not py2exe_release: import compile_ui as cui ldir = os.path.dirname(__file__) cui.check_ui_generation(os.path.join(ldir, 'editor.ui')) import vplants.treeeditor3d.editor_ui as editor_ui class MTGEditor(QMainWindow, editor_ui.Ui_MainWindow) : def __init__(self, parent=None): """ @param parent : parent window """ QMainWindow.__init__(self, parent) editor_ui.Ui_MainWindow.__init__(self) self.setupUi(self) self.pointSizeSlider.setValue(self.mtgeditor.pointWidth) self.nodeSizeSlider.setValue(self.mtgeditor.nodeWidth) QObject.connect(self.actionOpenMTG, SIGNAL('triggered(bool)'),self.mtgeditor.openMTG)
from openalea.vpltk.qt.QtGui import * else: import sip sip.setapi('QString', 2) sip.setapi('QVariant', 2) from PyQt4.QtCore import * from PyQt4.QtGui import * import os if not py2exe_release: import compile_ui as cui ldir = os.path.dirname(__file__) cui.check_ui_generation(os.path.join(ldir, 'editor.ui')) import vplants.treeeditor3d.editor_ui as editor_ui class MTGEditor(QMainWindow, editor_ui.Ui_MainWindow): def __init__(self, parent=None): """ @param parent : parent window """ QMainWindow.__init__(self, parent) editor_ui.Ui_MainWindow.__init__(self) self.setupUi(self) self.pointSizeSlider.setValue(self.mtgeditor.pointWidth) self.nodeSizeSlider.setValue(self.mtgeditor.nodeWidth) QObject.connect(self.actionOpenMTG, SIGNAL('triggered(bool)'),
# Generate GUI if necessary from os.path import dirname, exists, join ldir = dirname(__file__) release = exists(join(ldir, 'py2exe_release.py')) if not release: try: import compile_ui as ui except ImportError as ie: from . import compile_ui as ui ui.check_rc_generation(join(ldir, 'lpyresources.qrc')) ui.check_ui_generation(join(ldir, 'lpymainwindow.ui')) ui.check_ui_generation(join(ldir, 'debugger_ui.ui')) ui.check_ui_generation(join(ldir, 'debugger_right_ui.ui')) ui.check_ui_generation(join(ldir, 'logindialog.ui')) ui.check_ui_generation(join(ldir, 'logdialog.ui')) ui.check_ui_generation(join(ldir, 'killsimulationwidget.ui')) ui.check_ui_generation(join(ldir, 'lpyprefwidget.ui')) ui.check_ui_generation(join(ldir, 'scalarmetaedit.ui')) ui.check_ui_generation(join(ldir, 'scalarfloatmetaedit.ui')) del ldir pass
try: import openalea.lpy.gui.py2exe_release py2exe_release = True except: py2exe_release = False # Generate GUI if necessary if not py2exe_release: import os import compile_ui as ui ldir = os.path.dirname(__file__) ui.check_ui_generation(os.path.join(ldir, 'killsimulationwidget.ui')) del ldir from openalea.vpltk.qt import qt from killsimulationwidget import Ui_KillSimulationDialog class KillSimulationDialog (qt.QtGui.QDialog,Ui_KillSimulationDialog): def __init__(self,parent): qt.QtGui.QDialog.__init__(self,parent) self.setupUi(self) self.setModal(True) self.timer = qt.QtCore.QTimer(self) self.timer.setInterval(1000) self.timer.setSingleShot(True) qt.QtCore.QObject.connect(self.timer,qt.QtCore.SIGNAL('timeout()'),self.step) qt.QtCore.QObject.connect(self, qt.QtCore.SIGNAL("accepted()"), self.finishProcess) qt.QtCore.QObject.connect(self, qt.QtCore.SIGNAL("rejected()"), self.timer.stop) self.timeout = 5 self.condition = None
except: pass from openalea.lpy import * # Restore default signal handler for CTRL+C import signal; signal.signal(signal.SIGINT, signal.SIG_DFL) # Add local dir as import dir sys.path = ['']+sys.path # Generate GUI if necessary if not py2exe_release: import compile_ui as ui ldir = os.path.dirname(__file__) ui.check_ui_generation(os.path.join(ldir, 'lpymainwindow.ui')) ui.check_ui_generation(os.path.join(ldir, 'debugger_ui.ui')) ui.check_ui_generation(os.path.join(ldir, 'debugger_right_ui.ui')) ui.check_ui_generation(os.path.join(ldir, 'logindialog.ui')) ui.check_ui_generation(os.path.join(ldir, 'logdialog.ui')) ui.check_rc_generation(os.path.join(ldir, 'lpyresources.qrc')) del ldir pass import lpydock import lpymainwindow as lsmw from computationtask import * from lpystudiodebugger import LpyVisualDebugger from lpyprofiling import AnimatedProfiling, ProfilingWithFinalPlot, ProfilingWithNoPlot
from openalea.vpltk.qt import qt import os from lpyprofiling import AnimatedProfiling, ProfilingWithFinalPlot, ProfilingWithNoPlot try: import openalea.lpy.gui.py2exe_release except: import compile_ui as ui ldir = os.path.dirname(__file__) ui.check_ui_generation(os.path.join(ldir, 'lpyprefwidget.ui')) del ldir import lpyprefwidget class LpyPreferences: def __init__(self,lpyeditor): self.editor = lpyeditor self.widget = None self.dialog = None def show(self): if True: self.dialog = qt.QtGui.QDialog(self.editor) self.widget = lpyprefwidget.Ui_PreferenceDialog() self.widget.setupUi(self.dialog) self.widget.toolbarAppEdit.setCurrentIndex(self.editor.getToolBarApp()[0]) qt.QtCore.QObject.connect(self.widget.toolbarAppEdit,qt.QtCore.SIGNAL('activated(const QString&)'),self.editor.setToolBarApp) self.widget.fontFamilyEdit.setCurrentFont(self.editor.codeeditor.currentFont()) self.widget.fontSizeEdit.setValue(self.editor.codeeditor.currentFont().pointSize()) qt.QtCore.QObject.connect(self.widget.fontFamilyEdit,qt.QtCore.SIGNAL('currentFontChanged(const QFont&)'), self.editor.codeeditor.setEditionFontFamily)
from openalea.vpltk.qt import qt from scalar import * try: import openalea.lpy.gui.py2exe_release py2exe_release = True except: py2exe_release = False import sys # Generate GUI if necessary if not py2exe_release: import os import compile_ui as ui ldir = os.path.dirname(__file__) ui.check_ui_generation(os.path.join(ldir, 'scalarmetaedit.ui')) ui.check_ui_generation(os.path.join(ldir, 'scalarfloatmetaedit.ui')) del ldir import scalarmetaedit as sme class ScalarDialog(qt.QtGui.QDialog,sme.Ui_ScalarDialog): def __init__(self,*args): qt.QtGui.QDialog.__init__(self,*args) self.setupUi(self) qt.QtCore.QObject.connect(self.minValueEdit,qt.QtCore.SIGNAL('valueChanged(int)'),self.updateRange) qt.QtCore.QObject.connect(self.maxValueEdit,qt.QtCore.SIGNAL('valueChanged(int)'),self.updateRange) def setScalar(self,value): self.nameEdit.setText(value.name) self.valueEdit.setValue(value.value) self.minValueEdit.setValue(value.minvalue)