After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 453670 - patch: open diffs in new tabs of running instance
patch: open diffs in new tabs of running instance
Status: RESOLVED FIXED
Product: meld
Classification: Other
Component: general
unspecified
Other All
: Normal minor
: ---
Assigned To: Stephen Kennedy
Stephen Kennedy
: 396913 578901 616466 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-07-04 12:42 UTC by Kacper Wysocki
Modified: 2012-06-10 22:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
open diffs in existing instance of meld, through dbus (5.50 KB, patch)
2007-07-04 12:44 UTC, Kacper Wysocki
none Details | Review
diffs in new tabs of running instance - for meld 1.1.5 (6.09 KB, patch)
2007-07-26 09:53 UTC, Kacper Wysocki
none Details | Review
DBus single app instance enforcment patch (for 1.2.1) (5.43 KB, patch)
2009-04-18 05:22 UTC, Jeff Oliver
none Details | Review

Description Kacper Wysocki 2007-07-04 12:42:48 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:
Comment 1 Kacper Wysocki 2007-07-04 12:44:17 UTC
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
Comment 2 Kacper Wysocki 2007-07-26 09:53:13 UTC
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
Comment 3 Stephen Kennedy 2007-07-31 22:35:08 UTC
*** Bug 396913 has been marked as a duplicate of this bug. ***
Comment 4 Stephen Kennedy 2008-07-07 20:41:56 UTC
[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.
Comment 5 Alexander Kojevnikov 2009-04-14 06:32:51 UTC
*** Bug 578901 has been marked as a duplicate of this bug. ***
Comment 6 Jeff Oliver 2009-04-17 04:19:04 UTC
 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?
Comment 7 Jeff Oliver 2009-04-18 05:22:12 UTC
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.
Comment 8 Kacper Wysocki 2009-04-18 11:17:55 UTC
I'm glad someone's picking up and bringing this work forward. I've reviewed the patch and see only improvements. Good stuff.
Comment 9 Kai Willadsen 2012-06-10 22:42:11 UTC
*** Bug 616466 has been marked as a duplicate of this bug. ***
Comment 10 Kai Willadsen 2012-06-10 22:43:18 UTC
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.