comparison cagou/plugins/plugin_wid_chat.py @ 278:444ba439530f

chat: moved transfer button to header_box
author Goffi <goffi@goffi.org>
date Wed, 20 Mar 2019 09:29:44 +0100
parents f5302d57fb09
children ef77423ce500
comparison
equal deleted inserted replaced
277:f5302d57fb09 278:444ba439530f
38 from cagou.core.image import Image 38 from cagou.core.image import Image
39 from cagou.core.common import SymbolButton, JidButton 39 from cagou.core.common import SymbolButton, JidButton
40 from kivy.uix.dropdown import DropDown 40 from kivy.uix.dropdown import DropDown
41 from kivy.core.window import Window 41 from kivy.core.window import Window
42 from cagou import G 42 from cagou import G
43 from cagou.core import menu
43 44
44 log = logging.getLogger(__name__) 45 log = logging.getLogger(__name__)
45 46
46 PLUGIN_INFO = { 47 PLUGIN_INFO = {
47 "name": _(u"chat"), 48 "name": _(u"chat"),
162 self.dispatch('on_text_validate') 163 self.dispatch('on_text_validate')
163 164
164 165
165 class MessagesWidget(GridLayout): 166 class MessagesWidget(GridLayout):
166 pass 167 pass
168
169
170 class TransferButton(SymbolButton):
171 chat = properties.ObjectProperty()
172
173 def on_release(self, *args):
174 menu.TransferMenu(callback=self.chat.onTransferOK).show(self)
167 175
168 176
169 class EncryptionMainButton(SymbolButton): 177 class EncryptionMainButton(SymbolButton):
170 178
171 def __init__(self, chat, **kwargs): 179 def __init__(self, chat, **kwargs):
378 self._hi_comp_data = None 386 self._hi_comp_data = None
379 self._hi_comp_last = None 387 self._hi_comp_last = None
380 self._hi_comp_dropdown = DropDown() 388 self._hi_comp_dropdown = DropDown()
381 self._hi_comp_allowed = True 389 self._hi_comp_allowed = True
382 cagou_widget.CagouWidget.__init__(self) 390 cagou_widget.CagouWidget.__init__(self)
391 transfer_btn = TransferButton(chat=self)
392 self.headerInputAddExtra(transfer_btn)
383 if type_ == C.CHAT_ONE2ONE: 393 if type_ == C.CHAT_ONE2ONE:
384 self.encryption_btn = EncryptionMainButton(self) 394 self.encryption_btn = EncryptionMainButton(self)
385 self.headerInputAddExtra(self.encryption_btn) 395 self.headerInputAddExtra(self.encryption_btn)
386 self.header_input.hint_text = u"{}".format(target) 396 self.header_input.hint_text = u"{}".format(target)
387 self.postInit() 397 self.postInit()