Commits

Alexey Elfman committed 6538cad

some things are working now

  • Participants
  • Parent commits c7f6589

Comments (0)

Files changed (1)

         self.ui.statusbar.clearMessage()
         
     def keyPressEvent(self, event):
-        if event.modifiers() == QtCore.Qt.NoModifier:
-            key = event.key()
-
-            if key == QtCore.Qt.Key_Escape:
-                self.close()
-                event.accept()
-            
-            if key == QtCore.Qt.Key_Enter or key == QtCore.Qt.Key_Return:
-                self.run()
-                event.accept()
-            
+        
+        key = event.key()
+        
+        if event.modifiers() == QtCore.Qt.NoModifier and key == QtCore.Qt.Key_Escape:
+            self.close()
+            event.accept()
+        
+        elif (event.modifiers() == QtCore.Qt.KeypadModifier and key == QtCore.Qt.Key_Enter) or \
+             (event.modifiers() == QtCore.Qt.NoModifier and key == QtCore.Qt.Key_Return):
+            self.run()
+            event.accept()
+        
         if not event.isAccepted():
             super(MainForm, self).keyPressEvent(event)
 
                 res = subprocess.Popen(shlex.split(command), close_fds=False)
                 ran = True
             except OSError as e:
-                print "Error %d: %s" % (e.errno, e.strerror)
                 self.ui.statusbar.showMessage(u"Error %d: %s" % (e.errno, e.strerror.decode('utf-8')))
                 ran = False
             
                 self.command_save(command)
                 self.close()
 
-def main(argv):
-    app = QtGui.QApplication(argv)
+def main(argv=None):
+    app = QtGui.QApplication(argv or sys.argv)
     app.setApplicationName("AltF2")
 
     dialer = MainForm()