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

Move data files to data/ directory #285

Merged
merged 3 commits into from
Aug 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/flatpak-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:
- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
with:
bundle: com.github.GradienceTeam.Gradience.Devel.flatpak
manifest-path: com.github.GradienceTeam.Gradience.Devel.json
manifest-path: build-aux/flatpak/com.github.GradienceTeam.Gradience.Devel.json
cache-key: flatpak-builder-${{ github.sha }}-nightly
2 changes: 1 addition & 1 deletion .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ jobs:
- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
with:
bundle: com.github.GradienceTeam.Gradience.flatpak
manifest-path: com.github.GradienceTeam.Gradience.json
manifest-path: build-aux/flatpak/com.github.GradienceTeam.Gradience.json
cache-key: flatpak-builder-${{ github.sha }}
arch: ${{ matrix.arch }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,6 @@ cython_debug/

# End of https://www.toptal.com/developers/gitignore/api/meson,flatpak,python

.vscode/
.vscode/

flatpak-pip-generator
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@ ninja -C builddir run

1. Open Terminal
2. Run `git clone https://github.com/GradienceTeam/Gradience.git && cd Gradience`
3. Add the `gnome-nightly` Flatpak repository `flatpak remote-add --if-not-exists gnome-nightly https://nightly.gnome.org/gnome-nightly.flatpakrepo`
4. Install the `master` version of GNOME SDK: `flatpak install org.gnome.Sdk/x86_64/master org.gnome.Platform/x86_64/master`
5. Run `flatpak-builder --install --user --force-clean repo/ com.github.GradienceTeam.Gradience.json`
3. Install the `42` version of GNOME SDK: `flatpak install org.gnome.Sdk/x86_64/42 org.gnome.Platform/x86_64/42`
4. Run: `flatpak-builder --install --user --force-clean repo/ build-aux/flatpak/com.github.GradienceTeam.Gradience.Devel.json`

Alternatively, open the project with GNOME Builder, then build and run it.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@
],
"sources" : [
{
"type" : "git",
"path" : ".",
"branch": "next"
"type" : "dir",
"path" : "../../."
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"sources" : [
{
"type" : "dir",
"path" : "."
"path" : "../../."
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@
}
]
},
{
"name": "python3-regex",
"buildsystem": "simple",
"build-commands": [
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"regex\" --no-build-isolation"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/f7/e1/8b46ff54516faea4ea9469c4f5b50f2e9e73131f54d19e6827141698a822/regex-2022.8.17.tar.gz",
"sha256": "5c77eab46f3a2b2cd8bbe06467df783543bf7396df431eb4a144cc4b89e9fb3c"
}
]
},
{
"name": "python3-material-color-utilities-python",
"buildsystem": "simple",
Expand Down Expand Up @@ -112,40 +98,6 @@
"sha256": "48c24706c23bb4262173b6fa49eabb10afa15b8412f14283120549517ccfa314"
}
]
},
{
"name": "python3-requests",
"buildsystem": "simple",
"build-commands": [
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"requests\" --no-build-isolation"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/6f/de/5be2e3eed8426f871b170663333a0f627fc2924cc386cd41be065e7ea870/urllib3-1.26.12-py2.py3-none-any.whl",
"sha256": "b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/04/a2/d918dcd22354d8958fe113e1a3630137e0fc8b44859ade3063982eacd2a4/idna-3.3-py3-none-any.whl",
"sha256": "84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/db/51/a507c856293ab05cdc1db77ff4bc1268ddd39f29e7dc4919aa497f0adbec/charset_normalizer-2.1.1-py3-none-any.whl",
"sha256": "83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/e9/06/d3d367b7af6305b16f0d28ae2aaeb86154fa91f144f036c2d5002a5a202b/certifi-2022.6.15-py3-none-any.whl",
"sha256": "fe86415d55e84719d75f8b69414f6438ac3547d2078ab91b67e779ef69378412"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/ca/91/6d9b8ccacd0412c08820f72cebaa4f0c0441b5cda699c90f618b6f8a1b42/requests-2.28.1-py3-none-any.whl",
"sha256": "8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"
}
]
}
]
}
4 changes: 1 addition & 3 deletions data/com.github.GradienceTeam.Gradience.gschema.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
<key name="first-run" type="b">
<default>true</default>
</key>

<key name="disabled-plugins" type="as">
<default>[]</default>
</key>

</key>
</schema>
</schemalist>
70 changes: 70 additions & 0 deletions data/gradience.gresource.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/com/github/GradienceTeam/Gradience">
<file>presets/adwaita.json</file>
<file>presets/adwaita-dark.json</file>
<file>presets/pretty-purple.json</file>

<file preprocess="xml-stripblanks">ui/error.ui</file>
<file preprocess="xml-stripblanks">ui/palette_shades.ui</file>
<file preprocess="xml-stripblanks">ui/option.ui</file>
<file preprocess="xml-stripblanks">ui/window.ui</file>
<file preprocess="xml-stripblanks">ui/app_type_dialog.ui</file>
<file preprocess="xml-stripblanks">ui/custom_css_group.ui</file>
<file preprocess="xml-stripblanks">ui/builtin_preset_row.ui</file>
<file preprocess="xml-stripblanks">ui/explore_preset_row.ui</file>
<file preprocess="xml-stripblanks">ui/preset_row.ui</file>
<file preprocess="xml-stripblanks">ui/presets_manager_window.ui</file>
<file preprocess="xml-stripblanks">ui/plugin_row.ui</file>
<file preprocess="xml-stripblanks">ui/welcome.ui</file>

<file>images/welcome.svg</file>
<file>images/welcome-dark.svg</file>
</gresource>
<gresource prefix="/com/github/GradienceTeam/Gradience/icons/scalable/actions/">
<file
preprocess="xml-stripblanks"
alias="adw-gtk3-warning-symbolic.svg"
>icons/scalable/actions/com.github.GradienceTeam.Gradience-adw-gtk3-warning-symbolic.svg</file>
<file
preprocess="xml-stripblanks"
alias="palette-symbolic.svg"
>icons/scalable/actions/com.github.GradienceTeam.Gradience-palette-symbolic.svg</file>
<file
preprocess="xml-stripblanks"
alias="larger-brush-symbolic.svg"
>icons/scalable/actions/com.github.GradienceTeam.Gradience-larger-brush-symbolic.svg</file>
<file
preprocess="xml-stripblanks"
alias="color-picker-symbolic.svg"
>icons/scalable/actions/com.github.GradienceTeam.Gradience-color-picker-symbolic.svg</file>
<file
preprocess="xml-stripblanks"
alias="code-symbolic.svg"
>icons/scalable/actions/com.github.GradienceTeam.Gradience-code-symbolic.svg</file>
<file
preprocess="xml-stripblanks"
alias="drive-symbolic.svg"
>icons/scalable/actions/com.github.GradienceTeam.Gradience-drive-symbolic.svg</file>
<file
preprocess="xml-stripblanks"
alias="drive-unsaved-symbolic.svg"
>icons/scalable/actions/com.github.GradienceTeam.Gradience-drive-unsaved-symbolic.svg</file>
<file
preprocess="xml-stripblanks"
alias="settings-symbolic.svg"
>icons/scalable/actions/com.github.GradienceTeam.Gradience-settings-symbolic.svg</file>
<file
preprocess="xml-stripblanks"
alias="download-symbolic.svg"
>icons/scalable/actions/com.github.GradienceTeam.Gradience-download-symbolic.svg</file>
<file
preprocess="xml-stripblanks"
alias="remove-symbolic.svg"
>icons/scalable/actions/com.github.GradienceTeam.Gradience-remove-symbolic.svg</file>
<file
preprocess="xml-stripblanks"
alias="checkmark-small-symbolic.svg"
>icons/scalable/actions/com.github.GradienceTeam.Gradience-checkmark-small-symbolic.svg</file>
</gresource>
</gresources>
17 changes: 15 additions & 2 deletions data/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
gnome = import('gnome')

subdir('ui')

desktop_file = i18n.merge_file(
input: configure_file(
input: '@0@.desktop.in.in'.format(PROJECT_RDNN_NAME),
Expand All @@ -14,10 +18,19 @@ desktop_file = i18n.merge_file(
desktop_utils = find_program('desktop-file-validate', required: false)
if desktop_utils.found()
test('Validate desktop file', desktop_utils,
args: [desktop_file]
args: [desktop_file.full_path()]
)
endif

gnome.compile_resources('gradience',
'gradience.gresource.xml',
gresource_bundle: true,
source_dir: meson.current_build_dir(),
install: true,
install_dir: PKGDATA_DIR,
dependencies: blueprints,
)

appstream_file = i18n.merge_file(
input: configure_file(
input: '@0@.appdata.xml.in.in'.format(PROJECT_RDNN_NAME),
Expand All @@ -39,7 +52,7 @@ appstream_file = i18n.merge_file(
appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
test('Validate appstream file', appstream_util,
args: ['validate', appstream_file]
args: ['validate', appstream_file.full_path()]
)
endif

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions data/ui/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
blueprints = custom_target('blueprints',
input: files(
'error.blp',
'palette_shades.blp',
'option.blp',
'window.blp',
'app_type_dialog.blp',
'custom_css_group.blp',
'presets_manager_window.blp',
'plugin_row.blp',
'welcome.blp',
'preset_row.blp',
'builtin_preset_row.blp',
'explore_preset_row.blp'
),
output: '.',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ template GradiencePresetWindow : Adw.Window {

Gtk.StackPage {
name: "page_offline";
child: Gtk.Label offline_label {
child: Gtk.Label {
label: _("Offline");
valign: start;
halign: center;
Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 8 additions & 5 deletions src/explore_preset_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ def __init__(self, name, url, win, author="", **kwargs):
def on_apply_button_clicked(self, *_args):
try:
download_preset(to_slug_case(self.name), self.url)
except Exception:
except Exception as exception:
self.toast_overlay.add_toast(
Adw.Toast(title=_("Preset could not be downloaded"))
)
buglog(exception)
else:
self.app.load_preset_from_file(os.path.join(
os.environ.get("XDG_CONFIG_HOME",
Expand All @@ -67,20 +68,22 @@ def on_apply_button_clicked(self, *_args):
self.toast_overlay.add_toast(
Adw.Toast(title=_("Preset downloaded"))
)

buglog("Apply and download compeleted")
self.win.reload_pref_group()

buglog("Apply and download compeleted")

@Gtk.Template.Callback()
def on_download_button_clicked(self, *_args):
try:
download_preset(to_slug_case(self.name), self.url)
except Exception:
except Exception as exception:
self.toast_overlay.add_toast(
Adw.Toast(title=_("Preset could not be downloaded"))
)
buglog(exception)
else:
self.toast_overlay.add_toast(
Adw.Toast(title=_("Preset downloaded"))
)
self.win.reload_pref_group()
buglog("Download compeleted")
buglog("Download compeleted")
71 changes: 0 additions & 71 deletions src/gradience.gresource.xml

This file was deleted.