示例#1
0
 def onIconChange(self):
     icon = self.parentWidget().windowIcon()
     if icon is None:
         icon = qApp.windowIcon()
         if icon is None:
             pass
     self.sysMenuButton.setIcon(icon)
示例#2
0
 def createTrayIcon(self):
     """Create a new system tray icon if not already created.
     """
     if QSystemTrayIcon.isSystemTrayAvailable:
         if not self.trayIcon:
             self.trayIcon = QSystemTrayIcon(qApp.windowIcon(), qApp)
             self.trayIcon.activated.connect(self.toggleTrayShow)
         self.trayIcon.show()
示例#3
0
 def notify_update(parent: QWidget, version: str) -> QMessageBox.ButtonRole:
     mbox = QMessageBox(parent)
     mbox.setIconPixmap(qApp.windowIcon().pixmap(64, 64))
     mbox.setWindowTitle('%s UPDATER' % qApp.applicationName())
     mbox.setText(
         '<table border="0" width="350"><tr><td><h4 align="center">Your Version: %s <br/> Available Version: %s'
         % (qApp.applicationVersion(), version) +
         '</h4></td></tr></table><br/>')
     mbox.setInformativeText(
         'A new version of %s has been detected. Would you like to update now?'
         % qApp.applicationName())
     install_btn = mbox.addButton('Install Update', QMessageBox.AcceptRole)
     reject_btn = mbox.addButton('Not Now', QMessageBox.RejectRole)
     mbox.setDefaultButton(install_btn)
     return mbox.exec_()
示例#4
0
 def notify_restart(parent: QWidget) -> bool:
     mbox = QMessageBox(parent)
     mbox.setIconPixmap(qApp.windowIcon().pixmap(64, 64))
     mbox.setWindowTitle('%s UPDATER' % qApp.applicationName())
     mbox.setText(
         '<h3 style="color:#6A4572;">INSTALLATION COMPLETE</h3>' +
         '<table border="0" width="350"><tr><td><p>The application needs to be restarted in order to use '
         +
         'the newly installed version.</p><p>Would you like to restart now?</td></tr></table><br/>'
     )
     restart_btn = mbox.addButton('Yes', QMessageBox.AcceptRole)
     restart_btn.clicked.connect(Updater.restart_app)
     reject_btn = mbox.addButton('No', QMessageBox.RejectRole)
     mbox.setDefaultButton(restart_btn)
     return mbox.exec_()
示例#5
0
    def __init__(self, parent: QWidget = None):
        """Constructor de la clase. Construye e inicializa una instancia de AboutBox.

        Note:
            Antes de instanciar un objeto de esta clase, la configuración del programa debe haber
            sido cargada. Para esto llamar a Settings.load_settings().

        Args:
            parent (QWidget): Padre de este QDialog. Defaults to None.
        """
        super().__init__(parent)
        self.setTextFormat(Qt.RichText)
        self.setText(
            """
<style>
    a {color: #eeeeef;}
    div {color: #ececec;}
</style>
<div>
<strong>CAPOUNET Sync</strong>
<br>©2018
<br><br>
Desarrollado para la Caja de Ahorros del Personal Obrero de la Universidad \
Nacional Experimental del Táchira.
<br><br>
<strong>Esta aplicación ha sido desarrollada con:</strong>
<br> - Python 3.6
<br> - PyQt5
<br> - Requests 2.18.4
<br> - QDarkStyle 2.5.4
<br><br>
<strong>Desarrolladores:</strong>
<br> -Gregory Sánchez <a href="https://github.com/gregsanz182">@gregsanz182</a>
<br> -Anny Chacón <a href="https://github.com/AnnyChacon">@AnnyChacon</a>
<br>
<br><strong>GNU General Public License v3.0</strong>
<br>Este programa no incluye garantía alguna.
<br>Es software libre, y puedes distribuirlo bajo ciertas condiciones.
<br>Debiste haber recibido una copia de la Licencia Pública General (GNU) con este programa.
Si no es así, visita <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.
</div>
            """
        )
        self.setIconPixmap(qApp.windowIcon().pixmap(QSize(80, 80)))
        self.setWindowTitle("Sobre CAPOUNET Sync")
示例#6
0
 def _initSystemTray(self):
     from PyQt5.QtWidgets import qApp
     self.systemTray = QSystemTrayIcon(self)
     self.systemTray.setIcon(qApp.windowIcon())
     self.systemTray.show()
     self.systemTray.activated.connect(self.onSystemTrayIconClicked)
示例#7
0
 def _initSystemTray(self):
     from PyQt5.QtWidgets import qApp
     self.systemTray = QSystemTrayIcon(self)
     self.systemTray.setIcon(qApp.windowIcon())
     self.systemTray.show()
     self.systemTray.activated.connect(self.onSystemTrayIconClicked)