Re: [gedit-list] tools plugin -- request for comments



Hi Rui,

> 
> I want to create a "Tools" plugin for gedit, but first I want to discuss
> this with you, read the following "spec" and tell me what you think.
> 
> 
> 
> <<<<< start
> 
> Tools Plugin
> ------------
> 
> - Provide a mechanism to call external programs from a
>   menuitem/shortcut-key.
> 
> - Capture and parse the output of an external program to show a
>   error/warning list.
> 
> - We can also have filter tools, this ones are feed with some document
>   text and return/replace the selection or create a new document.
> 
> - Group several tools in a group, so we can have a fast access to the
>   tools needed for a specific task, say, a simple tool chain for coding
>   C programs.

How will the group selected? Using the document MIME-type?

>   These tools will be automatically associated with Ctrl+<N> shortcuts.
>   OTOH if a tool is not associated with a specific group it will be
>   always available.
> 
> 
> 
> Each tool
> ---------
> 
> - The tool name and a icon that appears on menus.
> 
> - Command line (to be passed to user shell)
>   with expansions format: $() and escape $$.
>     - filename
>     - basename
>     - uri
>     - line
>     - column
>     - selection (selected text)
>     - totallines (?)
> 
I'm not so sure about totallines.
We also need a way to set the working directory and to pass it and the
home dir as command line argument. 
We also need a way to display an input box for the user to enter input
that will be added to the parameter string.

> 
> - stdin to pass to command line
>     - current selection
>     - all document
>     - a string
>     - none
> 
>     pass as a locale or utf8 encoded text.
> 
> 
> - Capture output to:
>     - replace current selection
>     - replace all document
>     - a new document
>     - insert at cursor position
>     - insert in a new line above/bellow current line
>     - append to document
>     - output window
>     - output window with error/warning parsing, this needs a list with
>       output filters to apply
>       - each output filter is applied in order, this iteration ends when
>         one of them matches a filename:linum pair.
> 
> 
hmm... I think that for the moment all the output could go to the output
window. The user can copy text from the output window and paste it in
the document if needed.

> - A flag that says if we should:  save all files, save the current
>   file, or not save at all.
> 
> 
> - Working directory.
> 
> 
> - Environment for the command?  (or the user can use the env command)
> 
> 
> 
> NOTE: While the tool is running no other tool can run, neither the user
>       can modify the document.  This only applies to a tool that uses
>       output window or modifies the document.
> 
> 
> 
> 
> Output Filters
> --------------
>    - operate at line basis.
>    - each filter has a type: warning or error.
Are warning and error the only two types we need?

>    - each return:
>        - filename
>        - line
>        - column (optional)
>      NOTE: a regex lib that can name groups is needed.  pcre can
>            do this with, (?P<filename>.+) (?P<linenum>[0-9]+).
>            (Python syntax).
>            Or, we can simulate this using gnuregex by counting `()'.
>    - a unique name.
>    - a description. (humm, really?)
> 
> 
> 
> 
> Changes to gedit
> ----------------
> 
> I need a way of connecting mouse double-click and space/enter key
> signals;  needed to open the file:line with the error/warning.
> How about a "action" signal?
> 
> 
> I also need a output-cleared and destroyed signal in output window;
> needed for releasing resources allocated by the tool.
> 
> 
> <<<<< end
> 
> 
> 
> You will find a GUI mockup of all this in the attachment, the most
> "crude" one is the tool-editor-advanced dialog.

Your mockups look good. My only doubt is: do we really need such a
complicate GUI, i.e. all these dialogs?
Please, change your dialog to follow the HIG more closely. For example,
you have to set the right border size, the HELP button (do we really
need it in all the dialogs?) should be on the left side of the action
area, there must be space among buttons and so on.

Great work!

Thanks,
Paolo





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]