Do stuff in already open applications rather than in new instances #4
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When an application program is launched, Nasin should be able to figure out if it is already running, and if so, send messages to it. This mainly applies to applications that satisfy ApplicationURLOpener, but it could also apply to applications that you might have multiple windows of in general (like a calculator). For the second case, we likely will need another API, likely a NewWindow behavior of Application.
To accomplish this, Nasin needs to be able to parse command line args. Since a GUI application doesn't really require a super slick and convenient CLI interface, flag will work just fine here.
The only problem is how to allow A) the application to parse cli args and B) allow nasin to parse cli args, while being able to do B without A, and being able to do B while the configuration for A is not yet defined. We cannot solve this by parsing the arguments twice because the parsing depends on the configuration of A.
This could be done over dbus, however that is not cross platform. Perhaps pid files could be utilized.
The clear solution here is to create another Application interface with an extra AddFlags method that Nasin can check for:
AddFlags, if it exists, will be called before Init, and it will add flags to the default flag set that Nasin uses.