Storybook

Storybook - Open Source Novel Writing Software

  • Before adding a new feature request please check if an identical task already exists.
  • Describe your new feature request as short and precise as possible. Use the possibility of attaching a screen shot or sketch.
  • Text can be formatted using the Dokuwiki Syntax.

Storybook Homepage

Tasklist

FS#19 - Multiple Storybook instances

Attached to Project: Storybook
Opened by Intertec (Intertec) - Wednesday, 09 November 2011, 13:40 GMT+2
Last edited by Intertec (Intertec) - Thursday, 26 April 2012, 14:26 GMT+2
Task Type Refactoring
Category Backend
Status Closed
Assigned To No-one
Operating System All
Severity High
Priority High
Reported Version 3.1.0
Due in Version 4.0.0
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

  • allow multiple instances (multiple projects) to be opened
  • no MDI, instead span the current process and show the main window again like it is in OpenOffice and others

Single Application Instance

	private static boolean lockInstance(final String lockFile) {
		try {
			final File file = new File(lockFile);
			final RandomAccessFile randomAccessFile = new RandomAccessFile(
					file, "rw");
			final FileLock fileLock = randomAccessFile.getChannel().tryLock();
			if (fileLock != null) {
				Runtime.getRuntime().addShutdownHook(new Thread() {
					public void run() {
						try {
							fileLock.release();
							randomAccessFile.close();
							file.delete();
						} catch (Exception e) {
							System.err.println("Unable to remove lock file: "
									+ lockFile);
							e.printStackTrace();
						}
					}
				});
				return true;
			}
		} catch (Exception e) {
			System.err
					.println("Unable to create and/or lock file: " + lockFile);
			e.printStackTrace();
		}
		return false;
	}
This task depends upon

Closed by  Intertec (Intertec)
Thursday, 26 April 2012, 14:26 GMT+2
Reason for closing:  Implemented

Loading...