From b105a2a9e9068463eaad97b402209e3b944b6501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sun, 22 Jun 2008 21:18:29 +0200 Subject: First mail window draft --- portato/gui/exception_handling.py | 5 + portato/gui/templates/MailInfoWindow.glade | 185 +++++++++++++++++++++++++++++ portato/gui/windows/mailinfo.py | 30 +++++ 3 files changed, 220 insertions(+) create mode 100644 portato/gui/templates/MailInfoWindow.glade create mode 100644 portato/gui/windows/mailinfo.py (limited to 'portato') diff --git a/portato/gui/exception_handling.py b/portato/gui/exception_handling.py index 29cd4e6..5d5eb17 100644 --- a/portato/gui/exception_handling.py +++ b/portato/gui/exception_handling.py @@ -21,6 +21,7 @@ from StringIO import StringIO from ..helper import debug, error from .dialogs import file_chooser_dialog, io_ex_dialog +from .windows.mailinfo import MailInfoWindow # for the i18n from ..constants import LOCALE_DIR, APP @@ -53,6 +54,7 @@ class UncaughtExceptionDialog(gtk.MessageDialog): self.format_secondary_text(_("It probably isn't fatal, but should be reported to the developers nonetheless.")) self.add_button(_("Show Details"), 1) + self.add_button(_("Send..."), 3) self.add_button(gtk.STOCK_SAVE_AS, 2) self.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE) @@ -103,6 +105,9 @@ class UncaughtExceptionDialog(gtk.MessageDialog): else: debug("Nothing to save") + elif resp == 3: + debug("Send bug per mail") + MailInfoWindow(self, self.text) else: break self.destroy() diff --git a/portato/gui/templates/MailInfoWindow.glade b/portato/gui/templates/MailInfoWindow.glade new file mode 100644 index 0000000..6d72295 --- /dev/null +++ b/portato/gui/templates/MailInfoWindow.glade @@ -0,0 +1,185 @@ + + + + + + Send Bug Mail ... + GTK_WIN_POS_CENTER + True + GDK_WINDOW_TYPE_HINT_DIALOG + True + True + + + True + + + True + 4 + 2 + + + True + <b><u>Additional Information</u></b> + +(all optional) + True + GTK_JUSTIFY_CENTER + + + 2 + + + + + True + True + + + 1 + 2 + 1 + 2 + + + + + True + True + + + 1 + 2 + 2 + 3 + + + + + True + 0 + Email address: + True + + + 2 + 3 + 5 + + + + + True + 0 + Name: + True + + + 1 + 2 + 5 + + + + + True + 0 + Comments / +what did you do to hit the bug? + + + 3 + 4 + 5 + + + + + True + 0 + 0 + GTK_SHADOW_IN + + + True + True + + + + + + label_item + + + + + 1 + 2 + 3 + 4 + + + + + + + True + True + GTK_BUTTONBOX_SPREAD + + + True + True + True + gtk-cancel + True + 0 + + + + + + True + True + True + 0 + + + + True + 2 + + + True + 1 + gtk-ok + + + + + True + 0 + _Send + True + True + + + 1 + + + + + + + 1 + + + + + 1 + + + + + + diff --git a/portato/gui/windows/mailinfo.py b/portato/gui/windows/mailinfo.py new file mode 100644 index 0000000..45b4273 --- /dev/null +++ b/portato/gui/windows/mailinfo.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# +# File: portato/gui/windows/mailinfo.py +# This file is part of the Portato-Project, a graphical portage-frontend. +# +# Copyright (C) 2008 René 'Necoro' Neumann +# This is free software. You may redistribute copies of it under the terms of +# the GNU General Public License version 2. +# There is NO WARRANTY, to the extent permitted by law. +# +# Written by René 'Necoro' Neumann + +from __future__ import absolute_import + +import gtk + +from .basic import AbstractDialog +from ...helper import debug + +class MailInfoWindow (AbstractDialog): + + def __init__ (self, parent, tb): + + AbstractDialog.__init__(self, parent) + self.window.show_all() + + def cb_cancel_clicked (self): + + self.close() + return True -- cgit v1.2.3