-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from tangkong/gui_open_page
GUI: Open page method, add some icons
- Loading branch information
Showing
8 changed files
with
166 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ requirements: | |
- pcdsutils | ||
- pyqt | ||
- python-dateutil | ||
- qtawesome | ||
- qtpy | ||
|
||
test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
64 gui_open_page | ||
################ | ||
|
||
API Breaks | ||
---------- | ||
- N/A | ||
|
||
Features | ||
-------- | ||
- adds ``Window.open_page(entry)`` for opening an ``Entry`` in a new tab | ||
- Adds icons to represent various ``Entry`` subclasses | ||
|
||
Bugfixes | ||
-------- | ||
- N/A | ||
|
||
Maintenance | ||
----------- | ||
- N/A | ||
|
||
Contributors | ||
------------ | ||
- tangkong |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ apischema | |
pcdsutils | ||
PyQt5 | ||
python-dateutil | ||
qtawesome | ||
qtpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
from pytestqt.qtbot import QtBot | ||
|
||
from superscore.client import Client | ||
from superscore.widgets.window import Window | ||
|
||
|
||
def test_main_window(qtbot: QtBot): | ||
def test_main_window(qtbot: QtBot, mock_client: Client): | ||
"""Pass if main window opens successfully""" | ||
window = Window() | ||
window = Window(client=mock_client) | ||
qtbot.addWidget(window) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
def get_page_icon_map(): | ||
# Don't pollute the namespace | ||
from superscore.model import Collection, Readback, Setpoint, Snapshot | ||
from superscore.widgets.page.entry import CollectionPage | ||
|
||
page_map = { | ||
Collection: CollectionPage | ||
} | ||
|
||
# a list of qtawesome icon names | ||
icon_map = { | ||
Collection: 'mdi.file-document-multiple', | ||
Snapshot: 'mdi.camera', | ||
Setpoint: 'mdi.target', | ||
Readback: 'mdi.book-open-variant', | ||
} | ||
|
||
return page_map, icon_map | ||
|
||
|
||
PAGE_MAP, ICON_MAP = get_page_icon_map() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters