mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Fix #731
This commit is contained in:
parent
7f962d7eb5
commit
f2f66ba6f2
@ -13,7 +13,8 @@
|
||||
<string>ERROR</string>
|
||||
</property>
|
||||
<property name="windowIcon" >
|
||||
<iconset resource="../images.qrc" >:/library</iconset>
|
||||
<iconset resource="../images.qrc" >
|
||||
<normaloff>:/library</normaloff>:/library</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" >
|
||||
@ -34,7 +35,7 @@
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
@ -42,10 +43,50 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1" >
|
||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
||||
<property name="standardButtons" >
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../images.qrc" />
|
||||
</resources>
|
||||
<connections/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>ConversionErrorDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>246</x>
|
||||
<y>491</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>64</x>
|
||||
<y>497</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>ConversionErrorDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>165</x>
|
||||
<y>480</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>32</x>
|
||||
<y>428</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
@ -186,8 +186,9 @@ class %(classname)s(%(base_class)s):
|
||||
files = choose_files(self, 'recipe loader dialog', _('Choose a recipe file'), filters=[(_('Recipes'), '*.py')], all_files=False, select_only_single_file=True)
|
||||
if files:
|
||||
file = files[0]
|
||||
src = open(file, 'rb').read().decode('utf-8')
|
||||
raise Exception('a')
|
||||
try:
|
||||
src = open(file, 'rb').read().decode('utf-8')
|
||||
title = compile_recipe(src).title
|
||||
except Exception, err:
|
||||
error_dialog(self, _('Invalid input'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user