Check for state.kivy together with state.enableGUI (closes #1479)
This commit is contained in:
parent
973f39d5b2
commit
166a2dac41
|
@ -252,7 +252,10 @@ class Main:
|
||||||
if daemon:
|
if daemon:
|
||||||
state.enableGUI = False # run without a UI
|
state.enableGUI = False # run without a UI
|
||||||
|
|
||||||
if state.enableGUI and not state.curses and not depends.check_pyqt():
|
if (
|
||||||
|
state.enableGUI and not state.curses and not state.kivy
|
||||||
|
and not depends.check_pyqt()
|
||||||
|
):
|
||||||
sys.exit(
|
sys.exit(
|
||||||
'PyBitmessage requires PyQt unless you want'
|
'PyBitmessage requires PyQt unless you want'
|
||||||
' to run it as a daemon and interact with it'
|
' to run it as a daemon and interact with it'
|
||||||
|
|
|
@ -29,7 +29,10 @@ class singleinstance:
|
||||||
self.lockfile = os.path.normpath(
|
self.lockfile = os.path.normpath(
|
||||||
os.path.join(state.appdata, 'singleton%s.lock' % flavor_id))
|
os.path.join(state.appdata, 'singleton%s.lock' % flavor_id))
|
||||||
|
|
||||||
if state.enableGUI and not self.daemon and not state.curses:
|
if (
|
||||||
|
state.enableGUI and not self.daemon and not state.curses
|
||||||
|
and not state.kivy
|
||||||
|
):
|
||||||
# Tells the already running (if any) application to get focus.
|
# Tells the already running (if any) application to get focus.
|
||||||
import bitmessageqt
|
import bitmessageqt
|
||||||
bitmessageqt.init()
|
bitmessageqt.init()
|
||||||
|
|
21
src/tr.py
21
src/tr.py
|
@ -1,4 +1,4 @@
|
||||||
import os
|
import sys
|
||||||
|
|
||||||
import state
|
import state
|
||||||
|
|
||||||
|
@ -21,13 +21,22 @@ def translateText(context, text, n = None):
|
||||||
enableGUI = state.enableGUI
|
enableGUI = state.enableGUI
|
||||||
except AttributeError: # inside the plugin
|
except AttributeError: # inside the plugin
|
||||||
enableGUI = True
|
enableGUI = True
|
||||||
if enableGUI:
|
if enableGUI and not state.kivy:
|
||||||
try:
|
try:
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
except Exception as err:
|
except ImportError:
|
||||||
print 'PyBitmessage requires PyQt unless you want to run it as a daemon and interact with it using the API. You can download PyQt from http://www.riverbankcomputing.com/software/pyqt/download or by searching Google for \'PyQt Download\'. If you want to run in daemon mode, see https://bitmessage.org/wiki/Daemon'
|
sys.exit(
|
||||||
print 'Error message:', err
|
'PyBitmessage requires PyQt unless you want'
|
||||||
os._exit(0)
|
' to run it as a daemon and interact with it'
|
||||||
|
' using the API. You can download PyQt from '
|
||||||
|
'http://www.riverbankcomputing.com/software/pyqt/download'
|
||||||
|
' or by searching Google for \'PyQt Download\'.'
|
||||||
|
' If you want to run in daemon mode, see '
|
||||||
|
'https://bitmessage.org/wiki/Daemon\n'
|
||||||
|
'You can also run PyBitmessage with'
|
||||||
|
' the new curses interface by providing'
|
||||||
|
' \'-c\' as a commandline argument.'
|
||||||
|
)
|
||||||
if n is None:
|
if n is None:
|
||||||
return QtGui.QApplication.translate(context, text)
|
return QtGui.QApplication.translate(context, text)
|
||||||
else:
|
else:
|
||||||
|
|
Reference in New Issue
Block a user