diff options
Diffstat (limited to '')
-rw-r--r-- | src/ui.py | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -442,7 +442,7 @@ class KPMainWindow(QtGui.QMainWindow): f.addSeparator() self.fd = f.addAction('Save', self.saveMap, QKeySequence("Ctrl+S")) self.fe = f.addAction('Save As...', self.saveMapAs, QKeySequence("Ctrl+Shift+S")) - self.ff = f.addAction('Export...') # E + self.ff = f.addAction('Export...', self.exportMap, QKeySequence("Ctrl+Shift+E")) f.addSeparator() self.fg = f.addAction('Take Screenshot...', self.screenshot, QKeySequence("Ctrl+Alt+S")) f.addSeparator() @@ -636,6 +636,18 @@ class KPMainWindow(QtGui.QMainWindow): self.saveMap(True) + def exportMap(self): + target = KP.map.filePath + + dialogDir = '' if target is None else os.path.dirname(target) + target = unicode(QtGui.QFileDialog.getSaveFileName( + self, 'Export Map', dialogDir, 'Koopatlas binary map (*.kpbin)')) + + if len(target) == 0: + return + + KP.map.export(target) + @QtCore.pyqtSlot() def screenshot(self): |