mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-15 00:34:42 +09:00
Sync current work
This commit is contained in:
@@ -22,6 +22,9 @@ class AppRow(Adw.ActionRow):
|
||||
self.set_visible(is_visible)
|
||||
self.set_selectable(False)
|
||||
|
||||
def set_masked(self, is_masked):
|
||||
self.mask_label.set_visible(is_masked)
|
||||
|
||||
def __init__(self, parent_window, host_flatpaks, index, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.my_utils = myUtils(parent_window)
|
||||
@@ -112,7 +115,7 @@ class AppRow(Adw.ActionRow):
|
||||
run_item = Gio.MenuItem.new(_("Open"), f"win.run{index}")
|
||||
row_menu_model.append_item(run_item)
|
||||
|
||||
parent_window.create_action(("uninstall" + str(index)), lambda *_, index=index: parent_window.uninstallButtonHandler(self, index))
|
||||
parent_window.create_action(("uninstall" + str(index)), lambda *_: parent_window.uninstallButtonHandler(self, self.app_name, self.app_ref, self.app_id))
|
||||
uninstall_item = Gio.MenuItem.new(_("Uninstall"), f"win.uninstall{index}")
|
||||
row_menu_model.append_item(uninstall_item)
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ class myUtils:
|
||||
|
||||
def uninstallFlatpak(self, ref_arr, type_arr, should_trash, progress_bar=None):
|
||||
self.uninstall_success = True
|
||||
|
||||
print(ref_arr)
|
||||
to_uninstall = []
|
||||
for i in range(len(ref_arr)):
|
||||
to_uninstall.append([ref_arr[i], type_arr[i]])
|
||||
|
||||
@@ -105,8 +105,7 @@ class DowngradeWindow(Adw.Window):
|
||||
if self.my_utils.maskFlatpak(self.app_id, self.install_type) != 0:
|
||||
self.parent_window.toast_overlay.add_toast(Adw.Toast.new(_("Could not disable updates for {}").format(self.app_name)))
|
||||
|
||||
self.parent_window.flatpaks_list_box.remove(self.parent_window.flatpaks_list_box.get_row_at_index(self.index))
|
||||
self.parent_window.create_row(self.index)
|
||||
self.parent_window.refresh_list_of_flatpaks(self, False)
|
||||
self.close()
|
||||
|
||||
def downgradeThread(self):
|
||||
|
||||
@@ -109,7 +109,7 @@ class PropertiesWindow(Adw.Window):
|
||||
PropertiesWindow(i, self.host_flatpaks, self.parent_window)
|
||||
|
||||
def trashDataHandler(self):
|
||||
def onResponse(response, *args):
|
||||
def onResponse(_none, response, widget):
|
||||
if response == "cancel":
|
||||
return
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@ class WarehouseWindow(Adw.ApplicationWindow):
|
||||
self.uninstallButtonsEnable(True)
|
||||
self.main_stack.set_visible_child(self.main_box)
|
||||
if self.my_utils.uninstall_success:
|
||||
self.refresh_list_of_flatpaks(self, False)
|
||||
self.toast_overlay.add_toast(Adw.Toast.new(_("Uninstalled successfully")))
|
||||
else:
|
||||
self.toast_overlay.add_toast(Adw.Toast.new(_("Could not uninstall some apps")))
|
||||
@@ -199,16 +200,11 @@ class WarehouseWindow(Adw.ApplicationWindow):
|
||||
dialog.set_response_appearance("continue", Adw.ResponseAppearance.DESTRUCTIVE)
|
||||
Gtk.Window.present(dialog)
|
||||
|
||||
def uninstallButtonHandler(self, _widget, index):
|
||||
def uninstallButtonHandler(self, widget, name, ref, id):
|
||||
if self.currently_uninstalling:
|
||||
self.toast_overlay.add_toast(Adw.Toast.new(_("Cannot uninstall while already uninstalling")))
|
||||
return
|
||||
|
||||
name = self.host_flatpaks[index][0]
|
||||
ref = self.host_flatpaks[index][8]
|
||||
id = self.host_flatpaks[index][2]
|
||||
self.flatpak_rows[index][1] = True
|
||||
|
||||
def uninstallResponse(_idk, response_id, _widget):
|
||||
if response_id == "cancel":
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user