Skip to content

Commit

Permalink
0.9.9
Browse files Browse the repository at this point in the history
  • Loading branch information
vinifmor authored Dec 2, 2020
2 parents 5f9fbd7 + fa935c9 commit 24725a1
Show file tree
Hide file tree
Showing 181 changed files with 12,143 additions and 3,050 deletions.
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,62 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [0.9.9] 2020-12-02
### Features
- Themes (stylesheets)
- new settings property **theme**: it points to a file defining a set of customizations over the current style (QT). In other words, a stylesheet file. At the moment 3 will come bundled with bauh:
- [Light](https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.9/light.png): default light theme
- [Darcula](https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.9/darcula.png): dark based on JetBrain's Darcula theme
- [Sublime](https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.9/sublime.png): dark based on Sublime Text's editor theme
- the theme can be changed through the new lower bar button:
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.9/bt_themes.png">
</p>

- custom themes can be provided as well. More information at [README#custom-themes](https://github.com/vinifmor/bauh/tree/master#custom-themes)

### Improvements
- Flatpak
- history: only displaying the commit's 8 first characters

- UI
- root dialog design and behavior
- tooltip for the label displaying the number of applications on the table/available [#138](https://github.com/vinifmor/bauh/issues/138)
- screenshots:
- dialog resizing behavior
- "loading" message displays the number of images being loaded
- "name filter" now requires ENTER or click to be triggered
- some app actions icons are now displayed with a different picture when disabled to prevent confusion (e.g: launch, screenshots) [#138](https://github.com/vinifmor/bauh/issues/138)
- suggestions button moved to the lower bar (label removed)
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.9/suggestions.png">
</p>

- Settings
- new property **system_theme** (UI -> System theme): merges the system's theme/stylesheet with bauh's (default: false)
- property **style** renamed to **qt_style** and its default value now is **fusion**. If this property is set to **null**, **fusion** will be considered as well. Fusion is the default style that all default themes (stylesheets) are based on, so if you change this property the final style may not look like as expected.
- **Applications displayed** property (Interface) tooltip now informs that 0 (zero) can be used for no limit [#138](https://github.com/vinifmor/bauh/issues/138)

- Parameters
- new parameter **--offline**: it assumes the internet connection is off. Useful if the connection is bad/unstable and you just want to check your installed packages.

### Fixes
- AppImage
- not able to launch AppImage files installed inside folders named with spaces (e.g: "/path/my folder/abc.appimage")

- Arch
- search: not able to find installed packages that were renamed on the repositories (e.g: xapps -> xapp)
- not able to replace an installed package for a new one that replaces it during conflict resolutions (e.g: xapp replaces xapps)
- AUR: not able to find some repository dependencies when their names are not an exact match (e.g: sc-controller [0.4.7-1] relies on "pylibacl". This dependency now is called "python-pylibacl")

- UI
- history dialog: not able to maximize/minimize it on some systems
- wrong tooltips

### i18n
- French translations by [KINFOO](https://github.com/KINFOO): [#143](https://github.com/vinifmor/bauh/pull/143)


## [0.9.8] 2020-10-02
### Fixes
- Arch
Expand Down
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Key features:
- A management panel where you can: search, install, uninstall, upgrade, downgrade, launch, ignore updates and retrieve releases history from software packages.
- Tray mode: it launches attached to the system tray and publishes notifications when there are software updates available
- System backup: it integrates with **Timeshift** to provide a simple and safe backup process before applying changes to your system.
- Custom themes: it's possible to customize the tool's style/appearance. More at [Custom themes](https://github.com/vinifmor/bauh/tree/master#custom-themes).


This project has an official Twitter account (**@bauh4linux**) so people can stay on top of its news.
Expand Down Expand Up @@ -267,6 +268,23 @@ environment:
- Arch-based systems: **python-lxml**, **python-beautifulsoup4**
- Debian-based systems ( using pip ): **beautifulsoup4**, **lxml**

### Custom themes
- Custom themes can be provided by adding their files at **~/.local/share/bauh/themes** (sub-folders are allowed).
- Themes are composed by 2 required and 1 optional files sharing the same name:
- **my_theme.qss**: file with the qss rules. Full example: [light.qss](https://raw.githubusercontent.com/vinifmor/bauh/qss/bauh/view/resources/style/light/light.qss)
- **my_theme.meta**: file defining the theme's data. Full example: [light.meta](https://raw.githubusercontent.com/vinifmor/bauh/qss/bauh/view/resources/style/light/light.meta)
- available fields:
- `name`: name that will be displayed on the interface. It supports translations by adding additional `name` fields with brackets and the language code (e.g: `name[es]=Mi tema`)
- `description`: theme's description that will be displayed on the interface. It supports translations like `name` (e.g: description[es] = Mi tema).
- `version`: theme's version. It just works as information at the moment. (e.g: 1.0)
- `root_theme`: optional attribute that points to a theme that must be loaded before the theme. It supports the bauh's default theme keys (e.g: default, light, ...) or a file path (e.g: `/path/to/root/file.qss`).
- `abstract`: optional boolean attribute (true/false) that should only be used by themes that are not complete on their own and just work as a base (root) for other themes. Abstract themes are not displayed on the interface. Full example: [default.qss](https://raw.githubusercontent.com/vinifmor/bauh/qss/bauh/view/resources/style/default/default.qss)
- **my_theme.vars**: optional file defining `key=value` pairs of variables that will be available for the .qss file (can be referenced through the symbol **@**. e.g `@my_var`). Full example: [light.vars](https://raw.githubusercontent.com/vinifmor/bauh/qss/bauh/view/resources/style/light/light.vars)
- common theme variables available:
- **style_dir**: path to the .qss file directory. Example: @style_dir/my_icon.svg
- **images**: path to bauh's icons directory (gem icons are not available through this variable). Example: @images/logo.svg


### General settings

#### Environment variables / parameters
Expand All @@ -275,6 +293,7 @@ You can change some application settings via environment variables or arguments
- `--settings`: it displays only the settings window.
- `--reset`: it cleans all configurations and cached data stored in the HOME directory.
- `--logs`: it enables logs (for debugging purposes).
- `--offline`: it assumes the internet connection is off.

#### General configuration file (**~/.config/bauh/config.yml**)
```
Expand All @@ -295,15 +314,17 @@ system:
notifications: true # if system popup should be displayed for some events. e.g: when there are updates, bauh will display a system popup
single_dependency_checking: false # if bauh should check only once if for the available technologies on the system.
ui:
style: null # the current QT style set. A null value will map to 'Fusion', 'Breeze' or 'Oxygen' (depending on what is installed)
qt_style: fusion # defines the Qt style. A null value will map to 'fusion' as well.
table:
max_displayed: 50 # defines the maximum number of displayed applications on the table.
max_displayed: 50 # defines the maximum number of displayed applications on the table. Use 0 for no limit.
tray: # system tray settings
default_icon: null # defines a path to a custom icon
updates_icon: null # defines a path to a custom icon indicating updates
hdpi: true # enables HDPI rendering improvements. Use 'false' to disable them if you think the interface looks strange
auto_scale: false # activates Qt auto screen scale factor (QT_AUTO_SCREEN_SCALE_FACTOR). It fixes scaling issues for some desktop environments (like Gnome)
scale_factor: 1.0 # defines the interface display scaling factor (Qt). Raise the value to raise the interface size. The settings window display this value as a percentage (e.g: 1.0 -> 100%).
theme: defines the path to the theme/stylesheet file with a .qss extension (e.g: /path/to/my/theme.qss). For themes provided by bauh, only a string key is needed (e.g: light). Default: light
system_theme: merges the system's theme/stylesheet with bauh's. Default: false.
updates:
check_interval: 30 # the updates checking interval in SECONDS
ask_for_reboot: true # if a dialog asking for a system reboot should be displayed after a successful upgrade
Expand Down
4 changes: 2 additions & 2 deletions bauh/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__version__ = '0.9.8'
__version__ = '0.9.9'
__app_name__ = 'bauh'

import os
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
LOGS_PATH = '/tmp/{}/logs'.format(__app_name__)
LOGS_PATH = '/tmp/{}/logs'.format(__app_name__)
10 changes: 8 additions & 2 deletions bauh/api/abstract/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
from bauh.api.abstract.disk import DiskCacheLoaderFactory
from bauh.api.abstract.download import FileDownloader
from bauh.api.http import HttpClient
from bauh.commons.internet import InternetChecker
from bauh.view.util.translation import I18n


class ApplicationContext:

def __init__(self, download_icons: bool, http_client: HttpClient, app_root_dir: str, i18n: I18n,
cache_factory: MemoryCacheFactory, disk_loader_factory: DiskCacheLoaderFactory,
logger: logging.Logger, file_downloader: FileDownloader, distro: str, app_name: str):
logger: logging.Logger, file_downloader: FileDownloader, distro: str, app_name: str,
internet_checker: InternetChecker):
"""
:param download_icons: if packages icons should be downloaded
:param http_client: a shared instance of http client
Expand All @@ -24,7 +26,7 @@ def __init__(self, download_icons: bool, http_client: HttpClient, app_root_dir:
:param file_downloader
:param distro
:param app_name
:param root_password
:param internet_checker
"""
self.download_icons = download_icons
self.http_client = http_client
Expand All @@ -40,9 +42,13 @@ def __init__(self, download_icons: bool, http_client: HttpClient, app_root_dir:
'Graphics', 'Network', 'Office', 'Science', 'Settings', 'System', 'Utility')
self.app_name = app_name
self.root_password = None
self.internet_checker = internet_checker

def is_system_x86_64(self):
return self.arch_x86_64

def get_view_path(self):
return self.app_root_dir + '/view'

def is_internet_available(self) -> bool:
return self.internet_checker.is_available()
7 changes: 4 additions & 3 deletions bauh/api/abstract/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def sort_by_priority(req: "UpgradeRequirement") -> Tuple[int, str]:

class UpgradeRequirements:

def __init__(self, to_install: List[UpgradeRequirement], to_remove: List[UpgradeRequirement],
def __init__(self, to_install: Optional[List[UpgradeRequirement]], to_remove: Optional[List[UpgradeRequirement]],
to_upgrade: List[UpgradeRequirement], cannot_upgrade: List[UpgradeRequirement]):
"""
:param to_install: additional packages that must be installed with the upgrade
Expand Down Expand Up @@ -264,7 +264,7 @@ def serialize_to_disk(self, pkg: SoftwarePackage, icon_bytes: bytes, only_icon:
f.write(icon_bytes)

@abstractmethod
def requires_root(self, action: str, pkg: SoftwarePackage):
def requires_root(self, action: str, pkg: Optional[SoftwarePackage]):
"""
if a given action requires root privileges to be executed. Current actions are: 'install', 'uninstall', 'downgrade', 'search', 'refresh', 'prepare'
:param action:
Expand All @@ -274,11 +274,12 @@ def requires_root(self, action: str, pkg: SoftwarePackage):
pass

@abstractmethod
def prepare(self, task_manager: TaskManager, root_password: str, internet_available: bool):
def prepare(self, task_manager: Optional[TaskManager], root_password: Optional[str], internet_available: Optional[bool]):
"""
It prepares the manager to start working. It will be called by GUI. Do not call it within.
:param task_manager: a task manager instance used to register ongoing tasks during prepare
:param root_password
:param internet_available: if there is internet connection available
:return:
"""
pass
Expand Down
4 changes: 2 additions & 2 deletions bauh/api/abstract/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def should_stop(self) -> bool:
:return: if the use requested to stop the process.
"""

def request_root_password(self) -> Tuple[str, bool]:
def request_root_password(self) -> Tuple[bool, str]:
"""
asks the root password for the user
:return: a tuple with the typed password and if it is valid
:return: a tuple informing if the password is valid and its text
"""


Expand Down
25 changes: 15 additions & 10 deletions bauh/api/abstract/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import List, Set, Optional


class MessageType:
class MessageType(Enum):
INFO = 0
WARNING = 1
ERROR = 2
Expand All @@ -19,7 +19,7 @@ class ViewComponent(ABC):
"""
Represents a GUI component
"""
def __init__(self, id_: str, observers: List[ViewObserver] = None):
def __init__(self, id_: Optional[str], observers: Optional[List[ViewObserver]] = None):
self.id = id_
self.observers = observers if observers else []

Expand Down Expand Up @@ -56,12 +56,15 @@ class InputOption:
Represents a select component option.
"""

def __init__(self, label: str, value: object, tooltip: str = None, icon_path: str = None, read_only: bool = False, id_: str = None):
def __init__(self, label: str, value: object, tooltip: Optional[str] = None,
icon_path: Optional[str] = None, read_only: bool = False, id_: Optional[str] = None,
invalid: bool = False):
"""
:param label: the string that will be shown to the user
:param value: the option value (not shown)
:param tooltip: an optional tooltip
:param icon_path: an optional icon path
:param invalid: if this option is considered invalid
"""
if not label:
raise Exception("'label' must be a not blank string")
Expand All @@ -72,6 +75,7 @@ def __init__(self, label: str, value: object, tooltip: str = None, icon_path: st
self.tooltip = tooltip
self.icon_path = icon_path
self.read_only = read_only
self.invalid = invalid

def __hash__(self):
return hash(self.label) + hash(self.value)
Expand Down Expand Up @@ -155,9 +159,10 @@ class TextInputType(Enum):

class TextInputComponent(ViewComponent):

def __init__(self, label: str, value: str = '', placeholder: str = None, tooltip: str = None, read_only: bool =False,
id_: str = None, only_int: bool = False, max_width: int = -1, type_: TextInputType = TextInputType.SINGLE_LINE,
capitalize_label: bool = True, min_width: int = -1, min_height: int = -1):
def __init__(self, label: str, value: str = '', placeholder: Optional[str] = None, tooltip: Optional[str] = None,
read_only: bool = False, id_: Optional[str] = None, only_int: bool = False, max_width: int = -1,
type_: TextInputType = TextInputType.SINGLE_LINE, capitalize_label: bool = True, min_width: int = -1,
min_height: int = -1):
super(TextInputComponent, self).__init__(id_=id_)
self.label = label
self.value = value
Expand Down Expand Up @@ -216,9 +221,9 @@ def get_component(self, id_: str) -> ViewComponent:

class FileChooserComponent(ViewComponent):

def __init__(self, allowed_extensions: Set[str] = None, label: str = None, tooltip: str = None,
file_path: str = None, max_width: int = -1, id_: str = None, search_path: str = None, capitalize_label: bool = True,
directory: bool = False):
def __init__(self, allowed_extensions: Optional[Set[str]] = None, label: Optional[str] = None, tooltip: Optional[str] = None,
file_path: Optional[str] = None, max_width: int = -1, id_: Optional[str] = None,
search_path: Optional[str] = None, capitalize_label: bool = True, directory: bool = False):
super(FileChooserComponent, self).__init__(id_=id_)
self.label = label
self.allowed_extensions = allowed_extensions
Expand All @@ -229,7 +234,7 @@ def __init__(self, allowed_extensions: Set[str] = None, label: str = None, toolt
self.capitalize_label = capitalize_label
self.directory = directory

def set_file_path(self, fpath: str):
def set_file_path(self, fpath: Optional[str]):
self.file_path = fpath

if self.observers:
Expand Down
1 change: 1 addition & 0 deletions bauh/api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@

CACHE_PATH = '{}/.cache/bauh'.format(str(Path.home()))
CONFIG_PATH = '{}/.config/bauh'.format(str(Path.home()))
USER_THEMES_PATH = '{}/.local/share/bauh/themes'.format(str(Path.home()))
DESKTOP_ENTRIES_DIR = '{}/.local/share/applications'.format(str(Path.home()))
TEMP_DIR = '/tmp/bauh{}'.format('_root' if os.getuid() == 0 else '')
3 changes: 3 additions & 0 deletions bauh/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def main(tray: bool = False):

logger = logs.new_logger(__app_name__, bool(args.logs))

if args.offline:
logger.warning("offline mode activated")

app_config = config.read_config(update_file=True)

if bool(app_config['ui']['auto_scale']):
Expand Down
1 change: 1 addition & 0 deletions bauh/app_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def read() -> Namespace:
parser = argparse.ArgumentParser(prog=__app_name__, description="GUI for Linux software management")
parser.add_argument('-v', '--version', action='version', version='%(prog)s {}'.format(__version__))
parser.add_argument('--logs', action="store_true", help='It activates {} logs.'.format(__app_name__))
parser.add_argument('--offline', action="store_true", help='It assumes the internet connection is off')

exclusive_args = parser.add_mutually_exclusive_group()
exclusive_args.add_argument('--tray', action="store_true", help='If {} should be attached to the system tray.'.format(__app_name__))
Expand Down
4 changes: 3 additions & 1 deletion bauh/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from bauh.api.http import HttpClient
from bauh.cli import __app_name__, cli_args
from bauh.cli.controller import CLIManager
from bauh.commons.internet import InternetChecker
from bauh.context import generate_i18n, DEFAULT_I18N_KEY
from bauh.view.core import config, gems
from bauh.view.core.controller import GenericSoftwareManager
Expand Down Expand Up @@ -42,7 +43,8 @@ def main():
distro=util.get_distro(),
file_downloader=AdaptableFileDownloader(logger, bool(app_config['download']['multithreaded']),
i18n, http_client, app_config['download']['multithreaded_client']),
app_name=__app_name__)
app_name=__app_name__,
internet_checker=InternetChecker(offline=False))

managers = gems.load_managers(context=context, locale=i18n.current_key, config=app_config, default_locale=DEFAULT_I18N_KEY)

Expand Down
Loading

0 comments on commit 24725a1

Please sign in to comment.