Run commands on new user

main
Mateus Melchiades 1 year ago
parent 35015ff864
commit 53743064f2

@ -46,7 +46,7 @@ class VanillaDefaultUser(Adw.Bin):
self.__step = step
# signals
self.btn_next.connect("clicked", self.__window.next)
self.btn_next.connect("clicked", self.__on_btn_next_clicked)
self.fullname_entry.connect('changed', self.__on_fullname_entry_changed)
self.username_entry.connect('changed', self.__on_username_entry_changed)
self.password_entry.connect('changed', self.__on_password_changed)
@ -56,6 +56,10 @@ class VanillaDefaultUser(Adw.Bin):
def step_id(self):
return self.__key
def __on_btn_next_clicked(self, widget):
self.__window.set_user(self.username)
self.__window.next
def get_finals(self):
return {
"vars": {

@ -119,12 +119,14 @@ class VanillaProgress(Gtk.Box):
status = not bool(status)
if self.__success_fn is not None and status:
self.__success_fn()
self.__success_fn(*self.__success_fn_args)
self.__window.set_installation_result(status, self.__terminal)
def start(self, setup_commands, success_fn):
def start(self, setup_commands, success_fn, *fn_args):
self.__success_fn = success_fn
self.__success_fn_args = fn_args
self.__terminal.spawn_async(
Vte.PtyFlags.DEFAULT,
".",
@ -136,4 +138,4 @@ class VanillaProgress(Gtk.Box):
-1,
None,
None
)
)

@ -172,7 +172,7 @@ class VanillaWindow(Adw.ApplicationWindow):
commands
)
self.__view_progress.start(res, Processor.hide_first_setup)
self.__view_progress.start(res, Processor.hide_first_setup, self.__user)
def set_installation_result(self, result, terminal):
self.__view_done.set_result(result, terminal)

Loading…
Cancel
Save