mirror of
https://github.com/cyber-defence-campus/mole
synced 2026-06-20 13:19:21 +00:00
Added configuration parameters for manual source functions (#175)
This commit is contained in:
@@ -291,8 +291,6 @@ class PathController:
|
||||
par_cnt_fun = parser.parse(par_cnt)
|
||||
if par_cnt_fun is None:
|
||||
return None, "Invalid par_cnt..."
|
||||
if is_from_manual_func:
|
||||
par_slice = "True"
|
||||
par_slice_fun = parser.parse(par_slice)
|
||||
if par_slice_fun is None:
|
||||
return None, "Invalid par_slice..."
|
||||
@@ -326,6 +324,8 @@ class PathController:
|
||||
synopsis: str, par_cnt: str, par_slice: str, all_code_xrefs: bool
|
||||
) -> None:
|
||||
# Create manual function
|
||||
if is_from_manual_func and not all_code_xrefs:
|
||||
par_slice = "True"
|
||||
manual_fun, msg = _create_fun(synopsis, par_cnt, par_slice)
|
||||
# Give user feedback if function creating failed
|
||||
if manual_fun is None:
|
||||
|
||||
+10
-18
@@ -397,28 +397,20 @@ class ManualConfigDialog(qtw.QDialog):
|
||||
self.par_cnt_wid.setToolTip(
|
||||
"expression specifying the number of parameters (e.g. 'i >= 1')"
|
||||
)
|
||||
self.par_slice_wid = qtw.QLineEdit("False")
|
||||
self.par_slice_wid.setToolTip(
|
||||
"expression specifying which parameter 'i' to slice (e.g. 'i >= 1')"
|
||||
)
|
||||
self.all_code_xrefs_wid = qtw.QCheckBox()
|
||||
self.all_code_xrefs_wid.setToolTip("include all symbol's code cross-references")
|
||||
# Configuration layout
|
||||
cnf_lay = qtw.QGridLayout()
|
||||
cnf_lay.addWidget(qtw.QLabel("par_cnt:"), 0, 0)
|
||||
cnf_lay.addWidget(self.par_cnt_wid, 0, 1)
|
||||
if not is_from_manual_func:
|
||||
self.par_slice_wid = qtw.QLineEdit(
|
||||
"True" if is_from_manual_func else "False"
|
||||
)
|
||||
self.par_slice_wid.setToolTip(
|
||||
"expression specifying which parameter 'i' to slice (e.g. 'i >= 1')"
|
||||
)
|
||||
cnf_lay.addWidget(qtw.QLabel("par_slice:"), 1, 0)
|
||||
cnf_lay.addWidget(self.par_slice_wid, 1, 1)
|
||||
self.all_code_xrefs_wid = qtw.QCheckBox()
|
||||
self.all_code_xrefs_wid.setToolTip(
|
||||
"include all symbol's code cross-references"
|
||||
)
|
||||
cnf_lay.addWidget(qtw.QLabel("all_code_xrefs:"), 2, 0)
|
||||
cnf_lay.addWidget(self.all_code_xrefs_wid, 2, 1)
|
||||
else:
|
||||
self.par_slice_wid = None
|
||||
self.all_code_xrefs_wid = None
|
||||
cnf_lay.addWidget(qtw.QLabel("par_slice:"), 1, 0)
|
||||
cnf_lay.addWidget(self.par_slice_wid, 1, 1)
|
||||
cnf_lay.addWidget(qtw.QLabel("all_code_xrefs:"), 2, 0)
|
||||
cnf_lay.addWidget(self.all_code_xrefs_wid, 2, 1)
|
||||
# Configuration widget
|
||||
cnf_wid = qtw.QGroupBox("Configuration:")
|
||||
cnf_wid.setLayout(cnf_lay)
|
||||
|
||||
Reference in New Issue
Block a user