Changeset 779:98a7abceb685 in hatta-dev
- Timestamp:
- 07/16/10 19:44:20 (19 months ago)
- Branch:
- default
- Files:
-
- 4 added
- 1 edited
-
HattaError.ui (added)
-
error.png (added)
-
error_dialog.py (added)
-
hatta_qticon.py (modified) (6 diffs)
-
ui_errorDialog.py (added)
Legend:
- Unmodified
- Added
- Removed
-
hatta_qticon.py
r776 r779 15 15 from thread import start_new_thread 16 16 from time import sleep 17 from urllib import urlopen, unquote 17 from traceback import format_exc 18 from urllib import urlopen, quote 18 19 from wsgiref import simple_server 19 20 import gettext … … 30 31 QMessageBox, QAction, QKeySequence, QWidget, QVBoxLayout, QGridLayout, 31 32 QLabel, QSpinBox, QToolTip, QLineEdit, QHBoxLayout, QPushButton, 32 QFileDialog, QPixmap, QCheckBox, QDesktopServices )33 QFileDialog, QPixmap, QCheckBox, QDesktopServices, QDialog) 33 34 from PyQt4.QtCore import (QString, QThread, pyqtSignal, pyqtSlot, Qt, 34 35 QPoint, QLocale) 35 36 36 37 from hatta import WikiConfig, Wiki, WikiRequest, project_name, project_url 38 39 from error_dialog import ErrorDialog 37 40 38 41 def we_are_frozen(): … … 85 88 except Exception as e: 86 89 self.exception_signal.emit(unicode(e)) 90 # It's very important to shut down the thread, so that the threaded 91 # werkzeug won't continue to run and send other exceptions. 92 self.quit() 87 93 88 94 def quit(self): … … 384 390 pyqtSlot(str) 385 391 def on_error(self, strerror): 386 """Displays errors from exceptions.""" 387 QMessageBox.critical(None, 'Exception', 388 _(u'Error: %(error_string)s') % 389 dict(error_string=strerror), 1, 2) 392 """Displays error and send bug request.""" 393 report_bug('bugs@hatta-wiki.org', strerror) 390 394 391 395 def _make_discovery_action(self, name, host, port): … … 580 584 bool(self.should_announce)) 581 585 586 587 error_dialog = None 588 def report_bug(email, caption): 589 error_dialog.prepare_error(unicode(caption), format_exc()) 590 if error_dialog.exec_() == QDialog.Accepted: 591 link = 'mailto:%s?subject=%s&body=%s' % ( 592 email, 593 quote(u'[Bug] ' + unicode(caption)), 594 quote(error_dialog.get_bug_dump())) 595 webbrowser.open(link) 596 QApplication.exit() 597 582 598 if __name__ == '__main__': 583 599 try: … … 594 610 translation.install(unicode=1) 595 611 596 app = QApplication(sys.argv) 597 QApplication.setQuitOnLastWindowClosed(False) 598 status_icon = HattaTrayIcon() 599 app.exec_() 612 try: 613 app = QApplication(sys.argv) 614 QApplication.setQuitOnLastWindowClosed(False) 615 error_dialog = ErrorDialog() 616 status_icon = HattaTrayIcon() 617 app.exec_() 618 except Exception as e: 619 report_bug('dhubleizh@o2.pl', unicode(e)) 600 620 except KeyboardInterrupt: 601 621 pass
Note: See TracChangeset
for help on using the changeset viewer.
