Skip to content

Commit

Permalink
Fix version printing in GUI
Browse files Browse the repository at this point in the history
When version was changed but not the name,
many versions where printed in the GUI.
  • Loading branch information
dagheyman committed Jul 7, 2016
1 parent 73cbe25 commit 039c6f2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ykman/gui/view/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class _HeaderPanel(QtGui.QGroupBox):
def __init__(self, controller, parent=None):
super(_HeaderPanel, self).__init__(m.device, parent)

self._controller = controller

layout = QtGui.QHBoxLayout(self)

self._device_name = QtGui.QLabel()
Expand All @@ -75,10 +77,11 @@ def _set_serial(self, serial):
self._serial.setText((m.serial_1 % serial) if serial else '')

def _set_version(self, version):
name = self._controller.device_name
if version:
name = self._device_name.text()
self._device_name.setText(name + ' ({0[0]}.{0[1]}.{0[2]})'.format(version))

else:
self._device_name.setText(name)

class _FeatureSection(QtGui.QGroupBox):

Expand Down

0 comments on commit 039c6f2

Please sign in to comment.