From 18d142e2a1927003ba579e436bbe06afb3d8f498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20B=C3=B6lter?= Date: Sun, 14 Nov 2010 14:03:07 +0100 Subject: [PATCH] Style is now cleared when the API key/User ID controls are changed (clipboard style would overwrite the default style on osx) --- gui/characterEditor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gui/characterEditor.py b/gui/characterEditor.py index 34b55e075..bd37a17d2 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -513,6 +513,7 @@ class APIView (wx.Panel): fgSizerInput.Add(self.m_staticIDText, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5) self.inputID = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0) + self.inputID.Bind(wx.EVT_TEXT, self.removeStyle) fgSizerInput.Add(self.inputID, 1, wx.ALL | wx.EXPAND, 5) self.m_staticKeyText = wx.StaticText(self, wx.ID_ANY, u"API key:", wx.DefaultPosition, wx.DefaultSize, 0) @@ -520,6 +521,7 @@ class APIView (wx.Panel): fgSizerInput.Add(self.m_staticKeyText, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5) self.inputKey = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0) + self.inputKey.Bind(wx.EVT_TEXT, self.removeStyle) fgSizerInput.Add(self.inputKey, 0, wx.ALL | wx.EXPAND, 5) pmainSizer.Add(fgSizerInput, 0, wx.EXPAND, 5) @@ -555,6 +557,14 @@ class APIView (wx.Panel): self.Layout() self.charChanged(None) + def removeStyle(self, event): + object = event.GetEventObject() + value = object.GetLineText(0) + object.Clear() + object.ChangeValue(value) + object.SetModified(True) + event.Skip() + def charChanged(self, event): cChar = service.Character.getInstance() ID, key = cChar.getApiDetails(self.Parent.Parent.getActiveCharacter())