Chat messages should be able to be send with enter in the edit box
This commit is contained in:
parent
e0eb0eefce
commit
6f9a5ce8d2
@ -672,8 +672,14 @@ class chatBuffer(baseBuffer):
|
|||||||
def connect_events(self):
|
def connect_events(self):
|
||||||
widgetUtils.connect_event(self.tab.send, widgetUtils.BUTTON_PRESSED, self.send_chat_to_user)
|
widgetUtils.connect_event(self.tab.send, widgetUtils.BUTTON_PRESSED, self.send_chat_to_user)
|
||||||
widgetUtils.connect_event(self.tab.attachment, widgetUtils.BUTTON_PRESSED, self.add_attachment)
|
widgetUtils.connect_event(self.tab.attachment, widgetUtils.BUTTON_PRESSED, self.add_attachment)
|
||||||
|
widgetUtils.connect_event(self.tab.text, widgetUtils.KEYPRESS, self.catch_enter)
|
||||||
self.tab.set_focus_function(self.onFocus)
|
self.tab.set_focus_function(self.onFocus)
|
||||||
|
|
||||||
|
def catch_enter(self, event, *args, **kwargs):
|
||||||
|
if event.GetKeyCode() == wx.WXK_RETURN:
|
||||||
|
self.send_chat_to_user()
|
||||||
|
event.Skip()
|
||||||
|
|
||||||
def get_items(self, show_nextpage=False):
|
def get_items(self, show_nextpage=False):
|
||||||
if self.can_get_items == False: return
|
if self.can_get_items == False: return
|
||||||
retrieved = True # Control variable for handling unauthorised/connection errors.
|
retrieved = True # Control variable for handling unauthorised/connection errors.
|
||||||
|
@ -146,7 +146,6 @@ class chatTab(wx.Panel):
|
|||||||
self.attachment = wx.Button(self, wx.NewId(), _(u"Add"))
|
self.attachment = wx.Button(self, wx.NewId(), _(u"Add"))
|
||||||
sizer.Add(self.attachment, 0, wx.ALL, 5)
|
sizer.Add(self.attachment, 0, wx.ALL, 5)
|
||||||
self.send = wx.Button(self, -1, _(u"Send"))
|
self.send = wx.Button(self, -1, _(u"Send"))
|
||||||
self.send.SetDefault()
|
|
||||||
sizer.Add(self.send, 0, wx.ALL, 5)
|
sizer.Add(self.send, 0, wx.ALL, 5)
|
||||||
self.SetSizer(sizer)
|
self.SetSizer(sizer)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user