-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tim Lauridsen
committed
Apr 19, 2023
1 parent
869c6bb
commit 4b5c05c
Showing
3 changed files
with
96 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
from yumex.backend.dnf import YumexPackage | ||
from yumex.backend.presenter import YumexPresenter | ||
from yumex.constants import ROOTDIR, APP_ID, PACKAGE_COLUMNS | ||
from yumex.ui.dialogs import GPGDialog | ||
from yumex.ui.flatpak_result import YumexFlatpakResult | ||
from yumex.ui.flatpak_view import YumexFlatpakView | ||
from yumex.ui.pachage_view import YumexPackageView | ||
|
@@ -153,6 +154,7 @@ def show_message(self, title, timeout=2): | |
toast = Adw.Toast(title=title) | ||
toast.set_timeout(timeout) | ||
self.toast_overlay.add_toast(toast) | ||
log(f"show_message : {title}") | ||
return toast | ||
|
||
def load_packages(self, pkg_filter: PackageFilter): | ||
|
@@ -179,11 +181,29 @@ def _do_transaction(self, queued): | |
transaction_result.show() | ||
if transaction_result.confirm: | ||
# run the transaction | ||
self.progress.show() | ||
self.progress.set_title(_("Running Transaction")) | ||
result: TransactionResult = root_backend.run_transaction() | ||
if result.completed: | ||
return True | ||
while True: | ||
self.progress.show() | ||
self.progress.set_title(_("Running Transaction")) | ||
result: TransactionResult = root_backend.run_transaction() | ||
if result.completed: | ||
return True | ||
if result.key_install and result.key_values: | ||
self.progress.hide() | ||
dialog = GPGDialog(self, result.key_values) | ||
dialog.set_transient_for(self) | ||
dialog.show() | ||
log(f"Install key: {dialog.install_key}") | ||
if dialog.install_key: | ||
log("Re-run transaction and import GPG keys") | ||
# tell the backend to import this gpg key in next run | ||
root_backend.do_gpg_import() | ||
# rebuild the transaction again, before re-run | ||
root_backend.build_transaction(queued) | ||
continue | ||
else: | ||
return True | ||
else: | ||
break | ||
if result.error: | ||
self.show_message(result.error) | ||
return False | ||
|
@@ -248,6 +268,18 @@ def on_package_selection_changed(self, widget, pkg: YumexPackage): | |
|
||
def on_testing(self, *args): | ||
"""Used to test gui stuff <Shift><Ctrl>T to activate""" | ||
values = ( | ||
"rpmfusion-nonfree-release,0,38,1,noarch,rpmfusion-nonfree", | ||
"RPM Fusion nonfree repository for Fedora (2020) <[email protected]>", | ||
"94843C65", | ||
"file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-38", | ||
1571667044, | ||
) | ||
dialog = GPGDialog(self, values) | ||
dialog.set_transient_for(self) | ||
dialog.show() | ||
if dialog.install_key: | ||
log("Re-run transaction and import GPG keys") | ||
pass | ||
|
||
def on_apply_actions_clicked(self, *_args): | ||
|