Switch to dialog_box

This commit is contained in:
Dimitris Zlatanidis 2022-12-25 17:05:01 +02:00
parent dedb19689c
commit dc2db730d2

View file

@ -5,8 +5,8 @@ import os
import subprocess
import multiprocessing
from dialog import Dialog
from collections import OrderedDict
from slpkg.dialog_box import DialogBox
from slpkg.downloader import Wget
from slpkg.checksum import Md5sum
@ -14,7 +14,6 @@ from slpkg.configs import Configs
from slpkg.queries import SBoQueries
from slpkg.utilities import Utilities
from slpkg.dependencies import Requires
from slpkg.views.version import Version
from slpkg.views.views import ViewMessage
from slpkg.models.models import LogsDependencies
from slpkg.models.models import session as Session
@ -29,9 +28,8 @@ class Slackbuilds:
self.install = install
self.session = Session
self.utils = Utilities()
self.dialog = DialogBox()
self.configs = Configs
self.d = Dialog(dialog="dialog")
self.d.set_background_title(f'{self.configs.prog_name} {Version().version}')
self.install_order = []
self.dependencies = []
self.sbos = {}
@ -79,15 +77,20 @@ class Slackbuilds:
def choose_dependencies(self, dependencies):
""" Choose packages for upgrade. """
height = 10
width = 70
list_height = 0
choices = []
title = ' Uncheck dependencies if you want to remove '
for package in dependencies:
repo_ver = SBoQueries(package).version()
choices += [(package, repo_ver, True)]
code, tags = self.d.checklist(f'There are {len(choices)} dependencies:',
title=' Uncheck dependencies if you want to remove ',
height=10, width=70, list_height=0, choices=choices)
text = f'There are {len(choices)} dependencies:'
code, tags = self.dialog.checklist(text, title, height, width, list_height, choices)
os.system('clear')
return tags