comparison cagou/core/menu.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 1b835bcfa663
children 772c170b47a9
comparison
equal deleted inserted replaced
301:86292cc41e81 302:f55b60659ec1
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20 20
21 from sat.core.i18n import _ 21 from sat.core.i18n import _
22 from sat.core import log as logging 22 from sat.core import log as logging
23 log = logging.getLogger(__name__)
24 from cagou.core.constants import Const as C 23 from cagou.core.constants import Const as C
25 from cagou.core.common import JidToggle 24 from cagou.core.common import JidToggle
26 from kivy.uix.boxlayout import BoxLayout 25 from kivy.uix.boxlayout import BoxLayout
27 from kivy.uix.label import Label 26 from kivy.uix.label import Label
28 from kivy.uix.popup import Popup 27 from kivy.uix.popup import Popup
36 from kivy.clock import Clock 35 from kivy.clock import Clock
37 from cagou import G 36 from cagou import G
38 from functools import partial 37 from functools import partial
39 import webbrowser 38 import webbrowser
40 39
40 log = logging.getLogger(__name__)
41
41 ABOUT_TITLE = _(u"About {}".format(C.APP_NAME)) 42 ABOUT_TITLE = _(u"About {}".format(C.APP_NAME))
42 ABOUT_CONTENT = _(u"""Cagou (Salut à Toi) v{version} 43 ABOUT_CONTENT = _(u"""[b]Cagou (Salut à Toi)[/b]
44
45 [u]cagou version[/u]:
46 {version}
47
48 [u]backend version[/u]:
49 {backend_version}
43 50
44 Cagou is a libre communication tool based on libre standard XMPP. 51 Cagou is a libre communication tool based on libre standard XMPP.
45 52
46 Cagou is part of the "Salut à Toi" project 53 Cagou is part of the "Salut à Toi" project (desktop/mobile frontend)
47 more informations at [color=5500ff][ref=website]salut-a-toi.org[/ref][/color] 54 more informations at [color=5500ff][ref=website]salut-a-toi.org[/ref][/color]
48 """) 55 """)
49 56
50 57
51 class AboutContent(Label): 58 class AboutContent(Label):
162 self._buildMenus(self.menus_container, caller) 169 self._buildMenus(self.menus_container, caller)
163 170
164 def onAbout(self): 171 def onAbout(self):
165 about = AboutPopup() 172 about = AboutPopup()
166 about.title = ABOUT_TITLE 173 about.title = ABOUT_TITLE
167 about.content = AboutContent(text=ABOUT_CONTENT.format(version=G.host.version), 174 about.content = AboutContent(
168 markup=True) 175 text=ABOUT_CONTENT.format(
176 backend_version = G.host.backend_version,
177 version=G.host.version),
178 markup=True)
169 about.open() 179 about.open()
170 180
171 181
172 class TransferItem(BoxLayout): 182 class TransferItem(BoxLayout):
173 plug_info = properties.DictProperty() 183 plug_info = properties.DictProperty()