-
Notifications
You must be signed in to change notification settings - Fork 0
/
DlgAbout.py
48 lines (34 loc) · 1.13 KB
/
DlgAbout.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
# -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from ui.DlgAbout_ui import Ui_DlgAbout
from TransformationTools 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.logo.setPixmap( QPixmap( ":/faunalia/logo" ) )
self.title.setText( name() )
self.description.setText( description() )
text = self.txt.toHtml()
text = text.replace( "$PLUGIN_NAME$", name() )
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)