Skip to content

Commit

Permalink
fixes update button state
Browse files Browse the repository at this point in the history
  • Loading branch information
myTonino committed Oct 29, 2016
1 parent e650a34 commit ec12710
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 74 deletions.
19 changes: 10 additions & 9 deletions src/lib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
26 changes: 13 additions & 13 deletions src/translations/tonino_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
<translation>Speichern unter</translation>
</message>
<message>
<location filename="../lib/main.py" line="1553"/>
<location filename="../lib/main.py" line="1554"/>
<source>Do you want to save your changes?</source>
<translation>Wollen Sie die Änderungen speichern?</translation>
</message>
<message>
<location filename="../lib/main.py" line="1552"/>
<location filename="../lib/main.py" line="1553"/>
<source>The scale has been modified.</source>
<translation>Die Skala wurde geändert.</translation>
</message>
<message>
<location filename="../lib/main.py" line="1460"/>
<location filename="../lib/main.py" line="1461"/>
<source>Do you want to update to %s?</source>
<translation>Wollen Sie auf Version %s aktualisieren?</translation>
</message>
Expand All @@ -48,7 +48,7 @@
<translation>Skala anwenden</translation>
</message>
<message>
<location filename="../lib/main.py" line="1459"/>
<location filename="../lib/main.py" line="1460"/>
<source>The Tonino firmware is outdated!</source>
<translation>Die Tonino Firmware ist veraltet!</translation>
</message>
Expand All @@ -63,12 +63,12 @@
<translation>Kalibrierung</translation>
</message>
<message>
<location filename="../lib/main.py" line="1384"/>
<location filename="../lib/main.py" line="1385"/>
<source>Tonino*</source>
<translation></translation>
</message>
<message>
<location filename="../lib/main.py" line="1386"/>
<location filename="../lib/main.py" line="1387"/>
<source>Tonino**</source>
<translation></translation>
</message>
Expand Down Expand Up @@ -337,12 +337,12 @@
<translation>Die Firmware wurde aktualisiert</translation>
</message>
<message>
<location filename="../lib/main.py" line="1437"/>
<location filename="../lib/main.py" line="1438"/>
<source>Connecting...</source>
<translation>Verbinden...</translation>
</message>
<message>
<location filename="../lib/main.py" line="1488"/>
<location filename="../lib/main.py" line="1489"/>
<source>Connected to Tonino</source>
<translation>Verbunden mit Tonino</translation>
</message>
Expand All @@ -357,12 +357,12 @@
<translation>Werkseinstellung wiederhergestellt</translation>
</message>
<message>
<location filename="../lib/main.py" line="1260"/>
<location filename="../lib/main.py" line="1261"/>
<source>Coordinate out of range</source>
<translation>Koordinate außerhalb des erlaubten Bereichs</translation>
</message>
<message>
<location filename="../lib/main.py" line="1245"/>
<location filename="../lib/main.py" line="1246"/>
<source>Scale uploaded</source>
<translation>Skala übertragen</translation>
</message>
Expand All @@ -387,17 +387,17 @@
<translation>Kalibrierung aktualisiert</translation>
</message>
<message>
<location filename="../lib/main.py" line="1475"/>
<location filename="../lib/main.py" line="1476"/>
<source>Not connected</source>
<translation>Nicht Verbunden</translation>
</message>
<message>
<location filename="../lib/main.py" line="1494"/>
<location filename="../lib/main.py" line="1495"/>
<source>Scale could not be retrieved</source>
<translation>Skala konnte nicht empfangen werden</translation>
</message>
<message>
<location filename="../lib/main.py" line="1490"/>
<location filename="../lib/main.py" line="1491"/>
<source>Connected to TinyTonino</source>
<translation>Verbunden mit TinyTonino</translation>
</message>
Expand Down
26 changes: 13 additions & 13 deletions src/translations/tonino_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
<translation></translation>
</message>
<message>
<location filename="../lib/main.py" line="1553"/>
<location filename="../lib/main.py" line="1554"/>
<source>Do you want to save your changes?</source>
<translation>¿Desea guardar los cambios?</translation>
</message>
<message>
<location filename="../lib/main.py" line="1460"/>
<location filename="../lib/main.py" line="1461"/>
<source>Do you want to update to %s?</source>
<translation>¿Desea actualizar a %s?</translation>
</message>
Expand All @@ -43,12 +43,12 @@
<translation>Aplicar Escala</translation>
</message>
<message>
<location filename="../lib/main.py" line="1459"/>
<location filename="../lib/main.py" line="1460"/>
<source>The Tonino firmware is outdated!</source>
<translation>¡El firmware de Tonino está desactualizado!</translation>
</message>
<message>
<location filename="../lib/main.py" line="1552"/>
<location filename="../lib/main.py" line="1553"/>
<source>The scale has been modified.</source>
<translation>La escala ha sido modificada.</translation>
</message>
Expand All @@ -63,12 +63,12 @@
<translation>Calibración</translation>
</message>
<message>
<location filename="../lib/main.py" line="1384"/>
<location filename="../lib/main.py" line="1385"/>
<source>Tonino*</source>
<translation></translation>
</message>
<message>
<location filename="../lib/main.py" line="1386"/>
<location filename="../lib/main.py" line="1387"/>
<source>Tonino**</source>
<translation></translation>
</message>
Expand Down Expand Up @@ -337,12 +337,12 @@
<translation>Firmware actualizado correctamente</translation>
</message>
<message>
<location filename="../lib/main.py" line="1437"/>
<location filename="../lib/main.py" line="1438"/>
<source>Connecting...</source>
<translation>Conectando...</translation>
</message>
<message>
<location filename="../lib/main.py" line="1488"/>
<location filename="../lib/main.py" line="1489"/>
<source>Connected to Tonino</source>
<translation>Conectado a Tonino</translation>
</message>
Expand All @@ -357,12 +357,12 @@
<translation>Tonino restaurado a valores por defecto</translation>
</message>
<message>
<location filename="../lib/main.py" line="1260"/>
<location filename="../lib/main.py" line="1261"/>
<source>Coordinate out of range</source>
<translation>Coordinar fuera de rango</translation>
</message>
<message>
<location filename="../lib/main.py" line="1245"/>
<location filename="../lib/main.py" line="1246"/>
<source>Scale uploaded</source>
<translation>Escala cargada</translation>
</message>
Expand All @@ -387,17 +387,17 @@
<translation>Calibración actualizada</translation>
</message>
<message>
<location filename="../lib/main.py" line="1475"/>
<location filename="../lib/main.py" line="1476"/>
<source>Not connected</source>
<translation>No conectado</translation>
</message>
<message>
<location filename="../lib/main.py" line="1494"/>
<location filename="../lib/main.py" line="1495"/>
<source>Scale could not be retrieved</source>
<translation>La escala no pudo ser recuperar</translation>
</message>
<message>
<location filename="../lib/main.py" line="1490"/>
<location filename="../lib/main.py" line="1491"/>
<source>Connected to TinyTonino</source>
<translation>Conectado a TinyTonino</translation>
</message>
Expand Down
26 changes: 13 additions & 13 deletions src/translations/tonino_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
<translation></translation>
</message>
<message>
<location filename="../lib/main.py" line="1553"/>
<location filename="../lib/main.py" line="1554"/>
<source>Do you want to save your changes?</source>
<translation>Voulez-vous sauvegarder les modifications ?</translation>
</message>
<message>
<location filename="../lib/main.py" line="1460"/>
<location filename="../lib/main.py" line="1461"/>
<source>Do you want to update to %s?</source>
<translation>Voulez-vous installer la nouvelle version %s ?</translation>
</message>
Expand All @@ -43,12 +43,12 @@
<translation>Appliquer Échelle</translation>
</message>
<message>
<location filename="../lib/main.py" line="1459"/>
<location filename="../lib/main.py" line="1460"/>
<source>The Tonino firmware is outdated!</source>
<translation>Il y a une nouvelle version du logiciel !</translation>
</message>
<message>
<location filename="../lib/main.py" line="1552"/>
<location filename="../lib/main.py" line="1553"/>
<source>The scale has been modified.</source>
<translation>L&apos;échelle a été modifiée.</translation>
</message>
Expand All @@ -63,12 +63,12 @@
<translation>Calibrage</translation>
</message>
<message>
<location filename="../lib/main.py" line="1384"/>
<location filename="../lib/main.py" line="1385"/>
<source>Tonino*</source>
<translation></translation>
</message>
<message>
<location filename="../lib/main.py" line="1386"/>
<location filename="../lib/main.py" line="1387"/>
<source>Tonino**</source>
<translation></translation>
</message>
Expand Down Expand Up @@ -337,12 +337,12 @@
<translation>La mise à jour a été correctement installée</translation>
</message>
<message>
<location filename="../lib/main.py" line="1437"/>
<location filename="../lib/main.py" line="1438"/>
<source>Connecting...</source>
<translation>Connection en cours...</translation>
</message>
<message>
<location filename="../lib/main.py" line="1488"/>
<location filename="../lib/main.py" line="1489"/>
<source>Connected to Tonino</source>
<translation>Connecté à Tonino</translation>
</message>
Expand All @@ -357,12 +357,12 @@
<translation>Tonino utilise les paramètres par défaut</translation>
</message>
<message>
<location filename="../lib/main.py" line="1260"/>
<location filename="../lib/main.py" line="1261"/>
<source>Coordinate out of range</source>
<translation>Les coordinées sont hors limite</translation>
</message>
<message>
<location filename="../lib/main.py" line="1245"/>
<location filename="../lib/main.py" line="1246"/>
<source>Scale uploaded</source>
<translation>Échelle chargée</translation>
</message>
Expand All @@ -387,17 +387,17 @@
<translation>Étalonnage mis à jour</translation>
</message>
<message>
<location filename="../lib/main.py" line="1475"/>
<location filename="../lib/main.py" line="1476"/>
<source>Not connected</source>
<translation>Non connecté</translation>
</message>
<message>
<location filename="../lib/main.py" line="1494"/>
<location filename="../lib/main.py" line="1495"/>
<source>Scale could not be retrieved</source>
<translation>L&apos;échelle n&apos;a pas pu être récupéré</translation>
</message>
<message>
<location filename="../lib/main.py" line="1490"/>
<location filename="../lib/main.py" line="1491"/>
<source>Connected to TinyTonino</source>
<translation>Connecté à TinyTonino</translation>
</message>
Expand Down
Loading

0 comments on commit ec12710

Please sign in to comment.