root/branches/libffado-2.0/support/mixer-qt4/ffado_regdialog.py

Revision 1298, 3.7 kB (checked in by ppalmers, 13 years ago)

add Qt4 port of the mixer (only for audiofire and saffire ATM). needed since PyQt?3 doesn't support DBUS signals.

Line 
1 #
2 # Copyright (C) 2005-2008 by Pieter Palmers
3 #
4 # This file is part of FFADO
5 # FFADO = Free Firewire (pro-)audio drivers for linux
6 #
7 # FFADO is based upon FreeBoB.
8 #
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 2 of the License, or
12 # (at your option) version 3 of the License.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 #
22
23 from PyQt4.QtCore import SIGNAL, SLOT, QObject
24 from PyQt4.QtGui import QDialog
25 from ffado_regdialogui import Ui_ffadoRegDialogUI
26
27 REGISTRATION_MESSAGE = """
28 <html><head><meta name="qrichtext" content="1" />
29 <style type="text/css">\np, li { white-space: pre-wrap; }\n</style></head>
30 <body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">\n
31 <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
32 You are running this version of FFADO for the first time with this device. </p>
33 <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
34 In order to collect usage statistics we would like to send some information about your system to ffado.org.
35 It is very important for us to have good usage statistics. This is to convince vendors that Linux users
36 do exist and is where you as a user can help the project. </p>
37 <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
38 The information collected is intended only for usage monitoring. The email address is optional, and will
39 be used for FFADO related announcements only. If you provide one, please provide a valid one. </p>
40 <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
41 Note: This registration can also be performed on-line at
42 <a href="http://www.ffado.org/?q=usage">http://www.ffado.org/?q=usage</a>.</p></body></html>
43 """
44
45 class ffadoRegDialog(QDialog, Ui_ffadoRegDialogUI):
46     def __init__(self, vendor_name, vendor_id, model_name, model_id,
47                  guid, version, email="(optional)",
48                  parent = None):
49         QDialog.__init__(self,parent)
50         self.setupUi(self)
51         self.txtVendorName.setText(vendor_name)
52         self.txtVendorId.setText(vendor_id)
53         self.txtModelName.setText(model_name)
54         self.txtModelId.setText(model_id)
55         self.txtGUID.setText(guid)
56         self.txtVersion.setText(version)
57         self.txtEmail.setText(email)
58         self.txtMessage.setHtml(REGISTRATION_MESSAGE)
59
60         self.choice = "nosend"
61         QObject.connect(self.btnSend,SIGNAL('clicked()'),self.buttonPressed)
62         QObject.connect(self.btnNoSend,SIGNAL('clicked()'),self.buttonPressed)
63         QObject.connect(self.btnNeverSend,SIGNAL('clicked()'),self.buttonPressed)
64
65     def buttonPressed(self):
66         sender = self.sender()
67         if sender == self.btnSend:
68             print "user chose to send"
69             self.choice = "send"
70         elif sender ==  self.btnNoSend:
71             print "user chose not to send"
72             self.choice = "nosend"
73         elif sender ==  self.btnNeverSend:
74             print "user chose to never send"
75             self.choice = "neversend"
76         self.close()
77
78     def getEmail(self):
79         return self.txtEmail.text()
Note: See TracBrowser for help on using the browser.