From fe77caf2f0236f15ab4d9542d10f04239a39eaff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=BE=A4?= Date: Tue, 5 Jun 2018 14:26:56 +0800 Subject: [PATCH 1/2] Fix up typos: FIle->File --- calculator/MainWindow.py | 12 ++++++------ calculator/mainwindow.ui | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/calculator/MainWindow.py b/calculator/MainWindow.py index a8655c1..234c81c 100644 --- a/calculator/MainWindow.py +++ b/calculator/MainWindow.py @@ -252,8 +252,8 @@ class Ui_MainWindow(object): self.menuBar = QtWidgets.QMenuBar(MainWindow) self.menuBar.setGeometry(QtCore.QRect(0, 0, 484, 22)) self.menuBar.setObjectName("menuBar") - self.menuFIle = QtWidgets.QMenu(self.menuBar) - self.menuFIle.setObjectName("menuFIle") + self.menuFile = QtWidgets.QMenu(self.menuBar) + self.menuFile.setObjectName("menuFile") MainWindow.setMenuBar(self.menuBar) self.statusBar = QtWidgets.QStatusBar(MainWindow) self.statusBar.setObjectName("statusBar") @@ -262,9 +262,9 @@ class Ui_MainWindow(object): self.actionExit.setObjectName("actionExit") self.actionReset = QtWidgets.QAction(MainWindow) self.actionReset.setObjectName("actionReset") - self.menuFIle.addAction(self.actionReset) - self.menuFIle.addAction(self.actionExit) - self.menuBar.addAction(self.menuFIle.menuAction()) + self.menuFile.addAction(self.actionReset) + self.menuFile.addAction(self.actionExit) + self.menuBar.addAction(self.menuFile.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) @@ -310,7 +310,7 @@ class Ui_MainWindow(object): self.pushButton_pc.setShortcut(_translate("MainWindow", "%")) self.pushButton_eq.setText(_translate("MainWindow", "=")) self.pushButton_eq.setShortcut(_translate("MainWindow", "Return")) - self.menuFIle.setTitle(_translate("MainWindow", "FIle")) + self.menuFile.setTitle(_translate("MainWindow", "File")) self.actionExit.setText(_translate("MainWindow", "Exit")) self.actionExit.setShortcut(_translate("MainWindow", "Ctrl+Q")) self.actionReset.setText(_translate("MainWindow", "Reset")) diff --git a/calculator/mainwindow.ui b/calculator/mainwindow.ui index 5d14863..6bf5f82 100644 --- a/calculator/mainwindow.ui +++ b/calculator/mainwindow.ui @@ -550,14 +550,14 @@ color: #4CAF50; 22 - + - FIle + File - + From ca2bb1c6c1b461f4928d831816f28f711a1492c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Jorge?= Date: Mon, 15 Oct 2018 21:01:48 -0500 Subject: [PATCH 2/2] calculator: fixes window not closing with the Exit menu --- calculator/calculator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/calculator/calculator.py b/calculator/calculator.py index ed4e897..9bfe880 100644 --- a/calculator/calculator.py +++ b/calculator/calculator.py @@ -33,6 +33,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.actionReset.triggered.connect(self.reset) self.pushButton_ac.pressed.connect(self.reset) + self.actionExit.triggered.connect(self.close) + self.pushButton_m.pressed.connect(self.memory_store) self.pushButton_mr.pressed.connect(self.memory_recall)