mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Welcome wizard: Non-standard pages (email and web) were not having any effect
This commit is contained in:
parent
2c25153079
commit
208fa57895
@ -14,7 +14,7 @@ from calibre.utils.config import OptionParser
|
|||||||
from calibre.utils.logging import Log
|
from calibre.utils.logging import Log
|
||||||
from calibre.constants import preferred_encoding
|
from calibre.constants import preferred_encoding
|
||||||
from calibre.customize.conversion import OptionRecommendation
|
from calibre.customize.conversion import OptionRecommendation
|
||||||
|
from calibre import patheq
|
||||||
|
|
||||||
USAGE = '%prog ' + _('''\
|
USAGE = '%prog ' + _('''\
|
||||||
input_file output_file [options]
|
input_file output_file [options]
|
||||||
@ -220,6 +220,9 @@ def create_option_parser(args, log):
|
|||||||
from calibre.ebooks.conversion.plumber import Plumber
|
from calibre.ebooks.conversion.plumber import Plumber
|
||||||
|
|
||||||
reporter = ProgressBar(log)
|
reporter = ProgressBar(log)
|
||||||
|
if patheq(input, output):
|
||||||
|
raise ValueError('Input file is the same as the output file')
|
||||||
|
|
||||||
plumber = Plumber(input, output, log, reporter)
|
plumber = Plumber(input, output, log, reporter)
|
||||||
add_input_output_options(parser, plumber)
|
add_input_output_options(parser, plumber)
|
||||||
add_pipeline_options(parser, plumber)
|
add_pipeline_options(parser, plumber)
|
||||||
|
@ -53,8 +53,6 @@ class Plumber(object):
|
|||||||
'''
|
'''
|
||||||
self.input = os.path.abspath(input)
|
self.input = os.path.abspath(input)
|
||||||
self.output = os.path.abspath(output)
|
self.output = os.path.abspath(output)
|
||||||
if self.input == self.output:
|
|
||||||
raise ValueError('Input file is the same as the output file')
|
|
||||||
self.log = log
|
self.log = log
|
||||||
self.ui_reporter = report_progress
|
self.ui_reporter = report_progress
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ class KindlePage(QWizardPage, KindleUI):
|
|||||||
|
|
||||||
if self.send_email_widget.set_email_settings(True):
|
if self.send_email_widget.set_email_settings(True):
|
||||||
conf = smtp_prefs()
|
conf = smtp_prefs()
|
||||||
accounts = conf.get('accounts', {})
|
accounts = conf.parse().accounts
|
||||||
if not accounts: accounts = {}
|
if not accounts: accounts = {}
|
||||||
for y in accounts.values():
|
for y in accounts.values():
|
||||||
y[2] = False
|
y[2] = False
|
||||||
@ -494,6 +494,9 @@ class FinishPage(QWizardPage, FinishUI):
|
|||||||
def nextId(self):
|
def nextId(self):
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
def commit(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Wizard(QWizard):
|
class Wizard(QWizard):
|
||||||
@ -536,7 +539,11 @@ class Wizard(QWizard):
|
|||||||
|
|
||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
self.device_page.commit()
|
pages = map(self.page, self.visitedPages())
|
||||||
|
for page in pages:
|
||||||
|
if page is not self.library_page:
|
||||||
|
page.commit()
|
||||||
|
|
||||||
if not self.library_page.commit(self.completed):
|
if not self.library_page.commit(self.completed):
|
||||||
self.completed(None)
|
self.completed(None)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user