Merge branch 'qt-gui-update' of https://github.com/CopterExpress/clever-show into qt-gui-update

This commit is contained in:
Artem30801
2020-03-05 00:09:40 +03:00
2 changed files with 12 additions and 6 deletions

View File

@@ -812,12 +812,18 @@ class ConfigDialog(QtWidgets.QDialog):
return reply == QMessageBox.Yes
def save_as(self):
save_path = QFileDialog.getSaveFileName(self, "Save as configuration file",
directory=self.filename,
filter="Config files (*.ini)")[0]
save_path = QFileDialog.getSaveFileName(self, "Save as configuration file (.ini)",
directory=self.filename+'.ini',
options=QFileDialog.DontConfirmOverwrite,
filter="Config files (*.ini);;All files (*.*)")[0]
if not save_path:
return
split_path = save_path.split('.')
if not (len(split_path) > 1 and split_path[-1] == 'ini'):
save_path += '.ini'
cfg = config.ConfigManager()
cfg.load_from_dict(self.model.to_config_dict())
cfg.config.filename = save_path

View File

@@ -166,7 +166,7 @@ class MainWindow(QtWidgets.QMainWindow):
self.ui.action_retrive_any_file.triggered.connect(b_partial(self.request_any_file, client_path=None))
self.ui.action_restart_clever.triggered.connect(
b_partial(self.send_to_selected, "service_restart", kwargs={"name": "clever"}))
b_partial(self.send_to_selected, "service_restart", command_kwargs={"name": "clever"}))
self.ui.action_restart_clever_show.triggered.connect(self.restart_clever_show)
self.ui.action_restart_chrony.triggered.connect(self.restart_chrony)
self.ui.action_reboot_all.triggered.connect(b_partial(self.send_to_selected, "reboot_all"))
@@ -323,7 +323,7 @@ class MainWindow(QtWidgets.QMainWindow):
self.ui.pause_button.setText('Resume')
else:
time_gap = 0.1 # TODO config? automatic delay detection?
self.send_to_selected("resume", kwargs={"time": server.time_now() + time_gap})
self.send_to_selected("resume", command_kwargs={"time": server.time_now() + time_gap})
self.ui.pause_button.setText('Pause')
@pyqtSlot()
@@ -534,7 +534,7 @@ class MainWindow(QtWidgets.QMainWindow):
text, ok = QInputDialog.getText(self, "Enter command to send on copter",
"Command:", QLineEdit.Normal, "")
if ok and text:
self.send_to_selected("execute", kwargs={"command": text})
self.send_to_selected("execute", command_kwargs={"command": text})
@pyqtSlot()
def restart_clever_show(self):