~ubuntu-branches/ubuntu/raring/hplip/raring

« back to all changes in this revision

Viewing changes to ui4/systrayframe.py

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-10-06 15:03:44 UTC
  • mfrom: (1.6.1) (20.1.16 quantal)
  • Revision ID: package-import@ubuntu.com-20121006150344-2p3xz26br0t3hu2q
Tags: 3.12.10-1
* New upstream release
  - Fixes "Network scanning fails (Closes: #683033)
* quilt refresh hplip-syslog-fix-debug-messages-to-error.dpatch
* Fix "error in clean build env" updated debian/rules (Closes: #687129)

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        QFrame.__init__(self, parent)
35
35
 
36
36
 
37
 
    def initUi(self, systray_visible, polling, polling_interval, device_list, systray_messages):
 
37
    def initUi(self, systray_visible, polling, polling_interval, device_list, systray_messages,upgrade_notify,
 
38
                                        upgrade_postpone_time, upgrade_msg):
 
39
                                    
38
40
        self.systray_visible = systray_visible
39
41
        self.polling = polling
40
42
        self.polling_interval = polling_interval
41
43
        self.device_list = device_list
42
44
        self.systray_messages = systray_messages
 
45
        self.upgrade_notify = upgrade_notify
 
46
        self.upgrade_postpone_time =upgrade_postpone_time
 
47
        self.upgrade_msg = upgrade_msg
43
48
 
44
49
        self.gridlayout = QGridLayout(self)
45
50
 
96
101
        self.listWidget = QListWidget(self.MonitorGroupBox)
97
102
        self.gridlayout4.addWidget(self.listWidget,1,0,1,1)
98
103
        self.gridlayout1.addWidget(self.MonitorGroupBox,1,0,1,2)
 
104
        
 
105
        
 
106
        #UpdategroupBox  is same as "gridlayout5"
 
107
        self.groupBox_4 = QGroupBox(self.frame)
 
108
        self.UpdategroupBox = QGridLayout(self.groupBox_4)
 
109
        self.UpdategroupBox.setObjectName("UpdategroupBox")
 
110
        self.UpdatecheckBox = QCheckBox(self.groupBox_4)
 
111
        self.UpdatecheckBox.setObjectName("UpdatecheckBox")
 
112
        self.UpdategroupBox.addWidget(self.UpdatecheckBox,0,0,1,4)
 
113
        self.label_5 = QLabel(self.groupBox_4)
 
114
        self.label_5.setObjectName("label_5")
 
115
        self.UpdategroupBox.addWidget(self.label_5, 1, 0, 1, 4)
 
116
        self.textEdit = QTextEdit(self.groupBox_4)
 
117
        self.textEdit.setObjectName("textEdit")
 
118
        self.textEdit.setReadOnly(True)
 
119
        self.UpdategroupBox.addWidget(self.textEdit, 2, 0, 1, 4)
 
120
        self.gridlayout1.addWidget(self.groupBox_4,2,0,1,2)
 
121
 
99
122
        self.gridlayout.addWidget(self.frame,0,0,1,1)
 
123
        
 
124
        
100
125
 
101
126
        self.setWindowTitle(QApplication.translate("self", "self", None, QApplication.UnicodeUTF8))
102
127
        self.groupBox_2.setTitle(QApplication.translate("self", "System tray icon visibility", None, QApplication.UnicodeUTF8))
107
132
        self.label_2.setText(QApplication.translate("self", "Messages to show:", None, QApplication.UnicodeUTF8))
108
133
        self.MonitorGroupBox.setTitle(QApplication.translate("self", "Monitor button presses on devices", None, QApplication.UnicodeUTF8))
109
134
        self.label.setText(QApplication.translate("self", "Devices to monitor:", None, QApplication.UnicodeUTF8))
 
135
        
 
136
        
 
137
        self.groupBox_4.setTitle(QApplication.translate("Dialog", "Update Settings", None, QApplication.UnicodeUTF8))
 
138
        self.UpdatecheckBox.setText(QApplication.translate("Dialog", "Check and notify HPLIP updates", None, QApplication.UnicodeUTF8))
 
139
        self.label_5.setText(QApplication.translate("Dialog", "Status:", None, QApplication.UnicodeUTF8))
 
140
        self.textEdit.setPlainText(self.upgrade_msg)
 
141
        
110
142
 
111
143
        self.connect(self.ShowAlwaysRadioButton, SIGNAL("clicked(bool)"), self.ShowAlwaysRadioButton_clicked)
112
144
        self.connect(self.HideWhenInactiveRadioButton, SIGNAL("clicked(bool)"), self.HideWhenInactiveRadioButton_clicked)
113
145
        self.connect(self.HideAlwaysRadioButton, SIGNAL("clicked(bool)"), self.HideAlwaysRadioButton_clicked)
114
146
        self.connect(self.MessageShowComboBox, SIGNAL("activated(int)"), self.MessageShowComboBox_activated)
115
 
 
 
147
        self.connect(self.UpdatecheckBox, SIGNAL("clicked(bool)"), self.UpdatecheckBox_clicked)
 
148
        
 
149
 
 
150
 
 
151
 
 
152
    def UpdatecheckBox_clicked(self, b):
 
153
        log.debug("Update HPLIP val =%d "%b)
 
154
        if b is False:
 
155
            self.upgrade_notify = False
 
156
        else:
 
157
            self.upgrade_notify = True
116
158
 
117
159
    def updateUi(self):
118
160
        self.updateVisibility()
119
161
        self.updateMessages()
120
162
        self.updateDeviceList()
 
163
        self.updateUpgradeSettings()
121
164
 
122
165
 
123
166
    def updateVisibility(self):
159
202
    def updateDeviceList(self):
160
203
        pass
161
204
 
 
205
    def updateUpgradeSettings(self):
 
206
        if self.upgrade_notify is True:
 
207
            self.UpdatecheckBox.setChecked(True)
 
208
        else:
 
209
            self.UpdatecheckBox.setChecked(False)
 
210
 
 
211
 
 
212
 
162
213
 
163
214
    def __tr(self, s, c=None):
164
215
        return QApplication.translate("SystrayFrame", s, c, QApplication.UnicodeUTF8)