This commit is contained in:
Kovid Goyal 2008-05-31 08:31:19 -07:00
parent 7f962d7eb5
commit f2f66ba6f2
2 changed files with 46 additions and 4 deletions

View File

@ -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>

View File

@ -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'),