linuxmint / mintinstall

Software Manager
137 stars 98 forks source link

[Next] Added "Software Sources" option to submenu #382

Open loganjameshart opened 1 year ago

loganjameshart commented 1 year ago

From Issue #369

Creates a submenu item which opens Mint's "Software Sources" application, then refreshes the cache immediately after.

mtwebster commented 10 months ago

Hi, I like the idea but it needs to be done a bit differently than this - this freezes mintinstall until mintsources closes. There's an event loop running that needs to continue running while waiting on the return, or we get 'window is not responding' dialogs and more.

Something more along the lines of this is needed:

# callback function for later
def on_process_exited(proc, result):
    proc.wait_finish(result)
    # now refresh...

# Launch mintsources
p = Gio.Subprocess.new(["mintsources"], 0)
# Add a callback for when it finishes...
p.wait_async(None, on_process_exited)
...
# other things can keep going in the meantime...
...