Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
[gui] Use an sleeping symbol instead of ok in table
Browse files Browse the repository at this point in the history
  • Loading branch information
IceflowRE committed Jan 9, 2021
1 parent bd7bc27 commit e12310b
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 8 deletions.
4 changes: 2 additions & 2 deletions mp3monitoring/core/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __run(self):
"""
self._active = True
while True:
self.status = 'search'
self.status = 'searching'
cur_check: float = time.time()
mp3_files: List[Path] = []
if self.config.recursive:
Expand All @@ -103,7 +103,7 @@ def __run(self):

self.config.last_check = cur_check
if not self._sleep_event.is_set():
self.status = 'ok'
self.status = 'sleeping'
if self._sleep_event.wait(self.config.sleep_time):
self._sleep_event.clear()
self._active = False
Expand Down
11 changes: 5 additions & 6 deletions mp3monitoring/gui/monitor_table_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ def __init__(self, parent):

def paint(self, painter, option, index):
str_to_symbol = {
"error": pkg_data.ERROR_SYMBOL,
"ok": pkg_data.OK_SYMBOL,
"search": pkg_data.SEARCH_SYMBOL,
"stopped": pkg_data.STOPPED_SYMBOL,
"wait": pkg_data.WAIT_SYMBOL,
"stopping": pkg_data.WAIT_SYMBOL,
'error': pkg_data.ERROR_SYMBOL,
'sleeping': pkg_data.SLEEPING_SYMBOL,
'searching': pkg_data.SEARCH_QUAD_SYMBOL,
'stopped': pkg_data.STOPPED_SYMBOL,
'stopping': pkg_data.WAIT_SYMBOL,
}

if int(option.state) & QStyle.State_Enabled and int(option.state) & QStyle.State_Selected and int(option.state) & QStyle.State_Active:
Expand Down
4 changes: 4 additions & 0 deletions mp3monitoring/gui/pkg_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
OK_SYMBOL = Path(p)
with resources.path('mp3monitoring.gui.pkg_data.symbols', 'search.svg') as p:
SEARCH_SYMBOL = Path(p)
with resources.path('mp3monitoring.gui.pkg_data.symbols', 'search_quad.svg') as p:
SEARCH_QUAD_SYMBOL = Path(p)
with resources.path('mp3monitoring.gui.pkg_data.symbols', 'sleeping.svg') as p:
SLEEPING_SYMBOL = Path(p)
with resources.path('mp3monitoring.gui.pkg_data.symbols', 'stopped.svg') as p:
STOPPED_SYMBOL = Path(p)
with resources.path('mp3monitoring.gui.pkg_data.symbols', 'wait.svg') as p:
Expand Down
2 changes: 2 additions & 0 deletions mp3monitoring/gui/pkg_data/symbols/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ This work
- power.svg
- remove.svg
- search.svg
- search_quad.svg
- settings.svg
- sleeping.svg
- start.svg
- stop.svg
- stopped.svg
Expand Down
98 changes: 98 additions & 0 deletions mp3monitoring/gui/pkg_data/symbols/search_quad.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
128 changes: 128 additions & 0 deletions mp3monitoring/gui/pkg_data/symbols/sleeping.svg
Loading
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 e12310b

Please sign in to comment.