Commit graph

265 commits

Author SHA1 Message Date
tfuxu
f0afbd817d
frontend: introduce initial CLI interface
This commit adds a new CLI interface made using argparse library. Current status of CLI interface is very WIP, as it lacks logic for the majority of commands and doesn't work properly on Flatpak and local builds.
Currently working commands: monet, version
2022-12-10 17:03:38 +01:00
tfuxu
527a9dc90f
backend: seperate JSON encoding in Preset module to a new function
* add more checks in new_preset_from_monet function
* return full Preset object instead of dict data
* remove some unused code
2022-12-10 15:21:13 +01:00
tfuxu
674848edaa
backend: include backend/theming modules in meson compilation 2022-12-10 14:58:49 +01:00
tfuxu
e1e244db72
backend/theming: move apply, restore and reset preset functions to backend 2022-12-09 00:12:02 +01:00
tfuxu
22f476f766
backend: create new modules for preset generation utilities 2022-12-08 14:05:38 +01:00
tfuxu
e834e55b11
backend/models: refactor Preset model object
This commit is the first in a series of commits that will introduce new CLI interface for Gradience. Currently we need to move some parts of code that reside mostly in frontend modules to their new backend modules, and this commit is the beggining of this whole ordeal.

* Refactor Preset model object, in order to make it more readable and to allow `new` function that directly takes new values for properties
* Move presets_dir from models/preset to new backend/globals module
* Create new utils/colors module (will be used in later commits)
* Update all modules that are affected by above changes
2022-12-08 12:43:12 +01:00
tfuxu
771c0e58c1
feat: add error messages to preview demo functions
* allow demo functions to fail if shell returns an error
2022-12-06 19:37:20 +01:00
tfuxu
a8c83d1935
feat: introduce new backend/logger module
This commit introduces a new logger module and converts any log message that used buglog() to use one of five new functions from Logger class.
2022-12-04 00:00:18 +01:00
tfuxu
df73f3d006
misc: make code more readable 2022-12-02 23:37:41 +01:00
tfuxu
5e42501691
rename: change module name from utils.py to common.py 2022-12-02 23:21:55 +01:00
tfuxu
30a9fdb613
move modules to new backend/frontend directories 2022-12-02 22:52:47 +01:00
tfuxu
dcc7c315e5
feat: rename utils/css.py to utils/css_parser.py and utils/custom_presets.py to utils/preset_downloader.py 2022-12-01 19:29:15 +01:00
Jonathan Lestrelin
976270150d
Parse firefox profiles.ini files to get paths of profiles. (#664)
# Parse firefox profiles.ini files to get paths of profiles

This parses firefox profiles.ini files to get the paths of the profiles
instead of just treating any subdir of the firefox dir as a profile.

This allows supporting profiles without a dot in their name which the
existing glob didn't match which can happen if they are named manually,
as well as profiles configured to be outside of the firefox directory
that were ignored and profiles that are symlinked (by adding a resolve()
on the path before the is_dir()).

There is also an additional try condition to avoid failing for the
remaining profiles if encountering a profile without the
customChrome.css, as it might be installed on some profiles only.

## Changelog

- Fixed theming Firefox profiles that don't have a dot in their name
- Fixed theming Firefox profiles that are outside of the Firefox dir
- Fixed theming Firefox profiles that are symlinks
- Fixed failing to theme remaining profiles after encountering one on
which the firefox-gnome-theme is not present

Please note that I have only tested on non-flatpak Firefox.

Signed-off-by: 0xMRTT <0xMRTT@proton.me>
Co-authored-by: 0xMRTT <0xMRTT@proton.me>
2022-11-30 07:13:57 +01:00
e5dc62cabb feat: bump 0.3.3 and add release notes 2022-11-29 19:23:08 +03:00
Martins Zeltins
f21081a6f5 Grammar fix 2022-11-25 19:01:15 +02:00
dfa96acb7f feat: logout message without logout action 2022-11-24 22:44:23 +03:00
6e4c0c7b79 fix: typos 2022-11-24 20:20:38 +03:00
8612ed1fd0 feat: improve "Details" tab of "About" window 2022-11-21 00:36:04 +03:00
3ee0da09e3 Revert "feat: improve "Details" tab of "About" window"
This reverts commit 2bd0944ed5.
2022-11-21 00:33:32 +03:00
2bd0944ed5 feat: improve "Details" tab of "About" window 2022-11-21 00:32:38 +03:00
5e36436528 feat: 0.3.2 release notes 2022-11-20 22:59:46 +03:00
ed047c1d47 feat: 0.3.2 release notes 2022-11-20 22:46:31 +03:00
ff8b903697 Revert "Revert "feat: update release notes""
This reverts commit c77673b64a.
2022-11-20 22:38:00 +03:00
374de8b968 Revert "Revert "Revert "feat: update release notes"""
This reverts commit c415151eed.
2022-11-20 22:36:28 +03:00
c415151eed Revert "Revert "feat: update release notes""
This reverts commit 1ebd0cbd7b.
2022-11-20 22:34:11 +03:00
1ebd0cbd7b Revert "feat: update release notes"
This reverts commit 85603f0e63.
2022-11-20 22:34:00 +03:00
85603f0e63 feat: update release notes 2022-11-20 21:01:20 +03:00
tfuxu
0fad4da087
feat: more readible exceptions in 'preset' module
* add .close() to file objects
* remove __name__ == '__main__' statement
2022-11-20 17:21:23 +01:00
tfuxu
83ef5db581
fix: save imported presets directly to 'user' repository 2022-11-20 17:12:36 +01:00
u1f98e
fc9b75d543 Fix renaming presets not changing the in file name 2022-11-19 20:11:57 -08:00
u1f98e
09ddffe39e Fix saving and renaming presets 2022-11-19 19:46:55 -08:00
u1f98e
8cdaea82c0 Remove some debug print statements 2022-11-19 19:05:39 -08:00
u1f98e
39cf8a0185 Use preset path instead of names to determine the preset file location 2022-11-19 19:02:16 -08:00
tfuxu
cd0918bef4
ux: add mnemonics to the rest of dialogs 2022-11-11 22:10:00 +01:00
Hari Rana
5edbd1f96c
Improve UI and UX (#648)
## Global description

This improves UX by allowing users to close through dialogs by pressing
Esc. I added mnemonics for the file picker, and set `save` as the
default response.

## Changelog

- Allow Esc shortcut to close dialogs
- Add mnemonics for dialogs
- Set `save` as default response

Signed-off-by: 0xMRTT <0xMRTT@proton.me>
Co-authored-by: tfuxu <73042332+tfuxu@users.noreply.github.com>
Co-authored-by: 0xMRTT <0xMRTT@proton.me>
2022-11-11 22:04:46 +01:00
tfuxu
07ecf60b06
fix: add LOCALE_DIR to constants.py meson config 2022-11-11 01:40:20 +01:00
11dac72d10 revert: bump: 0.3.2
This reverts commit 7ea65952c1.
2022-11-11 00:08:06 +03:00
7ea65952c1 bump: 0.3.2 2022-11-10 01:43:31 +03:00
tfuxu
9f25905130
docs: update source code structure explanation 2022-11-09 22:06:31 +01:00
tfuxu
9c8fa556f2
UX: add new toasts for exceptions in reset_color_scheme
* update toast text in reset_color_scheme and restore_color_scheme
2022-11-05 14:07:19 +01:00
Kian-Meng Ang
0f297aece3 docs: fix typos
Found via `codespell -S po,builddir`.
2022-11-05 09:37:58 +08:00
tfuxu
aa89bd0729 feat: move from cssutils to in-house solution
This commit replaces cssutils module with a GTK CSS "parser" based on regex expressions
2022-10-14 23:25:12 +02:00
tfuxu
e2512db571
Merge branch 'main' into patch-1 2022-10-13 23:36:58 +02:00
tfuxu
aa2b5a9125 feat: add indent to downloaded presets 2022-10-13 20:20:31 +02:00
tfuxu
174486a4c9 fix: change cssutils defaults to fix issues in CSS validation 2022-10-13 17:58:01 +02:00
tfuxu
0607561ff2
Remove to_slug_case function
Signed-off-by: tfuxu <73042332+tfuxu@users.noreply.github.com>
2022-10-11 20:13:45 +00:00
0xMRTT
b0c82c7a08
Merge branch 'main' into fix-rename
Signed-off-by: 0xMRTT <0xMRTT@tuta.io>
2022-10-11 20:06:10 +00:00
tfuxu
281e848ab1
fix: Use different variables for display name and filename 2022-10-11 22:02:32 +02:00
0xMRTT
263dcbfea3
feat: add plugin debug 2022-10-11 19:15:57 +02:00
0xMRTT
0b19a9e5a7
fix: #624 2022-10-11 19:13:53 +02:00