Display the app window when there's no system tray available

Like in some gnome-shell setups.
This commit is contained in:
Gustavo Iñiguez Goia 2019-11-23 23:56:15 +01:00
parent 911593e55a
commit 3e0b239d8f

View file

@ -111,6 +111,8 @@ class UIService(ui_pb2_grpc.UIServicer, QtWidgets.QGraphicsObject):
self._tray = QtWidgets.QSystemTrayIcon(self.off_icon) self._tray = QtWidgets.QSystemTrayIcon(self.off_icon)
self._tray.setContextMenu(self._menu) self._tray.setContextMenu(self._menu)
self._tray.show() self._tray.show()
if not self._tray.isSystemTrayAvailable():
self._stats_dialog.show()
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def _on_status_change(self): def _on_status_change(self):
@ -289,7 +291,6 @@ class UIService(ui_pb2_grpc.UIServicer, QtWidgets.QGraphicsObject):
self._remote_stats[addr].update(request.stats) self._remote_stats[addr].update(request.stats)
else: else:
self._new_remote_trigger.emit(addr, request.stats) self._new_remote_trigger.emit(addr, request.stats)
return ui_pb2.PingReply(id=request.id) return ui_pb2.PingReply(id=request.id)
def AskRule(self, request, context): def AskRule(self, request, context):