martinrotter / textosaurus

Cross-platform text editor based on Qt and Scintilla.
GNU General Public License v3.0
284 stars 44 forks source link

Having become multi-profile, Textosaurus should now also be able to initiate multiple instances #70

Closed paoloschi closed 5 years ago

paoloschi commented 5 years ago

Brief description of the issue.

Running textosaurus-master-4d7028b-linux64.AppImage (02-01-2019 07:48:46) I could appreciate the new functionality brought by the option -c, --config <directory> Use an alternate configuration directory. (THANKS!:) With this enhancement Textosaurus has become a multi-profile application that allows users to target the most appropriate configuration for each different application task. In all likelihood, there will be a need to work by opening several profiles at the same time and this is not possible at the moment...

What is the expected result?

when the instance generated by the

textosaurus -c /path/to/config-1

command is still open, the user can execute

textosaurus -c /path/to/config-2

by opening a new Textosaurus work session in a separate window

What actually happened?

textosaurus -c /path/to/config-2
[textosaurus] WARNING: Another instance of the application is already running. Notifying it. (2019-02-03 13:03:41)

Other information (logs, see Wiki)

However, for users who do not need to maintain multiple configurations for Textosaurus, the current status that allows a single instance will most likely remain preferable! For this reason, I think possibility of working with multiple instances would be appropriate to add it as a new general OPTION

martinrotter commented 5 years ago

Would it be fine to allow user to turn off "single instance check" via command line switch? Something like -s, --no-single-instance option which will start new Textosaurus instance no matter what. This option will particularly make sense with -c option, so that you will be able to launch multiple completely independent options of Textosaurus with separate user data/config.

What you think?

paoloschi commented 5 years ago

I just think that it would be perfect. Also, the need to operate via command line options wouldn't be systemically forced as the desktop user can define separate starters for each different application task where to set the command line options once and for all. I'm obviously referring to *.desktop launchers in Linux; by not using it, I don't know the equivalent method available to the Windows user

martinrotter commented 5 years ago

Done, pls check via development binary if it works. See -h for the new switch syntax.

paoloschi commented 5 years ago

textosaurus-master-3b576a4-linux64.AppImage

The -n option produces the expected result. In the session launched with -n I'm noting that if I check Tools/Settings/General/Restore previous session without changes to the initial empty document I can't close the application: a dialog informs me that: "Document cannot be saved to file because the destination is probably non-writable."

There is also that the session started with -n now does not remember the status of the Sidebars when I relaunch the application.

update Oh, now I see why the two things that I brought back up here happened to me. I had given a string to -c which is not a full-path but just the name of a directory, leaving Textosaurus to create it for me in the current path. I take note that I must always indicate a full-path for -c (the other times I had done it but without awareness it was necessary...) I was running with -c test -n without the test directory being created! Sorry for the noise...

martinrotter commented 5 years ago

OH, ok. If you experience any problems, just make sure to write clearly all steps to reproduce the problem.

I will enhance the description of -c option.

martinrotter commented 5 years ago

https://github.com/martinrotter/textosaurus/commit/6e2a81ae99a52449dda0e25deceb351a460b0087