mirror of
https://gitlab.com/cc-ru/ocelot/ocelot-desktop.git
synced 2025-12-20 02:59:19 +01:00
parent
33b08dcef8
commit
82b35d9dbc
@ -404,13 +404,16 @@ object OcelotDesktop
|
|||||||
val selectedFile =
|
val selectedFile =
|
||||||
Option.when(chooser.showDialog(null, null) == JFileChooser.APPROVE_OPTION)(chooser.getSelectedFile)
|
Option.when(chooser.showDialog(null, null) == JFileChooser.APPROVE_OPTION)(chooser.getSelectedFile)
|
||||||
|
|
||||||
|
// users of [showFileChooserDialog] expect that the continuation is run on the main thread.
|
||||||
|
// let's meet this expectation.
|
||||||
|
UiHandler.UiThreadTasks.add(() => {
|
||||||
val result = f(selectedFile)
|
val result = f(selectedFile)
|
||||||
|
|
||||||
result match {
|
result match {
|
||||||
case f @ Failure(_) => showFailureMessage(f)
|
case f@Failure(_) => showFailureMessage(f)
|
||||||
case Success(_) =>
|
case Success(_) =>
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}).start()
|
}).start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user