mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-28 09:58:21 +01:00
Added dialog to config
This commit is contained in:
parent
a68321b270
commit
9428461a65
3 changed files with 17 additions and 6 deletions
|
@ -18,10 +18,14 @@ class DialogBox:
|
||||||
self.d = Dialog(dialog="dialog")
|
self.d = Dialog(dialog="dialog")
|
||||||
self.d.set_background_title(f'{self.configs.prog_name} {Version().version}')
|
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. """
|
""" Choose packages for upgrade. """
|
||||||
|
|
||||||
|
if self.configs.dialog:
|
||||||
code, tags = self.d.checklist(text, title=title, height=height, width=width,
|
code, tags = self.d.checklist(text, title=title, height=height, width=width,
|
||||||
list_height=list_height, choices=choices)
|
list_height=list_height, choices=choices)
|
||||||
|
else:
|
||||||
|
code = False
|
||||||
|
tags = packages
|
||||||
|
|
||||||
return code, tags
|
return code, tags
|
||||||
|
|
|
@ -89,8 +89,12 @@ class Slackbuilds:
|
||||||
|
|
||||||
text = f'There are {len(choices)} dependencies:'
|
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)
|
||||||
|
|
||||||
|
if not code:
|
||||||
|
return dependencies
|
||||||
|
|
||||||
|
if tags:
|
||||||
os.system('clear')
|
os.system('clear')
|
||||||
return tags
|
return tags
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,10 @@ class Upgrade:
|
||||||
|
|
||||||
text = f'There are {len(choices)} packages for 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')
|
os.system('clear')
|
||||||
if code == 'ok':
|
if code == 'ok':
|
||||||
|
|
Loading…
Reference in a new issue