Commit f4edac4c authored by Tong Zhang's avatar Tong Zhang
Browse files

UI: Update UI and resources.

parent e2f85c06
<RCC>
<qresource prefix="icons">
<file>refresh.png</file>
<file>auto-refresh.png</file>
<file>export.png</file>
<file>exit.png</file>
<file>load_lattice.png</file>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -43,7 +43,7 @@ class Ui_MainWindow(object):
self.elem_name_cbb = QtWidgets.QComboBox(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred,
QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
self.elem_name_cbb.sizePolicy().hasHeightForWidth())
......@@ -423,6 +423,19 @@ class Ui_MainWindow(object):
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionExport_Lattice.setIcon(icon4)
self.actionExport_Lattice.setObjectName("actionExport_Lattice")
self.actionUpdate = QtWidgets.QAction(MainWindow)
icon5 = QtGui.QIcon()
icon5.addPixmap(QtGui.QPixmap(":/icons/refresh.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionUpdate.setIcon(icon5)
self.actionUpdate.setObjectName("actionUpdate")
self.actionAuto_Update = QtWidgets.QAction(MainWindow)
self.actionAuto_Update.setCheckable(True)
icon6 = QtGui.QIcon()
icon6.addPixmap(QtGui.QPixmap(":/icons/auto-refresh.png"),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionAuto_Update.setIcon(icon6)
self.actionAuto_Update.setObjectName("actionAuto_Update")
self.menu_Help.addAction(self.actionContents)
self.menu_Help.addSeparator()
self.menu_Help.addAction(self.action_About)
......@@ -431,6 +444,8 @@ class Ui_MainWindow(object):
self.menubar.addAction(self.menu_Help.menuAction())
self.toolBar.addAction(self.actionLoad_Lattice)
self.toolBar.addAction(self.actionExport_Lattice)
self.toolBar.addAction(self.actionUpdate)
self.toolBar.addAction(self.actionAuto_Update)
self.toolBar.addAction(self.actionE_xit)
self.retranslateUi(MainWindow)
......@@ -460,6 +475,9 @@ class Ui_MainWindow(object):
self.trajectory_layout_plot.setXLimitMin)
self.actionLoad_Lattice.triggered.connect(MainWindow.onLoadLattice)
self.actionExport_Lattice.triggered.connect(MainWindow.onExportLatfile)
self.actionAuto_Update.toggled['bool'].connect(
MainWindow.onAutoUpdateModel)
self.actionUpdate.triggered.connect(MainWindow.onUpdateModel)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
......@@ -539,6 +557,8 @@ class Ui_MainWindow(object):
self.actionExport_Lattice.setToolTip(
_translate("MainWindow",
"Export physics model to a FLAME lattice file."))
self.actionUpdate.setText(_translate("MainWindow", "Update"))
self.actionAuto_Update.setText(_translate("MainWindow", "Auto Update"))
from mpl4qt.widgets.mplbasewidget import MatplotlibBaseWidget
......
......@@ -54,7 +54,7 @@
<widget class="QComboBox" name="elem_name_cbb">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>1</horstretch>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
......@@ -712,6 +712,8 @@
</attribute>
<addaction name="actionLoad_Lattice"/>
<addaction name="actionExport_Lattice"/>
<addaction name="actionUpdate"/>
<addaction name="actionAuto_Update"/>
<addaction name="actionE_xit"/>
</widget>
<action name="action_About">
......@@ -774,6 +776,27 @@
<string>Export physics model to a FLAME lattice file.</string>
</property>
</action>
<action name="actionUpdate">
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icons/refresh.png</normaloff>:/icons/refresh.png</iconset>
</property>
<property name="text">
<string>Update</string>
</property>
</action>
<action name="actionAuto_Update">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/icons/auto-refresh.png</normaloff>:/icons/auto-refresh.png</iconset>
</property>
<property name="text">
<string>Auto Update</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
......@@ -1047,6 +1070,38 @@
</hint>
</hints>
</connection>
<connection>
<sender>actionAuto_Update</sender>
<signal>toggled(bool)</signal>
<receiver>MainWindow</receiver>
<slot>onAutoUpdateModel()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>866</x>
<y>456</y>
</hint>
</hints>
</connection>
<connection>
<sender>actionUpdate</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>onUpdateModel()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>866</x>
<y>456</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>onAbout()</slot>
......@@ -1056,5 +1111,7 @@
<slot>on_ellipse_size_changed()</slot>
<slot>onLoadLattice()</slot>
<slot>onExportLatfile()</slot>
<slot>onUpdateModel()</slot>
<slot>onAutoUpdateModel()</slot>
</slots>
</ui>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment