refactoring modules structure | improving README and CHANGELOG
10
bauh/app.py
@@ -6,13 +6,13 @@ from PyQt5.QtWidgets import QApplication
|
||||
from bauh import __version__, __app_name__, app_args, ROOT_DIR
|
||||
from bauh.api.abstract.controller import ApplicationContext
|
||||
from bauh.api.http import HttpClient
|
||||
from bauh.core import gems, config
|
||||
from bauh.core.controller import GenericSoftwareManager
|
||||
from bauh.util import util, logs, resource
|
||||
from bauh.util.cache import DefaultMemoryCacheFactory, CacheCleaner
|
||||
from bauh.util.disk import DefaultDiskCacheLoaderFactory
|
||||
from bauh.view.core import gems, config
|
||||
from bauh.view.core.controller import GenericSoftwareManager
|
||||
from bauh.view.util import util, logs, resource
|
||||
from bauh.view.qt.systray import TrayIcon
|
||||
from bauh.view.qt.window import ManageWindow
|
||||
from bauh.view.util.cache import CacheCleaner, DefaultMemoryCacheFactory
|
||||
from bauh.view.util.disk import DefaultDiskCacheLoaderFactory
|
||||
|
||||
args = app_args.read()
|
||||
logger = logs.new_logger(__app_name__, bool(args.logs))
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import re
|
||||
|
||||
HTML_RE = re.compile(r'<[^>]+>')
|
||||
|
||||
|
||||
def strip_html(string: str):
|
||||
return HTML_RE.sub('', string)
|
||||
@@ -1,11 +1,11 @@
|
||||
import inspect
|
||||
import os
|
||||
import pkgutil
|
||||
from typing import List, Type
|
||||
from typing import List
|
||||
|
||||
from bauh import ROOT_DIR
|
||||
from bauh.api.abstract.controller import SoftwareManager, ApplicationContext
|
||||
from bauh.util import util
|
||||
from bauh.view.util import util
|
||||
|
||||
|
||||
def find_manager(member):
|
||||
@@ -3,7 +3,7 @@ from PyQt5.QtGui import QPixmap
|
||||
from PyQt5.QtWidgets import QVBoxLayout, QDialog, QLabel
|
||||
|
||||
from bauh import __version__, __app_name__
|
||||
from bauh.util import resource
|
||||
from bauh.view.util import resource
|
||||
|
||||
PROJECT_URL = 'https://github.com/vinifmor/' + __app_name__
|
||||
LICENSE_URL = 'https://raw.githubusercontent.com/vinifmor/{}/master/LICENSE'.format(__app_name__)
|
||||
@@ -30,7 +30,7 @@ class AboutDialog(QDialog):
|
||||
layout.addWidget(QLabel(''))
|
||||
|
||||
line_desc = QLabel(self)
|
||||
line_desc.setStyleSheet('font-size: 10px; font-weight: bold;')
|
||||
line_desc.setStyleSheet('font-size: 11px; font-weight: bold;')
|
||||
line_desc.setText(locale_keys['about.info.desc'])
|
||||
line_desc.setAlignment(Qt.AlignCenter)
|
||||
line_desc.setMinimumWidth(400)
|
||||
@@ -39,14 +39,14 @@ class AboutDialog(QDialog):
|
||||
layout.addWidget(QLabel(''))
|
||||
|
||||
label_more_info = QLabel()
|
||||
label_more_info.setStyleSheet('font-size: 9px;')
|
||||
label_more_info.setStyleSheet('font-size: 10px;')
|
||||
label_more_info.setText(locale_keys['about.info.link'] + ": <a href='{url}'>{url}</a>".format(url=PROJECT_URL))
|
||||
label_more_info.setOpenExternalLinks(True)
|
||||
label_more_info.setAlignment(Qt.AlignCenter)
|
||||
layout.addWidget(label_more_info)
|
||||
|
||||
label_license = QLabel()
|
||||
label_license.setStyleSheet('font-size: 9px;')
|
||||
label_license.setStyleSheet('font-size: 10px;')
|
||||
label_license.setText("<a href='{}'>{}</a>".format(LICENSE_URL, locale_keys['about.info.license']))
|
||||
label_license.setOpenExternalLinks(True)
|
||||
label_license.setAlignment(Qt.AlignCenter)
|
||||
@@ -55,7 +55,7 @@ class AboutDialog(QDialog):
|
||||
layout.addWidget(QLabel(''))
|
||||
|
||||
label_rate = QLabel()
|
||||
label_rate.setStyleSheet('font-size: 9px; font-weight: bold;')
|
||||
label_rate.setStyleSheet('font-size: 10px; font-weight: bold;')
|
||||
label_rate.setText(locale_keys['about.info.rate'] + ' :)')
|
||||
label_rate.setOpenExternalLinks(True)
|
||||
label_rate.setAlignment(Qt.AlignCenter)
|
||||
|
||||
@@ -10,8 +10,8 @@ from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QAction, QTableWidg
|
||||
|
||||
from bauh.api.abstract.cache import MemoryCache
|
||||
from bauh.api.abstract.model import PackageStatus
|
||||
from bauh.util import resource
|
||||
from bauh.util.html import strip_html
|
||||
from bauh.commons.html import strip_html
|
||||
from bauh.view.util import resource
|
||||
from bauh.view.qt import dialog
|
||||
from bauh.view.qt.components import IconButton
|
||||
from bauh.view.qt.view_model import PackageView, PackageViewStatus
|
||||
@@ -385,13 +385,13 @@ class AppsTable(QTableWidget):
|
||||
def get_info():
|
||||
self.window.get_app_info(pkg)
|
||||
|
||||
item.addWidget(IconButton(icon_path=resource.get_path('img/app_info.svg'), action=get_info, background='#2E68D3'))
|
||||
item.addWidget(IconButton(icon_path=resource.get_path('img/app_info.svg'), action=get_info, background='#2E68D3', tooltip=self.i18n['action.info.tooltip']))
|
||||
|
||||
def handle_click():
|
||||
self.show_pkg_settings(pkg)
|
||||
|
||||
if self.has_any_settings(pkg):
|
||||
bt = IconButton(icon_path=resource.get_path('img/app_settings.svg'), action=handle_click, background='#12ABAB')
|
||||
bt = IconButton(icon_path=resource.get_path('img/app_settings.svg'), action=handle_click, background='#12ABAB', tooltip=self.i18n['action.settings.tooltip'])
|
||||
item.addWidget(bt)
|
||||
|
||||
self.setCellWidget(idx, col, item)
|
||||
|
||||
@@ -4,7 +4,7 @@ from PyQt5.QtGui import QIcon
|
||||
from PyQt5.QtWidgets import QMessageBox, QLabel, QWidget, QHBoxLayout
|
||||
from bauh.api.abstract.view import MessageType
|
||||
|
||||
from bauh.util import resource
|
||||
from bauh.view.util import resource
|
||||
from bauh.view.qt import css
|
||||
|
||||
MSG_TYPE_MAP = {
|
||||
|
||||
@@ -4,9 +4,9 @@ from PyQt5.QtWidgets import QWidget, QLabel, QGridLayout, QPushButton
|
||||
|
||||
from bauh import ROOT_DIR
|
||||
from bauh.api.abstract.view import MultipleSelectComponent, InputOption
|
||||
from bauh.commons import resource
|
||||
from bauh.core.config import Configuration, save
|
||||
from bauh.core.controller import GenericSoftwareManager
|
||||
from bauh.view.core.config import Configuration, save
|
||||
from bauh.view.core.controller import GenericSoftwareManager
|
||||
from bauh.view.util import resource
|
||||
from bauh.view.qt import qt_utils, css
|
||||
from bauh.view.qt.components import MultipleSelectQt, CheckboxQt, new_spacer
|
||||
|
||||
@@ -19,7 +19,7 @@ class GemSelectorPanel(QWidget):
|
||||
self.manager = manager
|
||||
self.config = config
|
||||
self.setLayout(QGridLayout())
|
||||
self.setWindowIcon(QIcon(resource.get_path('img/logo.svg', ROOT_DIR)))
|
||||
self.setWindowIcon(QIcon(resource.get_path('img/logo.svg')))
|
||||
self.setWindowTitle(i18n['gem_selector.title'])
|
||||
self.resize(400, 400)
|
||||
self.show_panel_after_restart = show_panel_after_restart
|
||||
|
||||
@@ -3,8 +3,7 @@ from PyQt5.QtGui import QIcon
|
||||
from PyQt5.QtWidgets import QDialog, QVBoxLayout, QGroupBox, \
|
||||
QLineEdit, QLabel, QGridLayout, QPushButton, QPlainTextEdit, QToolBar
|
||||
from bauh.api.abstract.cache import MemoryCache
|
||||
|
||||
from bauh.util.html import strip_html
|
||||
from bauh.commons.html import strip_html
|
||||
|
||||
IGNORED_ATTRS = {'name', '__app__'}
|
||||
|
||||
|
||||
@@ -5,9 +5,8 @@ import subprocess
|
||||
from PyQt5.QtGui import QIcon
|
||||
from PyQt5.QtWidgets import QInputDialog, QLineEdit
|
||||
|
||||
from bauh import ROOT_DIR
|
||||
from bauh.api.abstract.view import MessageType
|
||||
from bauh.commons import resource
|
||||
from bauh.view.util import resource
|
||||
from bauh.view.qt.dialog import show_message
|
||||
|
||||
|
||||
@@ -20,7 +19,7 @@ def ask_root_password(locale_keys: dict):
|
||||
diag = QInputDialog()
|
||||
diag.setInputMode(QInputDialog.TextInput)
|
||||
diag.setTextEchoMode(QLineEdit.Password)
|
||||
diag.setWindowIcon(QIcon(resource.get_path('img/lock.svg', ROOT_DIR)))
|
||||
diag.setWindowIcon(QIcon(resource.get_path('img/lock.svg')))
|
||||
diag.setWindowTitle(locale_keys['popup.root.title'])
|
||||
diag.setLabelText(locale_keys['popup.root.password'] + ':')
|
||||
diag.setCancelButtonText(locale_keys['popup.button.cancel'])
|
||||
|
||||
@@ -2,8 +2,8 @@ from PyQt5.QtWidgets import QComboBox, QStyleFactory, QWidget, QApplication
|
||||
|
||||
from bauh import __app_name__
|
||||
from bauh.commons.html import bold
|
||||
from bauh.core import config
|
||||
from bauh.util import util
|
||||
from bauh.view.core import config
|
||||
from bauh.view.util import util
|
||||
from bauh.view.qt import dialog
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from PyQt5.QtWidgets import QSystemTrayIcon, QMenu
|
||||
from bauh import __app_name__
|
||||
from bauh.api.abstract.controller import SoftwareManager
|
||||
from bauh.api.abstract.model import PackageUpdate
|
||||
from bauh.util import util, resource
|
||||
from bauh.view.util import util, resource
|
||||
from bauh.view.qt.about import AboutDialog
|
||||
from bauh.view.qt.window import ManageWindow
|
||||
|
||||
|
||||
@@ -6,15 +6,15 @@ from PyQt5.QtCore import QEvent, Qt, QSize, pyqtSignal
|
||||
from PyQt5.QtGui import QIcon, QWindowStateChangeEvent, QPixmap, QCursor
|
||||
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QCheckBox, QHeaderView, QToolBar, \
|
||||
QLabel, QPlainTextEdit, QLineEdit, QProgressBar, QPushButton, QComboBox, QMenu, QAction, QApplication
|
||||
from pip._internal.configuration import Configuration
|
||||
|
||||
from bauh.api.abstract.cache import MemoryCache
|
||||
from bauh.api.abstract.context import ApplicationContext
|
||||
from bauh.api.abstract.controller import SoftwareManager
|
||||
from bauh.api.abstract.model import SoftwarePackage, PackageAction
|
||||
from bauh.api.abstract.view import MessageType
|
||||
from bauh.core.config import Configuration
|
||||
from bauh.core.controller import GenericSoftwareManager
|
||||
from bauh.util import util, resource
|
||||
from bauh.view.core.controller import GenericSoftwareManager
|
||||
from bauh.view.util import util, resource
|
||||
from bauh.view.qt import dialog, commons, qt_utils
|
||||
from bauh.view.qt.about import AboutDialog
|
||||
from bauh.view.qt.apps_table import AppsTable, UpdateToggleButton
|
||||
@@ -242,7 +242,10 @@ class ManageWindow(QWidget):
|
||||
self.combo_styles.setStyleSheet('QComboBox {font-size: 12px;}')
|
||||
self.ref_combo_styles = self.toolbar_bottom.addWidget(self.combo_styles)
|
||||
|
||||
bt_settings = IconButton(icon_path=resource.get_path('img/app_settings.svg'), action=self._show_settings_menu, background='#12ABAB')
|
||||
bt_settings = IconButton(icon_path=resource.get_path('img/app_settings.svg'),
|
||||
action=self._show_settings_menu,
|
||||
background='#12ABAB',
|
||||
tooltip=self.i18n['manage_window.bt_settings.tooltip'])
|
||||
self.ref_bt_settings = self.toolbar_bottom.addWidget(bt_settings)
|
||||
|
||||
self.layout.addWidget(self.toolbar_bottom)
|
||||
|
||||
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 283 B |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 820 B After Width: | Height: | Size: 820 B |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
@@ -47,6 +47,8 @@ tray.action.manage=Manage applications
|
||||
tray.action.exit=Quit
|
||||
tray.action.about=About
|
||||
tray.action.refreshing=Refreshing
|
||||
action.info.tooltip=Click here to see information about this application
|
||||
action.settings.tooltip=Click here to open extra actions
|
||||
notification.new_updates=Updates
|
||||
notification.update_selected.success=app(s) updated successfully
|
||||
notification.update_selected.failed=Update failed
|
||||
@@ -111,4 +113,5 @@ exit=exit
|
||||
manage_window.settings.gems=Application types
|
||||
style=style
|
||||
style.change.title=Style change
|
||||
style.change.question=To change the current style is necessary to restart {}. Proceed ?
|
||||
style.change.question=To change the current style is necessary to restart {}. Proceed ?
|
||||
manage_window.bt_settings.tooltip=Click here to open extra actions
|
||||
@@ -49,6 +49,8 @@ tray.action.manage=Administrar aplicativos
|
||||
tray.action.exit=Cerrar
|
||||
tray.action.about=Sobre
|
||||
tray.action.refreshing=Recargando
|
||||
action.info.tooltip=Haga clic aquí para ver informaciones sobre este aplicativo
|
||||
action.settings.tooltip=Haga clic aquí para abrir acciones adicionales
|
||||
notification.new_updates=Actualizaciones
|
||||
notification.update_selected.success=aplicativo(s) actualizado(s) con éxito
|
||||
notification.update_selected.failed=La actualización falló
|
||||
@@ -113,4 +115,5 @@ exit=salir
|
||||
manage_window.settings.gems=Tipos de aplicativos
|
||||
style=estilo
|
||||
style.change.title=Cambio de estilo
|
||||
style.change.question=Para cambiar el estilo actual es necesario reiniciar {}. ¿Proceder?
|
||||
style.change.question=Para cambiar el estilo actual es necesario reiniciar {}. ¿Proceder?
|
||||
manage_window.bt_settings.tooltip=Haga clic aquí para abrir acciones adicionales
|
||||
@@ -99,6 +99,8 @@ ask.continue=Continuar ?
|
||||
cancel=cancelar
|
||||
status.caching_data=Cacheando dados de {} para o disco
|
||||
action.run.tooltip=Clique aqui para iniciar esse aplicativo
|
||||
action.info.tooltip=Clique aqui para ver informações sobre este aplicativo
|
||||
action.settings.tooltip=Clique aqui para abrir ações adicionais
|
||||
any=qualquer
|
||||
manage_window.name_filter.tooltip=Digite aqui para filtrar aplicativos pelo nome
|
||||
manage_window.name_filter.placeholder=Filtrar por nome
|
||||
@@ -113,4 +115,5 @@ exit=sair
|
||||
manage_window.settings.gems=Tipos de aplicativos
|
||||
style=estilo
|
||||
style.change.title=Mudança de estilo
|
||||
style.change.question=Para alterar o estilo atual é necessário reiniciar o {}. Continuar ?
|
||||
style.change.question=Para alterar o estilo atual é necessário reiniciar o {}. Continuar ?
|
||||
manage_window.bt_settings.tooltip=Clique aqui para abrir ações adicionais
|
||||
@@ -2,4 +2,4 @@ from bauh import ROOT_DIR
|
||||
|
||||
|
||||
def get_path(resource_path):
|
||||
return ROOT_DIR + '/resources/' + resource_path
|
||||
return ROOT_DIR + '/view/resources/' + resource_path
|
||||
@@ -7,7 +7,7 @@ import sys
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from bauh import __app_name__
|
||||
from bauh.util import resource
|
||||
from bauh.view.util import resource
|
||||
|
||||
|
||||
def get_locale_keys(key: str = None, locale_dir: str = resource.get_path('locale')):
|
||||