-
Notifications
You must be signed in to change notification settings - Fork 5
/
terre_image_about.py
65 lines (53 loc) · 2.23 KB
/
terre_image_about.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# -*- coding: utf-8 -*-
"""
/***************************************************************************
QGISEducation
A QGIS plugin
QGISEducation
-------------------
begin : 2014-11-03
copyright : (C) 2014 by CNES
email : alexia.mondot@c-s.fr
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""
from PyQt4.QtCore import QUrl
from PyQt4.QtGui import QDialog
from ui_dlg import Ui_DlgAbout
from TerreImage import name, description, version
import platform
try:
import resources
except ImportError:
import resources_rc
class DlgAbout(QDialog, Ui_DlgAbout):
def __init__(self, parent=None):
QDialog.__init__(self, parent)
self.setupUi(self)
# self.title.setText( name() + version() )
# self.description.setText( description() )
text = self.txt.toHtml()
text = text.replace("$PLUGIN_NAME$", name())
text = text.replace("$PLUGIN_VERSION$", version())
subject = "Help: %s" % name()
body = """\n\n
--------
Plugin name: %s
Plugin version: %s
Python version: %s
Platform: %s - %s
--------
""" % (name(), version(), platform.python_version(), platform.system(), platform.version())
mail = QUrl("mailto:abc@abc.com")
mail.addQueryItem("subject", subject)
mail.addQueryItem("body", body)
text = text.replace("$MAIL_SUBJECT$", unicode(mail.encodedQueryItemValue("subject")))
text = text.replace("$MAIL_BODY$", unicode(mail.encodedQueryItemValue("body")))
self.txt.setHtml(text)