Skip to content

Commit

Permalink
New design
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgarcia committed Jun 14, 2017
1 parent 68ee90d commit c6d132c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 15 deletions.
8 changes: 5 additions & 3 deletions hearinglosssimulator/gui/audiodevice_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ def __init__(self, parent = None):
self.createActions()
self.createToolBars()


v = QT.QVBoxLayout()
self.mainlayout.addLayout(v)

self.mainlayout.addWidget(QT.QLabel(u'<h1><b>Setup loss on each ear</b>'))
v.addWidget(QT.QLabel(u'<h1><b>Setup loss on each ear</b>'))
self.hearingLossParameter = HearingLossParameter()
self.mainlayout.addWidget(self.hearingLossParameter)

v.addWidget(self.hearingLossParameter)


self.audio_stream_done = False
Expand Down
17 changes: 10 additions & 7 deletions hearinglosssimulator/gui/common_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,31 @@ def __init__(self, parent = None):
# central layout
w = QT.QWidget()
self.setCentralWidget(w)
self.mainlayout = QT.QVBoxLayout()
self.mainlayout = QT.QHBoxLayout()
w.setLayout(self.mainlayout)


self.mainlayout.addWidget(QT.QLabel(u'<h1><b>Start/Stop</b>'))
h = QT.QHBoxLayout()
self.mainlayout.addLayout(h)
#~ self.mainlayout.addWidget(QT.QLabel(u'<h1><b>Start/Stop</b>'))
v = self.firstlayout = QT.QVBoxLayout()
self.mainlayout.addLayout(v)
v.addWidget(QT.QLabel(u'<h1><b>Start/Stop</b>'))

self.but_compute_filters = QT.QPushButton(u'Computed filters')
self.but_compute_filters.clicked.connect(self.compute_filters)
self.but_compute_filters.setIcon(QT.QIcon(':/compute.png'))
h.addWidget(self.but_compute_filters)
v.addWidget(self.but_compute_filters)

self.but_start_stop = QT.QPushButton(u'Start/Stop playback', checkable=True, enabled=False)
self.but_start_stop.toggled.connect(self.start_stop_audioloop)
self.but_start_stop.setIcon(QT.QIcon(':/media-playback-stop.png'))
h.addWidget(self.but_start_stop)
v.addWidget(self.but_start_stop)

self.but_enable_bypass = QT.QPushButton(u'Enable/bypass simulator', checkable=True, enabled=False, checked=True)
self.but_enable_bypass.toggled.connect(self.enable_bypass_simulator)
self.but_enable_bypass.setIcon(QT.QIcon(':/bypass.png'))
h.addWidget(self.but_enable_bypass)
v.addWidget(self.but_enable_bypass)

v.addStretch()

for but in [self.but_compute_filters, self.but_start_stop, self.but_enable_bypass]:
but.setFixedSize(256, 64)
Expand Down
2 changes: 2 additions & 0 deletions hearinglosssimulator/gui/lossparameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,13 @@ def __init__(self, parent = None):

v.addWidget(QT.QLabel('Hear level presets:'))
self.combo_hearing_level_preset = QT.QComboBox()
self.combo_hearing_level_preset.setMinimumHeight(48)
v.addWidget(self.combo_hearing_level_preset)
self.combo_hearing_level_preset.addItems(hearing_level_preset.keys())
self.combo_hearing_level_preset.currentIndexChanged.connect(self.on_change_preset)
v.addWidget(QT.QLabel('Compression healthiness:'))
self.combo_compression_loss_preset = QT.QComboBox()
self.combo_compression_loss_preset.setMinimumHeight(48)
v.addWidget(self.combo_compression_loss_preset)
self.combo_compression_loss_preset.addItems(compression_ratio.keys())
self.combo_compression_loss_preset.setCurrentIndex(2)
Expand Down
21 changes: 16 additions & 5 deletions hearinglosssimulator/gui/wifidevice_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,26 @@ def __init__(self, parent = None):

# central layout
self.resize(1000,800)
self.mainlayout.insertWidget(0, QT.QLabel(u'<h1><b>Wifi Device State/Conf</b>'))
v = self.firstlayout

v.insertWidget(0, QT.QLabel(u'<h1><b>Wifi Device State/Conf</b>'))
self.devicewidget = WifiDeviceWidget(self.client, parent=self)
self.mainlayout.insertWidget (1, self.devicewidget)
v.insertWidget (1, self.devicewidget)


self.mainlayout.addWidget(QT.QLabel(u'<h1><b>Setup loss on each ear</b>'))
#~ self.mainlayout.addWidget(QT.QLabel(u'<h1><b>Setup loss on each ear</b>'))
#~ self.hearingLossParameter = HearingLossParameter()
#~ self.mainlayout.addWidget(self.hearingLossParameter)

v = QT.QVBoxLayout()
self.mainlayout.addLayout(v)

v.addWidget(QT.QLabel(u'<h1><b>Setup loss on each ear</b>'))
self.hearingLossParameter = HearingLossParameter()
self.mainlayout.addWidget(self.hearingLossParameter)
v.addWidget(self.hearingLossParameter)


self.mainlayout.addStretch()
#~ self.mainlayout.addStretch()

self.configuration_elements = { 'wifidevice' : self.wifiDeviceParameter,
'hearingloss' : self.hearingLossParameter,
Expand All @@ -167,6 +176,8 @@ def __init__(self, parent = None):
}
self.load_configuration()

#~ self.showFullScreen()
self.showMaximized()


def createActions(self):
Expand Down

0 comments on commit c6d132c

Please sign in to comment.