diff --git a/aqt/browser.py b/aqt/browser.py index 5aee017e1..5b092d215 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -305,7 +305,7 @@ class Browser(QMainWindow): def __init__(self, mw): QMainWindow.__init__(self, mw) - #applyStyles(self) + applyStyles(self) self.mw = mw self.col = self.mw.col self.currentRow = None diff --git a/aqt/main.py b/aqt/main.py index 2db83a109..e4fa8d406 100755 --- a/aqt/main.py +++ b/aqt/main.py @@ -518,8 +518,7 @@ Debug info:\n%s""") % traceback.format_exc(), help="DeckErrors") self.form.statusbar.showMessage(text, timeout) def setupStyle(self): - print "applystyles" - #applyStyles(self) + applyStyles(self) # Key handling ########################################################################## @@ -941,15 +940,4 @@ they will be lost. Are you sure you want to continue?""")) def setupProxy(self): print "proxy" return - import urllib2 - if self.pm.profile['proxyHost']: - proxy = "http://" - if self.pm.profile['proxyUser']: - proxy += (self.pm.profile['proxyUser'] + ":" + - self.pm.profile['proxyPass'] + "@") - proxy += (self.pm.profile['proxyHost'] + ":" + - str(self.pm.profile['proxyPort'])) - os.environ["http_proxy"] = proxy - proxy_handler = urllib2.ProxyHandler() - opener = urllib2.build_opener(proxy_handler) - urllib2.install_opener(opener) + # need to bundle socksipy and install a default socket handler diff --git a/aqt/utils.py b/aqt/utils.py index 582838742..f11eef87b 100644 --- a/aqt/utils.py +++ b/aqt/utils.py @@ -310,12 +310,9 @@ def mungeQA(txt): return txt def applyStyles(widget): - try: - styleFile = open(os.path.join(aqt.mw.pm.profile.confDir, - "style.css")) - widget.setStyleSheet(styleFile.read()) - except (IOError, OSError): - pass + p = os.path.join(aqt.mw.pm.base, "style.css") + if os.path.exists(p): + widget.setStyleSheet(open(p).read()) def getBase(col): base = None