RareLauncher: Enable terminate and kill buttons
This commit is contained in:
parent
70af132da1
commit
6460e8724e
|
@ -60,23 +60,23 @@ class PreLaunchThread(QRunnable):
|
|||
return
|
||||
self.signals.ready_to_launch.emit(args)
|
||||
|
||||
def prepare_launch(self, args: InitArgs) -> Union[LaunchArgs, None]:
|
||||
def prepare_launch(self, args: InitArgs) -> Optional[LaunchArgs]:
|
||||
try:
|
||||
args = get_launch_args(self.core, args)
|
||||
launch_args = get_launch_args(self.core, args)
|
||||
except Exception as e:
|
||||
self.signals.error_occurred.emit(str(e))
|
||||
return None
|
||||
if not args:
|
||||
if not launch_args:
|
||||
return None
|
||||
|
||||
if args.pre_launch_command:
|
||||
if launch_args.pre_launch_command:
|
||||
proc = get_configured_process()
|
||||
proc.setProcessEnvironment(args.env)
|
||||
proc.setProcessEnvironment(launch_args.env)
|
||||
self.signals.started_pre_launch_command.emit()
|
||||
proc.start(args.pre_launch_command[0], args.pre_launch_command[1:])
|
||||
if args.pre_launch_wait:
|
||||
proc.start(launch_args.pre_launch_command[0], launch_args.pre_launch_command[1:])
|
||||
if launch_args.pre_launch_wait:
|
||||
proc.waitForFinished(-1)
|
||||
return args
|
||||
return launch_args
|
||||
|
||||
|
||||
class SyncCheckWorker(QRunnable):
|
||||
|
|
|
@ -48,15 +48,15 @@ class Console(QDialog):
|
|||
|
||||
button_layout.addItem(QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Fixed))
|
||||
|
||||
# self.terminate_button = QPushButton(self.tr("Terminate"))
|
||||
self.terminate_button = QPushButton(self.tr("Terminate"))
|
||||
# self.terminate_button.setVisible(platform.system() == "Windows")
|
||||
# button_layout.addWidget(self.terminate_button)
|
||||
# self.terminate_button.clicked.connect(lambda: self.term.emit())
|
||||
#
|
||||
# self.kill_button = QPushButton(self.tr("Kill"))
|
||||
button_layout.addWidget(self.terminate_button)
|
||||
self.terminate_button.clicked.connect(lambda: self.term.emit())
|
||||
|
||||
self.kill_button = QPushButton(self.tr("Kill"))
|
||||
# self.kill_button.setVisible(platform.system() == "Windows")
|
||||
# button_layout.addWidget(self.kill_button)
|
||||
# self.kill_button.clicked.connect(lambda: self.kill.emit())
|
||||
button_layout.addWidget(self.kill_button)
|
||||
self.kill_button.clicked.connect(lambda: self.kill.emit())
|
||||
|
||||
layout.addLayout(button_layout)
|
||||
|
||||
|
|
Loading…
Reference in a new issue