From b152fd501400bac0294d8bc01e3d0995fc44a121 Mon Sep 17 00:00:00 2001 From: axtlos Date: Mon, 27 Jun 2022 13:03:48 +0200 Subject: [PATCH] use python --- README.md | 20 ---- ...t.jadegui.json => al.getcyrst.jadegui.json | 6 +- ....in => al.getcyrst.jadegui.appdata.xml.in} | 2 +- ...ktop.in => al.getcyrst.jadegui.desktop.in} | 7 +- ...ma.xml => al.getcyrst.jadegui.gschema.xml} | 2 +- ...st.jadegui.svg => al.getcyrst.jadegui.svg} | 0 ...c.svg => al.getcyrst.jadegui-symbolic.svg} | 0 data/icons/meson.build | 2 +- data/meson.build | 10 +- main-page-screenshot.png | Bin 24998 -> 0 bytes po/POTFILES | 11 ++- src/__init__.py | 0 src/al.getcryst.jadegui.in | 11 --- src/al.getcryst.jadegui.src.gresource.xml | 7 -- src/gtk/help-overlay.ui | 30 ------ ...a.gresource.xml => jade_gui.gresource.xml} | 2 +- src/jade_gui.in | 46 +++++++++ src/main.js | 72 -------------- src/main.py | 79 +++++++++++++++ src/meson.build | 43 ++++---- src/window.blp | 4 +- src/window.js | 51 ---------- src/window.py | 63 ++++++++++++ src/window.ui | 93 ++++-------------- 24 files changed, 254 insertions(+), 307 deletions(-) delete mode 100644 README.md rename al.getcryst.jadegui.json => al.getcyrst.jadegui.json (87%) rename data/{al.getcryst.jadegui.appdata.xml.in => al.getcyrst.jadegui.appdata.xml.in} (86%) rename data/{al.getcryst.jadegui.desktop.in => al.getcyrst.jadegui.desktop.in} (65%) rename data/{al.getcryst.jadegui.gschema.xml => al.getcyrst.jadegui.gschema.xml} (61%) rename data/icons/hicolor/scalable/apps/{al.getcryst.jadegui.svg => al.getcyrst.jadegui.svg} (100%) rename data/icons/hicolor/symbolic/apps/{al.getcryst.jadegui-symbolic.svg => al.getcyrst.jadegui-symbolic.svg} (100%) delete mode 100644 main-page-screenshot.png create mode 100644 src/__init__.py delete mode 100755 src/al.getcryst.jadegui.in delete mode 100644 src/al.getcryst.jadegui.src.gresource.xml delete mode 100644 src/gtk/help-overlay.ui rename src/{al.getcryst.jadegui.data.gresource.xml => jade_gui.gresource.xml} (80%) create mode 100755 src/jade_gui.in delete mode 100644 src/main.js create mode 100644 src/main.py delete mode 100644 src/window.js create mode 100644 src/window.py diff --git a/README.md b/README.md deleted file mode 100644 index 846ebc0..0000000 --- a/README.md +++ /dev/null @@ -1,20 +0,0 @@ -

- - Logo - -

- -

Jade

- -

- Discord - Please don't theme this app -

- -

The libadwaita/gtk based gui installer using jade as the backend -

- -[The jade gui mockups](https://github.com/crystal-linux/demos-mockups/blob/main/preview.pdf) - -![](main-page-screenshot.png) - diff --git a/al.getcryst.jadegui.json b/al.getcyrst.jadegui.json similarity index 87% rename from al.getcryst.jadegui.json rename to al.getcyrst.jadegui.json index 7f7c14c..5ff8e6e 100644 --- a/al.getcryst.jadegui.json +++ b/al.getcyrst.jadegui.json @@ -1,9 +1,9 @@ { - "app-id" : "al.getcryst.jadegui", + "app-id" : "al.getcyrst.jadegui", "runtime" : "org.gnome.Platform", - "runtime-version" : "42", + "runtime-version" : "master", "sdk" : "org.gnome.Sdk", - "command" : "al.getcryst.jadegui", + "command" : "jade_gui", "finish-args" : [ "--share=network", "--share=ipc", diff --git a/data/al.getcryst.jadegui.appdata.xml.in b/data/al.getcyrst.jadegui.appdata.xml.in similarity index 86% rename from data/al.getcryst.jadegui.appdata.xml.in rename to data/al.getcyrst.jadegui.appdata.xml.in index 8143858..939afcb 100644 --- a/data/al.getcryst.jadegui.appdata.xml.in +++ b/data/al.getcyrst.jadegui.appdata.xml.in @@ -1,6 +1,6 @@ - al.getcryst.jadegui.desktop + al.getcyrst.jadegui.desktop CC0-1.0 GPL-3.0-or-later diff --git a/data/al.getcryst.jadegui.desktop.in b/data/al.getcyrst.jadegui.desktop.in similarity index 65% rename from data/al.getcryst.jadegui.desktop.in rename to data/al.getcyrst.jadegui.desktop.in index 463552c..d33b8a3 100644 --- a/data/al.getcryst.jadegui.desktop.in +++ b/data/al.getcyrst.jadegui.desktop.in @@ -1,7 +1,10 @@ [Desktop Entry] Name=jade_gui -Exec=al.getcryst.jadegui -Icon=al.getcryst.jadegui + +Exec=jade_gui + +Icon=al.getcyrst.jadegui + Terminal=false Type=Application Categories=GTK; diff --git a/data/al.getcryst.jadegui.gschema.xml b/data/al.getcyrst.jadegui.gschema.xml similarity index 61% rename from data/al.getcryst.jadegui.gschema.xml rename to data/al.getcyrst.jadegui.gschema.xml index 8763ef6..f753157 100644 --- a/data/al.getcryst.jadegui.gschema.xml +++ b/data/al.getcyrst.jadegui.gschema.xml @@ -1,5 +1,5 @@ - + diff --git a/data/icons/hicolor/scalable/apps/al.getcryst.jadegui.svg b/data/icons/hicolor/scalable/apps/al.getcyrst.jadegui.svg similarity index 100% rename from data/icons/hicolor/scalable/apps/al.getcryst.jadegui.svg rename to data/icons/hicolor/scalable/apps/al.getcyrst.jadegui.svg diff --git a/data/icons/hicolor/symbolic/apps/al.getcryst.jadegui-symbolic.svg b/data/icons/hicolor/symbolic/apps/al.getcyrst.jadegui-symbolic.svg similarity index 100% rename from data/icons/hicolor/symbolic/apps/al.getcryst.jadegui-symbolic.svg rename to data/icons/hicolor/symbolic/apps/al.getcyrst.jadegui-symbolic.svg diff --git a/data/icons/meson.build b/data/icons/meson.build index 76c72f2..3e79b99 100644 --- a/data/icons/meson.build +++ b/data/icons/meson.build @@ -1,4 +1,4 @@ -application_id = 'al.getcryst.jadegui' +application_id = 'al.getcyrst.jadegui' scalable_dir = join_paths('hicolor', 'scalable', 'apps') install_data( diff --git a/data/meson.build b/data/meson.build index 41b505b..ce13d79 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,6 +1,6 @@ desktop_file = i18n.merge_file( - input: 'al.getcryst.jadegui.desktop.in', - output: 'al.getcryst.jadegui.desktop', + input: 'al.getcyrst.jadegui.desktop.in', + output: 'al.getcyrst.jadegui.desktop', type: 'desktop', po_dir: '../po', install: true, @@ -15,8 +15,8 @@ if desktop_utils.found() endif appstream_file = i18n.merge_file( - input: 'al.getcryst.jadegui.appdata.xml.in', - output: 'al.getcryst.jadegui.appdata.xml', + input: 'al.getcyrst.jadegui.appdata.xml.in', + output: 'al.getcyrst.jadegui.appdata.xml', po_dir: '../po', install: true, install_dir: join_paths(get_option('datadir'), 'appdata') @@ -29,7 +29,7 @@ if appstream_util.found() ) endif -install_data('al.getcryst.jadegui.gschema.xml', +install_data('al.getcyrst.jadegui.gschema.xml', install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') ) diff --git a/main-page-screenshot.png b/main-page-screenshot.png deleted file mode 100644 index 5462289a6d070ef205d8e2c7f5389dd816a7a286..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24998 zcmeFZc{G)O^gsGYMTz)G%B++kR7hqa^OTtkNiv1PF;5jyrXoY;c^;DCm=#5l*>N%) zl7w>%nKR%0^!ZM|d+%EJue;V=_ukLyvpDBG=Xu`m{occC@BP}IYiTG_A7wg|C=vg?>R?#3U+L`n3}zD`SsPaD@plxSK@|*;sIFj{~iC)(%v>@mpS+&=>QU- zHI+vq58(=IeE%>7L1Zd8T@4-w%tWk^A;@=jvTg2OHkQoYU2+5&&>c8TvZ0FVUH5~} z)It;Puu^}x$~1NszIEZnj27z`PQj>gW_We|`DYncTMNOyvE%S6>v_Bu>%|X(C&m>o zu+bw(h(`J;Gr6Vsf^+{gr+nF7BtO94dKtPqb*A$Cd&Z`CM#23w$4NEj8 z6j37xtz*$a9D^H&vq-URk96Tz=ooV3 zgf9%7q);=C4&bWRKoYkTV!ilo^ zbBgsKrg})Ja)$)$;o+~-uH?z>w~}QX&Z*I7HRL&l(72uudx^~3e-wS)g$m#Fx3J1Q zpNu!ZL1lQ81G!|57(LI8D~6oI(7!KMC%6n6_kL5Uf_=PY1Vfwr$!44`c z|Bw0O>K}!rTJxv#8X9s6c7sggY1TMQarHLl>3H+ECErS?-5P)0YWpKf18Y>$%W2PS zZ9MQ!Zm*>Ri~nOhJ%9axg@jVu8~(h6V0YMC!L;uon{LdN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q9 zU)=l<^}5-klN2%~JggSBj>@CQH;5)|UR@K4Pri`ENJb<{U|3b6UQACcKG&++G?eo$cw^Y_wCLAxJQ_WI-#k%*WogaFfGZX7<;5`E2Zxtw z3NUitpn+?s3l2FNNnE73vCrsmE~oLVB+y+?-n7||9gn)E&L#$JUcRCD27E+Y@OodF zd#kY96BK&Vok`^rp+~b5)S9=6IT(TiB349X8oBQK zhVNIwbel1Xm_ch7ou3^9KrQWC*sD^mSS~%CulwsFsJDhdvJR#b4h%DmXms>GLaF|l z)@hfk-jNKfZT2CxghhN1ZA!9|&aNN8xX5^}kLyUw%E+EK+7yUnBE0+?X9pxxpujsi z_awfYSVHHDuS6hULLg;>g)IL{A131P?+Ii}LTn->0e<ienq&50V;^f-^b+fQcot z?i}!@S}G0p^RqF(bK@7PrVRhgCgFu)B_4wbLVlPcc)Rt7{8DiiddIwQ)<){CKvoKn z6%M~=e&Tk-E?Iw^0yow_ABW{8$V5>4LLHytskl&2J^R5cXTg+Y49j!*Q{pRsmMab& zefv&$x**fEgzK=N{+iWvnF90}<7NgasOzd8?$F~!r^h3NG4Y}L>5S0nA9)?9f=m&*th z2oTEt5dg_L5~;|DEcS8B*uS7AS_9`*Z(V{8dUx-#%Ul}+O$CpkE1~z_t624R*?`e% z@%9G7-tRonD_R51NrHD8=tUUyuCIZaki~D2=O%3JKNkQ6Yhkj77|q^`x|cQ&# imports.package.run(main)) - .catch(logError); diff --git a/src/al.getcryst.jadegui.src.gresource.xml b/src/al.getcryst.jadegui.src.gresource.xml deleted file mode 100644 index 77e07d8..0000000 --- a/src/al.getcryst.jadegui.src.gresource.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - main.js - window.js - - diff --git a/src/gtk/help-overlay.ui b/src/gtk/help-overlay.ui deleted file mode 100644 index 05474c8..0000000 --- a/src/gtk/help-overlay.ui +++ /dev/null @@ -1,30 +0,0 @@ - - - - - true - - - shortcuts - 10 - - - General - - - Show Shortcuts - win.show-help-overlay - - - - - Quit - app.quit - - - - - - - - diff --git a/src/al.getcryst.jadegui.data.gresource.xml b/src/jade_gui.gresource.xml similarity index 80% rename from src/al.getcryst.jadegui.data.gresource.xml rename to src/jade_gui.gresource.xml index ed9e40c..ba34e2b 100644 --- a/src/al.getcryst.jadegui.data.gresource.xml +++ b/src/jade_gui.gresource.xml @@ -1,6 +1,6 @@ - + window.ui gtk/help-overlay.ui crystal-logo-minimal.png diff --git a/src/jade_gui.in b/src/jade_gui.in new file mode 100755 index 0000000..ba35488 --- /dev/null +++ b/src/jade_gui.in @@ -0,0 +1,46 @@ +#!@PYTHON@ + +# jade_gui.in + +# +# Copyright 2022 user + +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import os +import sys +import signal +import locale +import gettext + +VERSION = '@VERSION@' +pkgdatadir = '@pkgdatadir@' +localedir = '@localedir@' + +sys.path.insert(1, pkgdatadir) +signal.signal(signal.SIGINT, signal.SIG_DFL) +locale.bindtextdomain('jade_gui', localedir) +locale.textdomain('jade_gui') +gettext.install('jade_gui', localedir) + +if __name__ == '__main__': + import gi + + from gi.repository import Gio + resource = Gio.Resource.load(os.path.join(pkgdatadir, 'jade_gui.gresource')) + resource._register() + + from jade_gui import main + sys.exit(main.main(VERSION)) diff --git a/src/main.js b/src/main.js deleted file mode 100644 index d05f8c3..0000000 --- a/src/main.js +++ /dev/null @@ -1,72 +0,0 @@ -/* main.js - * - * Copyright 2022 user - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -import GObject from 'gi://GObject'; -import Gio from 'gi://Gio'; -import Gtk from 'gi://Gtk?version=4.0'; -import Adw from 'gi://Adw?version=1'; - -import { JadeGuiWindow } from './window.js'; - -pkg.initGettext(); -pkg.initFormat(); - -export const JadeGuiApplication = GObject.registerClass( - class JadeGuiApplication extends Adw.Application { - constructor() { - super({application_id: 'al.getcryst.jadegui', flags: Gio.ApplicationFlags.FLAGS_NONE}); - - const quit_action = new Gio.SimpleAction({name: 'quit'}); - quit_action.connect('activate', action => { - this.quit(); - }); - this.add_action(quit_action); - this.set_accels_for_action('app.quit', ['q']); - - const show_about_action = new Gio.SimpleAction({name: 'about'}); - show_about_action.connect('activate', action => { - let aboutParams = { - authors: [ - 'user' - ], - version: '0.1.0', - program_name: 'jade_gui', - transient_for: this.active_window, - modal: true, - }; - const aboutDialog = new Gtk.AboutDialog(aboutParams); - aboutDialog.present(); - }); - this.add_action(show_about_action); - } - - vfunc_activate() { - let {active_window} = this; - - if (!active_window) - active_window = new JadeGuiWindow(this); - - active_window.present(); - } - } -); - -export function main(argv) { - const application = new JadeGuiApplication(); - return application.run(argv); -} diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..6e38437 --- /dev/null +++ b/src/main.py @@ -0,0 +1,79 @@ +# main.py + +# +# Copyright 2022 user + +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import sys +import gi + +gi.require_version('Gtk', '4.0') +gi.require_version('Adw', '1') + +from gi.repository import Gtk, Gio, Adw +from .window import JadeGuiWindow, AboutDialog + + +class Jade_guiApplication(Adw.Application): + """The main application singleton class.""" + + def __init__(self): + super().__init__(application_id='al.getcyrst.jadegui', + flags=Gio.ApplicationFlags.FLAGS_NONE) + self.create_action('quit', self.quit, ['q']) + self.create_action('about', self.on_about_action) + self.create_action('preferences', self.on_preferences_action) + + def do_activate(self): + """Called when the application is activated. + + We raise the application's main window, creating it if + necessary. + """ + win = self.props.active_window + if not win: + win = JadeGuiWindow(application=self, window=win) + win.present() + + def on_about_action(self, widget, _): + """Callback for the app.about action.""" + about = AboutDialog(self.props.active_window) + about.present() + + def on_preferences_action(self, widget, _): + """Callback for the app.preferences action.""" + print('app.preferences action activated') + + def create_action(self, name, callback, shortcuts=None): + """Add an application action. + + Args: + name: the name of the action + callback: the function to be called when the action is + activated + shortcuts: an optional list of accelerators + """ + action = Gio.SimpleAction.new(name, None) + action.connect("activate", callback) + self.add_action(action) + if shortcuts: + self.set_accels_for_action(f"app.{name}", shortcuts) + + +def main(version): + """The application's entry point.""" + app = Jade_guiApplication() + return app.run(sys.argv) diff --git a/src/meson.build b/src/meson.build index 1c2a390..81252c9 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,43 +1,46 @@ -pkgdatadir = join_paths(get_option('datadir'), meson.project_name()) +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) +moduledir = join_paths(pkgdatadir, 'jade_gui') gnome = import('gnome') blueprints = custom_target('blueprints', input: files( 'gtk/help-overlay.blp', + 'window.blp', ), output: '.', command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], ) -src_res = gnome.compile_resources('al.getcryst.jadegui.src', - 'al.getcryst.jadegui.src.gresource.xml', + +gnome.compile_resources('jade_gui', + 'jade_gui.gresource.xml', dependencies: blueprints, gresource_bundle: true, install: true, install_dir: pkgdatadir, ) -data_res = gnome.compile_resources('al.getcryst.jadegui.data', - 'al.getcryst.jadegui.data.gresource.xml', - gresource_bundle: true, - install: true, - install_dir: pkgdatadir, -) +python = import('python') -bin_conf = configuration_data() -bin_conf.set('GJS', find_program('gjs').full_path()) -bin_conf.set('PACKAGE_VERSION', meson.project_version()) -bin_conf.set('PACKAGE_NAME', meson.project_name()) -bin_conf.set('prefix', get_option('prefix')) -bin_conf.set('libdir', join_paths(get_option('prefix'), get_option('libdir'))) -bin_conf.set('datadir', join_paths(get_option('prefix'), get_option('datadir'))) -bin_conf.set('resource_path', '/al/getcryst/jadegui') +conf = configuration_data() +conf.set('PYTHON', python.find_installation('python3').path()) +conf.set('VERSION', meson.project_version()) +conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir'))) +conf.set('pkgdatadir', pkgdatadir) configure_file( - input: 'al.getcryst.jadegui.in', - output: 'al.getcryst.jadegui', - configuration: bin_conf, + input: 'jade_gui.in', + output: 'jade_gui', + configuration: conf, install: true, install_dir: get_option('bindir') ) + +jade_gui_sources = [ + '__init__.py', + 'main.py', + 'window.py', +] + +install_data(jade_gui_sources, install_dir: moduledir) diff --git a/src/window.blp b/src/window.blp index 14d71f6..7f4f6f2 100644 --- a/src/window.blp +++ b/src/window.blp @@ -11,7 +11,7 @@ template JadeGuiWindow : Gtk.ApplicationWindow { Adw.HeaderBar header_bar { title-widget: Gtk.Box { Gtk.Image { - resource: "/al/getcryst/jadegui/crystal-logo-minimal.png"; + resource: "/al/getcyrst/jadegui/crystal-logo-minimal.png"; } Gtk.Label { margin-start: 2; @@ -30,7 +30,7 @@ template JadeGuiWindow : Gtk.ApplicationWindow { hexpand: true; Gtk.Image crystal-logo { - resource: "/al/getcryst/jadegui/crystal-logo-minimal.png"; + resource: "/al/getcyrst/jadegui/crystal-logo-minimal.png"; pixel-size: 200; margin-bottom: 25; } diff --git a/src/window.js b/src/window.js deleted file mode 100644 index 9d23746..0000000 --- a/src/window.js +++ /dev/null @@ -1,51 +0,0 @@ -/* window.js - * - * Copyright 2022 crystal linux - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -import GObject from 'gi://GObject'; -import Gtk from 'gi://Gtk'; -import Adw from 'gi://Adw'; - -export const JadeGuiWindow = GObject.registerClass({ - GTypeName: 'JadeGuiWindow', - Template: 'resource:///al/getcryst/jadegui/window.ui', - InternalChildren: ['label', 'quitButton', 'nextButton', 'crystal-logo'], -}, class JadeGuiWindow extends Gtk.ApplicationWindow { - _init(application) { - super._init({ application }); - this._quitButton.connect('clicked', () => { - confirm_quit(); - }); - } -}); - -function confirm_quit() { - const quitDialog = new Gtk.MessageDialog({ - text: "Do you want to try\nCrystal without installing?", - transient_for: JadeGuiWindow, - modal: true, - buttons: Gtk.ButtonsType.Ok, - }); - - quitDialog.connect("response", () => { - quitDialog.close(); - }); - - quitDialog.present(); - -} - diff --git a/src/window.py b/src/window.py new file mode 100644 index 0000000..6de94da --- /dev/null +++ b/src/window.py @@ -0,0 +1,63 @@ +# window.py + +# +# Copyright 2022 user + +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +from gi.repository import Gtk + + +@Gtk.Template(resource_path='/al/getcyrst/jadegui/window.ui') +class JadeGuiWindow(Gtk.ApplicationWindow): + __gtype_name__ = 'JadeGuiWindow' + + quitButton = Gtk.Template.Child() + + def __init__(self, window, **kwargs): + super().__init__(**kwargs) + self.quitButton.connect("clicked", self.confirmQuit) + self.window = window + + def confirmQuit(self, idk): + + def handle_response(_widget, response_id): + if response_id == Gtk.ResponseType.YES: + _widget.destroy() + self.destroy() + elif response_id == Gtk.ResponseType.NO: + _widget.destroy() + + dialog = Gtk.MessageDialog( + transient_for=self, + modal=True, + parent=self, + text=_("Do you want to try\nCrystal without installing?"), + buttons=Gtk.ButtonsType.YES_NO + ) + dialog.connect("response", handle_response) + dialog.present() + +class AboutDialog(Gtk.AboutDialog): + + def __init__(self, parent): + Gtk.AboutDialog.__init__(self) + self.props.program_name = 'jade_gui' + self.props.version = "0.1.0" + self.props.authors = ['user'] + self.props.copyright = '2022 user' + self.props.logo_icon_name = 'al.getcyrst.jadegui' + self.props.modal = True + self.set_transient_for(parent) diff --git a/src/window.ui b/src/window.ui index 00f77b0..e9fc336 100644 --- a/src/window.ui +++ b/src/window.ui @@ -2,98 +2,41 @@ +
- Prefrences - app.prefrences + _Preferences + app.preferences - Keyboard Shortcuts + _Keyboard Shortcuts win.show-help-overlay - About jade_gui + _About jade_gui app.about