qt_gui
Classes:
| Name | Description |
|---|---|
AboutDialog |
About dialog. |
DcsPyQtGui |
PySide6 GUI for DCSpy. |
GitCloneWorker |
Worker for git clone with reporting progress. |
QTextEditLogHandler |
GUI log handler. |
UiLoader |
UI file loader. |
Worker |
Runnable worker. |
WorkerSignals |
Defines the signals available from a running worker thread. |
WorkerSignalsMixIn |
Worker signals Mixin. |
AboutDialog
AboutDialog(parent)
Bases: QDialog
About dialog.
Dcspy about dialog window.
Methods:
| Name | Description |
|---|---|
showEvent |
Prepare all information about DCSpy application. |
Source code in src/dcspy/qt_gui.py
1826 1827 1828 1829 1830 1831 1832 1833 1834 | |
showEvent
showEvent(arg__1: QShowEvent) -> None
Prepare all information about DCSpy application.
Source code in src/dcspy/qt_gui.py
1842 1843 1844 1845 1846 | |
DcsPyQtGui
Bases: QMainWindow
PySide6 GUI for DCSpy.
PySide6 GUI for DCSpy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Namespace of CLI arguments |
Namespace()
|
|
|
DcspyConfigYaml | None
|
dict with configuration |
None
|
Methods:
| Name | Description |
|---|---|
activated |
Signal of activation. |
apply_configuration |
Apply configuration to GUI widgets. |
event_set |
Set event to close the running thread. |
fetch_system_data |
Fetch various system-related data. |
run_in_background |
Worker with signals callback to schedule a GUI job in the background. |
save_configuration |
Save configuration from GUI. |
Attributes:
| Name | Type | Description |
|---|---|---|
bios_path |
Path
|
Get the path to the DCS-BIOS directory. |
bios_repo_path |
Path
|
Get the path to DCS-BIOS repository. |
current_plane |
str
|
Get current plane from combo box. |
dcs_path |
Path
|
Get a path to the DCS World directory. |
Source code in src/dcspy/qt_gui.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
bios_path
property
bios_path: Path
bios_repo_path
property
bios_repo_path: Path
current_plane
property
current_plane: str
dcs_path
property
dcs_path: Path
activated
activated(reason: ActivationReason) -> None
Signal of activation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ActivationReason
|
Reason of activation |
required |
Source code in src/dcspy/qt_gui.py
1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 | |
apply_configuration
Apply configuration to GUI widgets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict
|
dictionary with configuration |
required |
Source code in src/dcspy/qt_gui.py
1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 | |
event_set
event_set() -> None
Set event to close the running thread.
Source code in src/dcspy/qt_gui.py
1631 1632 1633 | |
fetch_system_data
fetch_system_data(silence: bool = False) -> SystemData
Fetch various system-related data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
bool
|
Perform action with silence |
False
|
Returns:
| Type | Description |
|---|---|
SystemData
|
SystemData named tuple with all data |
Source code in src/dcspy/qt_gui.py
1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 | |
run_in_background
Worker with signals callback to schedule a GUI job in the background.
Parameter signal_handlers is a dict with signals from WorkerSignals.
Possible signals are: finished, error, result, progress.
Values in dict are methods/callables as handlers/callbacks for a particular signal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
partial | Callable
|
GUI method or function to run in background |
required |
|
dict[str, Callable]
|
Signals as keys: finished, error, result, progress and values as callable |
required |
Source code in src/dcspy/qt_gui.py
1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 | |
save_configuration
save_configuration() -> None
Save configuration from GUI.
Source code in src/dcspy/qt_gui.py
1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 | |
GitCloneWorker
Bases: QRunnable, WorkerSignalsMixIn
Worker for git clone with reporting progress.
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Git reference |
required |
|
str
|
Valid git repository address |
required |
|
Path
|
Path to DCS-BIOS |
required |
|
Path
|
Path to which the repository should be cloned to |
required |
|
bool
|
Perform action with silence |
False
|
Methods:
| Name | Description |
|---|---|
run |
Clone the repository and report progress using a special object CloneProgress. |
setup_signal_handlers |
Connect handlers to signals. |
Source code in src/dcspy/qt_gui.py
1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 | |
run
run() -> None
Clone the repository and report progress using a special object CloneProgress.
Source code in src/dcspy/qt_gui.py
1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 | |
setup_signal_handlers
setup_signal_handlers(
signal_handlers: dict[str, Callable[[Any], None]],
) -> None
Connect handlers to signals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, Callable[[Any], None]]
|
Dict with signals and handlers as value. |
required |
Source code in src/dcspy/qt_gui.py
1925 1926 1927 1928 1929 1930 1931 1932 | |
QTextEditLogHandler
QTextEditLogHandler(text_widget: QTextEdit)
Bases: Handler
GUI log handler.
Log handler for GUI application.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
QTextEdit
|
widget to emit logs to. |
required |
Methods:
| Name | Description |
|---|---|
emit |
Emit a log record. |
toggle_logging |
Toggle a logging state on and off. |
Source code in src/dcspy/qt_gui.py
2057 2058 2059 2060 2061 2062 2063 2064 2065 | |
emit
Emit a log record.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
LogRecord
|
LogRecord instance. |
required |
Source code in src/dcspy/qt_gui.py
2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 | |
toggle_logging
Toggle a logging state on and off.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
bool
|
State of logging |
required |
Source code in src/dcspy/qt_gui.py
2082 2083 2084 2085 2086 2087 2088 | |
UiLoader
Bases: QUiLoader
UI file loader.
Methods:
| Name | Description |
|---|---|
createWidget |
Create a widget. |
load_ui |
Load a UI file. |
createWidget
Create a widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Class name |
required |
|
QWidget | None
|
Parent |
None
|
|
Name |
''
|
Returns:
| Type | Description |
|---|---|
QWidget
|
QWidget |
Source code in src/dcspy/qt_gui.py
2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 | |
load_ui
load_ui(
ui_path: str | bytes | Path, base_instance=None
) -> QWidget
Load a UI file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | bytes | Path
|
Path to a UI file |
required |
|
|
None
|
Returns:
| Type | Description |
|---|---|
QWidget
|
QWidget |
Source code in src/dcspy/qt_gui.py
2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 | |
Worker
Bases: QRunnable, WorkerSignalsMixIn
Runnable worker.
Worker thread.
Inherits from QRunnable to handler worker thread setup, signals and wrap-up.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
partial
|
The function callback to run on a worker thread |
required |
Methods:
| Name | Description |
|---|---|
run |
Run the worker function. |
setup_signal_handlers |
Connect handlers to signals. |
Source code in src/dcspy/qt_gui.py
1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 | |
run
run() -> None
Run the worker function.
Source code in src/dcspy/qt_gui.py
1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 | |
setup_signal_handlers
setup_signal_handlers(
signal_handlers: dict[str, Callable[[Any], None]],
) -> None
Connect handlers to signals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, Callable[[Any], None]]
|
Dict with signals and handlers as value. |
required |
Source code in src/dcspy/qt_gui.py
1925 1926 1927 1928 1929 1930 1931 1932 | |
WorkerSignals
Bases: QObject
Defines the signals available from a running worker thread.
Supported signals are: * finished - no data * error - tuple with exctype, value, traceback.format_exc() * result - object/any type - data returned from processing * progress - float between zero (0) and one (1) as an indication of progress * stage - string with current stage
WorkerSignalsMixIn
WorkerSignalsMixIn()
Worker signals Mixin.
Signal handler for WorkerSignals.
Methods:
| Name | Description |
|---|---|
setup_signal_handlers |
Connect handlers to signals. |
Source code in src/dcspy/qt_gui.py
1921 1922 1923 | |
setup_signal_handlers
setup_signal_handlers(
signal_handlers: dict[str, Callable[[Any], None]],
) -> None
Connect handlers to signals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, Callable[[Any], None]]
|
Dict with signals and handlers as value. |
required |
Source code in src/dcspy/qt_gui.py
1925 1926 1927 1928 1929 1930 1931 1932 | |