mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 18:34:16 +02:00
[appimage] improvement -> manual file installation default search path set to '~/Downloads'
This commit is contained in:
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
|
|
||||||
## [0.9.7] 2020
|
## [0.9.7] 2020
|
||||||
### Improvements
|
### Improvements
|
||||||
|
- AppImage
|
||||||
|
- Manual file installation default search path set to '~/Downloads'
|
||||||
- Arch
|
- Arch
|
||||||
- upgrade summary: displaying the reason a given package must be installed
|
- upgrade summary: displaying the reason a given package must be installed
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
|||||||
@@ -182,13 +182,14 @@ class FormComponent(ViewComponent):
|
|||||||
class FileChooserComponent(ViewComponent):
|
class FileChooserComponent(ViewComponent):
|
||||||
|
|
||||||
def __init__(self, allowed_extensions: Set[str] = None, label: str = None, tooltip: str = None,
|
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):
|
file_path: str = None, max_width: int = -1, id_: str = None, search_path: str = None):
|
||||||
super(FileChooserComponent, self).__init__(id_=id_)
|
super(FileChooserComponent, self).__init__(id_=id_)
|
||||||
self.label = label
|
self.label = label
|
||||||
self.allowed_extensions = allowed_extensions
|
self.allowed_extensions = allowed_extensions
|
||||||
self.file_path = file_path
|
self.file_path = file_path
|
||||||
self.tooltip = tooltip
|
self.tooltip = tooltip
|
||||||
self.max_width = max_width
|
self.max_width = max_width
|
||||||
|
self.search_path = search_path
|
||||||
|
|
||||||
|
|
||||||
class TabComponent(ViewComponent):
|
class TabComponent(ViewComponent):
|
||||||
|
|||||||
@@ -69,7 +69,12 @@ class AppImageManager(SoftwareManager):
|
|||||||
icon_path=resource.get_path('img/upgrade.svg', ROOT_DIR))]
|
icon_path=resource.get_path('img/upgrade.svg', ROOT_DIR))]
|
||||||
|
|
||||||
def install_file(self, root_password: str, watcher: ProcessWatcher) -> bool:
|
def install_file(self, root_password: str, watcher: ProcessWatcher) -> bool:
|
||||||
file_chooser = FileChooserComponent(label=self.i18n['file'].capitalize(), allowed_extensions={'AppImage'})
|
default_path = '{}/Downloads'.format(str(Path.home()))
|
||||||
|
|
||||||
|
if not os.path.isdir(default_path):
|
||||||
|
default_path = None
|
||||||
|
|
||||||
|
file_chooser = FileChooserComponent(label=self.i18n['file'].capitalize(), allowed_extensions={'AppImage'}, search_path=default_path)
|
||||||
input_name = TextInputComponent(label=self.i18n['name'].capitalize())
|
input_name = TextInputComponent(label=self.i18n['name'].capitalize())
|
||||||
input_version = TextInputComponent(label=self.i18n['version'].capitalize())
|
input_version = TextInputComponent(label=self.i18n['version'].capitalize())
|
||||||
input_description = TextInputComponent(label=self.i18n['description'].capitalize())
|
input_description = TextInputComponent(label=self.i18n['description'].capitalize())
|
||||||
|
|||||||
@@ -840,6 +840,8 @@ class FormQt(QGroupBox):
|
|||||||
|
|
||||||
if c.file_path and os.path.isfile(c.file_path):
|
if c.file_path and os.path.isfile(c.file_path):
|
||||||
cur_path = c.file_path
|
cur_path = c.file_path
|
||||||
|
elif c.search_path and os.path.exists(c.search_path):
|
||||||
|
cur_path = c.search_path
|
||||||
else:
|
else:
|
||||||
cur_path = str(Path.home())
|
cur_path = str(Path.home())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user