Skip to content

Commit

Permalink
add help about and version menus
Browse files Browse the repository at this point in the history
  • Loading branch information
rookiepeng committed Jun 18, 2019
1 parent 0997543 commit a2964cb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
27 changes: 24 additions & 3 deletions arrayanalysis.py
Expand Up @@ -43,6 +43,7 @@

import sys
import res_rc
import webbrowser
from PyQt5 import QtWidgets, uic, QtCore, QtGui
from PyQt5.QtCore import QThread

Expand Down Expand Up @@ -148,8 +149,8 @@ def init_ui(self):

# self.ui.actionReset_config.triggered.connect(self.reset_config)

# self.ui.actionHelp.triggered.connect(self.help)
# self.ui.actionAbout.triggered.connect(self.about)
self.ui.actionHelp.triggered.connect(self.help)
self.ui.actionAbout.triggered.connect(self.about)

def init_figure(self):
"""Init figures"""
Expand Down Expand Up @@ -606,7 +607,27 @@ def export_pattern(self):
'All Files (*);;CSV files (*.csv)')
if fileName[0] or fileName[1]:
np.savetxt(fileName, self.exp_pattern, fmt='%1.8e', delimiter=',',
header='azimuth (degree), elevation (degree), pattern (dB)')
header='azimuth (degree), elevation (degree), \
pattern (dB)')

def help(self):
webbrowser.open(
'https://github.com/rookiepeng/antenna-array-analysis/issues')

def about(self):
msg = QtWidgets.QMessageBox()

msg.setText('<h1>Antenna Array Analysis</h1>')
msg.setTextFormat(QtCore.Qt.RichText)
msg.setInformativeText(
'<p>A simple GUI tool for antenna array analysis.</p><p>&nbsp;</p>\
<p><strong>Dr. Zhengyu Peng</strong></p><p><a \
href=''https://zpeng.me'' target=''_blank'' \
class=''url''>https://zpeng.me</a></p>')
msg.setWindowTitle("About")
msg.setStandardButtons(QtWidgets.QMessageBox.Ok)

retval = msg.exec_()


if __name__ == '__main__':
Expand Down
17 changes: 9 additions & 8 deletions ui_array_analysis.ui
Expand Up @@ -1069,17 +1069,10 @@
<string>Help</string>
</property>
<addaction name="actionHelp"/>
<addaction name="separator"/>
<addaction name="actionAbout"/>
</widget>
<widget class="QMenu" name="menuEdit">
<property name="title">
<string>Edit</string>
</property>
<addaction name="actionReset_config"/>
<addaction name="actionVersion_1_0_0"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuEdit"/>
<addaction name="menuAbout"/>
</widget>
<action name="actionExport_array_configurations">
Expand Down Expand Up @@ -1147,6 +1140,14 @@
<string>Reset config</string>
</property>
</action>
<action name="actionVersion_1_0_0">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Version 1.0.0</string>
</property>
</action>
</widget>
<resources>
<include location="res.qrc"/>
Expand Down

0 comments on commit a2964cb

Please sign in to comment.