← Back to team overview

kabikaboo team mailing list archive

[Bug 501644] Re: v1.7 - Duplicate Instance Detection Fails

 

I do want to be able to run multiple instances because I can have
multiple .kaboo documents going at any one time.

Tracking which files are open is an idea worth exploring.  The main
issue is with unexpected crashes, and making sure the user isn't stopped
from opening a file, when the program thinks its open but it isnt.  So
if I'm working on file X and my computer reboots, then we would have to
detect that and deal with that.  I'm not sure if this is 100%
possible... maybe bring up a dialog on startup asking user to allow them
to open that file anyways?

However I think we may be shooting our selves in the foot if we try to
stop users from opening the same file twice.  It is a nice feature to
have, but, the user may have a bizarre reason to do so: they might want
to copy that file or some such.  You and I would never do that but some
one might because they are used to other programs allowing this...  (I'm
thinking abiword)

I think the best behaviour may be:
- When Kabikaboo starts, check if its the only running instance:
-- If it is, open the last file (if set)
-- If it is not, start a new file
- When a user opens a file, check to see if another running instance has that file open:
-- If it is already open, pop a warning dialog to the user, asking if they really want to continue

cheers
dave

-- 
v1.7 - Duplicate Instance Detection Fails
https://bugs.launchpad.net/bugs/501644
You received this bug notification because you are a member of Kabikaboo
Team, which is subscribed to Kabikaboo.

Status in Kabikaboo: Confirmed

Bug description:
In 1.6 this worked.  
It should be a simple fix for Linux.

Modify the search function in kabikaboo.py ~ line 2938:

# check for duplicate instance of kabikaboo
    def check_for_duplicate_instance(self):
        result = False
        # WARNING: LINUX ONLY CODE
        output = commands.getoutput('ps -ax')
        # check for 2 or more regular instances
        if output.count('python kabikaboo.py') >= 2:
            result = True
        # check for instance and development instance
        if output.count('python kabikaboo.py') >= 1 and output.count('python -W ignore::DeprecationWarning kabikaboo.py') >= 1:
            result = True
        if result:
            print 'Duplicate instance of Kabikaboo already running.'
            print 'Will not open last file in this case.'
            print 'Starting with new document.'
            self.file.working_file = ''
        return result

Windows will need different code to do this.





References