kovidgoyal/calibre — pull request #214 by ingkebil (2014-04-01 20:47:37+00:00)
Title: Added OPML support to the user_profile dialog

A new button 'Import from OPML files' underneat the 'Load recipe from file' button has been added. Once clicked, the user is presented with a choose_file dialog. When one or more OPML files are selected, each line or each outline block will be imported as a custom recipe much in the way a profile is added now. For the values of oldest_article and max_articles, the values of the QSpinBoxes is taken. Most of the recipe creation code has been taken from the user_profile class in any case.

Two improvements can still be made:
* The import of larger OPML files can take a while (I presume mostly because of updating of the QAbstractListModel. I didn't have this problem when importing from the plugin). Either a solution is found for the slowness, or the import code needs to go into a different thread.
* Taking the value for max_articles and oldest_article from the QSpinBoxes might be confusing. Add a popup that asks explicitly for these values might be the way to go.
* When adding your OPML file again, you will be presented with a lot of 'Replace recipe?' dialog boxes. Option should be added to replace all. I didn't have time to look into this yet.