Skip to content

Commit

Permalink
[Hotplug][modalMessage] clean
Browse files Browse the repository at this point in the history
  • Loading branch information
TwolDE committed Jan 4, 2025
1 parent dd53c89 commit feb43b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def newDeviceCallback(answer):
choiceList.append(
(_("Permanently mount as %s") % mountPointDevice, 5),
)
print(f"[Hotplug][modalsend]default:{default} choiceList:{choiceList}")
ModalMessageBox.instance.showMessageBox(text=text, list=choiceList, default=default, windowTitle=_("New Storage Device"), callback=newDeviceCallback)
else:
self.addedDevice.append((DEVNAME, DEVPATH, ID_MODEL))
Expand Down
6 changes: 2 additions & 4 deletions lib/python/Screens/MessageBox.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,7 @@ def __init__(self, session):
def showMessageBox(self, text=None, timeout=-1, list=None, default=True, close_on_any_key=False, timeout_default=None, windowTitle=None, msgBoxID=None, typeIcon=MessageBox.TYPE_YESNO, enable_input=True, callback=None):
self.dialog.text = text
self.dialog["text"].setText(text)
self.dialog.typeIcon = typeIcon
self.dialog.type = typeIcon
self.dialog.picon = (typeIcon != MessageBox.TYPE_NOICON) # Legacy picon argument to support old skins.
self.dialog.picon = False
if typeIcon == MessageBox.TYPE_YESNO:
self.dialog.list = [(_("Yes"), True), (_("No"), False)] if list is None else list
self.dialog["list"].setList(self.dialog.list)
Expand All @@ -347,7 +345,7 @@ def showMessageBox(self, text=None, timeout=-1, list=None, default=True, close_o
self.callback = callback
self.dialog.timeout = timeout
self.dialog.msgBoxID = msgBoxID
self.dialog.enableInput = enable_input
self.dialog.enable_input = enable_input
if enable_input:
self.dialog.createActionMap(-20)
self.dialog["actions"].execBegin()
Expand Down

0 comments on commit feb43b3

Please sign in to comment.