Преглед на файлове

use Qt instead of xdg-open to open browser

Thomas Buck преди 3 години
родител
ревизия
0f940b4a92
променени са 1 файла, в които са добавени 2 реда и са изтрити 3 реда
  1. 2
    3
      octotray

+ 2
- 3
octotray Целия файл

@@ -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()

Loading…
Отказ
Запис