Use correct icon for mambabase; improve About box

This commit is contained in:
Silvan Calarco 2022-06-19 19:05:43 +02:00
parent 3d9e14a5d9
commit c69b843883

View File

@ -9,12 +9,15 @@ import os
import gettext
import libproxy
import distro
from PyQt5.QtCore import pyqtSignal
from PyQt5 import uic
from PyQt5.QtCore import pyqtSignal, Qt
from PyQt5.QtGui import QIcon, QCursor
from PyQt5.QtWidgets import QSystemTrayIcon, QApplication, QMenu, QMainWindow,\
QMessageBox, QWidget
from PyQt5.QtCore import QTimer, QProcess
DATADIR = os.path.dirname(os.path.realpath((__file__))) + "/"
class SystemTrayIcon(QSystemTrayIcon):
@ -71,7 +74,7 @@ class SystemTrayIcon(QSystemTrayIcon):
softwareCheckUpgradesAction = softwareMenu.addAction(QIcon.fromTheme("system-software-update"),_("Check for updates now..."))
softwareCheckUpgradesAction.triggered.connect(self.softwareCheckUpgrades)
softwareBaseInstallsAction = softwareMenu.addAction(QIcon.fromTheme("system-logo"),_("{} components...").format(distro.name()))
softwareBaseInstallsAction = softwareMenu.addAction(QIcon.fromTheme("mambabase"),_("{} components...").format(distro.name()))
softwareBaseInstallsAction.triggered.connect(self.softwareBaseInstalls)
# network menu
@ -99,7 +102,7 @@ class SystemTrayIcon(QSystemTrayIcon):
# about box
aboutAction = self.menu.addSeparator()
aboutAction = self.menu.addAction(QIcon.fromTheme("help-about"),_("About"))
aboutAction = self.menu.addAction(QIcon.fromTheme("system-logo"),_("About"))
aboutAction.triggered.connect(self.about)
self.setToolTip(_("{} control center").format(distro.name()))
@ -131,9 +134,19 @@ class SystemTrayIcon(QSystemTrayIcon):
self.contextMenu().popup(QCursor.pos())
def about(self):
QMessageBox.about(self.menu, _("About"),
aboutBox = QMessageBox(self.menu)
aboutBox.setWindowIcon(QIcon.fromTheme("mambatray"))
aboutBox.setWindowTitle(_("About"))
aboutBox.setText(
"<center><b>"+_("{} control center").format(distro.name()+"</b>"
"<br/></br/>"+distro.name(pretty=True)+"</center>"))
"<br/><br/>"+distro.name(pretty=True)+
"<br/><br/><a href=\""+distro.os_release_info()['home_url']+
"\">" + distro.os_release_info()['home_url'] + "</a>"
"</center>"))
aboutBox.setTextFormat(Qt.RichText)
aboutBox.setIconPixmap(QIcon.fromTheme("system-logo").pixmap(32));
aboutBox.setWindowModality(Qt.NonModal);
aboutBox.exec()
def networkOnline(self):
return networkOnlineProcess.execute("/usr/bin/nm-online",['-q','-x'])
@ -234,7 +247,7 @@ class SystemTrayIcon(QSystemTrayIcon):
def Lista(self):
testo = ''
for a in lista:
testo = testo + a + ', '
testo = testo + a + ', '
return testo[0:len(testo)-2]