9 |
9 |
10 from PyQt6.QtCore import pyqtSignal |
10 from PyQt6.QtCore import pyqtSignal |
11 from PyQt6.QtNetwork import QNetworkInformation |
11 from PyQt6.QtNetwork import QNetworkInformation |
12 from PyQt6.QtWidgets import QLabel |
12 from PyQt6.QtWidgets import QLabel |
13 |
13 |
14 import UI.PixmapCache |
14 from eric7.EricGui import EricPixmapCache |
15 import Preferences |
15 from eric7 import Preferences |
16 |
16 |
17 |
17 |
18 class EricNetworkIcon(QLabel): |
18 class EricNetworkIcon(QLabel): |
19 """ |
19 """ |
20 Class implementing a statusbar icon tracking the network status. |
20 Class implementing a statusbar icon tracking the network status. |
66 "<p>Shows the Internet reachability status<br/><br/>" |
66 "<p>Shows the Internet reachability status<br/><br/>" |
67 "<b>Internet:</b> {0}</p>" |
67 "<b>Internet:</b> {0}</p>" |
68 ) |
68 ) |
69 |
69 |
70 if online: |
70 if online: |
71 self.setPixmap(UI.PixmapCache.getPixmap("network-online")) |
71 self.setPixmap(EricPixmapCache.getPixmap("network-online")) |
72 tooltip = tooltip.format(self.tr("Reachable")) |
72 tooltip = tooltip.format(self.tr("Reachable")) |
73 else: |
73 else: |
74 self.setPixmap(UI.PixmapCache.getPixmap("network-offline")) |
74 self.setPixmap(EricPixmapCache.getPixmap("network-offline")) |
75 tooltip = tooltip.format(self.tr("Not Reachable")) |
75 tooltip = tooltip.format(self.tr("Not Reachable")) |
76 |
76 |
77 self.setToolTip(tooltip) |
77 self.setToolTip(tooltip) |
78 |
78 |
79 if online != self.__online: |
79 if online != self.__online: |