|
@@ -105,8 +105,8 @@ from core.settings import UserSettings
|
|
|
from gui_core.widgets import FloatValidator, GNotebook, FormNotebook, FormListbook
|
|
|
from core.giface import Notification
|
|
|
from gui_core.widgets import LayersList
|
|
|
-from gui_core.wrap import BitmapFromImage, Button, StaticText, StaticBox, SpinCtrl, \
|
|
|
- CheckBox, BitmapButton, TextCtrl, NewId
|
|
|
+from gui_core.wrap import BitmapFromImage, Button, CloseButton, StaticText, \
|
|
|
+ StaticBox, SpinCtrl, CheckBox, BitmapButton, TextCtrl, NewId
|
|
|
from core.debug import Debug
|
|
|
|
|
|
wxUpdateDialog, EVT_DIALOG_UPDATE = NewEvent()
|
|
@@ -572,11 +572,7 @@ class TaskFrame(wx.Frame):
|
|
|
# buttons
|
|
|
btnsizer = wx.BoxSizer(orient=wx.HORIZONTAL)
|
|
|
# cancel
|
|
|
- if sys.platform == 'darwin':
|
|
|
- # stock id automatically adds ctrl-c shortcut to close dialog
|
|
|
- self.btn_cancel = Button(parent=self.panel, label=_("Close"))
|
|
|
- else:
|
|
|
- self.btn_cancel = Button(parent=self.panel, id=wx.ID_CLOSE)
|
|
|
+ self.btn_cancel = CloseButton(parent=self.panel)
|
|
|
self.btn_cancel.SetToolTip(
|
|
|
_("Close this window without executing the command (Ctrl+Q)"))
|
|
|
btnsizer.Add(
|
|
@@ -586,9 +582,9 @@ class TaskFrame(wx.Frame):
|
|
|
border=10)
|
|
|
self.btn_cancel.Bind(wx.EVT_BUTTON, self.OnCancel)
|
|
|
# bind closing to ESC and CTRL+Q
|
|
|
- self.Bind(wx.EVT_MENU, self.OnCancel, id=wx.ID_CLOSE)
|
|
|
- accelTableList = [(wx.ACCEL_NORMAL, wx.WXK_ESCAPE, wx.ID_CLOSE)]
|
|
|
- accelTableList.append((wx.ACCEL_CTRL, ord('Q'), wx.ID_CLOSE))
|
|
|
+ self.Bind(wx.EVT_MENU, self.OnCancel, id=wx.ID_CANCEL)
|
|
|
+ accelTableList = [(wx.ACCEL_NORMAL, wx.WXK_ESCAPE, wx.ID_CANCEL)]
|
|
|
+ accelTableList.append((wx.ACCEL_CTRL, ord('Q'), wx.ID_CANCEL))
|
|
|
# TODO: bind Ctrl-t for tile windows here (trac #2004)
|
|
|
|
|
|
if self.get_dcmd is not None: # A callback has been set up
|
|
@@ -622,17 +618,14 @@ class TaskFrame(wx.Frame):
|
|
|
accelTableList.append((wx.ACCEL_CTRL, ord('R'), wx.ID_OK))
|
|
|
|
|
|
# copy
|
|
|
- if sys.platform == 'darwin':
|
|
|
- # stock id automatically adds ctrl-c shortcut to copy command
|
|
|
- self.btn_clipboard = Button(parent=self.panel, label=_("Copy"))
|
|
|
- else:
|
|
|
- self.btn_clipboard = Button(parent=self.panel, id=wx.ID_COPY)
|
|
|
+ self.btn_clipboard = Button(
|
|
|
+ parent=self.panel, id=wx.ID_ANY, label=_("Copy"))
|
|
|
self.btn_clipboard.SetToolTip(
|
|
|
_("Copy the current command string to the clipboard"))
|
|
|
btnsizer.Add(self.btn_clipboard, proportion=0,
|
|
|
flag=wx.ALL | wx.ALIGN_CENTER,
|
|
|
border=10)
|
|
|
- self.btn_clipboard.Bind(wx.EVT_BUTTON, self.OnCopy)
|
|
|
+ self.btn_clipboard.Bind(wx.EVT_BUTTON, self.OnCopyCommand)
|
|
|
|
|
|
# help
|
|
|
self.btn_help = Button(parent=self.panel, id=wx.ID_HELP)
|
|
@@ -875,7 +868,7 @@ class TaskFrame(wx.Frame):
|
|
|
event = wxCmdAbort(aborted=True)
|
|
|
wx.PostEvent(self._gconsole, event)
|
|
|
|
|
|
- def OnCopy(self, event):
|
|
|
+ def OnCopyCommand(self, event):
|
|
|
"""Copy the command"""
|
|
|
cmddata = wx.TextDataObject()
|
|
|
# list -> string
|