Added dialog to config

This commit is contained in:
Dimitris Zlatanidis 2022-12-25 17:35:54 +02:00
parent a68321b270
commit 9428461a65
3 changed files with 17 additions and 6 deletions

View file

@ -18,10 +18,14 @@ class DialogBox:
self.d = Dialog(dialog="dialog")
self.d.set_background_title(f'{self.configs.prog_name} {Version().version}')
def checklist(self, text, title, height, width, list_height, choices):
def checklist(self, text, title, height, width, list_height, choices, packages):
""" Choose packages for upgrade. """
code, tags = self.d.checklist(text, title=title, height=height, width=width,
list_height=list_height, choices=choices)
if self.configs.dialog:
code, tags = self.d.checklist(text, title=title, height=height, width=width,
list_height=list_height, choices=choices)
else:
code = False
tags = packages
return code, tags

View file

@ -89,9 +89,13 @@ class Slackbuilds:
text = f'There are {len(choices)} dependencies:'
code, tags = self.dialog.checklist(text, title, height, width, list_height, choices)
code, tags = self.dialog.checklist(text, title, height, width, list_height, choices, dependencies)
os.system('clear')
if not code:
return dependencies
if tags:
os.system('clear')
return tags
def creating_main_for_build(self):

View file

@ -64,7 +64,10 @@ class Upgrade:
text = f'There are {len(choices)} packages for upgrade:'
code, tags = self.dialog.checklist(text, title, height, width, list_height, choices)
code, tags = self.dialog.checklist(text, title, height, width, list_height, choices, packages)
if not code:
return packages
os.system('clear')
if code == 'ok':