diff --git a/src/lib/main.py b/src/lib/main.py index 29911f6..dfbccfb 100644 --- a/src/lib/main.py +++ b/src/lib/main.py @@ -989,7 +989,7 @@ def __init__(self, parent=None,app=None): self.ui.actionCut.triggered.connect(self.actionCut) self.ui.actionCopy.triggered.connect(self.actionCopy) self.ui.actionPaste.triggered.connect(self.actionPaste) - self.ui.pushButtonUpload.setEnabled(True) + self.ui.pushButtonUpload.setEnabled(False) # enable buttons self.ui.pushButtonDelete.setEnabled(False) @@ -1235,14 +1235,15 @@ def defaults(self): self.showMessage(_translate("Message","Tonino reset to defaults",None)) def uploadScale(self): - scale = self.app.scales.getCoefficients() - scale = [0.]*(4-len(scale)) + scale # ensure a 4 element scale - self.app.setScale(self.app.toninoPort,scale) - self.app.scales.setDeviceCoefficients(self.app.getScale(self.app.toninoPort)) - if self.app.currentFile and self.app.getModel() == 1: - scaleName = self.app.strippedName(self.app.currentFile).split(".")[0] - self.app.setScaleName(self.app.toninoPort,scaleName) - self.showMessage(_translate("Message","Scale uploaded",None)) + if self.app.toninoPort and self.app.scales.getCoefficients(): + scale = self.app.scales.getCoefficients() + scale = [0.]*(4-len(scale)) + scale # ensure a 4 element scale + self.app.setScale(self.app.toninoPort,scale) + self.app.scales.setDeviceCoefficients(self.app.getScale(self.app.toninoPort)) + if self.app.currentFile and self.app.getModel() == 1: + scaleName = self.app.strippedName(self.app.currentFile).split(".")[0] + self.app.setScaleName(self.app.toninoPort,scaleName) + self.showMessage(_translate("Message","Scale uploaded",None)) def addCoordinate(self,retry=True): try: diff --git a/src/translations/tonino_de.ts b/src/translations/tonino_de.ts index edc8682..0b937fb 100755 --- a/src/translations/tonino_de.ts +++ b/src/translations/tonino_de.ts @@ -18,17 +18,17 @@ Speichern unter - + Do you want to save your changes? Wollen Sie die Änderungen speichern? - + The scale has been modified. Die Skala wurde geändert. - + Do you want to update to %s? Wollen Sie auf Version %s aktualisieren? @@ -48,7 +48,7 @@ Skala anwenden - + The Tonino firmware is outdated! Die Tonino Firmware ist veraltet! @@ -63,12 +63,12 @@ Kalibrierung - + Tonino* - + Tonino** @@ -337,12 +337,12 @@ Die Firmware wurde aktualisiert - + Connecting... Verbinden... - + Connected to Tonino Verbunden mit Tonino @@ -357,12 +357,12 @@ Werkseinstellung wiederhergestellt - + Coordinate out of range Koordinate außerhalb des erlaubten Bereichs - + Scale uploaded Skala übertragen @@ -387,17 +387,17 @@ Kalibrierung aktualisiert - + Not connected Nicht Verbunden - + Scale could not be retrieved Skala konnte nicht empfangen werden - + Connected to TinyTonino Verbunden mit TinyTonino diff --git a/src/translations/tonino_es.ts b/src/translations/tonino_es.ts index f242479..ae9548e 100755 --- a/src/translations/tonino_es.ts +++ b/src/translations/tonino_es.ts @@ -18,12 +18,12 @@ - + Do you want to save your changes? ¿Desea guardar los cambios? - + Do you want to update to %s? ¿Desea actualizar a %s? @@ -43,12 +43,12 @@ Aplicar Escala - + The Tonino firmware is outdated! ¡El firmware de Tonino está desactualizado! - + The scale has been modified. La escala ha sido modificada. @@ -63,12 +63,12 @@ Calibración - + Tonino* - + Tonino** @@ -337,12 +337,12 @@ Firmware actualizado correctamente - + Connecting... Conectando... - + Connected to Tonino Conectado a Tonino @@ -357,12 +357,12 @@ Tonino restaurado a valores por defecto - + Coordinate out of range Coordinar fuera de rango - + Scale uploaded Escala cargada @@ -387,17 +387,17 @@ Calibración actualizada - + Not connected No conectado - + Scale could not be retrieved La escala no pudo ser recuperar - + Connected to TinyTonino Conectado a TinyTonino diff --git a/src/translations/tonino_fr.ts b/src/translations/tonino_fr.ts index d93b8e4..7b81737 100755 --- a/src/translations/tonino_fr.ts +++ b/src/translations/tonino_fr.ts @@ -18,12 +18,12 @@ - + Do you want to save your changes? Voulez-vous sauvegarder les modifications ? - + Do you want to update to %s? Voulez-vous installer la nouvelle version %s ? @@ -43,12 +43,12 @@ Appliquer Échelle - + The Tonino firmware is outdated! Il y a une nouvelle version du logiciel ! - + The scale has been modified. L'échelle a été modifiée. @@ -63,12 +63,12 @@ Calibrage - + Tonino* - + Tonino** @@ -337,12 +337,12 @@ La mise à jour a été correctement installée - + Connecting... Connection en cours... - + Connected to Tonino Connecté à Tonino @@ -357,12 +357,12 @@ Tonino utilise les paramètres par défaut - + Coordinate out of range Les coordinées sont hors limite - + Scale uploaded Échelle chargée @@ -387,17 +387,17 @@ Étalonnage mis à jour - + Not connected Non connecté - + Scale could not be retrieved L'échelle n'a pas pu être récupéré - + Connected to TinyTonino Connecté à TinyTonino diff --git a/src/translations/tonino_it.ts b/src/translations/tonino_it.ts index 1b968a9..6382578 100755 --- a/src/translations/tonino_it.ts +++ b/src/translations/tonino_it.ts @@ -18,12 +18,12 @@ - + Do you want to save your changes? Vuoi salvare i cambiamenti? - + Do you want to update to %s? Vuoi aggiornare alla versione %s? @@ -43,12 +43,12 @@ Applica scala - + The Tonino firmware is outdated! Il firmware di Tonino è obsoleto! - + The scale has been modified. La scala è stata modificata. @@ -63,12 +63,12 @@ Calibrazione - + Tonino* - + Tonino** @@ -337,12 +337,12 @@ Il firmware è stato aggiornato - + Connecting... Connessione in corso... - + Connected to Tonino Collegato a Tonino @@ -357,12 +357,12 @@ Tonino resettato all'impostazione di base - + Coordinate out of range Coordinate fuori dal range - + Scale uploaded Scala caricata @@ -387,17 +387,17 @@ La calibrazione è stato aggiornato - + Not connected Non collegato - + Scale could not be retrieved La scala non è stata ricevuto - + Connected to TinyTonino Collegato a TinyTonino diff --git a/src/translations/tonino_nl.ts b/src/translations/tonino_nl.ts index 92e12c3..83beba7 100755 --- a/src/translations/tonino_nl.ts +++ b/src/translations/tonino_nl.ts @@ -13,12 +13,12 @@ Versie - + Do you want to update to %s? Wilt u updaten naar %s? - + Do you want to save your changes? Wilt u uw wijzigingen opslaan? @@ -43,12 +43,12 @@ Schaal Toepassen - + The Tonino firmware is outdated! De Tonino firmware is verouderd! - + The scale has been modified. De schaal is gewijzigd. @@ -63,12 +63,12 @@ Kalibratie - + Tonino* - + Tonino** @@ -352,22 +352,22 @@ Tonino voorkeuren resetten - + Scale uploaded Schaal geupload - + Coordinate out of range Coordinaat buiten bereik - + Connecting... Verbinden... - + Connected to Tonino Verbonden met Tonino @@ -392,17 +392,17 @@ Kalibratie geupdatet - + Not connected Niet verbonden - + Scale could not be retrieved Schaal kon niet worden ontvangen - + Connected to TinyTonino Verbonden met TinyTonino