V0.6 #852
|
@ -1,14 +1,13 @@
|
||||||
from PyQt4 import uic
|
from PyQt4 import uic
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
from shared import codePath
|
||||||
|
|
||||||
|
def resource_path(resFile):
|
||||||
|
baseDir = codePath()
|
||||||
|
for subDir in ["ui", "bitmessageqt"]:
|
||||||
|
if os.path.isdir(os.path.join(baseDir, subDir)) and os.path.isfile(os.path.join(baseDir, subDir, resFile)):
|
||||||
|
return os.path.join(baseDir, subDir, resFile)
|
||||||
|
|
||||||
def resource_path(path):
|
def load(resFile, widget):
|
||||||
try:
|
uic.loadUi(resource_path(resFile), widget)
|
||||||
return os.path.join(sys._MEIPASS, path)
|
|
||||||
except:
|
|
||||||
return os.path.join(os.path.dirname(__file__), path)
|
|
||||||
|
|
||||||
|
|
||||||
def load(path, widget):
|
|
||||||
uic.loadUi(resource_path(path), widget)
|
|
||||||
|
|
Reference in New Issue
Block a user