primitivus: button are now working with XMLUI
This commit is contained in:
parent
2cbc6fa67d
commit
92cc200426
2 changed files with 13 additions and 9 deletions
|
|
@ -30,11 +30,6 @@ from contact_list import ContactList
|
||||||
from chat import Chat
|
from chat import Chat
|
||||||
import custom_widgets
|
import custom_widgets
|
||||||
import pdb
|
import pdb
|
||||||
"""from window import Window
|
|
||||||
from editbox import EditBox
|
|
||||||
from statusbar import StatusBar
|
|
||||||
from chat import Chat
|
|
||||||
from tools.jid import JID"""
|
|
||||||
import logging
|
import logging
|
||||||
from logging import debug, info, error
|
from logging import debug, info, error
|
||||||
import sys, os
|
import sys, os
|
||||||
|
|
@ -103,9 +98,8 @@ class PrimitivusApp(QuickApp):
|
||||||
|
|
||||||
def write_log(self, log, file_name='/tmp/primitivus_log'):
|
def write_log(self, log, file_name='/tmp/primitivus_log'):
|
||||||
"""method to write log in a temporary file, useful for debugging"""
|
"""method to write log in a temporary file, useful for debugging"""
|
||||||
f=open(file_name, 'a')
|
with open(file_name, 'a') as f:
|
||||||
f.write(log+"\n")
|
f.write(log+"\n")
|
||||||
f.close()
|
|
||||||
|
|
||||||
def redraw(self):
|
def redraw(self):
|
||||||
"""redraw the screen"""
|
"""redraw the screen"""
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,17 @@ class XMLUI(urwid.WidgetWrap):
|
||||||
##EVENTS##
|
##EVENTS##
|
||||||
|
|
||||||
def onButtonPress(self, button):
|
def onButtonPress(self, button):
|
||||||
self.host.debug()
|
callback_id, fields = button.param_id
|
||||||
|
data = {"callback_id":callback_id}
|
||||||
|
for field in fields:
|
||||||
|
ctrl = self.ctrl_list[field]
|
||||||
|
if isinstance(ctrl['control'],custom_widgets.List):
|
||||||
|
data[field] = '\t'.join(ctrl['control'].getSelectedValues())
|
||||||
|
else:
|
||||||
|
data[field] = ctrl['control'].getValue()
|
||||||
|
|
||||||
|
id = self.host.bridge.launchAction("button", data, profile_key = self.host.profile)
|
||||||
|
self.host.current_action_ids.add(id)
|
||||||
|
|
||||||
def onFormSubmitted(self, button):
|
def onFormSubmitted(self, button):
|
||||||
data = []
|
data = []
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue