Source-Export: Start work

Applied updates:
- Insert line break before first style in css for export
- export colored (styled) HTML (body only)
- copy styled HTML
- export CSS file
- copy as (inline) styled HTML code
- export (inline) styled HTML (body only)

- Refactor copy source commands

Improve interface:
- suggest "lilypond.css" as filename
- use current dir as default or
- user's home dir if current file isn't saved

Integrate html_document and html_selection
- HTML is now always generated from a selection.
  When exporting the whole document the selection
  is simply expanded to the document

HTML-export: Refactor HTML getter method
- Process incoming LilyPond source line by line (instead of token by token).
  This Will be used for further refinements of output
Source-Export: Improve HTML output

- Combine consecutive elements
  Consecutive elements, i.e. tokens of the same class,
  separated by spaces (e.g. "c d e f") are now wrapped
  in one single <span> element.

- Handle block comments correctly
  Block comments were rendered to HTML very tokenized so far.
  This wasn't good HTML style and sometimes caused Web editors
  to scramble the results by purging whitespace.

  Now block comments are rendered as class="lilypond-comment"
  on a line-by-line basis. While still being slightly redundant
  this will allow to easily copy&paste single lines from the result.
Source-Export: Move to 'export' module, add dummy dialog

Move highlight2html.py into export module

start unifying the interface to the export functions
(only one function for the content and one light wrapper
for the whole document. Behaviour isn't set by function
arguments but by properties of the options object)

Fix colorize.py th reflect the modifications

Add dummy for the new dialog
Source-Export: New options

- Add "external css" option
  exports html source code with reference to an external style sheet.
  Only makes sense with
  - document="full"
  - format="html"
- pad first line
  When exporting a selection the first line is prepended
  by an appropriate number of " " so it starts at the
  original position in the line

- Empty clipboard on cancel
Source-Export: QSettings start

Export options are now stored with the global QSettings object.
They are persistent throughout the session,
can be saved explicitely (from the "Export source" dialog) or
implicitely (Checkbox in Preferences->General)

The Dialog itself is a mere dummy yet. At least it shows
disabling of the "Save" button, Cancel and OK work too
(Cancel clears the clipboard)

The export options can't be edited in this intermediate state.
Default values can be set in export/__init__.py,
but they will be overwritten through the Settings.
Source-Export: Add PDF/ODT export

- Merge routines for printing and exporting to pdf.
  Printing now uses the highlight2html approach like exporting

- Add export to ODT files

TODO: PDF/Printer settings in dialog
Source-Export: New options: Linenumbers, work on printout

- prepend a line number at the beginning of lines
  Configurable number of digits (will be changed later)

  For now I manually enter <span class="lilypond-linenumber"> element around
  the number, without having a corresponding style sheet.

  Should better be a new token class

- Separate 'format' setting
  'format' is now only the html-plain/richtext differenct
  'filetype' is used for html, pdf or odt generation
   Having only 'format' caused issues when exporting to clipboard but 'format=pdf' was set

- Work towards correct font for printout
  (will only be solved much later ...)
Source-Export: Work on Dialog

- Add elements.
- Start testing interaction with Settings
- Define settings variables (copy) in dialog
  The application logic in the dialog should work
  on a local copy of the export options.
- Map options to widgets
  Use dictionaries to map options to widgets.
  Options are now correctly read from and written to Settings.
- Implement slots WIP
  Bind all widgets to handlers
  Try to handle all depending updates
  (enabling widgets, propagating options)
- Add file dialog
- Add Print/PDF export options
  (Mainly finished)
- Tooltips for most widgets
Source-Export: Formatting fixes (PDF/Linenumbers)

- Print and PDF-export respect document font
  When using Highlight2Html class for printing
  (instead of the former highlighter.py)
  the font wasn't respected anymore.
  Concretely the <pre> tag caused some different
  font setting to be used.
  Actually the font isn't used at all in HTML export,
  which is generally good.
  But maybe we add an option for that
  (which would then be auto-set for printing)
  The (slightly hacky?) solution is to conditionally
  inject an explicit <pre> CSS class when exporting to PDF or printer.
- Correctly format linenumbers
  Linenumbers now have a separate textformat (in Highlight2Html)
  so the css will correctly be used with inline as well as css formatting
- Improve printer setup dialog (start work)
  In order to use the printer dialog from the export dialog
  I think I have to use one QPrinter object in mainwindow and exportDialog
Source-Export: Adapt Menu Structure

- Remove "Print source" action
  Print source has been merged into "export source"
- Update File menu mnemonics
  This isn't related to source-export.
  Not all have been set, but significantly more than before
Update changelog
Source-Export: Add pre.lilypond class

The content is now wrapped in a <pre class="lilypond"> tag.
This should allow to override any styles on existing websites
(our WordPress theme introduced a larger line-height, thus
tearing apart the linenumbers styling).

Currently this includes a hard-coded line-height of 120%,
but this should be made configurable
Source-Export: Dialog Mnemonics
Source-Export: Don't set explicit pre.lilypond style

pre.lilypond is now exported as an empty style class.
This can be used to style the whole <pre> block that is
output with the "lilypond" class.
But setting it to a concrete style is the responsibility of the
actual web design.