From dc2db730d25cda5de8413e934382c4287712b080 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 25 Dec 2022 17:05:01 +0200 Subject: [PATCH] Switch to dialog_box --- slpkg/slackbuild.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/slpkg/slackbuild.py b/slpkg/slackbuild.py index 7faad6b7..7e1a061e 100644 --- a/slpkg/slackbuild.py +++ b/slpkg/slackbuild.py @@ -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