Skip to content

Commit 68a65fc

Browse files
committed
250714.1
1 parent 049d385 commit 68a65fc

File tree

5 files changed

+26
-19
lines changed

5 files changed

+26
-19
lines changed
Binary file not shown.

easycoder/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
from .ec_timestamp import *
1010
from .ec_value import *
1111

12-
__version__ = "250706.1"
12+
__version__ = "250714.1"

easycoder/ec_program.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ def doValue(self, value):
149149
elif valType == 'symbol':
150150
name = value['name']
151151
symbolRecord = self.getSymbolRecord(name)
152-
if symbolRecord['hasValue']:
153-
handler = self.domainIndex[symbolRecord['domain']].valueHandler('symbol')
154-
result = handler(symbolRecord)
155-
else:
156-
# Call the given domain to handle a value
157-
domain = self.domainIndex[value['domain']]
158-
handler = domain.valueHandler(value['type'])
159-
if handler: result = handler(value)
152+
# if symbolRecord['hasValue']:
153+
handler = self.domainIndex[symbolRecord['domain']].valueHandler('symbol')
154+
result = handler(symbolRecord)
155+
# else:
156+
# # Call the given domain to handle a value
157+
# # domain = self.domainIndex[value['domain']]
158+
# handler = domain.valueHandler(value['type'])
159+
# if handler: result = handler(value)
160160
else:
161161
# Call the given domain to handle a value
162162
domain = self.domainIndex[value['domain']]

easycoder/ec_pyside.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -467,12 +467,12 @@ def r_createDialog(self, command, record):
467467
dialogType = command['type']
468468
if dialogType in ['lineinput']:
469469
if dialogType == 'lineinput':
470-
input = QLineEdit()
471-
mainLayout.addWidget(input)
472-
dialog.buttonBox = QDialogButtonBox((QDialogButtonBox.Ok | QDialogButtonBox.Cancel))
473-
dialog.buttonBox.accepted.connect(dialog.accept)
474-
dialog.buttonBox.rejected.connect(dialog.reject)
475-
mainLayout.addWidget(dialog.buttonBox, alignment=Qt.AlignHCenter)
470+
dialog.lineEdit = QLineEdit(dialog)
471+
mainLayout.addWidget(dialog.lineEdit)
472+
buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel, dialog)
473+
buttonBox.accepted.connect(dialog.accept)
474+
buttonBox.rejected.connect(dialog.reject)
475+
mainLayout.addWidget(buttonBox, alignment=Qt.AlignHCenter)
476476
record['dialog'] = dialog
477477
return self.nextPC()
478478

@@ -504,7 +504,7 @@ def r_create(self, command):
504504

505505
# Declare a dialog variable
506506
def k_dialog(self, command):
507-
return self.compileVariable(command)
507+
return self.compileVariable(command, 'gui')
508508

509509
def r_dialog(self, command):
510510
return self.nextPC()
@@ -950,9 +950,9 @@ def r_show(self, command):
950950
window = self.getVariable(command['window'])['window']
951951
window.show()
952952
elif 'dialog' in command:
953-
dialog = self.getVariable(command['dialog'])['dialog']
954-
result = dialog.exec()
955-
# TODO: Finish the dialog box for getting the request relay name
953+
record = self.getVariable(command['dialog'])
954+
dialog = record['dialog']
955+
record['result'] = dialog.exec()
956956
return self.nextPC()
957957

958958
# Start the graphics
@@ -1071,6 +1071,13 @@ def v_symbol(self, symbolRecord):
10711071
v['type'] = 'boolean'
10721072
v['content'] = content
10731073
return v
1074+
elif keyword == 'dialog':
1075+
dialog = symbolRecord['dialog']
1076+
content = dialog.lineEdit.text() if symbolRecord['result'] == QDialog.Accepted else ''
1077+
v = {}
1078+
v['type'] = 'text'
1079+
v['content'] = content
1080+
return v
10741081
return None
10751082

10761083
def v_count(self, v):

0 commit comments

Comments
 (0)