Skip to content

Commit

Permalink
Merge branch 'master' into gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
geigi authored Jan 19, 2024
2 parents 464ed88 + 87639a3 commit bbf2fc9
Show file tree
Hide file tree
Showing 90 changed files with 1,170 additions and 8,353 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/aur.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ on:
jobs:
deploy:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ on: [push, pull_request]
jobs:
test:

runs-on: ubuntu-20.04

runs-on: ubuntu-latest
container:
image: ghcr.io/geigi/cozy-ci:main

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Lint with flake8
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/flathub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ on:
jobs:
deploy:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ on: [push, pull_request]
jobs:
flatpak:
runs-on: ubuntu-latest

container:
image: bilelmoussaoui/flatpak-github-actions:gnome-44
image: bilelmoussaoui/flatpak-github-actions:gnome-45
options: --privileged

strategy:
Expand All @@ -25,7 +24,7 @@ jobs:

- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
if: ${{ matrix.arch == 'aarch64' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/opensuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ on:
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand Down
1 change: 0 additions & 1 deletion AUTHORS

This file was deleted.

84 changes: 42 additions & 42 deletions data/ui/about.ui → AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<object class="AdwAboutWindow" id="about_dialog">
<property name="application_name">Cozy</property>
<property name="application_icon">com.github.geigi.cozy</property>
<property name="license_type">gpl-3-0</property>
<property name="issue_url">https://github.com/geigi/cozy/issues/new</property>
<property name="website">https://github.com/geigi/cozy</property>
<property name="developer_name">geigi</property>
<property name="developers">geigi
A6GibKm
alyssais
apandada1
AsavarTzeth
Fatih20
NathanBnm
camellan
chris-kobrzak
elya5
foliva
grenade
jimmac
jnbr
jubalh
kaphula
leuc
magnickolas
meisenzahl
naglis
oleg-krv
paper42
phpwutz
rapenne-s
rdbende
thibaultamartin
umeboshi2
worldofpeace</property>
<property name="translator_credits">Ainte
# Code
- Julian Geywitz
- Benedek Dévényi
- A6GibKm
- alyssais
- apandada1
- AsavarTzeth
- Fatih20
- NathanBnm
- camellan
- chris-kobrzak
- elya5
- foliva
- grenade
- jnbr
- jubalh
- kaphula
- leuc
- magnickolas
- meisenzahl
- naglis
- oleg-krv
- paper42
- phpwutz
- rapenne-s
- thibaultamartin
- umeboshi2
- worldofpeace

# Design
- Julian Geywitz
- Tobias Bernard
- Benedek Dévényi

# Icon
- Jakub Steiner

# Translators
```
Ainte
AndreBarata
Andrey389
Asyx
Expand Down Expand Up @@ -136,6 +137,5 @@ useruseruser1233211
vanhoxx
vlabo
xfgusta
yalexaner</property>
</object>
</interface>
yalexaner
```
102 changes: 64 additions & 38 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# Cozy development

This document is intended for software engineers and translators who would like to help out with the development of Cozy or simply be able to run bleeding edge versions of the code locally.
This document is intended for software engineers and translators who would like to help out with the development of Cozy, or simply be able to run bleeding edge versions of the code locally.

## Ubuntu

_The below instructions have been tested on Ubuntu 20.04_
## Building with GNOME Builder (recommended)

## Requirements
Cozy can be built and run with [GNOME Builder](https://apps.gnome.org/Builder/).

```bash
1. Open GNOME Builder
2. Click the **Clone Repository** button
3. Enter `https://github.com/geigi/cozy.git` in the **Repository URL** field
4. Click the **Clone Project** button
5. Click the ▶️**Run** button to start building the application


## Building manually

_The below instructions have been tested on Ubuntu 20.04 and Fedora 39_


### Requirements (Ubuntu)

```console
sudo apt update
sudo apt install \
appstreamcli \
Expand All @@ -21,86 +34,99 @@ sudo apt install \
gstreamer1.0-plugins-ugly \
libgirepository1.0-dev \
libgstreamer1.0-0 \
libgtk-3-dev \
libgtk-4-dev \
libadwaita-1-dev \
pip \
python-gi-cairo \
python3-gst-1.0 \
python3-venv

sudo add-apt-repository ppa:apandada1/libhandy-1
sudo apt update
sudo apt install libhandy-1-0 libhandy-1-dev
```

In case of issues with the `libhandy` installation, please refer to our [GitHub build script](.github/workflows/build.yml) on an alternative source of the library packages.

### UI development
### Requirements (Fedora)

[Glade](https://glade.gnome.org/) is the GUI tool we have been using for generating and managing application [windows and widgets](data/ui/).
```console
sudo dnf install \
appstream \
cmake \
gettext \
gstreamer1-libav \
gstreamer1-plugins-ugly \
gstreamer1-plugins-bad \
gstreamer1-plugins-good \
gstreamer1-devel\
gtk4-devel \
libadwaita-devel \
pipenv \
python3-cairo-devel \
python3-gstreamer1
```

## Source code

```bash
### Source code

```console
git clone https://github.com/geigi/cozy.git
cd cozy
```

## Python packages

It is generally a good idea to set up a virtual environment to avoid referencing packages and the Python binary installed globally.
### Python packages

> At its core, the main purpose of Python virtual environments is to create an isolated environment for Python projects. This means that each project can have its own dependencies, regardless of what dependencies every other project has.
>
> realpython.com
> [!TIP]
> It is generally a good idea to set up a virtual environment for Python projects. It creates an isolated environment where packages can be installed without creating conflicts with other packages installed system-wide.
```bash
# only if you wish to use a virtual environment
```console
python3 -m venv venv
source ./venv/bin/activate

python -m pip install --upgrade pip
pip install -r requirements.txt

pip install \
meson \
ninja
pip install meson ninja

pip install \
pytest \
pytest-mock
pip install pytest pytest-mock
```

## Build and install
To enter the virtual environment, you will need to run `source ./venv/bin/activate` every time you reopen your terminal.


### Build and install

Let's assume you wish to build the application under the `build/` directory and install the binaries under `app/`:

```bash
meson --prefix=$(pwd)/app ./build
```console
meson setup --prefix=$(pwd)/app ./build

ninja -C build install
```


### Install translation files

```bash
```console
ninja -C build com.github.geigi.cozy-update-po
ninja -C build extra-update-po
```

## Run application

```bash
### Run application

```console
XDG_DATA_DIRS=app/share:/usr/share \
PYTHONPATH=app/lib/python3.8/site-packages \
PYTHONPATH=app/lib/python3.11/site-packages \
app/bin/com.github.geigi.cozy
```

Your Python path may be different so you might need to amend the `PYTHONPATH` environment variable above in case of errors.

Please note, every time you make code changes, you need to execute `ninja -C build install` before you run the application.
> [!NOTE]
> Every time you make changes to the code, you need to execute `ninja -C build install` before you run the application.
## Test

## Running the test suite

```bash
python -m pytest
```
```

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ The translators:
- karaagac
- kevinmueller
- leondorus
- libreajans
- Sabri Unal
- linuxmasterclub
- magnickolas
- makaleks
Expand Down
1 change: 1 addition & 0 deletions com.github.geigi.cozy.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
{
"name": "cozy",
"buildsystem": "meson",
"run-tests": true,
"sources": [
{
"type": "dir",
Expand Down
15 changes: 9 additions & 6 deletions cozy/app_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ def __init__(self, gtk_app, main_window_builder, main_window):

self.whats_new_window: WhatsNewWindow = WhatsNewWindow()

self.library_view: LibraryView = LibraryView(main_window_builder)
self.app_view: AppView = AppView(main_window_builder)
self.search_view: SearchView = SearchView()
self.book_detail_view: BookDetailView = BookDetailView(main_window_builder)
self.headerbar: Headerbar = Headerbar(main_window_builder)
self.library_view: LibraryView = LibraryView(main_window_builder)
self.book_detail_view: BookDetailView = BookDetailView(main_window_builder)
self.media_controller: MediaController = MediaController(main_window_builder)
self.search_view: SearchView = SearchView(main_window_builder, self.headerbar)

self.library_view_model = inject.instance(LibraryViewModel)
self.app_view_model = inject.instance(AppViewModel)
Expand All @@ -68,7 +68,7 @@ def __init__(self, gtk_app, main_window_builder, main_window):
self.settings_view_model = inject.instance(SettingsViewModel)
self.player = inject.instance(Player)

self._connect_popovers()
self._connect_search_button()

self.search_view_model.add_listener(self._on_open_view)
self.book_detail_view_model.add_listener(self._on_open_view)
Expand Down Expand Up @@ -125,8 +125,11 @@ def open_library(self):
self.library_view_model.open_library()
self.app_view_model.view = View.LIBRARY_FILTER

def _connect_popovers(self):
self.headerbar.search_button.set_popover(self.search_view.popover)
def _connect_search_button(self):
self.headerbar.search_button.connect(
"notify::active",
self.search_view.on_state_changed
)

def _on_open_view(self, event, data):
if event == OpenView.AUTHOR:
Expand Down
Loading

0 comments on commit bbf2fc9

Please sign in to comment.