Skip to content

Commit

Permalink
Adding in GUI
Browse files Browse the repository at this point in the history
Config I/O overhaul
  • Loading branch information
bbtufty committed May 17, 2024
1 parent c59e339 commit 6df0805
Show file tree
Hide file tree
Showing 24 changed files with 4,983 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ body:
label: Installation
description: Are you using pip or GitHub? Which GitHub tag?
options:
- Windows executable
- pip
- GitHub - main branch
- GitHub - dev branch
- GitHub
validations:
required: true
- type: textarea
Expand Down
31 changes: 27 additions & 4 deletions .github/workflows/build_test.yaml → .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Test
name: Build

on:
push:
Expand All @@ -9,8 +9,8 @@ on:
- master

jobs:
job:
name: Build Test
build_sdist_and_wheel:
name: Build source distribution
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -34,4 +34,27 @@ jobs:
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
run: python -m build

build_executable:
name: Build executable
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install -e .
- name: Build package
run: >
pyinstaller romsearch_gui.py
--copy-metadata romsearch
--collect-data romsearch
--onefile
-n romsearch.exe
51 changes: 40 additions & 11 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and upload to PyPI
name: Build and upload

on: [push, pull_request]

Expand All @@ -18,19 +18,48 @@ jobs:
run: python -m build --sdist --wheel --outdir dist/ .
- uses: actions/upload-artifact@v4
with:
name: artifact-source
path: dist/*

upload_pypi:
name: Upload to PyPI
needs: [build_sdist_and_wheel]
runs-on: ubuntu-latest
build_and_upload_executable:
name: Build and upload executable
runs-on: windows-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
- uses: actions/checkout@v4
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
submodules: true
- uses: actions/setup-python@v5
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install -e .
- name: Build package
run: >
pyinstaller romsearch_gui.py
--copy-metadata romsearch
--collect-data romsearch
--onefile
-n romsearch.exe
- uses: softprops/action-gh-release@v2
with:
files: dist/*
token: ${{ secrets.GITHUB_TOKEN }}

# upload_pypi:
# name: Upload to PyPI
# needs: [build_sdist_and_wheel]
# runs-on: ubuntu-latest
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: artifact-source
# path: dist
# - uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Features
--------

- ROMSearch now has a GUI! This currently is just used for a more friendly way to set the config file, but will
be built out in the future
- ROMSearch now has two modes: the first is `filter_then_download` (default), which will use the dat file to filter,
then only download relevant files. The second is `download_then_filter`, which will download everything and then
filter. For data hoarders!
Expand All @@ -25,6 +27,8 @@ ROMDownloader
General
~~~~~~~

- Updated to .github workflows and templates
- `bool_filters` in the config file is now `dat_filters` for clarity
- Overhauled directory handling in the config file
- ROMSearch now has more clearly defined options
- Exposed log directory and cache directory
Expand Down
7 changes: 5 additions & 2 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ number of switches that may be useful in different use cases.
**ROMSearch works in such a way that by default it will grab what it thinks is the best ROM file. You can disable
many of the ways it decides this if you want to grab multiple files**

As a minimal example, if we wanted to grab the entire US Catalog of PlayStation games and post what you've added to a
Discord channel, the config file would look something like this: ::
We generally recommend setting this up through the GUI. For details on how to do that, see the
:doc:`GUI pages <gui/intro>`.

If you want to manually edit these files, here is an example. If we wanted to grab the entire US Catalog of PlayStation
games and post what you've added to a Discord channel, the config file would look something like this: ::

dirs:
raw_dir: 'F:\Emulation\raw'
Expand Down
5 changes: 5 additions & 0 deletions docs/gui/intro.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#############
ROMSearch GUI
#############

Some description here
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
:caption: Documentation

installation
gui/intro
configuration
1g1r
modules
Expand Down
5 changes: 4 additions & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
Installation
############

ROMSearch is pip-installable: ::
If you want to use the GUI version, grab the latest executable from the
`GitHub release page <https://github.com/bbtufty/romsearch/releases/latest>`_.

ROMSearch is also pip-installable: ::

pip install romsearch

Expand Down
3 changes: 2 additions & 1 deletion docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ ROMSearch offers the ability to:
* Discord integration so users can see the results of runs in a simple, clean way

To get started, see the :doc:`installation <installation>` and :doc:`configuration <configuration>` pages. For the
philosophy behind how ROMSearch chooses a ROM, see :doc:`1G1R <1g1r>`.
philosophy behind how ROMSearch chooses a ROM, see :doc:`1G1R <1g1r>`. Romsearch has a UI option which we recommend
for most users. For this, see :doc:`the GUI pages <gui/intro>`.

ROMSearch offers two modes: the default is "filter, then download" which will use the .dat file to find the best ROMs
and only download those. For data hoarders, we also offer a "download, then filter" option, which will download
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies = [
"numpy",
"packaging",
"pathvalidate",
"PySide6",
"pyyaml",
"xmltodict",
]
Expand Down
7 changes: 7 additions & 0 deletions romsearch/gui/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .gui_romsearch import MainWindow
from .gui_about import AboutWindow

__all__ = [
"MainWindow",
"AboutWindow",
]
14 changes: 14 additions & 0 deletions romsearch/gui/gui_about.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from PySide6.QtWidgets import QDialog

from .layout_about import Ui_About


class AboutWindow(QDialog):

def __init__(self, parent=None):
"""ROMSearch About window"""

super().__init__()

self.ui = Ui_About()
self.ui.setupUi(self)
Loading

0 comments on commit 6df0805

Please sign in to comment.