From 4770790597123d5b2cfbbdd42a71851718de9df0 Mon Sep 17 00:00:00 2001 From: surbhi Date: Thu, 5 Jul 2018 19:07:16 +0530 Subject: [PATCH] Added kivy for making it run on Desktop and Mobile Clients --- src/bitmessagemain.py | 11 +++++++---- src/main.py | 3 +++ src/state.py | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index 31a475dd..0a1d835b 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -69,7 +69,6 @@ import helper_bootstrap import helper_generic import helper_threading - def connectToStream(streamNumber): state.streamsInWhichIAmParticipating.append(streamNumber) selfInitiatedConnections[streamNumber] = {} @@ -390,18 +389,22 @@ class Main: # Populate with hardcoded value (same as connectToStream above) state.streamsInWhichIAmParticipating.append(1) - if not state.enableGUI: - BMConfigParser().remove_option('bitmessagesettings', 'dontconnect') - elif daemon is False: + if daemon is False and state.enableGUI: if state.curses: if not depends.check_curses(): sys.exit() print('Running with curses') import bitmessagecurses bitmessagecurses.runwrapper() + elif state.kivy: + BMConfigParser().remove_option('bitmessagesettings', 'dontconnect') + from mpybit import MainApp + MainApp().run() else: import bitmessageqt bitmessageqt.run() + else: + BMConfigParser().remove_option('bitmessagesettings', 'dontconnect') if daemon: if state.testmode: diff --git a/src/main.py b/src/main.py index fbaab682..969dbe56 100644 --- a/src/main.py +++ b/src/main.py @@ -1,5 +1,8 @@ """This module is for thread start.""" from bitmessagemain import main +import state if __name__ == '__main__': + state.kivy = True + print("Kivy Loading......") main() diff --git a/src/state.py b/src/state.py index d0433059..834b60be 100644 --- a/src/state.py +++ b/src/state.py @@ -68,3 +68,5 @@ resetNetworkProtocolAvailability() dandelion = 0 testmode = False + +kivy = False