From d8be7cd19a892b48c677bbcdf0f63f4eaf8df94a Mon Sep 17 00:00:00 2001
From: Dmitri Bogomolov <4glitch@gmail.com>
Date: Mon, 16 Apr 2018 10:00:23 +0300
Subject: [PATCH] Right check in module tr - right import order

---
 src/tr.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/tr.py b/src/tr.py
index cf7f16ac..8b41167f 100644
--- a/src/tr.py
+++ b/src/tr.py
@@ -1,6 +1,6 @@
 import os
 
-import shared
+import state
 
 # This is used so that the translateText function can be used when we are in daemon mode and not using any QT functions.
 class translateClass:
@@ -18,10 +18,10 @@ def _translate(context, text, disambiguation = None, encoding = None, n = None):
 
 def translateText(context, text, n = None):
     try:
-        is_daemon = shared.thisapp.daemon
+        enableGUI = state.enableGUI
     except AttributeError:  # inside the plugin
-        is_daemon = False
-    if not is_daemon:
+        enableGUI = True
+    if enableGUI:
         try:
             from PyQt4 import QtCore, QtGui
         except Exception as err: