fix: make output button working

This commit is contained in:
0xMRTT 2023-05-13 00:43:43 +02:00
parent 7a64aa9b71
commit b872e91fff
Signed by: 0xMRTT
GPG Key ID: 19C1449A774028BD
3 changed files with 10 additions and 2 deletions

View File

@ -102,7 +102,6 @@ template ImaginerWindow : Adw.ApplicationWindow {
valign: center;
halign: center;
label: _("_Imagine");
tooltip-text: _("Save location is missing.");
use-underline: true;
sensitive: false;
action-name: "app.ask";

View File

@ -156,6 +156,14 @@ class ImaginerApplication(Adw.Application):
self.load()
self.file_chooser = Gtk.FileChooserNative()
self.file_chooser.set_title(_("Choose a directory"))
self.file_chooser.set_transient_for(self.win)
self.file_chooser.set_action(Gtk.FileChooserAction.SELECT_FOLDER)
self.file_chooser.set_modal(True)
self.file_chooser.connect("response", self.on_file_chooser_response)
print(self.latest_provider)
for k, p in self.providers.items():
if p.slug == self.latest_provider:
@ -310,7 +318,7 @@ Providers: {self.enabled_providers}
except AttributeError:
self.path = "imaginer"
else:
self.path = f"{path}/imaginer-{self.slugify(self.prompt)}-{strftime('%d-%b-%Y-%H-%M-%S', gmtime())}"
self.path = f"{self.path}/imaginer-{self.slugify(self.prompt)}-{strftime('%d-%b-%Y-%H-%M-%S', gmtime())}"
if self.prompt == "" or self.prompt is None: # empty prompt
return

View File

@ -35,6 +35,7 @@ class ImaginerWindow(Adw.ApplicationWindow):
prompt = Gtk.Template.Child()
negative_prompt = Gtk.Template.Child()
menu = Gtk.Template.Child()
label_output = Gtk.Template.Child()
def __init__(self, **kwargs):
super().__init__(**kwargs)