Skip to content

Commit 8e7fb85

Browse files
committed
With command line option "show", set to details page even...
...if mintinstall window is already open
1 parent 79ca730 commit 8e7fb85

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

usr/lib/linuxmint/mintinstall/mintinstall.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,19 @@ def do_command_line(self, command_line, data=None):
703703
elif num > 1 and args[1] == "list-flatpak":
704704
sys.exit(self.export_listing(flatpak_only=True))
705705
elif num == 3 and args[1] == "show":
706-
self.show_on_startup_pkg = args[2]
706+
target_pkg = args[2]
707+
if self.gui_ready:
708+
pkginfo = self.installer.find_pkginfo(target_pkg, installer.PKG_TYPE_APT)
709+
if not pkginfo:
710+
pkginfo = self.installer.find_pkginfo(target_pkg, installer.PKG_TYPE_FLATPAK)
711+
if pkginfo:
712+
self.show_package(pkginfo, self.PAGE_LANDING)
713+
self.main_window.present()
714+
else:
715+
print(f"MintInstall: Package {target_pkg} not found.")
716+
else:
717+
self.show_on_startup_pkg = target_pkg
718+
707719
self.activate()
708720
return 0
709721
elif num == 3 and args[1] == "install":
@@ -2189,6 +2201,7 @@ def finished_loading_packages(self):
21892201
self.show_package(pkginfo, self.PAGE_LANDING)
21902202
else:
21912203
print(f"MintInstall: Package {self.show_on_startup_pkg} not found.")
2204+
self.show_on_startup_pkg = None
21922205

21932206
if self.install_on_startup_file is not None:
21942207
self.handle_command_line_install(self.install_on_startup_file)

0 commit comments

Comments
 (0)