From 521e41973aa09d00bf3a495507b03a21e4257165 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 2 Jan 2011 19:18:52 -0500 Subject: [PATCH] GUI: TXT, TCR, PDB Inputs gui conversion options updated. --- src/calibre/gui2/convert/pdb_input.py | 10 +++-- src/calibre/gui2/convert/pdb_input.ui | 48 --------------------- src/calibre/gui2/convert/tcr_input.py | 23 ++++++++++ src/calibre/gui2/convert/txt_input.py | 5 ++- src/calibre/gui2/convert/txt_input.ui | 60 +++++++-------------------- 5 files changed, 48 insertions(+), 98 deletions(-) delete mode 100644 src/calibre/gui2/convert/pdb_input.ui create mode 100644 src/calibre/gui2/convert/tcr_input.py diff --git a/src/calibre/gui2/convert/pdb_input.py b/src/calibre/gui2/convert/pdb_input.py index 4510cf81ba..655f4025a7 100644 --- a/src/calibre/gui2/convert/pdb_input.py +++ b/src/calibre/gui2/convert/pdb_input.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- __license__ = 'GPL 3' -__copyright__ = '2009, John Schember ' +__copyright__ = '2011, John Schember ' __docformat__ = 'restructuredtext en' -from calibre.gui2.convert.pdb_input_ui import Ui_Form +from calibre.gui2.convert.txt_input_ui import Ui_Form from calibre.gui2.convert import Widget class PluginWidget(Widget, Ui_Form): @@ -12,10 +12,12 @@ class PluginWidget(Widget, Ui_Form): TITLE = _('PDB Input') HELP = _('Options specific to')+' PDB '+_('input') COMMIT_NAME = 'pdb_input' - ICON = I('mimetypes/unknown.png') + ICON = I('mimetypes/txt.png') def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, - ['single_line_paras', 'print_formatted_paras']) + ['paragraph_format', 'markdown_disable_toc', 'preserve_spaces']) self.db, self.book_id = db, book_id + for x in get_option('paragraph_format').option.choices: + self.opt_paragraph_format.addItem(x) self.initialize_options(get_option, get_help, db, book_id) diff --git a/src/calibre/gui2/convert/pdb_input.ui b/src/calibre/gui2/convert/pdb_input.ui deleted file mode 100644 index 2b632b1a33..0000000000 --- a/src/calibre/gui2/convert/pdb_input.ui +++ /dev/null @@ -1,48 +0,0 @@ - - - Form - - - - 0 - 0 - 400 - 300 - - - - Form - - - - - - Qt::Vertical - - - - 20 - 213 - - - - - - - - Treat each &line as a paragraph - - - - - - - Assume print formatting - - - - - - - - diff --git a/src/calibre/gui2/convert/tcr_input.py b/src/calibre/gui2/convert/tcr_input.py new file mode 100644 index 0000000000..2aa877ce4d --- /dev/null +++ b/src/calibre/gui2/convert/tcr_input.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- + +__license__ = 'GPL 3' +__copyright__ = '2011, John Schember ' +__docformat__ = 'restructuredtext en' + +from calibre.gui2.convert.txt_input_ui import Ui_Form +from calibre.gui2.convert import Widget + +class PluginWidget(Widget, Ui_Form): + + TITLE = _('TCR Input') + HELP = _('Options specific to')+' TCR '+_('input') + COMMIT_NAME = 'tcr_input' + ICON = I('mimetypes/txt.png') + + def __init__(self, parent, get_option, get_help, db=None, book_id=None): + Widget.__init__(self, parent, + ['paragraph_format', 'markdown_disable_toc', 'preserve_spaces']) + self.db, self.book_id = db, book_id + for x in get_option('paragraph_format').option.choices: + self.opt_paragraph_format.addItem(x) + self.initialize_options(get_option, get_help, db, book_id) diff --git a/src/calibre/gui2/convert/txt_input.py b/src/calibre/gui2/convert/txt_input.py index 31019251e2..99d04fe2f4 100644 --- a/src/calibre/gui2/convert/txt_input.py +++ b/src/calibre/gui2/convert/txt_input.py @@ -16,7 +16,8 @@ class PluginWidget(Widget, Ui_Form): def __init__(self, parent, get_option, get_help, db=None, book_id=None): Widget.__init__(self, parent, - ['single_line_paras', 'print_formatted_paras', 'markdown', - 'markdown_disable_toc', 'preserve_spaces']) + ['paragraph_format', 'markdown_disable_toc', 'preserve_spaces']) self.db, self.book_id = db, book_id + for x in get_option('paragraph_format').option.choices: + self.opt_paragraph_format.addItem(x) self.initialize_options(get_option, get_help, db, book_id) diff --git a/src/calibre/gui2/convert/txt_input.ui b/src/calibre/gui2/convert/txt_input.ui index 186783c277..b45297fdf2 100644 --- a/src/calibre/gui2/convert/txt_input.ui +++ b/src/calibre/gui2/convert/txt_input.ui @@ -6,7 +6,7 @@ 0 0 - 470 + 488 300 @@ -15,27 +15,16 @@ - + - Treat each &line as a paragraph + Document structure detection - - - - Assume print formatting - - + + - - - - Process using markdown - - - - + <p>Markdown is a simple markup language for text files, that allows for advanced formatting. To learn more visit <a href="http://daringfireball.net/projects/markdown">markdown</a>. @@ -48,14 +37,21 @@ - + Do not insert Table of Contents into output text when using markdown - + + + + Preserve &spaces + + + + Qt::Vertical @@ -68,32 +64,8 @@ - - - - Preserve &spaces - - - - - - opt_markdown - toggled(bool) - opt_markdown_disable_toc - setEnabled(bool) - - - 76 - 80 - - - 418 - 105 - - - - +