73 @type QEvent |
73 @type QEvent |
74 @return flag indicating that the event was handled |
74 @return flag indicating that the event was handled |
75 @rtype bool |
75 @rtype bool |
76 """ |
76 """ |
77 if event.type() == QEvent.Type.KeyPress: |
77 if event.type() == QEvent.Type.KeyPress: |
78 |
|
79 # Anywhere in the dialog, make hitting escape cancel it |
78 # Anywhere in the dialog, make hitting escape cancel it |
80 if event.key() == Qt.Key.Key_Escape: |
79 if event.key() == Qt.Key.Key_Escape: |
81 self.close() |
80 self.close() |
82 |
81 |
83 # Anywhere in the dialog, make hitting up/down choose next item |
82 # Anywhere in the dialog, make hitting up/down choose next item |
188 # keep this |
187 # keep this |
189 del possible[:] |
188 del possible[:] |
190 possible.append(record) |
189 possible.append(record) |
191 |
190 |
192 ordered = [] |
191 ordered = [] |
193 for (_, in_order, name) in possible: |
192 for _, in_order, name in possible: |
194 try: |
193 try: |
195 age = os.stat(os.path.join(self.project.ppath, name)).st_mtime |
194 age = os.stat(os.path.join(self.project.ppath, name)).st_mtime |
196 except OSError: |
195 except OSError: |
197 # skipping, because it doesn't appear to exist... |
196 # skipping, because it doesn't appear to exist... |
198 continue |
197 continue |