|
@@ -15,6 +15,7 @@ import os
|
15
|
15
|
import time
|
16
|
16
|
import urllib.parse
|
17
|
17
|
import urllib.request
|
|
18
|
+from os import path
|
18
|
19
|
from PyQt5 import QtWidgets, QtGui, QtCore, QtNetwork
|
19
|
20
|
from PyQt5.QtWidgets import QSystemTrayIcon, QAction, QMenu, QMessageBox, QWidget, QLabel, QVBoxLayout, QHBoxLayout, QDesktopWidget, QSizePolicy, QSlider, QLayout, QTableWidget, QTableWidgetItem, QPushButton
|
20
|
21
|
from PyQt5.QtGui import QIcon, QPixmap, QImageReader, QDesktopServices
|
|
@@ -235,8 +236,15 @@ class OctoTray():
|
235
|
236
|
vendor = "xythobuz"
|
236
|
237
|
version = "0.3"
|
237
|
238
|
|
238
|
|
- iconPaths = [ "./", "../", "data/", "../data/", "/usr/share/pixmaps/" ]
|
239
|
239
|
iconName = "octotray_icon.png"
|
|
240
|
+ iconPaths = [
|
|
241
|
+ path.abspath(path.dirname(__file__)),
|
|
242
|
+ "data",
|
|
243
|
+ "/usr/share/pixmaps",
|
|
244
|
+ ".",
|
|
245
|
+ "..",
|
|
246
|
+ "../data"
|
|
247
|
+ ]
|
240
|
248
|
|
241
|
249
|
networkTimeout = 2.0 # in s
|
242
|
250
|
|
|
@@ -320,11 +328,11 @@ class OctoTray():
|
320
|
328
|
|
321
|
329
|
self.iconPathName = None
|
322
|
330
|
for p in self.iconPaths:
|
323
|
|
- if os.path.isfile(p + self.iconName):
|
324
|
|
- self.iconPathName = p + self.iconName
|
|
331
|
+ if os.path.isfile(path.join(p, self.iconName)):
|
|
332
|
+ self.iconPathName = path.join(p, self.iconName)
|
325
|
333
|
break
|
326
|
334
|
if self.iconPathName == None:
|
327
|
|
- self.showDialog("OctoTray Error", "Icon file has not been found! found", "", False, False, True)
|
|
335
|
+ self.showDialog("OctoTray Error", "Icon file has not been found!", "", False, False, True)
|
328
|
336
|
sys.exit(0)
|
329
|
337
|
|
330
|
338
|
self.icon = QIcon()
|