Slight improvements

This commit is contained in:
Artem30801
2019-12-30 10:35:48 +03:00
parent 2ebdb6f683
commit 9091d90554
2 changed files with 12 additions and 8 deletions

View File

@@ -212,7 +212,7 @@ class ModelFormatter:
@ModelFormatter.col_format(0, ModelFormatter.PLACE_FORMATTER)
def place_id(value):
value = value.stip()
value = value.strip()
# check user hostname spelling http://man7.org/linux/man-pages/man7/hostname.7.html
# '-' (hyphen) not first; latin letters/numbers/hyphens; length form 1 to 63
# or matches command pattern
@@ -277,6 +277,7 @@ def place_time_delta(value):
def view_time_delta(value):
return "{:.3f}".format(value)
class CopterDataModel(QtCore.QAbstractTableModel):
selected_ready_signal = QtCore.pyqtSignal(bool)
selected_takeoff_ready_signal = QtCore.pyqtSignal(bool)
@@ -460,6 +461,7 @@ class CopterDataModel(QtCore.QAbstractTableModel):
if row is not None:
self.removeRows(row)
def flip_checks(copter_item):
for col in ModelChecks.takeoff_checklist:
if col != 4 or col != 7:
@@ -498,7 +500,6 @@ class CopterProxyModel(QtCore.QSortFilterProxyModel):
return self.human_sort_prepare(leftData) < self.human_sort_prepare(rightData)
class SignalManager(QtCore.QObject):
update_data_signal = QtCore.pyqtSignal(int, int, QtCore.QVariant, QtCore.QVariant)
add_client_signal = QtCore.pyqtSignal(object)

View File

@@ -74,6 +74,7 @@ class ServerQt(Server):
table.ModelChecks.time_delta_max = self.config.checks_time_delta_max
# noinspection PyCallByClass,PyArgumentList
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, server):
super(MainWindow, self).__init__()
@@ -460,17 +461,19 @@ class MainWindow(QtWidgets.QMainWindow):
def send_any_command(self):
text, okPressed = QInputDialog.getText(self, "Enter command to send on copter",
"Command:", QLineEdit.Normal, "")
if okPressed and text != '':
if okPressed and text:
self.send_to_selected("execute", {"command": text})
@pyqtSlot()
def select_music_file(self):
path = QFileDialog.getOpenFileName(self, "Select music file", filter="Music files (*.mp3 *.wav)")[0]
if path:
media = QUrl.fromLocalFile(path)
content = QtMultimedia.QMediaContent(media)
self.player.setMedia(content)
self.ui.action_select_music_file.setText(self.ui.action_select_music_file.text() + " (selected)")
if not path:
return
media = QUrl.fromLocalFile(path)
content = QtMultimedia.QMediaContent(media)
self.player.setMedia(content)
self.ui.action_select_music_file.setText(self.ui.action_select_music_file.text() + " (selected)")
@pyqtSlot()
def play_music(self):