Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure #3691

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
367c4f2
bottle-row: Rename to BottleRow
TheEvilSkeleton Jan 12, 2025
5e2d977
new-bottle-dialog: Rename to NewBottleDialog
TheEvilSkeleton Jan 12, 2025
ec702ea
check-row: Rename to CheckRow
TheEvilSkeleton Jan 12, 2025
47adf3d
component-entry-row: Rename files and class name
TheEvilSkeleton Jan 12, 2025
e41d6d3
dependency-entry-row: Rename files and class name
TheEvilSkeleton Jan 12, 2025
a6d74e7
bottle-details-view: Rename files and class name
TheEvilSkeleton Jan 12, 2025
783f57f
bottle-details-page: Rename files and class name
TheEvilSkeleton Jan 12, 2025
6fc8c1f
details-preferences-page: Rename files and class name
TheEvilSkeleton Jan 12, 2025
fb7bfba
details-task-manager-view: Rename files and class name
TheEvilSkeleton Jan 12, 2025
a4d5642
details-versioning-page: Rename files and class name
TheEvilSkeleton Jan 12, 2025
fc459ae
bottle-picker-dialog: Rename files
TheEvilSkeleton Jan 12, 2025
1da8dea
crash-report-dialog: Rename files
TheEvilSkeleton Jan 12, 2025
e87a211
details-dependencies-view: Rename files and class name
TheEvilSkeleton Jan 12, 2025
f7572c3
details-installers-view: Rename files and class name
TheEvilSkeleton Jan 12, 2025
f95f073
dependencies-check-dialog: Rename files
TheEvilSkeleton Jan 12, 2025
ab72674
display-dialog: Rename files
TheEvilSkeleton Jan 12, 2025
7a4b2df
dll-overrides-dialog: Rename files
TheEvilSkeleton Jan 12, 2025
27b7999
drives-dialog: Rename files
TheEvilSkeleton Jan 12, 2025
775150b
duplicate-dialog: Rename files
TheEvilSkeleton Jan 12, 2025
a16dad8
exclusion-patterns-dialog: Rename files
TheEvilSkeleton Jan 12, 2025
9e9ed81
gamescope-dialog: Rename files
TheEvilSkeleton Jan 12, 2025
a6df665
exclusion-pattern-row: Rename files and class name
TheEvilSkeleton Jan 12, 2025
da5dac2
fsr-dialog: Rename files and add to POTFILES
TheEvilSkeleton Jan 12, 2025
2978560
importer-view: Rename files
TheEvilSkeleton Jan 12, 2025
ce74986
importer-row: Rename files and class name
TheEvilSkeleton Jan 12, 2025
1652c42
installer-row: Rename files and class name
TheEvilSkeleton Jan 13, 2025
ba2d7ac
library-view: Rename files and add to POTFILES
TheEvilSkeleton Jan 13, 2025
33781ab
bottles-list-view: Rename files and class name
TheEvilSkeleton Jan 13, 2025
606956c
loading-view: Rename files
TheEvilSkeleton Jan 13, 2025
2d0cfeb
local-resource-row: Rename class name
TheEvilSkeleton Jan 13, 2025
03bbe64
onboard-dialog: Rename files
TheEvilSkeleton Jan 13, 2025
683e586
program-row: Rename files and class name
TheEvilSkeleton Jan 13, 2025
e1ce4ea
state-row: Rename files and class name
TheEvilSkeleton Jan 13, 2025
ba874c3
task-row: Rename file and class name
TheEvilSkeleton Jan 13, 2025
0237e24
environment-variables-dialog: Rename files
TheEvilSkeleton Jan 13, 2025
49cc128
installer-dialog: Rename files
TheEvilSkeleton Jan 13, 2025
28e89f7
journal-dialog: Rename files
TheEvilSkeleton Jan 13, 2025
567f430
launch-options-dialog: Rename files
TheEvilSkeleton Jan 13, 2025
3307815
mangohud-dialog: Rename files and add to POTFILES
TheEvilSkeleton Jan 13, 2025
0321c6a
proton-alert-dialog: Rename files
TheEvilSkeleton Jan 13, 2025
ef0cc7e
rename-dialog: Rename files
TheEvilSkeleton Jan 13, 2025
f3c775f
dialog-run-args: Remove file
TheEvilSkeleton Jan 13, 2025
a54e643
sandbox-dialog: Rename files
TheEvilSkeleton Jan 13, 2025
8644b76
upgrade-versioning-dialog: Rename files
TheEvilSkeleton Jan 13, 2025
a0aa869
vkbasalt-dialog: Rename files
TheEvilSkeleton Jan 13, 2025
91635e5
vmtouch-dialog: Rename files and add to POTFILES
TheEvilSkeleton Jan 13, 2025
c1aef2f
frontend: Move files to root of `frontend/`
TheEvilSkeleton Jan 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Popover popover_exec_settings {
}
}

template $DetailsBottle: Adw.PreferencesPage {
template $BottleDetailsPage: Adw.PreferencesPage {
Overlay drop_overlay {
visible: false;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Gtk 4.0;
using Adw 1;

template $Details: Adw.Bin {
template $BottleDetailsView: Adw.Bin {
Adw.Leaflet leaflet {
can-navigate-back: true;
can-unfold: false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Gtk 4.0;
using Adw 1;

template $BottlesBottleRow: Adw.ActionRow {
template $BottleRow: Adw.ActionRow {
activatable: true;
use-markup: false;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bottle_details.py
# bottle_details_page.py
#
# Copyright 2022 brombinmirko <send@mirko.pm>
# Copyright 2025 The Bottles Contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -38,17 +38,17 @@
from bottles.backend.wine.winecfg import WineCfg
from bottles.backend.wine.winedbg import WineDbg
from bottles.backend.wine.wineserver import WineServer
from bottles.frontend.utils.common import open_doc_url
from bottles.frontend.utils.filters import add_executable_filters, add_all_filters
from bottles.frontend.utils.gtk import GtkUtils
from bottles.frontend.widgets.program import ProgramEntry
from bottles.frontend.windows.duplicate import DuplicateDialog
from bottles.frontend.windows.upgradeversioning import UpgradeVersioningDialog
from bottles.frontend.common import open_doc_url
from bottles.frontend.filters import add_executable_filters, add_all_filters
from bottles.frontend.gtk import GtkUtils
from bottles.frontend.program_row import ProgramRow
from bottles.frontend.duplicate_dialog import DuplicateDialog
from bottles.frontend.upgrade_versioning_dialog import UpgradeVersioningDialog


@Gtk.Template(resource_path="/com/usebottles/bottles/details-bottle.ui")
class BottleView(Adw.PreferencesPage):
__gtype_name__ = "DetailsBottle"
@Gtk.Template(resource_path="/com/usebottles/bottles/bottle-details-page.ui")
class BottleDetailsPage(Adw.PreferencesPage):
__gtype_name__ = "BottleDetailsPage"
__registry = []

# region Widgets
Expand Down Expand Up @@ -308,7 +308,7 @@ def new_program(
check_boot = wineserver_status

self.add_program(
ProgramEntry(
ProgramRow(
self.window,
self.config,
_program,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# details.py
# bottle_details_view.py
#
# Copyright 2022 brombinmirko <send@mirko.pm>
# Copyright 2025 The Bottles Contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -25,23 +25,23 @@
from bottles.backend.models.config import BottleConfig

from bottles.backend.utils.threading import RunAsync
from bottles.frontend.utils.gtk import GtkUtils
from bottles.frontend.views.bottle_details import BottleView
from bottles.frontend.views.bottle_installers import InstallersView
from bottles.frontend.views.bottle_dependencies import DependenciesView
from bottles.frontend.views.bottle_preferences import PreferencesView
from bottles.frontend.views.bottle_versioning import VersioningView
from bottles.frontend.views.bottle_taskmanager import TaskManagerView
from bottles.frontend.gtk import GtkUtils
from bottles.frontend.bottle_details_page import BottleDetailsPage
from bottles.frontend.details_installers_view import DetailsInstallersView
from bottles.frontend.details_dependencies_view import DetailsDependenciesView
from bottles.frontend.details_preferences_page import DetailsPreferencesPage
from bottles.frontend.details_versioning_page import DetailsVersioningPage
from bottles.frontend.details_task_manager_view import DetailsTaskManagerView


@Gtk.Template(resource_path="/com/usebottles/bottles/details.ui")
class DetailsView(Adw.Bin):
@Gtk.Template(resource_path="/com/usebottles/bottles/bottle-details-view.ui")
class BottleDetailsView(Adw.Bin):
"""
This class is the starting point for all the pages concerning the
bottle (details, preferences, dependencies ..).
"""

__gtype_name__ = "Details"
__gtype_name__ = "BottleDetailsView"
__pages = {}

# region Widgets
Expand Down Expand Up @@ -75,12 +75,12 @@ def __init__(self, window, config: Optional[BottleConfig] = None, **kwargs):
self.config = config
self.queue = QueueManager(add_fn=self.lock_back, end_fn=self.unlock_back)

self.view_bottle = BottleView(self, config)
self.view_installers = InstallersView(self, config)
self.view_dependencies = DependenciesView(self, config)
self.view_preferences = PreferencesView(self, config)
self.view_versioning = VersioningView(self, config)
self.view_taskmanager = TaskManagerView(self, config)
self.view_bottle = BottleDetailsPage(self, config)
self.view_installers = DetailsInstallersView(self, config)
self.view_dependencies = DetailsDependenciesView(self, config)
self.view_preferences = DetailsPreferencesPage(self, config)
self.view_versioning = DetailsVersioningPage(self, config)
self.view_taskmanager = DetailsTaskManagerView(self, config)

self.btn_back.connect("clicked", self.go_back)
self.btn_back_sidebar.connect("clicked", self.go_back_sidebar)
Expand All @@ -98,7 +98,7 @@ def __init__(self, window, config: Optional[BottleConfig] = None, **kwargs):

def set_title(self, title, subtitle: str = ""):
"""
This function is used to set the title of the DetailsView
This function is used to set the title of the BottleDetailsView
headerbar.
"""
self.content_title.set_title(title)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bottlepicker.py
# bottle_picker_dialog.py
#
# Copyright 2022 brombinmirko <send@mirko.pm>
# Copyright 2025 The Bottles Contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -31,7 +31,7 @@ def __init__(self, config: BottleConfig):
self.set_title(config.Name)


@Gtk.Template(resource_path="/com/usebottles/bottles/dialog-bottle-picker.ui")
@Gtk.Template(resource_path="/com/usebottles/bottles/bottle-picker-dialog.ui")
class BottlePickerDialog(Adw.ApplicationWindow):
"""This class should not be called from the application GUI, only from CLI."""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Gtk 4.0;
using Adw 1;

template $BottleView: Adw.Bin {
template $BottlesListView: Adw.Bin {
ScrolledWindow {
Box {
hexpand: true;
Expand Down
59 changes: 59 additions & 0 deletions bottles/frontend/bottles.gresource.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/com/usebottles/bottles">
<file>style.css</file>
<file>style-dark.css</file>
<file alias="gtk/help-overlay.ui">help-overlay.ui</file>
<file preprocess="xml-stripblanks">window.ui</file>
<file preprocess="xml-stripblanks">new-bottle-dialog.ui</file>
<file preprocess="xml-stripblanks">bottles-list-view.ui</file>
<file preprocess="xml-stripblanks">loading-view.ui</file>
<file preprocess="xml-stripblanks">bottle-row.ui</file>
<file preprocess="xml-stripblanks">check-row.ui</file>
<file preprocess="xml-stripblanks">task-row.ui</file>
<file preprocess="xml-stripblanks">dependency-entry-row.ui</file>
<file preprocess="xml-stripblanks">program-row.ui</file>
<file preprocess="xml-stripblanks">importer-row.ui</file>
<file preprocess="xml-stripblanks">state-row.ui</file>
<file preprocess="xml-stripblanks">installer-row.ui</file>
<file preprocess="xml-stripblanks">dll-override-entry.ui</file>
<file preprocess="xml-stripblanks">env-var-entry.ui</file>
<file preprocess="xml-stripblanks">component-entry-row.ui</file>
<file preprocess="xml-stripblanks">drive-entry.ui</file>
<file preprocess="xml-stripblanks">library-entry.ui</file>
<file preprocess="xml-stripblanks">local-resource-row.ui</file>
<file preprocess="xml-stripblanks">exclusion-pattern-row.ui</file>
<file preprocess="xml-stripblanks">bottle-details-view.ui</file>
<file preprocess="xml-stripblanks">bottle-details-page.ui</file>
<file preprocess="xml-stripblanks">details-dependencies-view.ui</file>
<file preprocess="xml-stripblanks">details-installers-view.ui</file>
<file preprocess="xml-stripblanks">details-preferences-page.ui</file>
<file preprocess="xml-stripblanks">details-versioning-page.ui</file>
<file preprocess="xml-stripblanks">details-task-manager-view.ui</file>
<file preprocess="xml-stripblanks">preferences.ui</file>
<file preprocess="xml-stripblanks">importer-view.ui</file>
<file preprocess="xml-stripblanks">library-view.ui</file>
<file preprocess="xml-stripblanks">launch-options-dialog.ui</file>
<file preprocess="xml-stripblanks">dll-overrides-dialog.ui</file>
<file preprocess="xml-stripblanks">environment-variables-dialog.ui</file>
<file preprocess="xml-stripblanks">crash-report-dialog.ui</file>
<file preprocess="xml-stripblanks">duplicate-dialog.ui</file>
<file preprocess="xml-stripblanks">rename-dialog.ui</file>
<file preprocess="xml-stripblanks">gamescope-dialog.ui</file>
<file preprocess="xml-stripblanks">vkbasalt-dialog.ui</file>
<file preprocess="xml-stripblanks">fsr-dialog.ui</file>
<file preprocess="xml-stripblanks">mangohud-dialog.ui</file>
<file preprocess="xml-stripblanks">display-dialog.ui</file>
<file preprocess="xml-stripblanks">drives-dialog.ui</file>
<file preprocess="xml-stripblanks">journal-dialog.ui</file>
<file preprocess="xml-stripblanks">sandbox-dialog.ui</file>
<file preprocess="xml-stripblanks">installer-dialog.ui</file>
<file preprocess="xml-stripblanks">bottle-picker-dialog.ui</file>
<file preprocess="xml-stripblanks">proton-alert-dialog.ui</file>
<file preprocess="xml-stripblanks">dependencies-check-dialog.ui</file>
<file preprocess="xml-stripblanks">exclusion-patterns-dialog.ui</file>
<file preprocess="xml-stripblanks">upgrade-versioning-dialog.ui</file>
<file preprocess="xml-stripblanks">vmtouch-dialog.ui</file>
<file preprocess="xml-stripblanks">onboard-dialog.ui</file>
</gresource>
</gresources>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# list.py
# bottles_list_view.py
#
# Copyright 2022 brombinmirko <send@mirko.pm>
# Copyright 2025 The Bottles Contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -25,13 +25,13 @@
from bottles.backend.state import Signals, SignalManager
from bottles.backend.utils.threading import RunAsync
from bottles.backend.wine.executor import WineExecutor
from bottles.frontend.utils.filters import add_executable_filters, add_all_filters
from bottles.frontend.filters import add_executable_filters, add_all_filters
from bottles.frontend.params import APP_ID


@Gtk.Template(resource_path="/com/usebottles/bottles/bottle-row.ui")
class BottlesBottleRow(Adw.ActionRow):
__gtype_name__ = "BottlesBottleRow"
class BottleRow(Adw.ActionRow):
__gtype_name__ = "BottleRow"

Adw.init()

Expand Down Expand Up @@ -123,9 +123,9 @@ def disable(self):
self.set_visible(False)


@Gtk.Template(resource_path="/com/usebottles/bottles/list.ui")
class BottleView(Adw.Bin):
__gtype_name__ = "BottleView"
@Gtk.Template(resource_path="/com/usebottles/bottles/bottles-list-view.ui")
class BottlesListView(Adw.Bin):
__gtype_name__ = "BottlesListView"
__bottles = {}

# region Widgets
Expand Down Expand Up @@ -191,7 +191,7 @@ def update_bottles_list(self, *args) -> None:
self.bottle_status.set_visible(is_empty_local_bottles)

for name, config in local_bottles.items():
_entry = BottlesBottleRow(self.window, config)
_entry = BottleRow(self.window, config)
self.__bottles[config.Path] = _entry

if config.Environment != "Steam":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Gtk 4.0;
using Adw 1;

template $BottlesCheckRow: Adw.ActionRow {
template $CheckRow: Adw.ActionRow {
activatable-widget: check_button;
active: bind check_button.active bidirectional;

Expand Down
File renamed without changes.
Empty file removed bottles/frontend/cli/__init__.py
Empty file.
17 changes: 0 additions & 17 deletions bottles/frontend/cli/meson.build

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Gtk 4.0;
using Adw 1;

template $ComponentEntry: Adw.ActionRow {
template $ComponentEntryRow: Adw.ActionRow {
title: _("Component version");

Spinner spinner {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# component.py
# component_entry_row.py
#
# Copyright 2022 brombinmirko <send@mirko.pm>
# Copyright 2025 The Bottles Contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -24,14 +24,14 @@
from bottles.backend.state import Status
from bottles.backend.utils.manager import ManagerUtils
from bottles.backend.utils.threading import RunAsync
from bottles.frontend.utils.gtk import GtkUtils
from bottles.frontend.gtk import GtkUtils

logging = Logger()


@Gtk.Template(resource_path="/com/usebottles/bottles/component-entry.ui")
class ComponentEntry(Adw.ActionRow):
__gtype_name__ = "ComponentEntry"
@Gtk.Template(resource_path="/com/usebottles/bottles/component-entry-row.ui")
class ComponentEntryRow(Adw.ActionRow):
__gtype_name__ = "ComponentEntryRow"
__gsignals__ = {
"component-installed": (GObject.SIGNAL_RUN_FIRST, None, ()),
"component-error": (GObject.SIGNAL_RUN_FIRST, None, ()),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# crash.py
# crash_report_dialog.py
#
# Copyright 2022 brombinmirko <send@mirko.pm>
# Copyright 2025 The Bottles Contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -45,7 +45,7 @@ def __on_btn_report_clicked(button, report):
webbrowser.open(report["html_url"])


@Gtk.Template(resource_path="/com/usebottles/bottles/dialog-crash-report.ui")
@Gtk.Template(resource_path="/com/usebottles/bottles/crash-report-dialog.ui")
class CrashReportDialog(Adw.Window):
__gtype_name__ = "CrashReportDialog"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# depscheck.py
# dependencies_check_dialog.py
#
# Copyright 2022 brombinmirko <send@mirko.pm>
# Copyright 2025 The Bottles Contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -18,7 +18,7 @@
from gi.repository import Gtk, Adw


@Gtk.Template(resource_path="/com/usebottles/bottles/dialog-deps-check.ui")
@Gtk.Template(resource_path="/com/usebottles/bottles/dependencies-check-dialog.ui")
class DependenciesCheckDialog(Adw.Window):
__gtype_name__ = "DependenciesCheckDialog"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Popover pop_actions {
}
}

template $DependencyEntry: Adw.ActionRow {
template $DependencyEntryRow: Adw.ActionRow {
title: _("Dependency name");
activatable-widget: btn_install;
subtitle: _("Dependency description");
Expand Down
Loading
Loading