summaryrefslogtreecommitdiffstats
path: root/powermanager/guidance_power_manager_ui.py
blob: 0edf5668ea5a384ca31ffd89a04990b52aed87b3 (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'guidance_power_manager_ui.ui'
#
# Created: Thu Apr 10 00:50:39 2008
#      by: The PyQt User Interface Compiler (pyuic) 3.17.4
#
# WARNING! All changes made in this file will be lost!


import sys
from qt import *
from tdecore import TDECmdLineArgs, TDEApplication
from tdecore import i18n
from tdeui import *



class PowerManagerUI(QWidget):
    def __init__(self,parent = None,name = None,fl = 0):
        QWidget.__init__(self,parent,name,fl)

        if not name:
            self.setName("PowerManagerUI")

        self.setMouseTracking(1)

        PowerManagerUILayout = QVBoxLayout(self,11,6,"PowerManagerUILayout")

        self.GeneralSettingsBox = QGroupBox(self,"GeneralSettingsBox")
        self.GeneralSettingsBox.setColumnLayout(0,Qt.Vertical)
        self.GeneralSettingsBox.layout().setSpacing(6)
        self.GeneralSettingsBox.layout().setMargin(11)
        GeneralSettingsBoxLayout = QVBoxLayout(self.GeneralSettingsBox.layout())
        GeneralSettingsBoxLayout.setAlignment(Qt.AlignTop)

        self.lockScreenOnResume = QCheckBox(self.GeneralSettingsBox,"lockScreenOnResume")
        GeneralSettingsBoxLayout.addWidget(self.lockScreenOnResume)
        PowerManagerUILayout.addWidget(self.GeneralSettingsBox)

        self.MainsPoweredBox = QGroupBox(self,"MainsPoweredBox")
        self.MainsPoweredBox.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Fixed,0,0,self.MainsPoweredBox.sizePolicy().hasHeightForWidth()))
        self.MainsPoweredBox.setColumnLayout(0,Qt.Vertical)
        self.MainsPoweredBox.layout().setSpacing(6)
        self.MainsPoweredBox.layout().setMargin(11)
        MainsPoweredBoxLayout = QVBoxLayout(self.MainsPoweredBox.layout())
        MainsPoweredBoxLayout.setAlignment(Qt.AlignTop)

        layout17 = QHBoxLayout(None,0,6,"layout17")

        self.PoweredBrightnessLabel = QLabel(self.MainsPoweredBox,"PoweredBrightnessLabel")
        layout17.addWidget(self.PoweredBrightnessLabel)

        self.PoweredBrightnessSlider = QSlider(self.MainsPoweredBox,"PoweredBrightnessSlider")
        self.PoweredBrightnessSlider.setMouseTracking(1)
        self.PoweredBrightnessSlider.setAcceptDrops(1)
        self.PoweredBrightnessSlider.setMaxValue(7)
        self.PoweredBrightnessSlider.setLineStep(1)
        self.PoweredBrightnessSlider.setPageStep(1)
        self.PoweredBrightnessSlider.setOrientation(QSlider.Horizontal)
        self.PoweredBrightnessSlider.setTickmarks(QSlider.Both)
        self.PoweredBrightnessSlider.setTickInterval(0)
        layout17.addWidget(self.PoweredBrightnessSlider)
        MainsPoweredBoxLayout.addLayout(layout17)

        layout13 = QHBoxLayout(None,0,6,"layout13")
        spacer12_3_2_2 = QSpacerItem(200,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout13.addItem(spacer12_3_2_2)

        self.PoweredIdleLabel = QLabel(self.MainsPoweredBox,"PoweredIdleLabel")
        layout13.addWidget(self.PoweredIdleLabel)

        self.PoweredIdleTime = QSpinBox(self.MainsPoweredBox,"PoweredIdleTime")
        layout13.addWidget(self.PoweredIdleTime)

        self.PoweredIdleCombo = QComboBox(0,self.MainsPoweredBox,"PoweredIdleCombo")
        layout13.addWidget(self.PoweredIdleCombo)
        MainsPoweredBoxLayout.addLayout(layout13)

        layout13_2_2 = QHBoxLayout(None,0,6,"layout13_2_2")
        spacer12_3_2_2_3_2 = QSpacerItem(200,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout13_2_2.addItem(spacer12_3_2_2_3_2)

        self.PoweredFreqLabel = QLabel(self.MainsPoweredBox,"PoweredFreqLabel")
        layout13_2_2.addWidget(self.PoweredFreqLabel)

        self.PoweredFreqCombo = QComboBox(0,self.MainsPoweredBox,"PoweredFreqCombo")
        layout13_2_2.addWidget(self.PoweredFreqCombo)
        MainsPoweredBoxLayout.addLayout(layout13_2_2)
        PowerManagerUILayout.addWidget(self.MainsPoweredBox)

        self.BatteryBox = QGroupBox(self,"BatteryBox")
        self.BatteryBox.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Fixed,0,0,self.BatteryBox.sizePolicy().hasHeightForWidth()))
        self.BatteryBox.setColumnLayout(0,Qt.Vertical)
        self.BatteryBox.layout().setSpacing(6)
        self.BatteryBox.layout().setMargin(11)
        BatteryBoxLayout = QVBoxLayout(self.BatteryBox.layout())
        BatteryBoxLayout.setAlignment(Qt.AlignTop)

        layout16 = QHBoxLayout(None,0,6,"layout16")

        self.BatteryBrightnessLabel = QLabel(self.BatteryBox,"BatteryBrightnessLabel")
        layout16.addWidget(self.BatteryBrightnessLabel)

        self.BatteryBrightnessSlider = QSlider(self.BatteryBox,"BatteryBrightnessSlider")
        self.BatteryBrightnessSlider.setMouseTracking(1)
        self.BatteryBrightnessSlider.setMaxValue(7)
        self.BatteryBrightnessSlider.setPageStep(1)
        self.BatteryBrightnessSlider.setOrientation(QSlider.Horizontal)
        self.BatteryBrightnessSlider.setTickmarks(QSlider.Both)
        layout16.addWidget(self.BatteryBrightnessSlider)
        BatteryBoxLayout.addLayout(layout16)

        layout14 = QGridLayout(None,1,1,0,6,"layout14")

        self.BatteryIdleCombo = QComboBox(0,self.BatteryBox,"BatteryIdleCombo")

        layout14.addWidget(self.BatteryIdleCombo,1,4)

        self.BatteryIdleLabel = QLabel(self.BatteryBox,"BatteryIdleLabel")

        layout14.addWidget(self.BatteryIdleLabel,1,2)

        self.BatteryCriticalCombo = QComboBox(0,self.BatteryBox,"BatteryCriticalCombo")

        layout14.addWidget(self.BatteryCriticalCombo,0,4)

        self.BatteryCriticalLabel = QLabel(self.BatteryBox,"BatteryCriticalLabel")

        layout14.addMultiCellWidget(self.BatteryCriticalLabel,0,0,1,2)

        self.BatteryIdleTime = QSpinBox(self.BatteryBox,"BatteryIdleTime")

        layout14.addWidget(self.BatteryIdleTime,1,3)

        self.CriticalRemainTime = QSpinBox(self.BatteryBox,"CriticalRemainTime")

        layout14.addWidget(self.CriticalRemainTime,0,3)
        spacer12_3 = QSpacerItem(28,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout14.addItem(spacer12_3,0,0)
        spacer12_3_2 = QSpacerItem(50,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout14.addMultiCell(spacer12_3_2,1,1,0,1)
        BatteryBoxLayout.addLayout(layout14)

        layout13_2 = QHBoxLayout(None,0,6,"layout13_2")
        spacer12_3_2_2_3 = QSpacerItem(200,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout13_2.addItem(spacer12_3_2_2_3)

        self.BatteryFreqLabel = QLabel(self.BatteryBox,"BatteryFreqLabel")
        layout13_2.addWidget(self.BatteryFreqLabel)

        self.BatteryFreqCombo = QComboBox(0,self.BatteryBox,"BatteryFreqCombo")
        layout13_2.addWidget(self.BatteryFreqCombo)
        BatteryBoxLayout.addLayout(layout13_2)
        PowerManagerUILayout.addWidget(self.BatteryBox)

        self.LaptopLidRadios = QButtonGroup(self,"LaptopLidRadios")
        self.LaptopLidRadios.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Fixed,0,0,self.LaptopLidRadios.sizePolicy().hasHeightForWidth()))
        self.LaptopLidRadios.setFrameShape(QButtonGroup.GroupBoxPanel)
        self.LaptopLidRadios.setColumnLayout(0,Qt.Vertical)
        self.LaptopLidRadios.layout().setSpacing(5)
        self.LaptopLidRadios.layout().setMargin(11)
        LaptopLidRadiosLayout = QHBoxLayout(self.LaptopLidRadios.layout())
        LaptopLidRadiosLayout.setAlignment(Qt.AlignTop)

        self.laptopClosedNone = QRadioButton(self.LaptopLidRadios,"laptopClosedNone")
        LaptopLidRadiosLayout.addWidget(self.laptopClosedNone)

        self.laptopClosedBlank = QRadioButton(self.LaptopLidRadios,"laptopClosedBlank")
        LaptopLidRadiosLayout.addWidget(self.laptopClosedBlank)

        self.laptopClosedSuspend = QRadioButton(self.LaptopLidRadios,"laptopClosedSuspend")
        LaptopLidRadiosLayout.addWidget(self.laptopClosedSuspend)

        self.laptopClosedHibernate = QRadioButton(self.LaptopLidRadios,"laptopClosedHibernate")
        LaptopLidRadiosLayout.addWidget(self.laptopClosedHibernate)

        self.laptopClosedShutdown = QRadioButton(self.LaptopLidRadios,"laptopClosedShutdown")
        LaptopLidRadiosLayout.addWidget(self.laptopClosedShutdown)
        spacer12_2 = QSpacerItem(213,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        LaptopLidRadiosLayout.addItem(spacer12_2)
        PowerManagerUILayout.addWidget(self.LaptopLidRadios)
        spacer11 = QSpacerItem(31,80,QSizePolicy.Minimum,QSizePolicy.Expanding)
        PowerManagerUILayout.addItem(spacer11)

        self.languageChange()

        self.resize(QSize(505,374).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)


    def languageChange(self):
        self.setCaption(i18n("PowerManagerUI"))
        self.GeneralSettingsBox.setTitle(i18n("General Settings"))
        self.lockScreenOnResume.setText(i18n("Lock screen on resume"))
        self.MainsPoweredBox.setTitle(i18n("Mains Powered"))
        self.PoweredBrightnessLabel.setText(i18n("Brightness"))
        QWhatsThis.add(self.PoweredBrightnessSlider,i18n("With this slider you can set the brightness when the system is plugged into the socket outlet"))
        self.PoweredIdleLabel.setText(i18n("When the system is idle for more than"))
        self.PoweredIdleTime.setPrefix(QString.null)
        self.PoweredIdleTime.setSuffix(i18n(" min"))
        QWhatsThis.add(self.PoweredIdleTime,i18n("To prevent data loss or other damage, you can have the system suspend or hibernate, so you don't run accidentally out of battery power. Configure the number of minutes below which the machine will run the configured action."))
        self.PoweredFreqLabel.setText(i18n("CPU frequency scaling policy"))
        self.BatteryBox.setTitle(i18n("Battery Powered"))
        self.BatteryBrightnessLabel.setText(i18n("Brightness"))
        QWhatsThis.add(self.BatteryBrightnessSlider,i18n("This slider controls the brightness when the system runs on batteries"))
        self.BatteryIdleLabel.setText(i18n("When the system is idle for more than"))
        self.BatteryCriticalLabel.setText(i18n("When battery remaining time drops below"))
        self.BatteryIdleTime.setPrefix(QString.null)
        self.BatteryIdleTime.setSuffix(i18n(" min"))
        QWhatsThis.add(self.BatteryIdleTime,i18n("To prevent data loss or other damage, you can have the system suspend or hibernate, so you don't run accidentally out of battery power. Configure the number of minutes below which the machine will run the configured action."))
        self.CriticalRemainTime.setPrefix(QString.null)
        self.CriticalRemainTime.setSuffix(i18n(" min"))
        QWhatsThis.add(self.CriticalRemainTime,i18n("To prevent data loss or other damage, you can have the system suspend or hibernate, so you don't run accidentally out of battery power. Configure the number of minutes below which the machine will run the configured action."))
        self.BatteryFreqLabel.setText(i18n("CPU frequency scaling policy"))
        self.LaptopLidRadios.setTitle(i18n("When Laptop Lid Closed"))
        self.laptopClosedNone.setText(i18n("Do nothing"))
        self.laptopClosedBlank.setText(i18n("Lock screen"))
        self.laptopClosedSuspend.setText(i18n("Suspend"))
        QToolTip.add(self.laptopClosedSuspend,i18n("Suspend to Memory"))
        QWhatsThis.add(self.laptopClosedSuspend,i18n("Suspend is a sleep state, the system will consume only very little energy when suspended"))
        self.laptopClosedHibernate.setText(i18n("Hibernate"))
        QToolTip.add(self.laptopClosedHibernate,i18n("Suspend to Disk"))
        QWhatsThis.add(self.laptopClosedHibernate,i18n("Hibernate or \"Suspend to Disk\" is a deep sleepstate, allowing the system to power off completely"))
        self.laptopClosedShutdown.setText(i18n("Shutdown"))
        QToolTip.add(self.laptopClosedShutdown,i18n("Halt the machine"))


if __name__ == "__main__":
    appname     = ""
    description = ""
    version     = ""

    TDECmdLineArgs.init (sys.argv, appname, description, version)
    a = TDEApplication ()

    QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
    w = PowerManagerUI()
    a.setMainWidget(w)
    w.show()
    a.exec_loop()