Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added new "about" screen #89

Merged
merged 1 commit into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion installer/android/src/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.15.241
1.17.243
15 changes: 15 additions & 0 deletions src/components/main_win.kv
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,21 @@
app.main_window.nav().set_state("close")
app.main_window.select_screen('settings_screen', verify_state=True)

OneLineIconListItem:
id: menu_item_about
text: "about"
on_release:
app.main_window.nav().set_state("close")
app.main_window.select_screen('about_screen', verify_state=True)
CustomIconPackLeftWidget:
icon: "information-outline"
icon_size: "32sp"
md_bg_color: app.color_transparent
md_bg_color_disabled: app.color_transparent
on_release:
app.main_window.nav().set_state("close")
app.main_window.select_screen('about_screen', verify_state=True)


<MainWin>:
id: main_win
Expand Down
6 changes: 3 additions & 3 deletions src/components/main_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ def is_screen_selectable(self, screen_id):
if not self.control:
return False
if self.state_process_health != 1:
return screen_id in ['engine_status_screen', 'startup_screen', 'welcome_screen', ]
return screen_id in ['engine_status_screen', 'startup_screen', 'welcome_screen', 'about_screen', ]
if self.state_identity_get != 1:
return screen_id in ['engine_status_screen', 'startup_screen', 'welcome_screen', 'settings_screen',
'my_id_screen', 'new_identity_screen', 'recover_identity_screen', ]
'my_id_screen', 'new_identity_screen', 'recover_identity_screen', 'about_screen', ]
if self.state_network_connected != 1:
return screen_id in ['engine_status_screen', 'startup_screen', 'welcome_screen',
'connecting_screen', 'settings_screen',
'my_id_screen', 'new_identity_screen', 'recover_identity_screen', ]
'my_id_screen', 'new_identity_screen', 'recover_identity_screen', 'about_screen', ]
return True

def update_menu_items(self):
Expand Down
Binary file added src/images/bitdust_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/screens/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def all_screens():
f'{KV_FILES_BASE}screens/screen_settings.kv', 'screens.screen_settings', 'SettingsScreen', ),
'my_id_screen': (
f'{KV_FILES_BASE}screens/screen_my_id.kv', 'screens.screen_my_id', 'MyIDScreen', ),
'about_screen': (
f'{KV_FILES_BASE}screens/screen_about.kv', 'screens.screen_about', 'AboutScreen', ),
'search_people_screen': (
f'{KV_FILES_BASE}screens/screen_search_people.kv', 'screens.screen_search_people', 'SearchPeopleScreen', ),
'friends_screen': (
Expand Down Expand Up @@ -99,6 +101,7 @@ def identity_missing_screens_list():
'recover_identity_screen',
'settings_screen',
'my_id_screen',
'about_screen',
]

#------------------------------------------------------------------------------
Expand Down
42 changes: 42 additions & 0 deletions src/screens/screen_about.kv
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<AboutScreen>:

ScreenContainerLayout:

TopEmptyScreenSpace:

AppScreenLayout:

AutomatShortStatusPanel:
id: state_panel
size_hint_x: 1
statuses: root.get_statuses()

VerticalScrollView:

VerticalWithPaddingLayout:
size_hint: None, None
pos_hint: {"top": 1}
height: self.minimum_height
width: root.width - app.scroll_bar_width

VFixedEmptySpace:

Image:
size_hint: None, None
width: dp(300)
height: dp(72)
pos_hint: {"left": 1, "top": 1}
allow_stretch: True
keep_ratio: True
source: "./src/images/bitdust_logo.png"

MarkupLabel:
id: about_text
size_hint_y: None
text_size: self.width, None
height: self.texture_size[1]
color: app.color_black
text: ""
on_ref_press: root.on_about_text_ref_pressed(*args)

BottomEmptyScreenSpace:
61 changes: 61 additions & 0 deletions src/screens/screen_about.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import webbrowser

from components import screen

#------------------------------------------------------------------------------

_Debug = False

#------------------------------------------------------------------------------

about_temlate_text = """
BitDust is an [u][color=#0000ff][ref=github_link]open-source[/ref][/color][/u] project of a worldwide distributed network that is aiming to provide online storage, safe personal communications and full control of your own private data.

The BitDist p2p-app is a peer-to-peer application which provides secure distributed data storage and safe private communications.

This is a story about respecting the digital freedoms of all people on this planet and taking full control over our own personal data that we send and receive over the Internet.

We are currently with a small team primarily focusing on the development and supporting the BitDust project and community.

More about the project you can read on [u][color=#0000ff][ref=web_site_link]www.bitdust.io[/ref][/color][/u].

Also you can give us your feedback about the BitDust p2p-app or report a bug directly via that [u][color=#0000ff][ref=feedback_link]link[/ref][/color][/u].
"""

#------------------------------------------------------------------------------

class AboutScreen(screen.AppScreen):

def get_title(self):
return 'about'

def get_statuses(self):
return {
None: 'main process is not started yet',
'AT_STARTUP': 'starting the application',
'LOCAL': 'initializing local environment',
'MODULES': 'starting sub-modules',
'INSTALL': 'installing application',
'READY': 'application is ready',
'STOPPING': 'application is shutting down',
'SERVICES': 'starting network services',
'INTERFACES': 'starting application interfaces',
'EXIT': 'application is closed',
}

def on_enter(self, *args):
self.ids.state_panel.attach(automat_id='initializer')
self.ids.about_text.text = about_temlate_text.format()

def on_leave(self, *args):
self.ids.state_panel.release()

def on_about_text_ref_pressed(self, *args):
if _Debug:
print('AboutScreen.on_about_text_ref_pressed', args)
if args[1] == 'github_link':
webbrowser.open('https://github.com/bitdust-io')
elif args[1] == 'web_site_link':
webbrowser.open('https://bitdust.io')
elif args[1] == 'feedback_link':
webbrowser.open('https://forms.gle/RkJW3L7NTamZ5K8m6')
Loading