mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-14 00:04:08 +09:00
Sync current work
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
- Proper credits in About Window
|
||||
|
||||
After 1.0
|
||||
- Separate Orphans Window
|
||||
- Export in batch mode
|
||||
- Copy drop down in batch mode
|
||||
- World domination
|
||||
@@ -37,8 +37,7 @@ template DowngradeWindow : Adw.Window {
|
||||
|
||||
Adw.PreferencesGroup {
|
||||
Adw.SwitchRow mask_row {
|
||||
title: _("Mask this Flatpak");
|
||||
subtitle: _("Ensure that the flatpak will never be updated to a newer version");
|
||||
title: _("Stop Updates");
|
||||
active: true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ class DowngradeWindow(Adw.Window):
|
||||
self.response = self.my_utils.downgradeFlatpak(self.app_ref, self.commit_to_use, self.install_type)
|
||||
|
||||
def onApply(self):
|
||||
self.set_title(_("Downgrading..."))
|
||||
self.set_title(_("Downgrading…"))
|
||||
self.no_close = self.connect("close-request", lambda event: True)
|
||||
self.main_toolbar_view.set_sensitive(False)
|
||||
self.should_pulse = True
|
||||
@@ -150,8 +150,9 @@ class DowngradeWindow(Adw.Window):
|
||||
# Apply
|
||||
self.pulser()
|
||||
self.add_controller(event_controller)
|
||||
self.set_title(_("Fetching Releases..."))
|
||||
self.set_title(_("Fetching Releases…"))
|
||||
self.set_transient_for(parent_window)
|
||||
self.mask_row.set_subtitle(_("Ensure that {} will never be updated to a newer version").format(self.app_name))
|
||||
|
||||
self.generateList()
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ class OrphansWindow(Adw.Window):
|
||||
self.toast_overlay.add_toast(Adw.Toast.new(_("Some apps didn't install")))
|
||||
|
||||
def installHandler(self):
|
||||
self.set_title(_("Installing... This could take a while"))
|
||||
self.set_title(_("Installing… This could take a while"))
|
||||
task = Gio.Task.new(None, None, self.installCallback)
|
||||
task.run_in_thread(lambda _task, _obj, _data, _cancellable, id_list=self.selected_dirs, remote=self.selected_remote, app_type=self.selected_remote_type: self.my_utils.installFlatpak(id_list, remote, app_type))
|
||||
|
||||
|
||||
@@ -4,6 +4,12 @@ import subprocess
|
||||
import os
|
||||
|
||||
def show_properties_window(widget, index, window):
|
||||
|
||||
app_name = window.host_flatpaks[index][0]
|
||||
app_id = window.host_flatpaks[index][2]
|
||||
install_type = window.host_flatpaks[index][7]
|
||||
data_folder = window.user_data_path + app_id
|
||||
|
||||
properties_window = Adw.Window(title=_("{} Properties").format(window.host_flatpaks[index][0]))
|
||||
properties_window.set_default_size(350, 600)
|
||||
properties_window.set_size_request(260, 230)
|
||||
@@ -16,9 +22,9 @@ def show_properties_window(widget, index, window):
|
||||
properties_toast_overlay.set_child(outer_box)
|
||||
properties_box = Gtk.Box(orientation="vertical", vexpand=True)
|
||||
properties_clamp = Adw.Clamp()
|
||||
eol_app_banner = Adw.Banner(title=_("This Flatpak has reached its End of Life and will not receive any security updates"))
|
||||
eol_runtime_banner = Adw.Banner(title=_("The runtime used by this app has reached its End of Life and will not receive any security updates"))
|
||||
mask_banner = Adw.Banner(title=_("This Flatpak has been masked and will not be updated"))
|
||||
eol_app_banner = Adw.Banner(title=_("{} has reached its End of Life and will not receive any security updates").format(app_name))
|
||||
eol_runtime_banner = Adw.Banner(title=_("{}' runtime has reached its End of Life and will not receive any security updates").format(app_name))
|
||||
mask_banner = Adw.Banner(title=_("{} is masked and will not be updated").format(window.host_flatpaks[index][0]))
|
||||
outer_box.append(eol_app_banner)
|
||||
outer_box.append(eol_runtime_banner)
|
||||
outer_box.append(mask_banner)
|
||||
@@ -62,11 +68,6 @@ def show_properties_window(widget, index, window):
|
||||
event_controller.connect("key-pressed", key_handler)
|
||||
properties_window.add_controller(event_controller)
|
||||
|
||||
app_name = window.host_flatpaks[index][0]
|
||||
app_id = window.host_flatpaks[index][2]
|
||||
install_type = window.host_flatpaks[index][7]
|
||||
data_folder = window.user_data_path + app_id
|
||||
|
||||
def on_response(_a, response_id, _b):
|
||||
if response_id != "continue":
|
||||
return
|
||||
@@ -180,7 +181,7 @@ def show_properties_window(widget, index, window):
|
||||
|
||||
if app_id in system_mask_list or app_id in user_mask_list:
|
||||
mask_banner.set_revealed(True)
|
||||
mask_banner.set_button_label(_("Unmask"))
|
||||
mask_banner.set_button_label(_("Enable Updates"))
|
||||
mask_banner.connect("button-clicked", lambda *_: maskHandler())
|
||||
|
||||
properties_window.set_content(properties_title_bar)
|
||||
|
||||
@@ -297,15 +297,15 @@ class WarehouseWindow(Adw.ApplicationWindow):
|
||||
flatpak_row.set_subtitle(app_id)
|
||||
|
||||
if "eol" in self.host_flatpaks[index][12]:
|
||||
eol_app_label = Gtk.Label(label=_("EOL"), valign=Gtk.Align.CENTER, tooltip_text=_("This Flatpak has reached its End of Life and will not receive any security updates"))
|
||||
eol_app_label = Gtk.Label(label=_("EOL"), valign=Gtk.Align.CENTER, tooltip_text=_("{} has reached its End of Life and will not receive any security updates").format(app_name))
|
||||
eol_app_label.add_css_class("error")
|
||||
|
||||
if self.host_flatpaks[index][13] in self.eol_list:
|
||||
eol_runtime_label = Gtk.Label(label=_("EOL"), valign=Gtk.Align.CENTER, tooltip_text=_("The runtime used by this app has reached its End of Life and will not receive any security updates"))
|
||||
eol_runtime_label = Gtk.Label(label=_("EOL"), valign=Gtk.Align.CENTER, tooltip_text=_("{}' runtime has reached its End of Life and will not receive any security updates").format(app_name))
|
||||
eol_runtime_label.add_css_class("error")
|
||||
flatpak_row.add_suffix(eol_runtime_label)
|
||||
|
||||
mask_label = Gtk.Label(label=_("Masked"), valign=Gtk.Align.CENTER, tooltip_text=_("This Flatpak is masked and will not be updated"), visible=False)
|
||||
mask_label = Gtk.Label(label=_("Updates Disabled"), hexpand=True, wrap=True, justify=Gtk.Justification.RIGHT, valign=Gtk.Align.CENTER, tooltip_text=_("{} is masked and will not be updated").format(app_name), visible=False)
|
||||
flatpak_row.add_suffix(mask_label)
|
||||
# ^ This is up here as we need to add this to flatpak_rows regardless of if its visible or not
|
||||
if app_id in self.system_mask_list or app_id in self.user_mask_list:
|
||||
@@ -356,7 +356,7 @@ class WarehouseWindow(Adw.ApplicationWindow):
|
||||
row_menu_model.append_item(run_item)
|
||||
|
||||
self.create_action(("mask" + str(index)), lambda *_, id=app_id, type=install_type, index=index: self.maskFlatpak(id, type, index))
|
||||
mask_item = Gio.MenuItem.new(_("Toggle Mask"), f"win.mask{index}")
|
||||
mask_item = Gio.MenuItem.new(_("Disable Updates"), f"win.mask{index}")
|
||||
row_menu_model.append_item(mask_item)
|
||||
|
||||
# if os.path.exists(self.user_data_path + app_id):
|
||||
@@ -388,21 +388,31 @@ class WarehouseWindow(Adw.ApplicationWindow):
|
||||
|
||||
def maskFlatpak(self, id, type, index):
|
||||
is_masked = self.flatpak_rows[index][7].get_visible() # Check the visibility of the mask label to see if the flatpak is masked
|
||||
response = []
|
||||
result = []
|
||||
name = self.host_flatpaks[index][0]
|
||||
|
||||
def callback():
|
||||
if response[0] == 1:
|
||||
name = self.host_flatpaks[index][0]
|
||||
if result[0] == 1:
|
||||
self.toast_overlay.add_toast(Adw.Toast.new(_("Could not toggle {}'s mask").format(name)))
|
||||
return
|
||||
self.flatpak_rows[index][7].set_visible(not is_masked)
|
||||
|
||||
def thread():
|
||||
response.append(self.my_utils.maskFlatpak(id, type, is_masked))
|
||||
|
||||
task = Gio.Task.new(None, None, lambda *_: callback())
|
||||
task.run_in_thread(lambda *_: thread())
|
||||
def onContinue(dialog, response):
|
||||
if response == "cancel":
|
||||
return
|
||||
task = Gio.Task.new(None, None, lambda *_: callback())
|
||||
task.run_in_thread(lambda *_: result.append(self.my_utils.maskFlatpak(id, type, is_masked)))
|
||||
|
||||
if is_masked:
|
||||
onContinue(self, None)
|
||||
else:
|
||||
dialog = Adw.MessageDialog.new(self, _("Disable Updates for {}?").format(name))
|
||||
dialog.set_body(_("This will mask {} ensuring it will never recieve any feature or security updates.").format(name))
|
||||
dialog.add_response("cancel", _("Cancel"))
|
||||
dialog.set_close_response("cancel")
|
||||
dialog.add_response("continue", _("Disable Updates"))
|
||||
dialog.connect("response", onContinue)
|
||||
dialog.present()
|
||||
|
||||
def copyItem(self, to_copy, to_toast=None):
|
||||
self.clipboard.set(to_copy)
|
||||
|
||||
Reference in New Issue
Block a user