|
@@ -21,6 +21,7 @@ This program is free software under the GNU General Public License
|
|
|
"""
|
|
|
|
|
|
import os
|
|
|
+import sys
|
|
|
|
|
|
import wx
|
|
|
from core import globalvar
|
|
@@ -137,6 +138,13 @@ class ImportDialog(wx.Dialog):
|
|
|
|
|
|
self.createSettingsPage()
|
|
|
|
|
|
+ # Enable copying to clipboard with cmd+c from dialog on macOS
|
|
|
+ # (default key binding will close the dialog), trac #3592
|
|
|
+ if sys.platform == "darwin":
|
|
|
+ self.Bind(wx.EVT_MENU, self.OnCopyToClipboard, id=wx.ID_COPY)
|
|
|
+ self.accel_tbl = wx.AcceleratorTable([(wx.ACCEL_CTRL, ord("C"), wx.ID_COPY)])
|
|
|
+ self.SetAcceleratorTable(self.accel_tbl)
|
|
|
+
|
|
|
def createSettingsPage(self):
|
|
|
|
|
|
self._blackList = {
|
|
@@ -310,6 +318,13 @@ class ImportDialog(wx.Dialog):
|
|
|
"""Do what has to be done after importing"""
|
|
|
pass
|
|
|
|
|
|
+ def OnCopyToClipboard(self, event):
|
|
|
+ """Copy selected text in dialog to the clipboard"""
|
|
|
+ try:
|
|
|
+ wx.Window.FindFocus().Copy()
|
|
|
+ except:
|
|
|
+ pass
|
|
|
+
|
|
|
def _getLayersToReprojetion(self, projMatch_idx, grassName_idx):
|
|
|
"""If there are layers with different projection from loation projection,
|
|
|
show dialog to user to explicitly select layers which will be reprojected..."""
|