Skip to content

Commit

Permalink
Adding in GUI
Browse files Browse the repository at this point in the history
- 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
- Updates to .github workflows and templates
- `bool_filters` in the config file is now `dat_filters` for clarity
  • Loading branch information
bbtufty committed May 17, 2024
1 parent c59e339 commit 09e168e
Show file tree
Hide file tree
Showing 34 changed files with 5,042 additions and 30 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
35 changes: 32 additions & 3 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,8 +18,37 @@ jobs:
run: python -m build --sdist --wheel --outdir dist/ .
- uses: actions/upload-artifact@v4
with:
name: artifact-source
path: dist/*

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/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
- uses: softprops/action-gh-release@v2
with:
files: dist/*
token: ${{ secrets.GITHUB_TOKEN }}

upload_pypi:
name: Upload to PyPI
needs: [build_sdist_and_wheel]
Expand All @@ -28,9 +57,9 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
name: artifact-source
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_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
~~~~~~~

- Updates 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
8 changes: 8 additions & 0 deletions docs/gui/config_includes_excludes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
########################
Config includes/excludes
########################

The platforms page of the config tab allows you to set includes and excludes per-platform. Put each term on a new line.
This will match at the beginning of the string, but will search through dupes as well in GameFinder.

.. image:: ../images/config_includes_excludes.png
8 changes: 8 additions & 0 deletions docs/gui/config_main.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
###########
Config main
###########

The main page of the config tab is for setting various directories and overall settings for ROMSearch. By hovering
over each setting, a tooltip will appear with a brief description of the item

.. image:: ../images/config_main.png
8 changes: 8 additions & 0 deletions docs/gui/config_modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
##############
Config modules
##############

Each module has its own separate tab with various options. These are generally pretty self-explanatory, and there
aren't too many of them

.. image:: ../images/config_modules.png
8 changes: 8 additions & 0 deletions docs/gui/config_platforms.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
################
Config platforms
################

The platforms page of the config tab allows you to set platforms you want to download ROMs for. The order here just
determines the order each platform is processed.

.. image:: ../images/config_platforms.png
10 changes: 10 additions & 0 deletions docs/gui/config_regions_languages.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
########################
Config regions/languages
########################

The platforms page of the config tab allows you to set region and language preferences. The order here is important! It
will determine how preferred each region/language is.

Note that if no platforms are selected, you will see nothing here! Make sure to check one.

.. image:: ../images/config_regions_languages.png
42 changes: 42 additions & 0 deletions docs/gui/intro.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#############
ROMSearch GUI
#############

ROMSearch features a GUI mode, which can be downloaded from the
`GitHub release page <https://github.com/bbtufty/romsearch/releases/latest>`_. Download the .exe file and place in a
folder of your choice. Note that currently this only works for windows, for Mac and Linux we suggest using the pip
version within ``python``.

**On first run, Windows may complain about the file. Just run anyway, the file is safe.**

When opening up the ROMSearch GUI, you will first see a terminal window. Do not close this! It'll output information
as ROMSearch runs, which can be handy to check where things are. The main window will also open up, which will look
something like this:

.. image:: ../images/config_main.png

You can exit ROMSearch using the button in the bottom left, or run ROMSearch using the button on the bottom right. By
default, it will load in sensible settings but you will need to add in the platforms you care about.

Creating a config file
----------------------

The first thing you'll want to do is create a configuration file. You can do this either by going
``File->New config file`` or ``Ctrl-N``. Save with ``File->Save config file`` or ``Ctrl-S``

Loading a config file
---------------------

If you have a pre-existing config file, ROMSearch will load this upon opening. Or, if you have another you'd like to
load you can do so by ``File->Load config file`` or ``Ctrl-O``.

.. toctree::
:glob:
:titlesonly:
:maxdepth: 2

config_main
config_platforms
config_regions_languages
config_includes_excludes
config_modules
Binary file added docs/images/config_includes_excludes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/config_main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/config_modules.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/config_platforms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/config_regions_languages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 09e168e

Please sign in to comment.