|
|
@ -154,8 +154,6 @@ class TrayIcon (QtGui.QSystemTrayIcon):
|
|
|
|
self.generation_actions()
|
|
|
|
self.generation_actions()
|
|
|
|
self.right_menu = self.create_menu('help', 'bug_report', None, 'tools',
|
|
|
|
self.right_menu = self.create_menu('help', 'bug_report', None, 'tools',
|
|
|
|
'update_system', None, 'exit')
|
|
|
|
'update_system', None, 'exit')
|
|
|
|
self.left_menu = self.create_menu('show_hide', 'update_system', None,
|
|
|
|
|
|
|
|
'exit')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.activated.connect(self.activ)
|
|
|
|
self.activated.connect(self.activ)
|
|
|
|
self.setToolTip('cl-console-gui - '+ _('System control'))
|
|
|
|
self.setToolTip('cl-console-gui - '+ _('System control'))
|
|
|
@ -316,21 +314,14 @@ class TrayIcon (QtGui.QSystemTrayIcon):
|
|
|
|
self._parent._closeEvent()
|
|
|
|
self._parent._closeEvent()
|
|
|
|
|
|
|
|
|
|
|
|
def activ(self, reason):
|
|
|
|
def activ(self, reason):
|
|
|
|
if reason == QtGui.QSystemTrayIcon.MiddleClick:
|
|
|
|
if reason == QtGui.QSystemTrayIcon.Trigger:
|
|
|
|
self.windowVisible()
|
|
|
|
|
|
|
|
elif reason == QtGui.QSystemTrayIcon.Trigger:
|
|
|
|
|
|
|
|
if self.check_for_update():
|
|
|
|
if self.check_for_update():
|
|
|
|
self.start_update_system()
|
|
|
|
self.start_update_system()
|
|
|
|
return
|
|
|
|
return
|
|
|
|
if QtGui.QCursor.pos().y() < self.left_menu.sizeHint().height():
|
|
|
|
|
|
|
|
self.left_menu.move(QtCore.QPoint \
|
|
|
|
|
|
|
|
(self.geometry().x(), self.geometry().y()) + \
|
|
|
|
|
|
|
|
QtCore.QPoint(0, self.geometry().height() + 8))
|
|
|
|
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
point = QtCore.QPoint(self.left_menu.sizeHint().width(), \
|
|
|
|
self.windowVisible()
|
|
|
|
self.left_menu.sizeHint().height() + 16)
|
|
|
|
if reason == QtGui.QSystemTrayIcon.DoubleClick:
|
|
|
|
self.left_menu.move(QtGui.QCursor.pos() - point)
|
|
|
|
self.windowVisible()
|
|
|
|
self.left_menu.show()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def showMessage(self, title, message, icon = 'dialog-warning'):
|
|
|
|
def showMessage(self, title, message, icon = 'dialog-warning'):
|
|
|
|
|
|
|
|
|
|
|
|