浏览代码

Prompt user when loading recent files

Michael Pitidis 13 年之前
父节点
当前提交
3f63c84d9b
共有 2 个文件被更改,包括 17 次插入1 次删除
  1. 12 0
      README
  2. 5 1
      labelme.py

+ 12 - 0
README

@@ -0,0 +1,12 @@
+
+# INSTRUCTIONS
+
+Since the Python Qt bindings are not currently installed on DICE
+machines, we have prepared a binary suitable for execution with
+[cxfreeze]. To run the program enter ./bin/labelme from the toplevel
+folder of the application. This has been tested succesfully on
+student.compute.
+
+[cxfreeze]: http://cx-freeze.sourceforge.net/
+
+<!-- vim: set ft=markdown tw=72: -->

+ 5 - 1
labelme.py

@@ -471,7 +471,7 @@ class MainWindow(QMainWindow, WindowMixin):
             icon = newIcon('labels')
             action = QAction(
                     icon, '&%d %s' % (i+1, QFileInfo(f).fileName()), self)
-            action.triggered.connect(partial(self.loadFile, f))
+            action.triggered.connect(partial(self.loadRecent, f))
             menu.addAction(action)
 
     def popLabelListMenu(self, point):
@@ -725,6 +725,10 @@ class MainWindow(QMainWindow, WindowMixin):
 
     ## User Dialogs ##
 
+    def loadRecent(self, filename):
+        if self.mayContinue():
+            self.loadFile(filename)
+
     def openFile(self, _value=False):
         if not self.mayContinue():
             return