Skip to content

Commit

Permalink
Soem icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgarcia committed Jun 14, 2017
1 parent bac6f2b commit 523c621
Show file tree
Hide file tree
Showing 9 changed files with 19,102 additions and 15,112 deletions.
4 changes: 0 additions & 4 deletions hearinglosssimulator/gui/audiodevice_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ def __init__(self, parent = None):
self.hearingLossParameter = HearingLossParameter()
self.mainlayout.addWidget(self.hearingLossParameter)

self.timer_icon = QT.QTimer(interval=1000)
self.timer_icon.timeout.connect(self.flash_icon)
self.flag_icon = True
self.timer_icon.start()


self.audio_stream_done = False
Expand Down
24 changes: 15 additions & 9 deletions hearinglosssimulator/gui/common_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,41 +53,46 @@ def __init__(self, parent = None):

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.fromTheme(':/compute.png'))
h.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.fromTheme('media-playback-stop'))
self.but_start_stop.setIcon(QT.QIcon.fromTheme(':/media-playback-stop.png'))
h.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)

for but in [self.but_compute_filters, self.but_start_stop, self.but_enable_bypass]:
but.setFixedSize(128, 128)
but.setFixedSize(256, 64)
but.setIconSize(QT.QSize(48, 48))
#~ but.setMaximumWidth(128)
#~ but.setMinimumHeight(128)
#~ but.setToolButtonStyle(T.ToolButtonTextUnderIcon)





self.mutex = Mutex()

self.timer_icon = QT.QTimer(interval=1000)
self.timer_icon.timeout.connect(self.flash_icon)
self.flag_icon = True
self.timer_icon.start()


self.processing = None


def flash_icon(self):
if self.running():
self.flag_icon = not(self.flag_icon)
if self.flag_icon:
self.but_start_stop.setIcon(QT.QIcon.fromTheme(''))
else:
self.but_start_stop.setIcon(QT.QIcon.fromTheme('media-playback-start'))
self.but_start_stop.setIcon(QT.QIcon.fromTheme(':/media-playback-start.png'))
else:
self.but_start_stop.setIcon(QT.QIcon.fromTheme('media-playback-stop'))
self.but_start_stop.setIcon(QT.QIcon.fromTheme(':/media-playback-stop.png'))


def warn(self, title, text):
Expand Down Expand Up @@ -166,13 +171,14 @@ def compute_filters(self):
self.but_enable_bypass.setEnabled(True)



def enable_bypass_simulator(self, checked):
self.set_bypass(checked)

if checked:
self.but_enable_bypass.setIcon(QT.QIcon(':/bypass.png'))
else:
self.but_enable_bypass.setIcon(QT.QIcon(''))
self.but_enable_bypass.setIcon(QT.QIcon(':/passthrough.png'))


def running(self):
Expand Down
8 changes: 6 additions & 2 deletions hearinglosssimulator/gui/icons/icons.qrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file alias="bypass.png">png/bypass.png</file>
<file alias="compute.png">png/compute.png</file>
<file alias="media-playback-start.png">png/media-playback-start.png</file>
<file alias="media-playback-stop.png">png/media-playback-stop.png</file>
<file alias="passthrough.png">png/passthrough.png</file>
<file alias="led-red.png">png/led-red.png</file>
<file alias="led-blue.png">png/led-blue.png</file>
<file alias="led-green.png">png/led-green.png</file>
<file alias="led-blue.png">png/led-blue.png</file>
<file alias="bypass.png">png/bypass.png</file>
</qresource>
</RCC>
34,084 changes: 18,987 additions & 15,097 deletions hearinglosssimulator/gui/icons/icons_py3.py

Large diffs are not rendered by default.

Binary file added hearinglosssimulator/gui/icons/png/compute.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hearinglosssimulator/gui/icons/png/passthrough.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 94 additions & 0 deletions hearinglosssimulator/gui/icons/png/passthrough.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 523c621

Please sign in to comment.