Skip to content

Commit

Permalink
Add software sources into submenu (Adding code from PR #382) (#432)
Browse files Browse the repository at this point in the history
* Add Software Sources option to menu, and do not interrupt main event loop.
  • Loading branch information
rlatosky authored Nov 25, 2024
1 parent 0872522 commit e744ee4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions usr/lib/linuxmint/mintinstall/mintinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,11 @@ def list_header_func(row, before, user_data=None):
self.refresh_cache_menuitem.set_sensitive(False)
submenu.append(self.refresh_cache_menuitem)

software_sources_menuitem = Gtk.MenuItem(label=_("Software sources..."))
software_sources_menuitem.connect("activate", self.open_software_sources)
software_sources_menuitem.show()
submenu.append(software_sources_menuitem)

self.prefs_menuitem = Gtk.MenuItem(label=_("Preferences"))
self.prefs_menuitem.connect("activate", self.on_prefs_clicked)
self.prefs_menuitem.show()
Expand Down Expand Up @@ -1400,6 +1405,15 @@ def load_landing_apps(self, rcache=None):
self.load_featured()
self.load_top_rated()

def open_software_sources(self,_):
# Opens Mint's Software Sources and refreshes the cache afterwards
def on_process_exited(proc, result):
proc.wait_finish(result)
self.refresh_cache()
p = Gio.Subprocess.new(["mintsources"], 0)
# Add a callback when we exit mintsources
p.wait_async(None, on_process_exited)

def should_show_pkginfo(self, pkginfo):
if pkginfo.pkg_hash.startswith("apt"):
return True
Expand Down

0 comments on commit e744ee4

Please sign in to comment.