Skip to content

Commit

Permalink
Fix add server via Gui crash
Browse files Browse the repository at this point in the history
Signed-off-by: Loren Eteval <[email protected]>
  • Loading branch information
LorenEteval committed May 11, 2024
1 parent 3556863 commit c1f6d4d
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions Furious/Widget/UserServersQTableWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -1093,13 +1093,25 @@ def addServerViaGui(

logger.error(f'error while converting factory to input: {ex}')

def handleAccepted():
guiEditor.inputToFactory(factory)
guiEditor.accepted.connect(
functools.partial(
self.handleAddServerViaGui,
guiEditor,
factory,
)
)
guiEditor.open()

self.appendNewItemByFactory(factory)
def handleAddServerViaGui(
self,
editor: GuiEditorWidgetQDialog,
factory: ConfigurationFactory,
):
editor.inputToFactory(factory)

guiEditor.connectAccepted(handleAccepted)
guiEditor.open()
self.appendNewItemByFactory(factory)

editor.accepted.disconnect()

def flushRow(self, row: int, item: ConfigurationFactory):
for column in list(range(self.columnCount())):
Expand Down

0 comments on commit c1f6d4d

Please sign in to comment.