Download it now!
Bug 30508 - Feature Wish: "Edit in external editor"
Summary: Feature Wish: "Edit in external editor"
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: low enhancement
Assignee: Suren
URL:
Whiteboard:
Keywords: easyHack
Depends on:
Blocks:
 
Reported: 2010-09-30 10:27 UTC by Tobias Florek
Modified: 2015-12-18 09:55 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Snippet for saving to a temporary file (1.13 KB, text/plain)
2010-11-07 05:48 UTC, Suren
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Florek 2010-09-30 10:27:04 UTC
A feature as the following would have saved me an hour or more yesterday.

for any image you have included in a document, have a contextmenu item, which says "Edit in external editor", which does just that. copies the image to /tmp and open an external editor (say gimp, should maybe be a preference somewhere), afterwards the image in the document should be replaced by the edited one.

maybe use inotify or something similar to detect changes to the editable copy.
Comment 1 Jan Holesovsky 2010-10-14 05:01:11 UTC
Sounds nice - Thorsten, anything we could easily achieve?
Comment 2 Thorsten Behrens (CIB) 2010-10-14 05:49:59 UTC
Nice idea, and not too hard to implement - adding easy2dev keyword - Tobias, would you even want to have a shot at it, we'll help with pointing to the right places of course?
Comment 3 Suren 2010-11-01 10:36:22 UTC
Thorsten, I can take this up. There is a query though. /tmp method will be only for Linux/Mac. How can we standardize the temp file creation across all platforms? 

Thanks !
Comment 4 Thorsten Behrens (CIB) 2010-11-02 02:47:27 UTC
Use osl::FileBase::createTempFile() for that (from osl/file.hxx)
Comment 5 Suren 2010-11-05 10:02:27 UTC
Hi Thorsten,

I am taking this bug. Thanks for the Temporary file suggestion. Will submit a first cuts patch soon enough.

Thanks,
~Suren
Comment 6 Suren 2010-11-07 05:42:56 UTC
Hi Thorsten,

I have attached a code snippet with which I have saved the Graphic to a temp file from your suggestion. Going further I was going to implement some thing like this, 

0. Lock the Graphic ( un-editable)
1. create a new writer thread
2. From the thread open the temporary file external application via osl_executeProcess from osl/process.h and wait for applicaton termination on that thread.
3. On thread completion, update graphic with new file and join the thread
4. Unlock the graphic.

I wanted to know if this is the recommended way of doing it. Please advice :) 

Thanks,
~Suren
Comment 7 Suren 2010-11-07 05:48:19 UTC
Created attachment 40087 [details]
Snippet for saving to a temporary file

I have also added "Edit with External tool" to the Graphic's Pop Up menu and called the method in this snippet in the Menu Item's ExecMethod. Works fine for me.
Comment 8 Thorsten Behrens (CIB) 2010-11-09 04:20:37 UTC
Suren, approach looks good to me - would you attach a more complete patch so I could have a try? Alternatively, you can post it to libreoffice@lists.freedesktop.org for broader discussion. Thanks!
Comment 9 Samuel Mehrbrodt (CIB) 2013-04-21 16:17:56 UTC
This is already done.
Comment 10 Robinson Tryon (qubit) 2015-12-18 09:55:30 UTC
Migrating Whiteboard tags to Keywords: (EasyHack)
[NinjaEdit]