mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-09-17 17:52:31 +00:00
fix: add report issue with preset button
This commit is contained in:
parent
eb8244830d
commit
5cd6b6d1b7
1 changed files with 21 additions and 1 deletions
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from gi.repository import Gtk, Adw
|
from gi.repository import Gtk, Adw, Xdp, XdpGtk4
|
||||||
|
|
||||||
from gradience.modules.custom_presets import PRESET_DIR
|
from gradience.modules.custom_presets import PRESET_DIR
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ class GradiencePresetRow(Adw.ExpanderRow):
|
||||||
name_entry_toggle = Gtk.Template.Child("name_entry_toggle")
|
name_entry_toggle = Gtk.Template.Child("name_entry_toggle")
|
||||||
apply_button = Gtk.Template.Child("apply_button")
|
apply_button = Gtk.Template.Child("apply_button")
|
||||||
remove_button = Gtk.Template.Child("remove_button")
|
remove_button = Gtk.Template.Child("remove_button")
|
||||||
|
btn_report = Gtk.Template.Child()
|
||||||
|
|
||||||
def __init__(self, name, win, repo_name, author="", **kwargs):
|
def __init__(self, name, win, repo_name, author="", **kwargs):
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
@ -59,6 +60,8 @@ class GradiencePresetRow(Adw.ExpanderRow):
|
||||||
apply_button = Gtk.Template.Child("apply_button")
|
apply_button = Gtk.Template.Child("apply_button")
|
||||||
rename_button = Gtk.Template.Child("rename_button")
|
rename_button = Gtk.Template.Child("rename_button")
|
||||||
|
|
||||||
|
self.btn_report.connect("clicked", self.on_btn_report_clicked)
|
||||||
|
|
||||||
@Gtk.Template.Callback()
|
@Gtk.Template.Callback()
|
||||||
def on_apply_button_clicked(self, *_args):
|
def on_apply_button_clicked(self, *_args):
|
||||||
buglog("apply")
|
buglog("apply")
|
||||||
|
@ -87,6 +90,23 @@ class GradiencePresetRow(Adw.ExpanderRow):
|
||||||
self.update_value()
|
self.update_value()
|
||||||
self.value_stack.set_visible_child(self.apply_button)
|
self.value_stack.set_visible_child(self.apply_button)
|
||||||
|
|
||||||
|
|
||||||
|
def on_report_btn_clicked(self, *_args):
|
||||||
|
buglog("report")
|
||||||
|
|
||||||
|
parent = XdpGtk4.parent_new_gtk(self.props.active_window)
|
||||||
|
|
||||||
|
def open_dir_callback(_, result):
|
||||||
|
self.app.portal.open_uri_finish(result)
|
||||||
|
|
||||||
|
self.app.portal.open_uri(
|
||||||
|
parent,
|
||||||
|
"https://github.com/GradienceTeam/Community/issues/new?assignees=daudix-UFO&labels=bug&template=preset_issue.yml&title=preset%3A+",
|
||||||
|
Xdp.OpenUriFlags.NONE,
|
||||||
|
None,
|
||||||
|
open_dir_callback,
|
||||||
|
)
|
||||||
|
|
||||||
@Gtk.Template.Callback()
|
@Gtk.Template.Callback()
|
||||||
def on_remove_button_clicked(self, *_args):
|
def on_remove_button_clicked(self, *_args):
|
||||||
self.delete_preset = True
|
self.delete_preset = True
|
||||||
|
|
Loading…
Reference in a new issue