mirror of
https://github.com/LorenEteval/Furious.git
synced 2026-09-30 10:58:09 +03:00
Fix guiEditor open() bug
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
@@ -937,27 +937,43 @@ class UserServersQTableWidget(QTranslatable, AppQTableWidget):
|
||||
|
||||
logger.error(f'error while converting factory to input: {ex}')
|
||||
|
||||
def handleAccepted():
|
||||
modified = guiEditor.inputToFactory(factory)
|
||||
|
||||
if modified:
|
||||
self.flushRow(index, factory)
|
||||
|
||||
if index == AS_UserActivatedItemIndex():
|
||||
try:
|
||||
if APP().isSystemTrayConnected():
|
||||
mbox = NewChangesNextTimeMBox()
|
||||
|
||||
# Show the MessageBox asynchronously
|
||||
mbox.open()
|
||||
except Exception:
|
||||
# Any non-exit exceptions
|
||||
|
||||
pass
|
||||
|
||||
guiEditor.connectAccepted(handleAccepted)
|
||||
guiEditor.accepted.connect(
|
||||
functools.partial(
|
||||
self.handleGuiEditorAccepted,
|
||||
guiEditor,
|
||||
index,
|
||||
factory,
|
||||
)
|
||||
)
|
||||
guiEditor.open()
|
||||
|
||||
def handleGuiEditorAccepted(
|
||||
self,
|
||||
editor: GuiEditorWidgetQDialog,
|
||||
index: int,
|
||||
factory: ConfigurationFactory,
|
||||
):
|
||||
logger.debug(f'guiEditor accepted with index {index}')
|
||||
|
||||
modified = editor.inputToFactory(factory)
|
||||
|
||||
if modified:
|
||||
self.flushRow(index, factory)
|
||||
|
||||
if index == AS_UserActivatedItemIndex():
|
||||
try:
|
||||
if APP().isSystemTrayConnected():
|
||||
mbox = NewChangesNextTimeMBox()
|
||||
|
||||
# Show the MessageBox asynchronously
|
||||
mbox.open()
|
||||
except Exception:
|
||||
# Any non-exit exceptions
|
||||
|
||||
pass
|
||||
|
||||
editor.accepted.disconnect()
|
||||
|
||||
@QtCore.Slot(QtCore.QPoint)
|
||||
def handleCustomContextMenuRequested(self, point):
|
||||
self.contextMenu.exec(self.mapToGlobal(point))
|
||||
|
||||
Reference in New Issue
Block a user