Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Key features

##### Required dependencies

`sudo apt-get install python3 python3-pip python3-yaml python3-dateutil python3-pyqt5 python3-packaging python3-requests`
`sudo apt-get install python3 python3-pip python3-yaml python3-dateutil python3-pyqt6 python3-packaging python3-requests`

##### Installing bauh

Expand Down
9 changes: 2 additions & 7 deletions bauh/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import traceback

import urllib3
from PyQt5.QtCore import QCoreApplication, Qt
from PyQt6.QtCore import QCoreApplication, Qt

from bauh import __app_name__, app_args
from bauh.view.core.config import CoreConfigManager
Expand Down Expand Up @@ -48,11 +48,6 @@ def main(tray: bool = False):
except Exception:
traceback.print_exc()

if bool(app_config['ui']['hdpi']):
logger.info("HDPI settings activated")
QCoreApplication.setAttribute(Qt.AA_UseHighDpiPixmaps)
QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)

if bool(args.suggestions):
logger.info("Forcing loading software suggestions after the initialization process")

Expand All @@ -64,7 +59,7 @@ def main(tray: bool = False):
app, widget = new_manage_panel(args, app_config, logger)

widget.show()
sys.exit(app.exec_())
sys.exit(app.exec())


def tray():
Expand Down
4 changes: 2 additions & 2 deletions bauh/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from logging import Logger
from typing import Tuple

from PyQt5.QtCore import QCoreApplication
from PyQt5.QtWidgets import QApplication
from PyQt6.QtCore import QCoreApplication
from PyQt6.QtWidgets import QApplication

from bauh import __app_name__, __version__
from bauh.stylesheet import process_theme, read_default_themes, read_user_themes, read_theme_metada
Expand Down
2 changes: 1 addition & 1 deletion bauh/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from argparse import Namespace
from typing import Tuple

from PyQt5.QtWidgets import QApplication, QWidget
from PyQt6.QtWidgets import QApplication, QWidget

from bauh import ROOT_DIR, __app_name__, __version__
from bauh.api import user
Expand Down
4 changes: 2 additions & 2 deletions bauh/tray.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from logging import Logger
from typing import Tuple

from PyQt5.QtCore import QObject
from PyQt5.QtWidgets import QApplication
from PyQt6.QtCore import QObject
from PyQt6.QtWidgets import QApplication

from bauh.context import new_qt_application
from bauh.view.qt.systray import TrayIcon
Expand Down
2 changes: 1 addition & 1 deletion bauh/view/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from threading import Thread
from typing import List, Tuple, Optional, Dict, Type, Iterable

from PyQt5.QtWidgets import QApplication, QStyleFactory
from PyQt6.QtWidgets import QApplication, QStyleFactory

from bauh import ROOT_DIR, __app_name__
from bauh.api.abstract.context import ApplicationContext
Expand Down
6 changes: 3 additions & 3 deletions bauh/view/qt/about.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from glob import glob

from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QVBoxLayout, QDialog, QLabel, QWidget, QHBoxLayout, QSizePolicy, QApplication
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QVBoxLayout, QDialog, QLabel, QWidget, QHBoxLayout, QSizePolicy, QApplication

from bauh import __version__, __app_name__, ROOT_DIR
from bauh.context import generate_i18n
Expand All @@ -22,7 +22,7 @@ def __init__(self, app_config: dict):

logo_container = QWidget()
logo_container.setObjectName('logo_container')
logo_container.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
logo_container.setSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Preferred)
logo_container.setLayout(QHBoxLayout())

label_logo = QLabel()
Expand Down
46 changes: 23 additions & 23 deletions bauh/view/qt/apps_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from threading import Lock
from typing import List, Optional, Dict

from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import QPixmap, QIcon, QCursor
from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QToolButton, QWidget, \
from PyQt6.QtCore import Qt, QSize
from PyQt6.QtGui import QPixmap, QIcon, QCursor
from PyQt6.QtWidgets import QTableWidget, QTableView, QMenu, QToolButton, QWidget, \
QHeaderView, QLabel, QHBoxLayout, QToolBar, QSizePolicy

from bauh.api.abstract.cache import MemoryCache
Expand All @@ -31,7 +31,7 @@ def __init__(self, pkg: Optional[PackageView], root: QWidget, i18n: I18n, checke
self.app_view = pkg
self.root = root

self.setCursor(QCursor(Qt.PointingHandCursor))
self.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))
self.setCheckable(True)

if clickable:
Expand Down Expand Up @@ -80,17 +80,17 @@ def __init__(self, parent: QWidget, icon_cache: MemoryCache, download_icons: boo
self.download_icons = download_icons
self.logger = logger
self.setColumnCount(self.COL_NUMBER)
self.setFocusPolicy(Qt.NoFocus)
self.setFocusPolicy(Qt.FocusPolicy.NoFocus)
self.setShowGrid(False)
self.verticalHeader().setVisible(False)
self.horizontalHeader().setVisible(False)
self.horizontalHeader().setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
self.setSelectionBehavior(QTableView.SelectRows)
self.horizontalHeader().setSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Preferred)
self.setSelectionBehavior(QTableView.SelectionBehavior.SelectRows)
self.setHorizontalHeaderLabels(('' for _ in range(self.columnCount())))
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
self.horizontalScrollBar().setCursor(QCursor(Qt.PointingHandCursor))
self.verticalScrollBar().setCursor(QCursor(Qt.PointingHandCursor))
self.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
self.setSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Preferred)
self.horizontalScrollBar().setCursor(QCursor(Qt.CursorShape.PointingHandCursor))
self.verticalScrollBar().setCursor(QCursor(Qt.CursorShape.PointingHandCursor))

self.file_downloader: Optional[URLFileDownloader] = None

Expand All @@ -109,9 +109,9 @@ def has_any_settings(self, pkg: PackageView):

def show_pkg_actions(self, pkg: PackageView):
menu_row = QMenu()
menu_row.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred)
menu_row.setSizePolicy(QSizePolicy.Policy.MinimumExpanding, QSizePolicy.Policy.Preferred)
menu_row.setObjectName('app_actions')
menu_row.setCursor(QCursor(Qt.PointingHandCursor))
menu_row.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))

if pkg.model.installed:

Expand Down Expand Up @@ -160,7 +160,7 @@ def ignore_updates():

menu_row.adjustSize()
menu_row.popup(QCursor.pos())
menu_row.exec_()
menu_row.exec()

def _map_custom_action(self, pkg: PackageView, action: CustomSoftwareAction, parent: QWidget) -> QCustomMenuAction:
def custom_action():
Expand Down Expand Up @@ -312,7 +312,7 @@ def _gen_row_button(self, text: str, name: str, callback, tip: Optional[str] = N
col_bt = QToolButton()
col_bt.setProperty('text_only', 'true')
col_bt.setObjectName(name)
col_bt.setCursor(QCursor(Qt.PointingHandCursor))
col_bt.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))
col_bt.setText(text)
col_bt.clicked.connect(callback)

Expand Down Expand Up @@ -363,15 +363,15 @@ def _set_col_type(self, col: int, pkg: PackageView):

col_type_icon = QLabel()
col_type_icon.setProperty('icon', 'true')
col_type_icon.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred)
col_type_icon.setSizePolicy(QSizePolicy.Policy.MinimumExpanding, QSizePolicy.Policy.Preferred)
col_type_icon.setPixmap(icon_data['px'])
col_type_icon.setToolTip(icon_data['tip'])
self.setCellWidget(pkg.table_index, col, col_type_icon)

def _set_col_version(self, col: int, pkg: PackageView, screen_width: int):
label_version = QLabel(str(pkg.model.version if pkg.model.version else '?'))
label_version.setObjectName('app_version')
label_version.setAlignment(Qt.AlignCenter)
label_version.setAlignment(Qt.AlignmentFlag.AlignCenter)

item = QWidget()
item.setProperty('container', 'true')
Expand Down Expand Up @@ -445,14 +445,14 @@ def _set_col_icon(self, col: int, pkg: PackageView):

col_icon = QLabel()
col_icon.setProperty('icon', 'true')
col_icon.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred)
col_icon.setSizePolicy(QSizePolicy.Policy.MinimumExpanding, QSizePolicy.Policy.Preferred)
self._update_icon(col_icon, icon)
self.setCellWidget(pkg.table_index, col, col_icon)

def _set_col_name(self, col: int, pkg: PackageView, screen_width: int):
col_name = QLabel()
col_name.setObjectName('app_name')
col_name.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred)
col_name.setSizePolicy(QSizePolicy.Policy.MinimumExpanding, QSizePolicy.Policy.Preferred)

name = pkg.model.get_display_name().strip()
if name:
Expand Down Expand Up @@ -540,7 +540,7 @@ def _set_col_publisher(self, col: int, pkg: PackageView, screen_width: int):
if pkg.model.is_trustable():
lb_verified = QLabel()
lb_verified.setObjectName('icon_publisher_verified')
lb_verified.setCursor(QCursor(Qt.WhatsThisCursor))
lb_verified.setCursor(QCursor(Qt.CursorShape.WhatsThisCursor))
lb_verified.setToolTip(self.i18n['publisher.verified'].capitalize())
item.addWidget(lb_verified)
else:
Expand Down Expand Up @@ -601,14 +601,14 @@ def show_info():

self.setCellWidget(pkg.table_index, col, toolbar)

def change_headers_policy(self, policy: QHeaderView = QHeaderView.ResizeToContents, maximized: bool = False):
def change_headers_policy(self, policy: QHeaderView = QHeaderView.ResizeMode.ResizeToContents, maximized: bool = False):
header_horizontal = self.horizontalHeader()
for i in range(self.columnCount()):
if maximized:
if i in (2, 3):
header_horizontal.setSectionResizeMode(i, QHeaderView.Stretch)
header_horizontal.setSectionResizeMode(i, QHeaderView.ResizeMode.Stretch)
else:
header_horizontal.setSectionResizeMode(i, QHeaderView.ResizeToContents)
header_horizontal.setSectionResizeMode(i, QHeaderView.ResizeMode.ResizeToContents)
else:
header_horizontal.setSectionResizeMode(i, policy)

Expand Down
Loading