|
|
|
@ -143,8 +143,8 @@ class TrayIcon (QtGui.QSystemTrayIcon):
|
|
|
|
|
self.setToolTip('cl-console-gui - '+ _('System control'))
|
|
|
|
|
self.setContextMenu(self.right_menu)
|
|
|
|
|
|
|
|
|
|
self.update_thread = TrayUpdateSystem(parent)
|
|
|
|
|
self.update_thread.mes_sig.connect(self.showMessage)
|
|
|
|
|
# self.update_thread = TrayUpdateSystem(parent)
|
|
|
|
|
# self.update_thread.mes_sig.connect(self.showMessage)
|
|
|
|
|
|
|
|
|
|
def translate(self):
|
|
|
|
|
# Translate left click menu
|
|
|
|
@ -169,19 +169,17 @@ class TrayIcon (QtGui.QSystemTrayIcon):
|
|
|
|
|
self._parent.currentWidget().tools()
|
|
|
|
|
|
|
|
|
|
def exit(self):
|
|
|
|
|
# if self._parent.isVisible():
|
|
|
|
|
# self._parent.hide()
|
|
|
|
|
if self.update_thread.isRunning():
|
|
|
|
|
text = _('The system is updated')
|
|
|
|
|
informative_text = _('Stop updating and exit?')
|
|
|
|
|
reply = show_question(self._parent, text, informative_text)
|
|
|
|
|
|
|
|
|
|
if reply == QtGui.QMessageBox.No:
|
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
elif reply == QtGui.QMessageBox.Yes:
|
|
|
|
|
self.update_thread.close()
|
|
|
|
|
self.update_thread.wait()
|
|
|
|
|
# if self.update_thread.isRunning():
|
|
|
|
|
# text = _('The system is updated')
|
|
|
|
|
# informative_text = _('Stop updating and exit?')
|
|
|
|
|
# reply = show_question(self._parent, text, informative_text)
|
|
|
|
|
#
|
|
|
|
|
# if reply == QtGui.QMessageBox.No:
|
|
|
|
|
# return 0
|
|
|
|
|
#
|
|
|
|
|
# elif reply == QtGui.QMessageBox.Yes:
|
|
|
|
|
# self.update_thread.close()
|
|
|
|
|
# self.update_thread.wait()
|
|
|
|
|
|
|
|
|
|
self._parent._closeEvent()
|
|
|
|
|
|
|
|
|
@ -254,24 +252,24 @@ class LeftButtonMenu(QtGui.QMenu):
|
|
|
|
|
self, triggered=parent.windowVisible)
|
|
|
|
|
self.addAction(self.windowVisible)
|
|
|
|
|
|
|
|
|
|
# Add Update system action
|
|
|
|
|
update_icons = ['system-software-update']
|
|
|
|
|
update_icon = QtGui.QIcon()
|
|
|
|
|
for image in update_icons:
|
|
|
|
|
update_icon.setThemeName(themeName)
|
|
|
|
|
update_icon = update_icon.fromTheme(image)
|
|
|
|
|
if not update_icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
update_icon.setThemeName('Tango')
|
|
|
|
|
update_icon = update_icon.fromTheme(image)
|
|
|
|
|
if not update_icon.isNull():
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
self.sys_update = QtGui.QAction(update_icon, _("Update system"), \
|
|
|
|
|
self, triggered=parent.start_update_system)
|
|
|
|
|
self.addAction(self.sys_update)
|
|
|
|
|
|
|
|
|
|
self.addSeparator()
|
|
|
|
|
# # Add Update system action
|
|
|
|
|
# update_icons = ['system-software-update']
|
|
|
|
|
# update_icon = QtGui.QIcon()
|
|
|
|
|
# for image in update_icons:
|
|
|
|
|
# update_icon.setThemeName(themeName)
|
|
|
|
|
# update_icon = update_icon.fromTheme(image)
|
|
|
|
|
# if not update_icon.isNull():
|
|
|
|
|
# break
|
|
|
|
|
# update_icon.setThemeName('Tango')
|
|
|
|
|
# update_icon = update_icon.fromTheme(image)
|
|
|
|
|
# if not update_icon.isNull():
|
|
|
|
|
# break
|
|
|
|
|
#
|
|
|
|
|
# self.sys_update = QtGui.QAction(update_icon, _("Update system"), \
|
|
|
|
|
# self, triggered=parent.start_update_system)
|
|
|
|
|
# self.addAction(self.sys_update)
|
|
|
|
|
#
|
|
|
|
|
# self.addSeparator()
|
|
|
|
|
|
|
|
|
|
# Add exit action
|
|
|
|
|
exit_icons = ['application-exit', 'system-log-out']
|
|
|
|
|