summaryrefslogtreecommitdiff
path: root/portato/gui
diff options
context:
space:
mode:
Diffstat (limited to 'portato/gui')
-rw-r--r--portato/gui/__init__.py2
-rw-r--r--portato/gui/dialogs.py22
-rw-r--r--portato/gui/exception_handling.py6
-rw-r--r--portato/gui/exceptions.py2
-rw-r--r--portato/gui/queue.py2
-rw-r--r--portato/gui/session.py2
-rw-r--r--portato/gui/slots.py2
-rw-r--r--portato/gui/templates/AboutWindow.ui8
-rw-r--r--portato/gui/templates/MailInfoWindow.ui38
-rw-r--r--portato/gui/templates/MainWindow.menu7
-rw-r--r--portato/gui/templates/MainWindow.ui18
-rw-r--r--portato/gui/templates/PreferenceWindow.ui2
-rw-r--r--portato/gui/updater.py2
-rw-r--r--portato/gui/utils.py2
-rw-r--r--portato/gui/views.py2
-rw-r--r--portato/gui/windows/__init__.py2
-rw-r--r--portato/gui/windows/about.py15
-rw-r--r--portato/gui/windows/basic.py5
-rw-r--r--portato/gui/windows/mailinfo.py139
-rw-r--r--portato/gui/windows/main.py86
-rw-r--r--portato/gui/windows/pkglist.py2
-rw-r--r--portato/gui/windows/plugin.py2
-rw-r--r--portato/gui/windows/preference.py2
-rw-r--r--portato/gui/windows/search.py2
-rw-r--r--portato/gui/windows/splash.py2
25 files changed, 279 insertions, 95 deletions
diff --git a/portato/gui/__init__.py b/portato/gui/__init__.py
index 0a584a8..bbe21d8 100644
--- a/portato/gui/__init__.py
+++ b/portato/gui/__init__.py
@@ -3,7 +3,7 @@
# File: portato/gui/__init__.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
diff --git a/portato/gui/dialogs.py b/portato/gui/dialogs.py
index d7ac41b..2cc2d6b 100644
--- a/portato/gui/dialogs.py
+++ b/portato/gui/dialogs.py
@@ -3,7 +3,7 @@
# File: portato/gui/dialogs.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
@@ -20,6 +20,13 @@ def mail_failure_dialog(e):
dialog.destroy()
return ret
+def no_email_dialog(p):
+ dialog = gtk.MessageDialog(p, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK_CANCEL, _("No email address given"))
+ dialog.format_secondary_text(_("You haven't specified an email address. Without it, it will not be possible for the developers to contact you for questions and thus it might be harder to fix the bug.\n\nDo you want to proceed nevertheless?"))
+ ret = dialog.run()
+ dialog.destroy()
+ return ret
+
def queue_not_empty_dialog():
dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_NONE, _("Do you really want to quit?"))
dialog.format_secondary_text(_("There are some packages in the emerge queue and/or an emerge process is running."))
@@ -68,7 +75,18 @@ def nothing_found_dialog ():
def changed_flags_dialog (what = "flags"):
check = gtk.CheckButton(_("Do not show this dialog again."))
hintMB = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, _("Changed %s") % what)
- hintMB.format_secondary_text(_("Portato will write these changes into the appropriate files.\nPlease backup them if you think it is necessairy."))
+ hintMB.format_secondary_text(_("Portato will write these changes into the appropriate files.\nPlease backup them if you think it is necessary."))
+ hintMB.vbox.add(check)
+ hintMB.vbox.show_all()
+ ret = hintMB.run()
+ hintMB.destroy()
+
+ return ret, check.get_active()
+
+def update_world_warning_dialog ():
+ check = gtk.CheckButton(_("Do not show this dialog again."))
+ hintMB = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, _("'Update World' may be giving errors"))
+ hintMB.format_secondary_text(_("Due to the fast changing portage, 'update world' might not work correctly or even throw errors.\nThis will be fixed (hopefully) in the next release."))
hintMB.vbox.add(check)
hintMB.vbox.show_all()
ret = hintMB.run()
diff --git a/portato/gui/exception_handling.py b/portato/gui/exception_handling.py
index 0ec1e9a..d9b133c 100644
--- a/portato/gui/exception_handling.py
+++ b/portato/gui/exception_handling.py
@@ -3,7 +3,7 @@
# File: portato/gui/exception_handling.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
@@ -99,7 +99,7 @@ def convert (version):
def get_version_infos():
from ..constants import VERSION, REVISION
from ..backend import system
- from ..db import _TYPE as db_type
+ from ..db import Database
if REVISION:
VERSION = "%s (git: %s)" % (VERSION, REVISION)
@@ -109,7 +109,7 @@ def get_version_infos():
"System: %s" % " ".join(get_runsystem()),
"Python version: %s" % sys.version,
"Used backend: %s" % system.get_version(),
- "Used database type: %s" % db_type,
+ "Used database type: %s" % Database.DB_TYPE,
"pygtk: %s (using GTK+: %s)" % (convert(gtk.pygtk_version), convert(gtk.gtk_version)),
"pygobject: %s (using GLib: %s)" % (convert(gobject.pygobject_version), convert(gobject.glib_version))))
diff --git a/portato/gui/exceptions.py b/portato/gui/exceptions.py
index 17041dc..3e35caa 100644
--- a/portato/gui/exceptions.py
+++ b/portato/gui/exceptions.py
@@ -3,7 +3,7 @@
# File: portato/gui/exceptions.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
diff --git a/portato/gui/queue.py b/portato/gui/queue.py
index 6d3d19d..b18e4e7 100644
--- a/portato/gui/queue.py
+++ b/portato/gui/queue.py
@@ -3,7 +3,7 @@
# File: portato/gui/queue.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
diff --git a/portato/gui/session.py b/portato/gui/session.py
index 7aa890d..549a2c9 100644
--- a/portato/gui/session.py
+++ b/portato/gui/session.py
@@ -3,7 +3,7 @@
# File: portato/gui/session.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
diff --git a/portato/gui/slots.py b/portato/gui/slots.py
index c7f20e6..75f4d77 100644
--- a/portato/gui/slots.py
+++ b/portato/gui/slots.py
@@ -3,7 +3,7 @@
# File: portato/gui/slots.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
diff --git a/portato/gui/templates/AboutWindow.ui b/portato/gui/templates/AboutWindow.ui
index ec3ed7e..a3f81cf 100644
--- a/portato/gui/templates/AboutWindow.ui
+++ b/portato/gui/templates/AboutWindow.ui
@@ -16,7 +16,7 @@
<property name="has_separator">False</property>
<property name="program_name">Portato</property>
<property name="copyright">This software is licensed under the terms of the GPLv2.
-Copyright (C) 2006-2009 Ren&#xE9; 'Necoro' Neumann &lt;necoro@necoro.net&gt;</property>
+Copyright (C) 2006-2010 Ren&#xE9; 'Necoro' Neumann &lt;necoro@necoro.net&gt;</property>
<property name="comments">A Portage GUI</property>
<property name="website">http://portato.necoro.net</property>
<property name="authors">Ren&#xE9; 'Necoro' Neumann
@@ -25,12 +25,6 @@ Thanks goto:
- The Porthole team, which often inspired me and gave me hints :)
- franzf, who often tested and gave comments
- the Sabayon-Distro for making Portato the default Portage-GUI</property>
- <property name="translator_credits">Catalan - Roger Calv&#xF3;
-German - Ren&#xE9; 'Necoro' Neumann
-Polish - Tomasz Osi&#x144;ski
-Portugese (Brazilian) - Alberto Federman Neto
-Spanish - Daniel Halens
-Turkish - G&#xFC;rkan 'seqizz' G&#xFC;r</property>
<property name="artists">p4r4d0x (inspired by wolfden)</property>
<signal name="response" handler="close"/>
<child internal-child="vbox">
diff --git a/portato/gui/templates/MailInfoWindow.ui b/portato/gui/templates/MailInfoWindow.ui
index 4551cdb..e3cdd1f 100644
--- a/portato/gui/templates/MailInfoWindow.ui
+++ b/portato/gui/templates/MailInfoWindow.ui
@@ -134,25 +134,39 @@ what did you do to hit the bug?</property>
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="logCheck">
- <property name="label" translatable="yes">Attach _Logfile</property>
+ <object class="GtkFrame" id="frame1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">Attaches the logfile to the mail. This log only contains debug information.</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkTreeView" id="fileList">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="headers_clickable">False</property>
+ <property name="enable_search">False</property>
+ <signal name="row_activated" handler="cb_file_clicked"/>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">These files will be sent:</property>
+ </object>
+ </child>
</object>
<packing>
+ <property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
- <property name="x_options">GTK_FILL</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
</object>
<packing>
<property name="padding">5</property>
diff --git a/portato/gui/templates/MainWindow.menu b/portato/gui/templates/MainWindow.menu
index 5d8e8e0..5594aaf 100644
--- a/portato/gui/templates/MainWindow.menu
+++ b/portato/gui/templates/MainWindow.menu
@@ -16,7 +16,7 @@
<child>
<object class="GtkAction" id="fileMenuAction">
<property name="name">fileMenuAction</property>
- <property name="label" translatable="yes">_File</property>
+ <property name="label" translatable="yes">_General</property>
</object>
</child>
<child>
@@ -158,7 +158,7 @@
<object class="GtkAction" id="pluginsAction">
<property name="stock_id">gtk-connect</property>
<property name="name">pluginsAction</property>
- <property name="label" translatable="yes">_Plugins</property>
+ <property name="label" translatable="yes">Plu_gins</property>
<signal handler="cb_plugins_clicked" name="activate"/>
</object>
</child>
@@ -168,6 +168,7 @@
<menubar name="menubar">
<menu name="fileMenu" action="fileMenuAction">
<menuitem name="prefMenuItem" action="prefAction"/>
+ <menuitem name="pluginsMenuItem" action="pluginsAction"/>
<menuitem name="reloadMenuItem" action="reloadAction"/>
<separator/>
<menuitem name="closeMenuItem" action="closeAction"/>
@@ -176,6 +177,7 @@
<menuitem name="emergeMenuItem" action="emergeAction"/>
<menuitem name="unmergeMenuItem" action="unmergeAction"/>
<menuitem name="updateMenuItem" action="updateAction"/>
+ <separator/>
<menuitem name="showUpdatesMenuItem" action="showUpdatesAction"/>
<menuitem name="showWorldPkgsMenuItem" action="showWorldPkgsAction" />
<menuitem name="showInstalledMenuItem" action="showInstalledAction"/>
@@ -189,7 +191,6 @@
<menu name="pluginMenu" action="pluginMenuAction"/>
<menu name="helpMenu" action="helpMenuAction">
<menuitem name="aboutMenuItem" action="aboutAction"/>
- <menuitem name="pluginsMenuItem" action="pluginsAction"/>
</menu>
</menubar>
<popup name="systrayPopup">
diff --git a/portato/gui/templates/MainWindow.ui b/portato/gui/templates/MainWindow.ui
index 8e8c3b4..05e9545 100644
--- a/portato/gui/templates/MainWindow.ui
+++ b/portato/gui/templates/MainWindow.ui
@@ -30,6 +30,16 @@
<property name="visible">True</property>
<property name="border_width">3</property>
<child>
+ <object class="GtkComboBox" id="typeCombo">
+ <property name="visible">True</property>
+ <signal name="changed" handler="cb_type_combo_changed"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkEntry" id="searchEntry">
<property name="visible">True</property>
<signal name="changed" handler="cb_search_changed"/>
@@ -38,12 +48,12 @@
</object>
<packing>
<property name="padding">5</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="deleteSearchButton">
- <property name="label">gtk-delete</property>
+ <property name="label">gtk-clear</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -54,7 +64,7 @@
<packing>
<property name="expand">False</property>
<property name="padding">5</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
@@ -69,7 +79,7 @@
<packing>
<property name="expand">False</property>
<property name="padding">5</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
</object>
diff --git a/portato/gui/templates/PreferenceWindow.ui b/portato/gui/templates/PreferenceWindow.ui
index c7a00e0..d2135d0 100644
--- a/portato/gui/templates/PreferenceWindow.ui
+++ b/portato/gui/templates/PreferenceWindow.ui
@@ -784,8 +784,6 @@
<child>
<object class="GtkHBox" id="hbox4">
<property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label21">
diff --git a/portato/gui/updater.py b/portato/gui/updater.py
index 7ce7c51..6539913 100644
--- a/portato/gui/updater.py
+++ b/portato/gui/updater.py
@@ -3,7 +3,7 @@
# File: portato/gui/updater.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
diff --git a/portato/gui/utils.py b/portato/gui/utils.py
index 47f6fb7..ce5971e 100644
--- a/portato/gui/utils.py
+++ b/portato/gui/utils.py
@@ -3,7 +3,7 @@
# File: portato/gui/utils.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
diff --git a/portato/gui/views.py b/portato/gui/views.py
index 3fc965f..699a832 100644
--- a/portato/gui/views.py
+++ b/portato/gui/views.py
@@ -3,7 +3,7 @@
# File: portato/gui/views.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
diff --git a/portato/gui/windows/__init__.py b/portato/gui/windows/__init__.py
index 6a4ac82..5be95ce 100644
--- a/portato/gui/windows/__init__.py
+++ b/portato/gui/windows/__init__.py
@@ -3,7 +3,7 @@
# File: portato/gui/gtk/__init__.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
diff --git a/portato/gui/windows/about.py b/portato/gui/windows/about.py
index 6c6fec5..0d2ce1a 100644
--- a/portato/gui/windows/about.py
+++ b/portato/gui/windows/about.py
@@ -3,19 +3,20 @@
# File: portato/gui/windows/about.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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
+from __future__ import absolute_import, with_statement
+import os
import gtk
from .basic import AbstractDialog
-from ...constants import VERSION, REVISION, APP_ICON
+from ...constants import VERSION, REVISION, DATA_DIR
class AboutWindow (AbstractDialog):
"""A window showing the "about"-informations."""
@@ -24,11 +25,11 @@ class AboutWindow (AbstractDialog):
AbstractDialog.__init__(self, parent)
- img = gtk.Image()
- img.set_from_file(APP_ICON)
-
self.window.set_version(VERSION)
- self.window.set_logo(img.get_pixbuf())
+ self.window.set_logo(None)
+
+ with open(os.path.join(DATA_DIR, "TRANSLATORS")) as f:
+ self.window.set_translator_credits("".join(f.readlines()))
if REVISION:
gitlabel = self.tree.get_widget("gitLabel")
diff --git a/portato/gui/windows/basic.py b/portato/gui/windows/basic.py
index 20d8009..01d31e5 100644
--- a/portato/gui/windows/basic.py
+++ b/portato/gui/windows/basic.py
@@ -3,7 +3,7 @@
# File: portato/gui/windows/basic.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
@@ -151,6 +151,9 @@ class AbstractDialog (Window):
self.window.set_transient_for(parent)
self.parent = parent
+ # type hint
+ self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)
+
# catch the ESC-key
self.window.connect("key-press-event", self.cb_key_pressed)
diff --git a/portato/gui/windows/mailinfo.py b/portato/gui/windows/mailinfo.py
index 0cc79f2..4367482 100644
--- a/portato/gui/windows/mailinfo.py
+++ b/portato/gui/windows/mailinfo.py
@@ -3,7 +3,7 @@
# File: portato/gui/windows/mailinfo.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
@@ -14,34 +14,98 @@ from __future__ import absolute_import, with_statement
import smtplib, socket
import time
+import gtk, pango, gobject
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
+from os.path import basename
from .basic import AbstractDialog
from ..utils import GtkThread
-from ..dialogs import mail_failure_dialog
+from .. import dialogs
from ...helper import debug, info
-from ...constants import VERSION
+from ...constants import VERSION, CONFIG_LOCATION
from ...log import LOGFILE
+from ... import session
+
+def mail_failure_dialog(*a):
+ dialogs.mail_failure_dialog(*a)
+ return False
+
+class ShowDialog (gtk.Dialog):
+
+ def __init__(self, parent, f):
+ gtk.Dialog.__init__(self, f, parent, buttons = (gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
+
+ textview = gtk.TextView()
+ textview.set_editable(False)
+ textview.modify_font(pango.FontDescription("Monospace"))
+ textview.set_size_request(gtk.gdk.screen_width()/2, gtk.gdk.screen_height()/3)
+
+ sw = gtk.ScrolledWindow();
+ sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+ sw.add(textview)
+
+ self.vbox.add(sw)
+
+ textbuffer = textview.get_buffer()
+
+ with open(f) as text:
+ textbuffer.set_text(text.read())
+
+ self.vbox.show_all()
class MailInfoWindow (AbstractDialog):
- TO = "bugs@portato.necoro.net"
+ TO = "bugs@necoro.eu"
def __init__ (self, parent, tb):
AbstractDialog.__init__(self, parent)
+
+ self.files = [LOGFILE, CONFIG_LOCATION] + [s._file for s in session.sessionlist]
+ self.fileList = self.tree.get_widget("fileList")
+ self.build_file_list()
+ self.mailEntry = self.tree.get_widget("mailEntry")
self.tb = tb
self.window.show_all()
+ def build_file_list(self):
+ store = gtk.ListStore(bool, str)
+
+ for f in self.files:
+ store.append((True, f))
+
+ self.fileList.set_model(store)
+ cell = gtk.CellRendererText()
+ tCell = gtk.CellRendererToggle()
+ tCell.set_property("activatable", True)
+ tCell.connect("toggled", self.cb_file_toggled)
+
+ self.fileList.append_column(gtk.TreeViewColumn(None, tCell, active = 0))
+ self.fileList.append_column(gtk.TreeViewColumn(None, cell, text = 1))
+
+ def cb_file_toggled(self, cell, path):
+ store = self.fileList.get_model()
+ store[path][0] = not store[path][0]
+ return True
+
+ def cb_file_clicked(self, view, path, *args):
+ store = view.get_model()
+ f = store[path][1]
+
+ dialog = ShowDialog(self.window, f)
+ dialog.run()
+ dialog.destroy()
+
def set_data (self):
self.message = MIMEMultipart()
self.message["Subject"] = "[Bug Report] Bug in Portato %s" % VERSION
self.message["To"] = self.TO
+ self.message["X-Portato-Version"] = VERSION
# TO and FROM
name = self.tree.get_widget("nameEntry").get_text()
- self.addr = self.tree.get_widget("mailEntry").get_text()
+ self.addr = self.mailEntry.get_text()
if not self.addr:
self.addr = self.TO
@@ -63,40 +127,61 @@ class MailInfoWindow (AbstractDialog):
txtmsg = MIMEText(text, "plain", "utf-8")
self.message.attach(txtmsg)
- # log
- if self.tree.get_widget("logCheck").get_active():
- with open(LOGFILE, "r") as f:
- log = MIMEText(f.read(), "plain", "utf-8")
- log.add_header('Content-Disposition', 'attachment', filename='portato.log')
+ # logs
+ for (active, f) in self.fileList.get_model():
+ if active:
+ debug("Attaching '%s'", f)
+ with open(f, "r") as text:
+ log = MIMEText(text.read(), "plain", "utf-8")
+ log.add_header('Content-Disposition', 'attachment', filename=basename(f))
- self.message.attach(log)
+ self.message.attach(log)
def send (self):
try:
- debug("Connecting to server")
- server = smtplib.SMTP("mail.necoro.eu")
- debug("Sending mail")
- try:
+ for i in range(5): # try 5 times at max
+ if i > 0:
+ info(_("Retrying after waiting %d seconds."), 300)
+ time.sleep(300)
try:
+ debug("Connecting to server")
+ server = smtplib.SMTP("mail.necoro.eu")
+ debug("Sending mail")
+
+ if smtplib._have_ssl: server.starttls()
+ else: debug("TLS not supported in Python. Continuing without it.")
+
server.sendmail(self.addr, self.TO, self.message.as_string())
except smtplib.SMTPRecipientsRefused, e:
- info(_("An error occurred while sending. I think we were greylisted. The error: %s") % e)
- info(_("Retrying after waiting 60 seconds."))
- time.sleep(60)
- server.sendmail(self.addr, self.TO, self.message.as_string())
- debug("Sent")
- finally:
- server.quit()
+ if e.recipients[self.TO][0] < 500:
+ info(_("An error occurred while sending. I think we were greylisted. The error: %s") % e)
+ else: raise
+ else:
+ debug("Sent")
+ break
+ finally:
+ try:
+ server.quit()
+ except smtplib.SMTPServerDisconnected:
+ pass # ignore this
except socket.error, e:
- mail_failure_dialog("%s (Code: %s)" % (e.args[1], e.args[0]))
+ gobject.idle_add(mail_failure_dialog, "%s (Code: %s)" % (e.args[1], e.args[0]))
+ except smtplib.SMTPResponseException, e:
+ gobject.idle_add(mail_failure_dialog, "%s (Code: %s)" % (e.smtp_error, e.smtp_code))
+ except smtplib.SMTPException, e:
+ gobject.idle_add(mail_failure_dialog, e.args)
def cb_cancel_clicked (self, *args):
-
self.close()
return True
def cb_send_clicked (self, *args):
- self.set_data()
- GtkThread(target = self.send, name = "Mail Send Thread").start()
- self.close()
+ if self.mailEntry.get_text() or dialogs.no_email_dialog(self.window) == gtk.RESPONSE_OK:
+ self.set_data()
+ GtkThread(target = self.send, name = "Mail Send Thread").start()
+ self.close()
+ else:
+ self.window.present()
+ self.mailEntry.grab_focus()
+
return True
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index ca88b04..3c868e8 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -3,7 +3,7 @@
# File: portato/gui/windows/main.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
-# Copyright (C) 2006-2009 René 'Necoro' Neumann
+# Copyright (C) 2006-2010 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.
@@ -29,7 +29,8 @@ from ... import get_listener