summaryrefslogtreecommitdiff
path: root/src/ui.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ui.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ui.py b/src/ui.py
index 6106e2a..74dc87e 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -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):