mirror of
https://github.com/markqvist/Sideband.git
synced 2024-10-01 03:15:37 -04:00
Improved startup when TCP peer is unreachable
This commit is contained in:
parent
419d5a9e5e
commit
4b819238a3
@ -5,6 +5,7 @@ import sys
|
||||
import os
|
||||
|
||||
from kivy.logger import Logger, LOG_LEVELS
|
||||
# Logger.setLevel(LOG_LEVELS["debug"])
|
||||
Logger.setLevel(LOG_LEVELS["error"])
|
||||
|
||||
if RNS.vendor.platformutils.get_platform() != "android":
|
||||
@ -39,7 +40,7 @@ from kivy.metrics import dp
|
||||
from kivymd.uix.button import MDFlatButton
|
||||
from kivymd.uix.dialog import MDDialog
|
||||
|
||||
__version__ = "0.1.8"
|
||||
__version__ = "0.1.9"
|
||||
__variant__ = "beta"
|
||||
|
||||
if RNS.vendor.platformutils.get_platform() == "android":
|
||||
@ -52,6 +53,7 @@ class SidebandApp(MDApp):
|
||||
self.title = "Sideband"
|
||||
|
||||
self.sideband = SidebandCore(self)
|
||||
|
||||
self.conversations_view = None
|
||||
|
||||
self.flag_new_conversations = False
|
||||
@ -64,15 +66,18 @@ class SidebandApp(MDApp):
|
||||
Window.softinput_mode = "below_target"
|
||||
self.icon = self.sideband.asset_dir+"/images/icon.png"
|
||||
|
||||
def start_core(self, dt):
|
||||
self.sideband.start()
|
||||
self.open_conversations()
|
||||
Clock.schedule_interval(self.jobs, 1)
|
||||
|
||||
#################################################
|
||||
# General helpers #
|
||||
#################################################
|
||||
|
||||
def build(self):
|
||||
FONT_PATH = self.sideband.asset_dir+"/fonts"
|
||||
# self.theme_cls.primary_palette = "Green"
|
||||
self.theme_cls.theme_style = "Dark"
|
||||
# self.theme_cls.theme_style = "Light"
|
||||
screen = Builder.load_string(root_layout)
|
||||
|
||||
return screen
|
||||
@ -132,9 +137,8 @@ class SidebandApp(MDApp):
|
||||
|
||||
self.root.ids.screen_manager.app = self
|
||||
self.root.ids.app_version_info.text = "Sideband v"+__version__+" "+__variant__
|
||||
self.open_conversations()
|
||||
|
||||
Clock.schedule_interval(self.jobs, 1)
|
||||
Clock.schedule_once(self.start_core, 3)
|
||||
|
||||
# Part of the focus hack fix
|
||||
def android_focus_fix(self, sender, val):
|
||||
|
@ -120,9 +120,7 @@ class SidebandCore():
|
||||
|
||||
RNS.Transport.register_announce_handler(self)
|
||||
RNS.Transport.register_announce_handler(self.propagation_detector)
|
||||
|
||||
self.start()
|
||||
|
||||
|
||||
|
||||
def __init_config(self):
|
||||
RNS.log("Creating new Sideband configuration...")
|
||||
|
@ -1,8 +1,53 @@
|
||||
root_layout = """
|
||||
#: import NoTransition kivy.uix.screenmanager.NoTransition
|
||||
#: import SlideTransition kivy.uix.screenmanager.SlideTransition
|
||||
|
||||
MDNavigationLayout:
|
||||
|
||||
ScreenManager:
|
||||
id: screen_manager
|
||||
# transition: SlideTransition()
|
||||
transition: NoTransition()
|
||||
|
||||
MDScreen:
|
||||
name: "starting_screen"
|
||||
|
||||
AnchorLayout:
|
||||
anchor_x: "center"
|
||||
anchor_y: "center"
|
||||
padding: dp(64)
|
||||
|
||||
|
||||
BoxLayout:
|
||||
spacing: dp(36)
|
||||
orientation: 'vertical'
|
||||
size_hint_y: None
|
||||
|
||||
MDLabel:
|
||||
id: connecting_info
|
||||
halign: "center"
|
||||
text: "Please Wait"
|
||||
font_size: "32dp"
|
||||
size_hint_y: None
|
||||
text_size: self.width, None
|
||||
height: self.texture_size[1]
|
||||
# size: self.texture_size
|
||||
|
||||
MDIconButton:
|
||||
pos_hint: {"center_x": .5, "center_y": .5}
|
||||
icon: "transit-connection-variant"
|
||||
user_font_size: "72dp"
|
||||
|
||||
MDLabel:
|
||||
id: connecting_info
|
||||
halign: "center"
|
||||
text: "Substantiating Reticulum"
|
||||
font_size: "32dp"
|
||||
size_hint_y: None
|
||||
text_size: self.width, None
|
||||
height: self.texture_size[1]
|
||||
# size: self.texture_size
|
||||
|
||||
|
||||
MDScreen:
|
||||
name: "conversations_screen"
|
||||
|
Loading…
Reference in New Issue
Block a user