... | ... |
@@ -1322,12 +1322,12 @@ class DotWidget(gtk.DrawingArea): |
1322 | 1322 |
try: |
1323 | 1323 |
self.set_xdotcode(xdotcode) |
1324 | 1324 |
except ParseError, ex: |
1325 |
- error_dlg = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, |
|
1326 |
- message_format=str(ex), |
|
1327 |
- buttons=gtk.BUTTONS_OK) |
|
1328 |
- error_dlg.set_title('Dot Viewer') |
|
1329 |
- error_dlg.run() |
|
1330 |
- error_dlg.destroy() |
|
1325 |
+ dialog = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, |
|
1326 |
+ message_format=str(ex), |
|
1327 |
+ buttons=gtk.BUTTONS_OK) |
|
1328 |
+ dialog.set_title('Dot Viewer') |
|
1329 |
+ dialog.run() |
|
1330 |
+ dialog.destroy() |
|
1331 | 1331 |
return False |
1332 | 1332 |
else: |
1333 | 1333 |
return True |
... | ... |
@@ -1643,9 +1643,13 @@ class DotWindow(gtk.Window): |
1643 | 1643 |
fp = file(filename, 'rt') |
1644 | 1644 |
self.set_dotcode(fp.read(), filename) |
1645 | 1645 |
fp.close() |
1646 |
- except IOError: |
|
1647 |
- # TODO: show an error message |
|
1648 |
- pass |
|
1646 |
+ except IOError, ex: |
|
1647 |
+ dlg = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, |
|
1648 |
+ message_format=str(ex), |
|
1649 |
+ buttons=gtk.BUTTONS_OK) |
|
1650 |
+ dlg.set_title('Dot Viewer') |
|
1651 |
+ dlg.run() |
|
1652 |
+ dlg.destroy() |
|
1649 | 1653 |
|
1650 | 1654 |
def on_open(self, action): |
1651 | 1655 |
chooser = gtk.FileChooserDialog(title="Open dot File", |