GNOME Bugzilla – Bug 453670
patch: open diffs in new tabs of running instance
Last modified: 2012-06-10 22:43:18 UTC
Meld already supports tabs. Lets open new diffs in new tabs rather than opening a new meld instance. This is ready and implemented, and the patch is available at http://www.cs.mcgill.ca/~kwysoc/hacks/#meld and was announced on the mailing list in November 2006. Other information:
Created attachment 91178 [details] [review] open diffs in existing instance of meld, through dbus patch applies to meld versions 1.1.2 through 1.1.4
Created attachment 92444 [details] [review] diffs in new tabs of running instance - for meld 1.1.5 Previous patch adapted for meld 1.1.5. Main difference: adapted to the use of optparse. The patch does three things: 1) moves argument parsing into a method 2) instruments this method with dbus 3) checks dbus on invocation of meld
*** Bug 396913 has been marked as a duplicate of this bug. ***
[posted to the mailing list] There are two features which I wanted to add to your patch 1) blocking mode: When a tab is opened from dbus, it should block and return the exit status from the tab. This is the killer application of dbus imho since it makes it much more friendly to vc merge scripts (which currently have to rely on timestamp sniffing etc). This needs some work on the meld side to actually provide the exit status. 2) If there are multiple meld instances running, when the dbus instance exits, one of the other instances should take over. Otherwise you can have several melds none of which respond to dbus requests.
*** Bug 578901 has been marked as a duplicate of this bug. ***
What is the typical use case of this tool? Is it more desirable to make this tool enforce a single instance? or should this tool allow multiple instances as it does now? Is it possible to have a single process run multiple main windows?
Created attachment 132862 [details] [review] DBus single app instance enforcment patch (for 1.2.1) This patch is a reimplementation of the previously posted patch for the current SVN code at the time. There are a few changes since that last patch: 1) Removed the -n, force a new window, command line option. Causes too much complexity at the moment. If you limit meld to a single tab-based app, you don't need to worry about multi-process synchronization, etc. 2) Separated the command line parsing from the actions taken afterwards. There is a new open_tab function that actually opens a new diff tab. 3) There is a bug in the previous patches, where an illegal command line can cause the original instance to exit. This is because the behavior of parse_args is to exit when something is wrong with the command line. Instead of exiting, I modified it to raise an exception. So, for the first instance, if there is an exception, it exists. For the DBus accessed option parsing, the access function just returns instead of exiting.
I'm glad someone's picking up and bringing this work forward. I've reviewed the patch and see only improvements. Good stuff.
*** Bug 616466 has been marked as a duplicate of this bug. ***
I've finally committed the patch from the "Opening new tabs in existing instance" thread on the mailing list. New tab opening support via D-Bus will be available in the first release of the 1.7 series. Thanks all for the contributions, and apologies that it... took a while.