Merge import buttons into single popover menu, add PyYAML to Flatpak
This commit is contained in:
parent
fef8dec193
commit
45100d3d44
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id" : "cz.bugsy.roster",
|
"id" : "cz.bugsy.roster",
|
||||||
"runtime" : "org.gnome.Platform",
|
"runtime" : "org.gnome.Platform",
|
||||||
"runtime-version" : "49",
|
"runtime-version" : "50",
|
||||||
"sdk" : "org.gnome.Sdk",
|
"sdk" : "org.gnome.Sdk",
|
||||||
"command" : "roster",
|
"command" : "roster",
|
||||||
"finish-args" : [
|
"finish-args" : [
|
||||||
@ -28,6 +28,20 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"modules" : [
|
"modules" : [
|
||||||
|
{
|
||||||
|
"name" : "python3-pyyaml",
|
||||||
|
"buildsystem" : "simple",
|
||||||
|
"build-commands" : [
|
||||||
|
"pip3 install --no-deps --prefix=/app pyyaml-6.0.3.tar.gz"
|
||||||
|
],
|
||||||
|
"sources" : [
|
||||||
|
{
|
||||||
|
"type" : "file",
|
||||||
|
"url" : "https://files.pythonhosted.org/packages/source/P/PyYAML/pyyaml-6.0.3.tar.gz",
|
||||||
|
"sha256" : "d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name" : "roster",
|
"name" : "roster",
|
||||||
"builddir" : true,
|
"builddir" : true,
|
||||||
|
|||||||
@ -3,6 +3,19 @@
|
|||||||
<requires lib="gtk" version="4.0"/>
|
<requires lib="gtk" version="4.0"/>
|
||||||
<requires lib="Adw" version="1.0"/>
|
<requires lib="Adw" version="1.0"/>
|
||||||
|
|
||||||
|
<menu id="import_menu">
|
||||||
|
<section>
|
||||||
|
<item>
|
||||||
|
<attribute name="label">Import from OpenAPI / Swagger</attribute>
|
||||||
|
<attribute name="action">win.import-openapi</attribute>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<attribute name="label">Import from WSDL</attribute>
|
||||||
|
<attribute name="action">win.import-wsdl</attribute>
|
||||||
|
</item>
|
||||||
|
</section>
|
||||||
|
</menu>
|
||||||
|
|
||||||
<template class="RosterWindow" parent="AdwApplicationWindow">
|
<template class="RosterWindow" parent="AdwApplicationWindow">
|
||||||
<property name="default-width">1200</property>
|
<property name="default-width">1200</property>
|
||||||
<property name="default-height">800</property>
|
<property name="default-height">800</property>
|
||||||
@ -49,20 +62,10 @@
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child type="end">
|
<child type="end">
|
||||||
<object class="GtkButton" id="import_wsdl_button">
|
<object class="GtkMenuButton" id="import_menu_button">
|
||||||
<property name="icon-name">papyrus-vertical-symbolic</property>
|
<property name="icon-name">papyrus-vertical-symbolic</property>
|
||||||
<property name="tooltip-text">Import from WSDL</property>
|
<property name="tooltip-text">Import</property>
|
||||||
<signal name="clicked" handler="on_import_wsdl_clicked"/>
|
<property name="menu-model">import_menu</property>
|
||||||
<style>
|
|
||||||
<class name="flat"/>
|
|
||||||
</style>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child type="end">
|
|
||||||
<object class="GtkButton" id="import_openapi_button">
|
|
||||||
<property name="icon-name">openapi-import-symbolic</property>
|
|
||||||
<property name="tooltip-text">Import from OpenAPI / Swagger</property>
|
|
||||||
<signal name="clicked" handler="on_import_openapi_clicked"/>
|
|
||||||
<style>
|
<style>
|
||||||
<class name="flat"/>
|
<class name="flat"/>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -69,8 +69,7 @@ class RosterWindow(Adw.ApplicationWindow):
|
|||||||
projects_listbox = Gtk.Template.Child()
|
projects_listbox = Gtk.Template.Child()
|
||||||
add_project_button = Gtk.Template.Child()
|
add_project_button = Gtk.Template.Child()
|
||||||
|
|
||||||
import_wsdl_button = Gtk.Template.Child()
|
import_menu_button = Gtk.Template.Child()
|
||||||
import_openapi_button = Gtk.Template.Child()
|
|
||||||
|
|
||||||
# History (hidden but kept for compatibility)
|
# History (hidden but kept for compatibility)
|
||||||
history_listbox = Gtk.Template.Child()
|
history_listbox = Gtk.Template.Child()
|
||||||
@ -496,6 +495,14 @@ class RosterWindow(Adw.ApplicationWindow):
|
|||||||
self.add_action(action)
|
self.add_action(action)
|
||||||
self.get_application().set_accels_for_action("win.send-request", ["<Control>Return"])
|
self.get_application().set_accels_for_action("win.send-request", ["<Control>Return"])
|
||||||
|
|
||||||
|
action = Gio.SimpleAction.new("import-openapi", None)
|
||||||
|
action.connect("activate", lambda a, p: self.on_import_openapi_clicked(None))
|
||||||
|
self.add_action(action)
|
||||||
|
|
||||||
|
action = Gio.SimpleAction.new("import-wsdl", None)
|
||||||
|
action.connect("activate", lambda a, p: self.on_import_wsdl_clicked(None))
|
||||||
|
self.add_action(action)
|
||||||
|
|
||||||
def _on_send_clicked(self, widget):
|
def _on_send_clicked(self, widget):
|
||||||
"""Handle Send button click from a tab widget."""
|
"""Handle Send button click from a tab widget."""
|
||||||
# Clear previous preprocessing results
|
# Clear previous preprocessing results
|
||||||
@ -1415,7 +1422,6 @@ class RosterWindow(Adw.ApplicationWindow):
|
|||||||
widget.original_request = None
|
widget.original_request = None
|
||||||
widget.modified = True
|
widget.modified = True
|
||||||
|
|
||||||
@Gtk.Template.Callback()
|
|
||||||
def on_import_wsdl_clicked(self, button):
|
def on_import_wsdl_clicked(self, button):
|
||||||
"""Open the WSDL import dialog."""
|
"""Open the WSDL import dialog."""
|
||||||
projects = self.project_manager.load_projects()
|
projects = self.project_manager.load_projects()
|
||||||
@ -1423,7 +1429,6 @@ class RosterWindow(Adw.ApplicationWindow):
|
|||||||
dialog.connect('import-completed', self._on_wsdl_import_completed)
|
dialog.connect('import-completed', self._on_wsdl_import_completed)
|
||||||
dialog.present(self)
|
dialog.present(self)
|
||||||
|
|
||||||
@Gtk.Template.Callback()
|
|
||||||
def on_import_openapi_clicked(self, button):
|
def on_import_openapi_clicked(self, button):
|
||||||
"""Open the OpenAPI import dialog."""
|
"""Open the OpenAPI import dialog."""
|
||||||
projects = self.project_manager.load_projects()
|
projects = self.project_manager.load_projects()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user