comparison cagou/core/cagou_main.py @ 302:f55b60659ec1

core (about): improved "about" popup: - added some style - backend version and Cagou version are shown - host.version is now Cagou version, while host.backend_version is the one of the backend fix 312
author Goffi <goffi@goffi.org>
date Fri, 28 Jun 2019 13:02:11 +0200
parents 318a46e78ff6
children 772c170b47a9
comparison
equal deleted inserted replaced
301:86292cc41e81 302:f55b60659ec1
31 from sat_frontends.quick_frontend.quick_app import QuickApp 31 from sat_frontends.quick_frontend.quick_app import QuickApp
32 from sat_frontends.quick_frontend import quick_widgets 32 from sat_frontends.quick_frontend import quick_widgets
33 from sat_frontends.quick_frontend import quick_chat 33 from sat_frontends.quick_frontend import quick_chat
34 from sat_frontends.quick_frontend import quick_utils 34 from sat_frontends.quick_frontend import quick_utils
35 from sat_frontends.tools import jid 35 from sat_frontends.tools import jid
36 from sat.tools import utils as sat_utils
36 from sat.tools import config 37 from sat.tools import config
37 from sat.tools.common import dynamic_import 38 from sat.tools.common import dynamic_import
38 import kivy 39 import kivy
39 kivy.require('1.10.0') 40 kivy.require('1.10.0')
40 import kivy.support 41 import kivy.support
67 from . import widgets_handler 68 from . import widgets_handler
68 from .common import IconButton 69 from .common import IconButton
69 from . import menu 70 from . import menu
70 from . import dialog 71 from . import dialog
71 from importlib import import_module 72 from importlib import import_module
73 import sat
74 import cagou
72 import cagou.plugins 75 import cagou.plugins
73 import cagou.kv 76 import cagou.kv
74 try: 77 try:
75 from plyer import notification 78 from plyer import notification
76 except ImportError: 79 except ImportError:
435 "icons/muchoslava/png/cagou_profil_bleu_96.png") 438 "icons/muchoslava/png/cagou_profil_bleu_96.png")
436 self._plg_wids = [] # main widgets plugins 439 self._plg_wids = [] # main widgets plugins
437 self._plg_wids_transfer = [] # transfer widgets plugins 440 self._plg_wids_transfer = [] # transfer widgets plugins
438 self._import_plugins() 441 self._import_plugins()
439 self._visible_widgets = {} # visible widgets by classes 442 self._visible_widgets = {} # visible widgets by classes
440 self.version = C.APP_VERSION # will be replaced by getVersion() 443 self.backend_version = sat.__version__ # will be replaced by getVersion()
444 if C.APP_VERSION.endswith('D'):
445 self.version = "{} {}".format(
446 C.APP_VERSION,
447 sat_utils.getRepositoryData(cagou)
448 )
449 else:
450 self.version = C.APP_VERSION
441 451
442 self.tls_validation = not C.bool(config.getConfig(main_config, 452 self.tls_validation = not C.bool(config.getConfig(main_config,
443 C.CONFIG_SECTION, 453 C.CONFIG_SECTION,
444 'no_certificate_validation', 454 'no_certificate_validation',
445 C.BOOL_FALSE)) 455 C.BOOL_FALSE))
500 pass 510 pass
501 else: 511 else:
502 sat_instance.stopService() 512 sat_instance.stopService()
503 513
504 def _getVersionCb(self, version): 514 def _getVersionCb(self, version):
505 self.version = version 515 self.backend_version = version
506 516
507 def onBackendReady(self): 517 def onBackendReady(self):
508 self.app.showWidget() 518 self.app.showWidget()
509 self.bridge.getVersion(callback=self._getVersionCb) 519 self.bridge.getVersion(callback=self._getVersionCb)
510 self.app.initFrontendState() 520 self.app.initFrontendState()