summaryrefslogtreecommitdiff
path: root/cad/src/commands/PartProperties
diff options
context:
space:
mode:
authorEric Messick <ericm@nanorex.com>2008-03-02 23:46:06 +0000
committerEric Messick <ericm@nanorex.com>2008-03-02 23:46:06 +0000
commit80d769ca73b3fcb25ce95e3f26596b4fa39ec037 (patch)
tree3a81f234fa9a05b2be168b524d543d006e637642 /cad/src/commands/PartProperties
parentfd27993f72932b3268ae0de3227b9d5cfef7a2f1 (diff)
downloadnanoengineer-theirix-80d769ca73b3fcb25ce95e3f26596b4fa39ec037.tar.gz
nanoengineer-theirix-80d769ca73b3fcb25ce95e3f26596b4fa39ec037.zip
move files into command package
Diffstat (limited to 'cad/src/commands/PartProperties')
-rwxr-xr-xcad/src/commands/PartProperties/PartProp.py31
-rwxr-xr-xcad/src/commands/PartProperties/PartPropDialog.py126
-rwxr-xr-xcad/src/commands/PartProperties/PartPropDialog.ui258
-rw-r--r--cad/src/commands/PartProperties/__init__.py0
4 files changed, 415 insertions, 0 deletions
diff --git a/cad/src/commands/PartProperties/PartProp.py b/cad/src/commands/PartProperties/PartProp.py
new file mode 100755
index 000000000..eb30b0495
--- /dev/null
+++ b/cad/src/commands/PartProperties/PartProp.py
@@ -0,0 +1,31 @@
+# Copyright 2004-2007 Nanorex, Inc. See LICENSE file for details.
+"""
+PartProp.py
+
+$Id$
+"""
+
+from PyQt4.Qt import QDialog, SIGNAL
+from commands.PartProperties.PartPropDialog import Ui_PartPropDialog
+
+class PartProp(QDialog, Ui_PartPropDialog):
+ def __init__(self, assy):
+ QDialog.__init__(self)
+ self.setupUi(self)
+ self.connect(self.okPushButton,SIGNAL("clicked()"),self.accept)
+ self.connect(self.cancelPushButton,SIGNAL("clicked()"),self.reject)
+
+ self.nameLineEdit.setText(assy.name)
+
+ self.mmpformatLabel.setText("MMP File Format: " + assy.mmpformat)
+
+ # Get statistics of part and display them in the statView widget.
+ from commands.GroupProperties.GroupProp import Statistics
+ stats = Statistics(assy.tree)
+ stats.display(self.statsView)
+
+ def accept(self):
+ QDialog.accept(self)
+
+ def reject(self):
+ QDialog.reject(self)
diff --git a/cad/src/commands/PartProperties/PartPropDialog.py b/cad/src/commands/PartProperties/PartPropDialog.py
new file mode 100755
index 000000000..5da9443b7
--- /dev/null
+++ b/cad/src/commands/PartProperties/PartPropDialog.py
@@ -0,0 +1,126 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2004-2007 Nanorex, Inc. See LICENSE file for details.
+# Form implementation generated from reading ui file 'PartPropDialog.ui'
+#
+# Created: Wed Sep 20 08:20:23 2006
+# by: PyQt4 UI code generator 4.0.1
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore, QtGui
+
+class Ui_PartPropDialog(object):
+ def setupUi(self, PartPropDialog):
+ PartPropDialog.setObjectName("PartPropDialog")
+ PartPropDialog.resize(QtCore.QSize(QtCore.QRect(0,0,396,402).size()).expandedTo(PartPropDialog.minimumSizeHint()))
+
+ self.gridlayout = QtGui.QGridLayout(PartPropDialog)
+ self.gridlayout.setMargin(11)
+ self.gridlayout.setSpacing(6)
+ self.gridlayout.setObjectName("gridlayout")
+
+ self.hboxlayout = QtGui.QHBoxLayout()
+ self.hboxlayout.setMargin(4)
+ self.hboxlayout.setSpacing(72)
+ self.hboxlayout.setObjectName("hboxlayout")
+
+ self.okPushButton = QtGui.QPushButton(PartPropDialog)
+ self.okPushButton.setMinimumSize(QtCore.QSize(0,0))
+ self.okPushButton.setAutoDefault(True)
+ self.okPushButton.setDefault(True)
+ self.okPushButton.setObjectName("okPushButton")
+ self.hboxlayout.addWidget(self.okPushButton)
+
+ self.cancelPushButton = QtGui.QPushButton(PartPropDialog)
+ self.cancelPushButton.setMinimumSize(QtCore.QSize(0,0))
+ self.cancelPushButton.setAutoDefault(True)
+ self.cancelPushButton.setDefault(False)
+ self.cancelPushButton.setObjectName("cancelPushButton")
+ self.hboxlayout.addWidget(self.cancelPushButton)
+ self.gridlayout.addLayout(self.hboxlayout,1,0,1,1)
+
+ self.tabWidget3 = QtGui.QTabWidget(PartPropDialog)
+ self.tabWidget3.setObjectName("tabWidget3")
+
+ self.tab = QtGui.QWidget()
+ self.tab.setObjectName("tab")
+
+ self.gridlayout1 = QtGui.QGridLayout(self.tab)
+ self.gridlayout1.setMargin(0)
+ self.gridlayout1.setSpacing(6)
+ self.gridlayout1.setObjectName("gridlayout1")
+
+ self.vboxlayout = QtGui.QVBoxLayout()
+ self.vboxlayout.setMargin(0)
+ self.vboxlayout.setSpacing(6)
+ self.vboxlayout.setObjectName("vboxlayout")
+
+ self.hboxlayout1 = QtGui.QHBoxLayout()
+ self.hboxlayout1.setMargin(0)
+ self.hboxlayout1.setSpacing(6)
+ self.hboxlayout1.setObjectName("hboxlayout1")
+
+ self.nameLabel = QtGui.QLabel(self.tab)
+ self.nameLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.nameLabel.setObjectName("nameLabel")
+ self.hboxlayout1.addWidget(self.nameLabel)
+
+ self.nameLineEdit = QtGui.QLineEdit(self.tab)
+ self.nameLineEdit.setAlignment(QtCore.Qt.AlignLeading)
+ self.nameLineEdit.setReadOnly(True)
+ self.nameLineEdit.setObjectName("nameLineEdit")
+ self.hboxlayout1.addWidget(self.nameLineEdit)
+ self.vboxlayout.addLayout(self.hboxlayout1)
+
+ self.mmpformatLabel = QtGui.QLabel(self.tab)
+ self.mmpformatLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.mmpformatLabel.setObjectName("mmpformatLabel")
+ self.vboxlayout.addWidget(self.mmpformatLabel)
+
+ self.hboxlayout2 = QtGui.QHBoxLayout()
+ self.hboxlayout2.setMargin(0)
+ self.hboxlayout2.setSpacing(6)
+ self.hboxlayout2.setObjectName("hboxlayout2")
+
+ self.vboxlayout1 = QtGui.QVBoxLayout()
+ self.vboxlayout1.setMargin(0)
+ self.vboxlayout1.setSpacing(6)
+ self.vboxlayout1.setObjectName("vboxlayout1")
+
+ self.statsLabel = QtGui.QLabel(self.tab)
+ self.statsLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.statsLabel.setObjectName("statsLabel")
+ self.vboxlayout1.addWidget(self.statsLabel)
+
+ spacerItem = QtGui.QSpacerItem(20,40,QtGui.QSizePolicy.Minimum,QtGui.QSizePolicy.Expanding)
+ self.vboxlayout1.addItem(spacerItem)
+ self.hboxlayout2.addLayout(self.vboxlayout1)
+
+ self.statsView = QtGui.QListWidget(self.tab)
+ self.statsView.setObjectName("statsView")
+ self.hboxlayout2.addWidget(self.statsView)
+ self.vboxlayout.addLayout(self.hboxlayout2)
+ self.gridlayout1.addLayout(self.vboxlayout,0,0,1,1)
+ self.tabWidget3.addTab(self.tab, "")
+ self.gridlayout.addWidget(self.tabWidget3,0,0,1,1)
+
+ self.retranslateUi(PartPropDialog)
+ QtCore.QObject.connect(self.okPushButton,QtCore.SIGNAL("clicked()"),PartPropDialog.accept)
+ QtCore.QObject.connect(self.cancelPushButton,QtCore.SIGNAL("clicked()"),PartPropDialog.reject)
+ QtCore.QMetaObject.connectSlotsByName(PartPropDialog)
+ PartPropDialog.setTabOrder(self.nameLineEdit,self.statsView)
+ PartPropDialog.setTabOrder(self.statsView,self.okPushButton)
+ PartPropDialog.setTabOrder(self.okPushButton,self.cancelPushButton)
+ PartPropDialog.setTabOrder(self.cancelPushButton,self.tabWidget3)
+
+ def retranslateUi(self, PartPropDialog):
+ PartPropDialog.setWindowTitle(QtGui.QApplication.translate("PartPropDialog", "Part Properties", None, QtGui.QApplication.UnicodeUTF8))
+ self.okPushButton.setText(QtGui.QApplication.translate("PartPropDialog", "&OK", None, QtGui.QApplication.UnicodeUTF8))
+ self.okPushButton.setShortcut(QtGui.QApplication.translate("PartPropDialog", "Alt+O", None, QtGui.QApplication.UnicodeUTF8))
+ self.cancelPushButton.setText(QtGui.QApplication.translate("PartPropDialog", "&Cancel", None, QtGui.QApplication.UnicodeUTF8))
+ self.cancelPushButton.setShortcut(QtGui.QApplication.translate("PartPropDialog", "Alt+C", None, QtGui.QApplication.UnicodeUTF8))
+ self.nameLabel.setText(QtGui.QApplication.translate("PartPropDialog", "Name:", None, QtGui.QApplication.UnicodeUTF8))
+ self.mmpformatLabel.setText(QtGui.QApplication.translate("PartPropDialog", "MMP File Format:", None, QtGui.QApplication.UnicodeUTF8))
+ self.statsLabel.setText(QtGui.QApplication.translate("PartPropDialog", "Statistics:", None, QtGui.QApplication.UnicodeUTF8))
+ self.tabWidget3.setTabText(self.tabWidget3.indexOf(self.tab), QtGui.QApplication.translate("PartPropDialog", "General", None, QtGui.QApplication.UnicodeUTF8))
diff --git a/cad/src/commands/PartProperties/PartPropDialog.ui b/cad/src/commands/PartProperties/PartPropDialog.ui
new file mode 100755
index 000000000..e6dfe59cf
--- /dev/null
+++ b/cad/src/commands/PartProperties/PartPropDialog.ui
@@ -0,0 +1,258 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>PartPropDialog</class>
+ <widget class="QDialog" name="PartPropDialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>396</width>
+ <height>402</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Part Properties</string>
+ </property>
+ <property name="windowIcon" >
+ <iconset/>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>11</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="1" column="0" >
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>4</number>
+ </property>
+ <property name="spacing" >
+ <number>72</number>
+ </property>
+ <item>
+ <widget class="QPushButton" name="okPushButton" >
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text" >
+ <string>&amp;OK</string>
+ </property>
+ <property name="shortcut" >
+ <string>Alt+O</string>
+ </property>
+ <property name="autoDefault" >
+ <bool>true</bool>
+ </property>
+ <property name="default" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelPushButton" >
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text" >
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="shortcut" >
+ <string>Alt+C</string>
+ </property>
+ <property name="autoDefault" >
+ <bool>true</bool>
+ </property>
+ <property name="default" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QTabWidget" name="tabWidget3" >
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>General</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="nameLabel" >
+ <property name="text" >
+ <string>Name:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="nameLineEdit" >
+ <property name="text" >
+ <string/>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignLeading</set>
+ </property>
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLabel" name="mmpformatLabel" >
+ <property name="text" >
+ <string>MMP File Format:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="statsLabel" >
+ <property name="text" >
+ <string>Statistics:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QListWidget" name="statsView" >
+ <column>
+ <property name="text" >
+ <string>Statistic Name</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>Value</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11" />
+ <pixmapfunction></pixmapfunction>
+ <tabstops>
+ <tabstop>nameLineEdit</tabstop>
+ <tabstop>statsView</tabstop>
+ <tabstop>okPushButton</tabstop>
+ <tabstop>cancelPushButton</tabstop>
+ <tabstop>tabWidget3</tabstop>
+ </tabstops>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>okPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>PartPropDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>cancelPushButton</sender>
+ <signal>clicked()</signal>
+ <receiver>PartPropDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>20</x>
+ <y>20</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/cad/src/commands/PartProperties/__init__.py b/cad/src/commands/PartProperties/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/cad/src/commands/PartProperties/__init__.py