finish user pagex

pull/6/head
axtloss 2 years ago
parent 2e9260c686
commit b06d7241b2

@ -0,0 +1,64 @@
app-id: al.getcryst.jadegui
runtime: org.gnome.Platform
runtime-version: '42'
sdk: org.gnome.Sdk
command: jade_gui
finish-args:
- --share=network
- --share=ipc
- --socket=fallback-x11
- --device=dri
- --socket=wayland
# - --socket=session-bus
cleanup:
- /include
- /lib/pkgconfig
- /man
- /share/doc
- /share/gtk-doc
- /share/pkgconfig
- "*.la"
- "*.a"
modules:
- name: libadwaita
buildsystem: meson
config-opts:
- -Dexamples=false
- -Dtests=false
sources:
- type: git
url: https://gitlab.gnome.org/GNOME/libadwaita.git
commit: da4125248a434ba7caaec85186db6ab44deecad7
modules:
- name: libsass
buildsystem: meson
sources:
- type: git
url: https://github.com/lazka/libsass.git
branch: meson
- name: sassc
buildsystem: meson
sources:
- type: git
url: https://github.com/lazka/sassc.git
branch: meson
- name: python3-pytz
buildsystem: simple
sources:
- type: archive
url: https://files.pythonhosted.org/packages/2f/5f/a0f653311adff905bbcaa6d3dfaf97edcf4d26138393c6ccd37a484851fb/pytz-2022.1.tar.gz
sha256: 1e760e2fe6a8163bc0b3d9a19c4f84342afa0a2affebfaa84b01b978a02ecaa7
build-commands:
- ls
- pip3 install --prefix=/app .
- name: jadegui
buildsystem: meson
build-options:
build-args:
- --share=network
sources:
- type: dir
path: .

@ -0,0 +1,53 @@
C1: -> org.freedesktop.DBus call org.freedesktop.DBus.Hello at /org/freedesktop/DBus
C2: -> org.freedesktop.DBus fake wildcarded AddMatch for org.freedesktop.portal
C3: -> org.freedesktop.DBus fake wildcarded AddMatch for al.getcryst.jadegui
C4: -> org.freedesktop.DBus fake wildcarded AddMatch for org.mpris.MediaPlayer2.al.getcryst.jadegui
C5: -> org.freedesktop.DBus fake ListNames
B-1: <- org.freedesktop.DBus return from C1
B-1: <- org.freedesktop.DBus signal org.freedesktop.DBus.NameAcquired at /org/freedesktop/DBus
B-1: <- org.freedesktop.DBus return from C2
*SKIPPED*
B-1: <- org.freedesktop.DBus return from C3
*SKIPPED*
B-1: <- org.freedesktop.DBus return from C4
*SKIPPED*
B-1: <- org.freedesktop.DBus return from C5
C6: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.DBus
C7: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.portal.Desktop
C8: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.portal.Documents
C9: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.portal.Flatpak
C10: -> org.freedesktop.DBus fake GetNameOwner for org.freedesktop.portal.IBus
*SKIPPED*
B-1: <- org.freedesktop.DBus return from C6
*SKIPPED*
B-1: <- org.freedesktop.DBus return from C7
*SKIPPED*
B-1: <- org.freedesktop.DBus return from C8
*SKIPPED*
B-1: <- org.freedesktop.DBus return from C9
*SKIPPED*
B-1: <- org.freedesktop.DBus return from C10
*SKIPPED*
C11: -> org.freedesktop.DBus call org.freedesktop.DBus.AddMatch at /org/freedesktop/DBus
C12: -> org.freedesktop.DBus call org.freedesktop.DBus.AddMatch at /org/freedesktop/DBus
C13: -> org.freedesktop.DBus call org.freedesktop.DBus.AddMatch at /org/freedesktop/DBus
C14: -> org.freedesktop.DBus call org.freedesktop.DBus.StartServiceByName at /org/freedesktop/DBus
B-1: <- org.freedesktop.DBus return from C11
B-1: <- org.freedesktop.DBus return from C12
B-1: <- org.freedesktop.DBus return from C13
B-1: <- org.freedesktop.DBus return from C14
C15: -> org.freedesktop.DBus call org.freedesktop.DBus.GetNameOwner at /org/freedesktop/DBus
B-1: <- org.freedesktop.DBus return from C15
C16: -> :1.80 call org.freedesktop.DBus.Properties.GetAll at /org/freedesktop/portal/desktop
B1834: <- :1.80 return from C16
C17: -> :1.80 call org.freedesktop.portal.Settings.ReadAll at /org/freedesktop/portal/desktop
B1838: <- :1.80 return from C17
C18: -> org.freedesktop.DBus call org.freedesktop.DBus.RequestName at /org/freedesktop/DBus
Filtering message due to arg0 al.getcyrst.jadegui, policy: 0 (required 3)
*HIDDEN* (ping)
B-1: <- org.freedesktop.DBus return from C18
*REWRITTEN*
C19: -> org.freedesktop.DBus call org.freedesktop.DBus.AddMatch at /org/freedesktop/DBus
C20: -> org.freedesktop.DBus call org.freedesktop.DBus.GetNameOwner at /org/freedesktop/DBus
B-1: <- org.freedesktop.DBus return from C19
B-1: <- org.freedesktop.DBus return from C20

@ -31,6 +31,7 @@ class UserScreen(Adw.Bin):
password_confirmation = Gtk.Template.Child() password_confirmation = Gtk.Template.Child()
enable_sudo_switch = Gtk.Template.Child() enable_sudo_switch = Gtk.Template.Child()
enable_root_switch = Gtk.Template.Child() enable_root_switch = Gtk.Template.Child()
next_page = Gtk.Template.Child()
def __init__(self, window, main_carousel, next_page, application, **kwargs): def __init__(self, window, main_carousel, next_page, application, **kwargs):
super().__init__(**kwargs) super().__init__(**kwargs)
@ -38,20 +39,25 @@ class UserScreen(Adw.Bin):
self.carousel = main_carousel self.carousel = main_carousel
self.sudo_enabled = True self.sudo_enabled = True
self.root_enabled = True self.root_enabled = True
self.next_page = next_page
self.enable_root_switch.set_active(self.root_enabled) self.enable_root_switch.set_active(self.root_enabled)
self.enable_sudo_switch.set_active(self.sudo_enabled) self.enable_sudo_switch.set_active(self.sudo_enabled)
self.username_entry.connect('changed', self.username_passes_regex) self.username_entry.connect('changed', self.username_passes_regex)
self.enable_root_switch.connect('state-set', self.enable_root_user) self.enable_root_switch.connect('state-set', self.enable_root_user)
self.enable_sudo_switch.connect('state-set', self.enable_sudo) self.enable_sudo_switch.connect('state-set', self.enable_sudo)
self.password_entry.connect('changed', self.verify_password)
self.password_confirmation.connect('changed', self.verify_password)
def username_passes_regex(self, widget): def username_passes_regex(self, widget):
input = self.username_entry.get_text() input = self.username_entry.get_text()
print(input) print(input)
if not re.search("^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$", input): if not re.search("^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$", input):
print("Invalid username!") print("Invalid username!")
self.username_entry.add_css_class('error')
self.next_page.set_sensitive(False)
else: else:
print("Valid username!") print("Valid username!")
self.username_entry.remove_css_class('error')
self.next_page.set_sensitive(True)
def enable_root_user(self, widget, switch_state): def enable_root_user(self, widget, switch_state):
print("root") print("root")
@ -76,3 +82,12 @@ class UserScreen(Adw.Bin):
self.enable_root_switch.set_active(not switch_state) self.enable_root_switch.set_active(not switch_state)
else: else:
self.sudo_enabled = switch_state self.sudo_enabled = switch_state
def verify_password(self, widget):
if self.password_entry.get_text() == self.password_confirmation.get_text():
self.next_page.set_sensitive(True)
self.password_confirmation.add_css_class('error')
elif self.password_entry.get_text() != self.password_confirmation.get_text():
self.next_page.set_sensitive(False)
self.password_confirmation.remove_css_class('error')

@ -4,6 +4,19 @@ using Adw 1;
template UserScreen : Adw.Bin { template UserScreen : Adw.Bin {
hexpand: true; hexpand: true;
vexpand: true; vexpand: true;
Gtk.Overlay {
Gtk.Button next_page {
margin-end: 20;
margin-bottom: 20;
label: "Next";
halign: end;
valign: end;
tooltip-text: "Move to next page";
styles ["suggested-action"]
}
}
Gtk.Box { Gtk.Box {
vexpand: true; vexpand: true;
hexpand: true; hexpand: true;
@ -14,32 +27,14 @@ template UserScreen : Adw.Bin {
description: "You can add more users in the settings on the installed system"; description: "You can add more users in the settings on the installed system";
Adw.PreferencesPage { Adw.PreferencesPage {
Adw.PreferencesGroup { Adw.PreferencesGroup {
Gtk.Entry username_entry { Adw.EntryRow username_entry {
margin-bottom: 7; title: "Enter your username";
primary-icon-name: "avatar-default-symbolic";
primary-icon-activatable: false;
secondary-icon-name: "edit-clear";
secondary-icon-activatable: true;
placeholder-text: "Enter your username";
} }
Gtk.Entry password_entry { Adw.EntryRow password_entry {
margin-top: 7; title: "Enter your password";
margin-bottom: 7;
primary-icon-name: "system-lock-screen-symbolic";
primary-icon-activatable: false;
secondary-icon-name: "edit-clear";
secondary-icon-activatable: true;
placeholder-text: "Enter your password";
} }
Gtk.Entry password_confirmation { Adw.EntryRow password_confirmation {
margin-top: 7; title: "Repeat your password";
margin-bottom: 7;
primary-icon-name: "system-lock-screen-symbolic";
primary-icon-activatable: false;
secondary-icon-name: "edit-clear";
secondary-icon-activatable: true;
placeholder-text: "Repeat your password";
styles ["big"]
} }
Gtk.ListBox { // TODO: MOVE TO ADVANCED/MISC SECTION??? Gtk.ListBox { // TODO: MOVE TO ADVANCED/MISC SECTION???
margin-top: 7; margin-top: 7;

Loading…
Cancel
Save