| 1 | # -*- coding: utf-8 -*- |
|---|
| 2 | |
|---|
| 3 | """ Panohead remote control. |
|---|
| 4 | |
|---|
| 5 | License |
|---|
| 6 | ======= |
|---|
| 7 | |
|---|
| 8 | - B{papywizard} (U{http://trac.gbiloba.org/papywizard}) is Copyright: |
|---|
| 9 | - (C) 2007-2009 Frédéric Mantegazza |
|---|
| 10 | |
|---|
| 11 | This software is governed by the B{CeCILL} license under French law and |
|---|
| 12 | abiding by the rules of distribution of free software. You can use, |
|---|
| 13 | modify and/or redistribute the software under the terms of the CeCILL |
|---|
| 14 | license as circulated by CEA, CNRS and INRIA at the following URL |
|---|
| 15 | U{http://www.cecill.info}. |
|---|
| 16 | |
|---|
| 17 | As a counterpart to the access to the source code and rights to copy, |
|---|
| 18 | modify and redistribute granted by the license, users are provided only |
|---|
| 19 | with a limited warranty and the software's author, the holder of the |
|---|
| 20 | economic rights, and the successive licensors have only limited |
|---|
| 21 | liability. |
|---|
| 22 | |
|---|
| 23 | In this respect, the user's attention is drawn to the risks associated |
|---|
| 24 | with loading, using, modifying and/or developing or reproducing the |
|---|
| 25 | software by the user in light of its specific status of free software, |
|---|
| 26 | that may mean that it is complicated to manipulate, and that also |
|---|
| 27 | therefore means that it is reserved for developers and experienced |
|---|
| 28 | professionals having in-depth computer knowledge. Users are therefore |
|---|
| 29 | encouraged to load and test the software's suitability as regards their |
|---|
| 30 | requirements in conditions enabling the security of their systems and/or |
|---|
| 31 | data to be ensured and, more generally, to use and operate it in the |
|---|
| 32 | same conditions as regards security. |
|---|
| 33 | |
|---|
| 34 | The fact that you are presently reading this means that you have had |
|---|
| 35 | knowledge of the CeCILL license and that you accept its terms. |
|---|
| 36 | |
|---|
| 37 | Module purpose |
|---|
| 38 | ============== |
|---|
| 39 | |
|---|
| 40 | Plugins architecture |
|---|
| 41 | |
|---|
| 42 | Implements |
|---|
| 43 | ========== |
|---|
| 44 | |
|---|
| 45 | - ComboBoxField |
|---|
| 46 | - LineEditField |
|---|
| 47 | - SpinBoxField |
|---|
| 48 | - CheckBoxField |
|---|
| 49 | |
|---|
| 50 | @author: Frédéric Mantegazza |
|---|
| 51 | @copyright: (C) 2007-2009 Frédéric Mantegazza |
|---|
| 52 | @license: CeCILL |
|---|
| 53 | """ |
|---|
| 54 | |
|---|
| 55 | __revision__ = "$Id$" |
|---|
| 56 | |
|---|
| 57 | from PyQt4 import QtGui |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | class ComboBoxField(QtGui.QComboBox): |
|---|
| 61 | """ |
|---|
| 62 | """ |
|---|
| 63 | def __init__(self, entries, current): |
|---|
| 64 | """ |
|---|
| 65 | """ |
|---|
| 66 | QtGui.QComboBox.__init__(self) |
|---|
| 67 | self.addItems(entries) |
|---|
| 68 | self.setCurrentIndex(entries.index(current)) |
|---|
| 69 | |
|---|
| 70 | |
|---|
| 71 | class LineEditField(QtGui.QLineEdit): |
|---|
| 72 | """ |
|---|
| 73 | """ |
|---|
| 74 | def __init__(self, text): |
|---|
| 75 | """ |
|---|
| 76 | """ |
|---|
| 77 | QtGui.QLineEdit.__init__(self, text) |
|---|
| 78 | self.adjustSize() |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | class SpinBoxField(QtGui.QSpinBox): |
|---|
| 82 | """ |
|---|
| 83 | """ |
|---|
| 84 | def __init__(self, minimum, maximum, value): |
|---|
| 85 | """ |
|---|
| 86 | """ |
|---|
| 87 | QtGui.QSpinBox.__init__(self) |
|---|
| 88 | self.setMinimum(minimum) |
|---|
| 89 | self.setMaximum(maximum) |
|---|
| 90 | self.setValue(value) |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | class CheckBoxField(QtGui.QCheckBox): |
|---|
| 94 | """ |
|---|
| 95 | """ |
|---|
| 96 | def __init__(self, checked): |
|---|
| 97 | """ |
|---|
| 98 | """ |
|---|
| 99 | QtGui.QCheckBox.__init__(self) |
|---|
| 100 | self.setChecked(checked) |
|---|