From a2964cb252e5119dc35e1db5d9301d94d040fd8b Mon Sep 17 00:00:00 2001 From: rookiepeng Date: Mon, 17 Jun 2019 22:02:41 -0400 Subject: [PATCH] add help about and version menus --- arrayanalysis.py | 27 ++++++++++++++++++++++++--- ui_array_analysis.ui | 17 +++++++++-------- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/arrayanalysis.py b/arrayanalysis.py index 7cc7c58..0288080 100644 --- a/arrayanalysis.py +++ b/arrayanalysis.py @@ -43,6 +43,7 @@ import sys import res_rc +import webbrowser from PyQt5 import QtWidgets, uic, QtCore, QtGui from PyQt5.QtCore import QThread @@ -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""" @@ -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('

Antenna Array Analysis

') + msg.setTextFormat(QtCore.Qt.RichText) + msg.setInformativeText( + '

A simple GUI tool for antenna array analysis.

 

\ +

Dr. Zhengyu Peng

https://zpeng.me

') + msg.setWindowTitle("About") + msg.setStandardButtons(QtWidgets.QMessageBox.Ok) + + retval = msg.exec_() if __name__ == '__main__': diff --git a/ui_array_analysis.ui b/ui_array_analysis.ui index c88b08c..a63153c 100644 --- a/ui_array_analysis.ui +++ b/ui_array_analysis.ui @@ -1069,17 +1069,10 @@ Help - - - - - Edit - - + - @@ -1147,6 +1140,14 @@ Reset config + + + false + + + Version 1.0.0 + +