Przeglądaj źródła

use Qt instead of xdg-open to open browser

Thomas Buck 3 lat temu
rodzic
commit
0f940b4a92
1 zmienionych plików z 2 dodań i 3 usunięć
  1. 2
    3
      octotray

+ 2
- 3
octotray Wyświetl plik

@@ -5,7 +5,6 @@
5 5
 # depends on:
6 6
 # - python-pyqt5
7 7
 # - curl
8
-# - xdg-open
9 8
 #
10 9
 # see also:
11 10
 # https://doc.qt.io/qt-5/qtwidgets-widgets-imageviewer-example.html
@@ -20,7 +19,7 @@ import time
20 19
 import urllib.parse
21 20
 from PyQt5 import QtWidgets, QtGui, QtCore, QtNetwork
22 21
 from PyQt5.QtWidgets import QSystemTrayIcon, QAction, QMenu, QMessageBox, QWidget, QLabel, QVBoxLayout, QHBoxLayout, QDesktopWidget, QSizePolicy, QSlider, QLayout
23
-from PyQt5.QtGui import QIcon, QPixmap, QImageReader
22
+from PyQt5.QtGui import QIcon, QPixmap, QImageReader, QDesktopServices
24 23
 from PyQt5.QtCore import QCoreApplication, QSettings, QUrl, QTimer, QSize, Qt
25 24
 
26 25
 class AspectRatioPixmapLabel(QLabel):
@@ -276,7 +275,7 @@ class OctoTray():
276 275
         sys.exit(self.app.exec_())
277 276
 
278 277
     def openBrowser(self, url):
279
-        os.system("xdg-open http://" + url)
278
+        QDesktopServices.openUrl(QUrl("http://" + url))
280 279
 
281 280
     def showDialog(self, title, text1, text2 = "", question = False, warning = False, error = False):
282 281
         msg = QMessageBox()

Ładowanie…
Anuluj
Zapisz