Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

feat: new debug check #137

Merged
merged 5 commits into from
Aug 15, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"app-id" : "com.github.AdwCustomizerTeam.AdwCustomizer",
"app-id" : "com.github.AdwCustomizerTeam.AdwCustomizer.Devel",
"runtime" : "org.gnome.Platform",
"runtime-version" : "master",
"sdk" : "org.gnome.Sdk",
Expand Down Expand Up @@ -67,11 +67,11 @@
"name" : "adwcustomizer",
"builddir" : true,
"buildsystem" : "meson",
"config-opts": ["-Dbuildtype=debug"],
"sources" : [
{
"type" : "git",
"path" : ".",
"branch": "next"
"type" : "dir",
"path" : "."
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions com.github.AdwCustomizerTeam.AdwCustomizer.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@
"name" : "adwcustomizer",
"builddir" : true,
"buildsystem" : "meson",
"config-opts": ["-Dbuildtype=release"],
"sources" : [
{
"type" : "git",
"path" : ".",
"branch": "main"
"type" : "dir",
"path" : "."
}
]
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2022 Adwaita Manager Team -->
<component type="desktop">
<id>com.github.AdwCustomizerTeam.AdwCustomizer</id>
<id>@APP_ID@</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>

Expand Down Expand Up @@ -58,7 +58,7 @@
</screenshot>
</screenshots>

<launchable type="desktop-id">com.github.AdwCustomizerTeam.AdwCustomizer.desktop</launchable>
<launchable type="desktop-id">@APP_ID@.desktop</launchable>

<categories>
<category>Utility</category>
Expand Down Expand Up @@ -123,10 +123,10 @@
</release>
</releases>

<url type="homepage">https://github.com/AdwCustomizerTeam/AdwCustomizer</url>
<url type="bugtracker">https://github.com/AdwCustomizerTeam/AdwCustomizer/issues</url>
<url type="help">https://github.com/orgs/AdwCustomizerTeam/discussions</url>
<url type="translate">https://www.transifex.com/adwcustomizerteam/adwcustomizer</url>
<url type="homepage">@PROJECT_URL@</url>
<url type="bugtracker">@BUGTRACKER_URL@</url>
<url type="help">@HELP_URL@</url>
<url type="translate">@TRANSLATE_URL@</url>

<update_contact>[email protected]</update_contact>
</component>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Adwaita Manager
Exec=adwcustomizer
Icon=com.github.AdwCustomizerTeam.AdwCustomizer
Icon=@APP_ID@
Terminal=false
Type=Application
Categories=GTK;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="adwcustomizer">
<schema id="com.github.AdwCustomizerTeam.AdwCustomizer" path="/com/github/AdwCustomizerTeam/AdwCustomizer/">
<schema id="@APP_ID@" path="/com/github/AdwCustomizerTeam/AdwCustomizer/">
<key name="window-width" type="i">
<default>1300</default>
</key>
Expand Down
11 changes: 3 additions & 8 deletions data/icons/meson.build
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
application_id = 'com.github.AdwCustomizerTeam.AdwCustomizer'

scalable_dir = join_paths('hicolor', 'scalable', 'apps')
install_data(
join_paths(scalable_dir, ('@[email protected]').format(APPLICATION_ID)),
install_dir: join_paths(get_option('datadir'), 'icons', scalable_dir)
)
install_data(
join_paths(scalable_dir, ('@[email protected]').format(APPLICATION_ID)),
install_dir: join_paths(get_option('datadir'), 'icons', scalable_dir)
)

symbolic_dir = join_paths('hicolor', 'symbolic', 'apps')
install_data(
join_paths(symbolic_dir, ('@[email protected]').format(APPLICATION_ID)),
install_dir: join_paths(get_option('datadir'), 'icons', symbolic_dir)
join_paths(symbolic_dir, ('@[email protected]').format(PROJECT_RDNN_NAME)),
install_dir: join_paths(get_option('datadir'), 'icons', symbolic_dir),
rename: '@[email protected]'.format(APPLICATION_ID)
)
67 changes: 33 additions & 34 deletions data/meson.build
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
if get_option('buildtype') == 'debug'

desktop_file = i18n.merge_file(
input: 'com.github.AdwCustomizerTeam.AdwCustomizer.Devel.desktop.in',
output: 'com.github.AdwCustomizerTeam.AdwCustomizer.desktop',
type: 'desktop',
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)
desktop_file = i18n.merge_file(
input: configure_file(
input: '@[email protected]'.format(PROJECT_RDNN_NAME),
output: '@BASENAME@',
configuration: conf
),
output: '@[email protected]'.format(APPLICATION_ID),
type: 'desktop',
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)

desktop_utils = find_program('desktop-file-validate', required: false)
if desktop_utils.found()
test('Validate desktop file', desktop_utils,
args: [desktop_file]
)
endif
else
desktop_file = i18n.merge_file(
input: 'com.github.AdwCustomizerTeam.AdwCustomizer.desktop.in',
output: 'com.github.AdwCustomizerTeam.AdwCustomizer.desktop',
type: 'desktop',
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
desktop_utils = find_program('desktop-file-validate', required: false)
if desktop_utils.found()
test('Validate desktop file', desktop_utils,
args: [desktop_file]
)

desktop_utils = find_program('desktop-file-validate', required: false)
if desktop_utils.found()
test('Validate desktop file', desktop_utils,
args: [desktop_file]
)
endif
endif

appstream_file = i18n.merge_file(
input: 'com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in',
output: 'com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml',
input: configure_file(
input: '@[email protected]'.format(PROJECT_RDNN_NAME),
output: '@BASENAME@',
configuration: configuration_data({
'APP_ID': APPLICATION_ID,
'PROJECT_URL': PROJECT_URL,
'BUGTRACKER_URL': BUGTRACKER_URL,
'HELP_URL': HELP_URL,
'TRANSLATE_URL': TRANSLATE_URL
})
),
output: '@[email protected]'.format(APPLICATION_ID),
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'appdata')
Expand All @@ -48,7 +43,11 @@ if appstream_util.found()
)
endif

install_data('com.github.AdwCustomizerTeam.AdwCustomizer.gschema.xml',
configure_file(
input: '@[email protected]'.format(PROJECT_RDNN_NAME),
output: '@[email protected]'.format(APPLICATION_ID),
configuration: conf,
install: true,
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
)

Expand Down
25 changes: 22 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,28 @@ gnome = import('gnome')
i18n = import('i18n')
python = import('python')

# Project information
PROJECT_URL = 'https://github.com/AdwCustomizerTeam/AdwCustomizer'
BUGTRACKER_URL = 'https://github.com/tfuxu/themeteor/issues'
HELP_URL = 'https://github.com/orgs/AdwCustomizerTeam/discussions'
TRANSLATE_URL = 'https://www.transifex.com/adwcustomizerteam/adwcustomizer'

# Constants
PROJECT_RDNN_NAME = 'com.github.AdwCustomizerTeam.AdwCustomizer'
APPLICATION_ID = PROJECT_RDNN_NAME

# Set APPLICATION_ID and VERSION_SUFFIX
if get_option('buildtype') == 'debug'
VCS_TAG = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
if VCS_TAG == ''
VERSION_SUFFIX = '-devel'
else
VERSION_SUFFIX = '-@0@'.format(VCS_TAG)
endif
APPLICATION_ID = '@[email protected]'.format(PROJECT_RDNN_NAME)
else
VERSION_SUFFIX = ''
APPLICATION_ID = PROJECT_RDNN_NAME
endif

dependency('glib-2.0')
dependency('gtk4', version: '>= 4.5.0')
Expand All @@ -34,12 +53,12 @@ PLUGINS_DIR = join_paths(PKGDATA_DIR, 'adwcustomizer', 'plugins')

# Install configuration data
conf = configuration_data()
conf.set('APP_ID', PROJECT_RDNN_NAME)
conf.set('APP_ID', APPLICATION_ID)
conf.set('PKGDATA_DIR', PKGDATA_DIR)
conf.set('DATA_DIR', join_paths(get_option('prefix'), get_option('datadir')))
conf.set('LOCALE_DIR', join_paths(get_option('prefix'), get_option('localedir')))
conf.set('PYTHON', PY_INSTALLDIR.full_path())
conf.set('VERSION', meson.project_version())
conf.set('VERSION', meson.project_version() + VERSION_SUFFIX)
conf.set('BUILD_TYPE', get_option('buildtype'))

# Subdirs
Expand Down
6 changes: 3 additions & 3 deletions po/POTFILES
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
data/com.github.AdwCustomizerTeam.AdwCustomizer.desktop.in
data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in
data/com.github.AdwCustomizerTeam.AdwCustomizer.gschema.xml
data/com.github.AdwCustomizerTeam.AdwCustomizer.desktop.in.in
data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in.in
data/com.github.AdwCustomizerTeam.AdwCustomizer.gschema.xml.in
src/ui/app_type_dialog.blp
src/ui/custom_css_group.blp
src/ui/error.blp
Expand Down
3 changes: 1 addition & 2 deletions src/adwcustomizer.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import gettext

pkgdatadir = '@PKGDATA_DIR@'
localedir = '@LOCALE_DIR@'
version = '@VERSION@'

builddir = os.environ.get('MESON_BUILD_ROOT')

Expand Down Expand Up @@ -58,4 +57,4 @@ if __name__ == '__main__':
resource._register()

from adwcustomizer import main
sys.exit(main.main(version))
sys.exit(main.main())
14 changes: 7 additions & 7 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ def to_slug_case(non_slug):
class AdwcustomizerApplication(Adw.Application):
"""The main application singleton class."""

def __init__(self, version):
def __init__(self):
super().__init__(
application_id=app_id,
flags=Gio.ApplicationFlags.FLAGS_NONE,
flags=Gio.ApplicationFlags.FLAGS_NONE
)
self.version = version
self.set_resource_base_path(rootdir)

self.portal = Xdp.Portal()

Expand Down Expand Up @@ -636,7 +636,7 @@ def show_about_window(self, *_args):
about = Adw.AboutWindow(
transient_for=self.props.active_window,
application_name=_("Adwaita Manager"),
application_icon="com.github.AdwCustomizerTeam.AdwCustomizer",
application_icon=app_id,
developer_name=_("Adwaita Manager Team"),
website="https://github.com/AdwCustomizerTeam/AdwCustomizer",
support_url="https://github.com/orgs/AdwCustomizerTeam/discussions",
Expand All @@ -661,7 +661,7 @@ def show_about_window(self, *_args):
Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""",
copyright="© 2022 Adwaita Manager Team",
license_type=Gtk.License.GPL_3_0,
version=f"{version}",
version=version,
release_notes="""
<ul>
<li>Add AdwViewSwitcher in the header bar.</li>
Expand Down Expand Up @@ -725,7 +725,7 @@ def create_stateful_action(
self.set_accels_for_action(f"app.{name}", shortcuts)


def main(version):
def main():
"""The application's entry point."""
app = AdwcustomizerApplication(version)
app = AdwcustomizerApplication()
return app.run(sys.argv)
6 changes: 3 additions & 3 deletions src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@
from .app_type_dialog import AdwcustomizerAppTypeDialog
from .custom_css_group import AdwcustomizerCustomCSSGroup
from material_color_utilities_python import *
from .constants import rootdir, build_type
from .constants import rootdir, app_id, build_type
from .presets_manager_window import AdwcustomizerPresetWindow


@Gtk.Template(resource_path=f"{rootdir}/ui/window.ui")
class AdwcustomizerMainWindow(Adw.ApplicationWindow):
__gtype_name__ = "AdwcustomizerMainWindow"
Expand Down Expand Up @@ -66,8 +67,7 @@ def __init__(self, **kwargs):
self.setup_plugins_page()
self.setup_colors_page()

self.settings = Gio.Settings(
"com.github.AdwCustomizerTeam.AdwCustomizer")
self.settings = Gio.Settings(app_id)

self.settings.bind(
"window-width", self, "default-width", Gio.SettingsBindFlags.DEFAULT
Expand Down