Do not allow the uninstalltion of Warehouse

This commit is contained in:
heliguy4599
2024-02-15 18:15:57 -05:00
parent 1086b11ff0
commit 711a61c101
3 changed files with 21 additions and 14 deletions

View File

@@ -1,5 +1,9 @@
- [ ] Uses standard keyboard shortcuts ([more info](https://developer.gnome.org/hig/reference/keyboard.html))
## Changes needed before acceptance into GNOME Circle
### This list may be extended in the future
#### Metadata
- [ ] .doap-file in repository exists and is up-to-date ([more info](https://gitlab.gnome.org/World/apps-for-gnome/-/blob/main/METADATA.md#doap))
- [x] Close selection mode after batch action
- [ ] Change app summary
- [ ] Fix the reload lag
- [x] Do not allow uninstallation of Warehouse
- [x] Add tooltip text to Snapshot Window's row buttons
- [ ] Fix subtitle issue in Leftover Data Window

View File

@@ -199,7 +199,7 @@ class AppRow(Adw.ActionRow):
row_menu_model.append_submenu(_("Copy"), copy_menu_model)
if "runtime" not in parent_window.host_flatpaks[index][12]:
if "runtime" not in parent_window.host_flatpaks[index][12] and self.app_id != "io.github.flattool.Warehouse":
parent_window.create_action(
("run" + str(index)),
lambda *_a, ref=self.app_ref, name=self.app_name: parent_window.run_app_thread(
@@ -209,14 +209,15 @@ 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 *_: parent_window.uninstall_button_handler(
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)
if self.app_id != "io.github.flattool.Warehouse":
parent_window.create_action(
("uninstall" + str(index)),
lambda *_: parent_window.uninstall_button_handler(
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)
data_menu_model = Gio.Menu()

View File

@@ -320,6 +320,8 @@ class WarehouseWindow(Adw.ApplicationWindow):
def create_row(self, index):
row = AppRow(self, self.host_flatpaks, index)
if row.app_id == "io.github.flattool.Warehouse":
row.tickbox.set_sensitive(False)
self.flatpaks_list_box.insert(row, index)
def generate_list_of_flatpaks(self):
@@ -654,7 +656,7 @@ class WarehouseWindow(Adw.ApplicationWindow):
i = 0
while self.flatpaks_list_box.get_row_at_index(i) != None:
current = self.flatpaks_list_box.get_row_at_index(i)
if current.get_visible() == True:
if (current.get_visible() == True) and (current.app_id != "io.github.flattool.Warehouse"):
current.tickbox.set_active(should_select_all)
i += 1