Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
matzman666 committed Nov 30, 2015
0 parents commit 5904378
Show file tree
Hide file tree
Showing 77 changed files with 5,323 additions and 0 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

123 changes: 123 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@

![python_version](https://img.shields.io/badge/Python-3.0-green.svg) ![dependencies](https://img.shields.io/badge/Dependencies-PyQt5%2C%20PyPipboy-green.svg) ![license_gpl3](https://img.shields.io/badge/License-GPL%203.0-green.svg)

# PyPipboyApp

PyPipboyApp is a platform independent and extensible unofficial Fallout 4 Pipboy Companion App written in Python3 using PyQt5 and [PyPipboy](https://github.com/matzman666/PyPipboy). Using a plugin mechanism it can be extendet with additional widgets and styles.

# Motivation

The motivation is to provide anyone with a highly customizable second monitor/screen application for the Fallout 4 game ([www.fallout4.com](https://www.fallout4.com/)) on the major operation systems. Therefore the application is written in Python3 and Qt. It extensively uses dock windows that can be dragged and dropped (or hidden) where-ever the users likes them to be. New widgets can be easily added just by dropping them into a directory. It also uses Qt style sheets to allow others to easily customize the style of the GUI.

# Features

Currently implemented features are:
- Uses [PyPipboy](https://github.com/matzman666/PyPipboy) for the communication layer.
- Widgets plugin mechanism.
- Runtime support for Qt style sheets.
- Currently available widgets:
- Data Browser
- Data Update Logger
- Player Info
- Date/Time
- Map (Heavy WIP)

# Screenshots

![Screen 01](screenshots/screen01.png) ![Screen 02](screenshots/screen02.png)

# Current Status

PyPipboy is at the beginning of the development. The first version of the GUI framework is ready including widget and style plugin mechanism is complete. There are also some working widgets and style examples.

# Usage

For now the best option is to download the provided archives in the release section.

Manual Installation:
- Install Python3, PyQt5, PyPipboy and its dependencies
- Download the application and run pypipboyapp.py (Beware that the version in the git repository does not contain any graphical assets as they are owned by Bethesda).


# Widget development

A widget consists of a directory containing Python3 code files and any needed resources. The entry point of a widget is the file info.py

#### Directory layout

```
- PyPipboyApp/
-- widgets/
--- your_widget/
---- info.py
---- ...
--- ...
```

#### info.py

```python
from widgets import widgets
from .dataupdateloggerwidget import DataUpdateLoggerWidget

# Holds meta-information about the widgets
class ModuleInfo(widgets.ModuleInfoBase):
LABEL = 'dataupdatelogger' # Unique widget label
NAME = 'Data Update Logger' # Human readable name
# Factory function that returns a (or a list of) widget instance
# handle ... handle representing the widget ()
# parent ... QtWidget parent
@staticmethod
def createWidgets(handle, parent):
return YourWidget(handle, parent)
```

#### Your widget class

```python
# widgets.WidgetBase inherits from QtDockWidget
class YourWidget(widgets.WidgetBase):
def __init__(self, mhandle, parent):
super().__init__('Data Browser', parent)
...
# Gets called when everything has been set up
# framework ... reference to the framework
# datamanager ... reference to the PipboyDataManager instance from PyPipboy library
def init(self, framework, datamanager):
super().init(app, datamanager)
...

```

# Style development

A style consists of a directory with a Qt style sheet named 'style.qss' and any needed resources.

#### Directory layout

```
- PyPipboyApp/
-- styles/
--- your_style/
---- style.qss
---- ...
--- ...
```

#### style.qss

For more information see [here](http://doc.qt.io/qt-5/stylesheet.html), or included example styles.

# Known bugs

It is in an very early alpha state, there are bound to be bugs.

# Contribution

Everyone who wants to contribute is welcome.

# License

This software is released under GPL 3.0.


Empty file added dialogs/__init__.py
Empty file.
9 changes: 9 additions & 0 deletions dialogs/connecthostdialog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-


from PyQt5 import QtWidgets, uic

class ConnectHostDialog(QtWidgets.QDialog):
def __init__(self, parent=None):
super().__init__(parent)
uic.loadUi('ui/connecthostdialog.ui', self)
31 changes: 31 additions & 0 deletions dialogs/selecthostdialog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-


from PyQt5 import QtWidgets, uic

class SelectHostDialog(QtWidgets.QDialog):
def __init__(self, parent=None):
super().__init__(parent)
uic.loadUi('ui/selecthostdialog.ui', self)

def exec(self, hosts):
self.hosts = list()
for h in hosts:
i = 0
if not h['IsBusy']:
text = h['addr'] + ' (' + h['MachineType'] + ')'
item = QtWidgets.QListWidgetItem(text, self.listWidget)
self.listWidget.insertItem(i, item)
if i == 0:
self.listWidget.setCurrentRow(0)
i += 1
self.hosts.append(h)
return super().exec()


def getSelectedHost(self):
selection = self.listWidget.selectionModel().selectedRows()
if len(selection) > 0:
return self.hosts[selection[0].row()]
return None

35 changes: 35 additions & 0 deletions logging.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[loggers]
keys=root,pypipboy,pypipboyapp

[handlers]
keys=default

[formatters]
keys=default

[logger_root]
level=WARNING
handlers=default

[logger_pypipboy]
level=DEBUG
handlers=default
propagate=0
qualname=pypipboy

[logger_pypipboyapp]
level=DEBUG
handlers=default
propagate=0
qualname=pypipboyapp

[handler_default]
class=StreamHandler
level=NOTSET
formatter=default
args=(sys.stdout,)

[formatter_default]
format=F1 %(asctime)s %(levelname)s %(message)s
datefmt=
class=logging.Formatter
Loading

0 comments on commit 5904378

Please sign in to comment.