summaryrefslogtreecommitdiff
path: root/portato/gui
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-06-22 21:18:29 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-06-22 21:18:29 +0200
commitb105a2a9e9068463eaad97b402209e3b944b6501 (patch)
treefa5f817a0f08eb84de1b61f8d94896e6dfcb0bcf /portato/gui
parent441784d7b54c5aefe1ba1dd5526bdc5ac960e4e5 (diff)
downloadportato-b105a2a9e9068463eaad97b402209e3b944b6501.tar.gz
portato-b105a2a9e9068463eaad97b402209e3b944b6501.tar.bz2
portato-b105a2a9e9068463eaad97b402209e3b944b6501.zip
First mail window draft
Diffstat (limited to '')
-rw-r--r--portato/gui/exception_handling.py5
-rw-r--r--portato/gui/templates/MailInfoWindow.glade185
-rw-r--r--portato/gui/windows/mailinfo.py30
3 files changed, 220 insertions, 0 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.4.4 on Fri Jun 20 18:22:54 2008 -->
+<glade-interface>
+ <widget class="GtkWindow" id="MailInfoWindow">
+ <property name="title" translatable="yes">Send Bug Mail ...</property>
+ <property name="window_position">GTK_WIN_POS_CENTER</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="skip_taskbar_hint">True</property>
+ <property name="skip_pager_hint">True</property>
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">2</property>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;&lt;u&gt;Additional Information&lt;/u&gt;&lt;/b&gt;
+
+(all optional)</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_CENTER</property>
+ </widget>
+ <packing>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="nameEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="mailEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Email address:</property>
+ <property name="single_line_mode">True</property>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_padding">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Name:</property>
+ <property name="single_line_mode">True</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_padding">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Comments /
+what did you do to hit the bug?</property>
+ </widget>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_padding">5</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <child>
+ <widget class="GtkTextView" id="commentEntry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </widget>
+ </child>
+ <child>
+ <placeholder/>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkHButtonBox" id="hbuttonbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
+ <child>
+ <widget class="GtkButton" id="cancelBtn">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="label" translatable="yes">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="response_id">0</property>
+ <signal name="clicked" handler="cb_cancel_clicked"/>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="sendBtn">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="response_id">0</property>
+ <signal name="clicked" handler="cb_send_clicked"/>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="stock">gtk-ok</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Send</property>
+ <property name="use_underline">True</property>
+ <property name="single_line_mode">True</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
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 <necoro@necoro.net>
+
+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