fixed ChaNGES
|
@ -0,0 +1 @@
|
|||
Subproject commit 0610d207c55d7bf36a98af985d72ae4767678727
|
BIN
src/alice.png
Executable file
After Width: | Height: | Size: 669 B |
50
src/bitmessagekivy/android/python-for-android/recipes/bitmsghash/__init__.py
Executable file
|
@ -0,0 +1,50 @@
|
|||
from pythonforandroid.toolchain import Recipe, shprint, shutil, current_directory
|
||||
from os.path import exists, join
|
||||
import os
|
||||
import sys
|
||||
from multiprocessing import cpu_count
|
||||
import sh
|
||||
|
||||
|
||||
class BitmsghashRecipe(Recipe):
|
||||
# This could also inherit from PythonRecipe etc. if you want to
|
||||
# use their pre-written build processes
|
||||
|
||||
url = 'https://github.com/surbhicis/bitmsghash/archive/master.zip'
|
||||
# {version} will be replaced with self.version when downloading
|
||||
|
||||
depends = ['openssl']
|
||||
|
||||
conflicts = []
|
||||
|
||||
def get_recipe_env(self, arch=None):
|
||||
env = super(BitmsghashRecipe, self).get_recipe_env(arch)
|
||||
r = Recipe.get_recipe('openssl', self.ctx)
|
||||
b = r.get_build_dir(arch.arch)
|
||||
env['CCFLAGS'] = env['CFLAGS'] = \
|
||||
env['CFLAGS'] + ' -I{openssl_build_path}/include ' \
|
||||
'-I{openssl_build_path}/include/openssl'.format(
|
||||
openssl_build_path=b)
|
||||
env['LDFLAGS'] = \
|
||||
env['LDFLAGS'] + ' -L{openssl_build_path} ' \
|
||||
'-lcrypto{openssl_version} ' \
|
||||
'-lssl{openssl_version}'.format(
|
||||
openssl_build_path=b,
|
||||
openssl_version=r.version)
|
||||
return env
|
||||
|
||||
def should_build(self, arch=None):
|
||||
super(BitmsghashRecipe, self).should_build(arch)
|
||||
return not exists(
|
||||
join(self.ctx.get_libs_dir(arch.arch), 'libbitmsghash.so'))
|
||||
|
||||
def build_arch(self, arch=None):
|
||||
super(BitmsghashRecipe, self).build_arch(arch)
|
||||
env = self.get_recipe_env(arch)
|
||||
with current_directory(join(self.get_build_dir(arch.arch))):
|
||||
dst_dir = join(self.get_build_dir(arch.arch))
|
||||
shprint(sh.make, '-j', str(cpu_count()), _env=env)
|
||||
self.install_libs(arch, '{}/libbitmsghash.so'.format(dst_dir),
|
||||
'libbitmsghash.so')
|
||||
|
||||
recipe = BitmsghashRecipe()
|
81
src/bitmessagekivy/identiconGeneration.py
Executable file
|
@ -0,0 +1,81 @@
|
|||
"""
|
||||
Core classes for loading images and converting them to a Texture.
|
||||
The raw image data can be keep in memory for further access
|
||||
"""
|
||||
import hashlib
|
||||
from io import BytesIO
|
||||
|
||||
from PIL import Image
|
||||
from kivy.core.image import Image as CoreImage
|
||||
from kivy.uix.image import Image as kiImage
|
||||
# pylint: disable=import-error
|
||||
|
||||
|
||||
# constants
|
||||
RESOLUTION = 300, 300
|
||||
V_RESOLUTION = 7, 7
|
||||
BACKGROUND_COLOR = 255, 255, 255, 255
|
||||
MODE = "RGB"
|
||||
|
||||
|
||||
def generate(Generate_string=None):
|
||||
"""Generating string"""
|
||||
hash_string = generate_hash(Generate_string)
|
||||
color = random_color(hash_string)
|
||||
image = Image.new(MODE, V_RESOLUTION, BACKGROUND_COLOR)
|
||||
image = generate_image(image, color, hash_string)
|
||||
image = image.resize(RESOLUTION, 0)
|
||||
data = BytesIO()
|
||||
image.save(data, format='png')
|
||||
data.seek(0)
|
||||
# yes you actually need this
|
||||
im = CoreImage(BytesIO(data.read()), ext='png')
|
||||
beeld = kiImage()
|
||||
# only use this line in first code instance
|
||||
beeld.texture = im.texture
|
||||
return beeld
|
||||
# image.show()
|
||||
|
||||
|
||||
def generate_hash(string):
|
||||
"""Generating hash"""
|
||||
try:
|
||||
# make input case insensitive
|
||||
string = str.lower(string)
|
||||
hash_object = hashlib.md5(str.encode(string))
|
||||
print(hash_object.hexdigest())
|
||||
# returned object is a hex string
|
||||
return hash_object.hexdigest()
|
||||
except IndexError:
|
||||
print("Error: Please enter a string as an argument.")
|
||||
|
||||
|
||||
def random_color(hash_string):
|
||||
"""Getting random color"""
|
||||
# remove first three digits from hex string
|
||||
split = 6
|
||||
rgb = hash_string[:split]
|
||||
split = 2
|
||||
r = rgb[:split]
|
||||
g = rgb[split:2 * split]
|
||||
b = rgb[2 * split:3 * split]
|
||||
color = (int(r, 16), int(g, 16), int(b, 16), 0xFF)
|
||||
return color
|
||||
|
||||
|
||||
def generate_image(image, color, hash_string):
|
||||
"""Generating images"""
|
||||
hash_string = hash_string[6:]
|
||||
lower_x = 1
|
||||
lower_y = 1
|
||||
upper_x = int(V_RESOLUTION[0] / 2) + 1
|
||||
upper_y = V_RESOLUTION[1] - 1
|
||||
limit_x = V_RESOLUTION[0] - 1
|
||||
index = 0
|
||||
for x in range(lower_x, upper_x):
|
||||
for y in range(lower_y, upper_y):
|
||||
if int(hash_string[index], 16) % 2 == 0:
|
||||
image.putpixel((x, y), color)
|
||||
image.putpixel((limit_x - x, y), color)
|
||||
index = index + 1
|
||||
return image
|
26
src/bitmessagekivy/kv/addressbook.kv
Executable file
|
@ -0,0 +1,26 @@
|
|||
<AddressBook>:
|
||||
name: 'addressbook'
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
spacing: dp(5)
|
||||
SearchBar:
|
||||
id: address_search
|
||||
GridLayout:
|
||||
id: identi_tag
|
||||
padding: [20, 0, 0, 5]
|
||||
cols: 1
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
MDLabel:
|
||||
id: tag_label
|
||||
text: ''
|
||||
font_style: 'Subtitle2'
|
||||
BoxLayout:
|
||||
orientation:'vertical'
|
||||
ScrollView:
|
||||
id: scroll_y
|
||||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
Loader:
|
||||
ComposerButton:
|
25
src/bitmessagekivy/kv/allmails.kv
Executable file
|
@ -0,0 +1,25 @@
|
|||
<Allmails>:
|
||||
name: 'allmails'
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
spacing: dp(5)
|
||||
GridLayout:
|
||||
id: identi_tag
|
||||
padding: [20, 20, 0, 5]
|
||||
spacing: dp(5)
|
||||
cols: 1
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
MDLabel:
|
||||
id: tag_label
|
||||
text: ''
|
||||
font_style: 'Subtitle2'
|
||||
BoxLayout:
|
||||
orientation:'vertical'
|
||||
ScrollView:
|
||||
id: scroll_y
|
||||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
Loader:
|
||||
ComposerButton:
|
58
src/bitmessagekivy/kv/chat_list.kv
Executable file
|
@ -0,0 +1,58 @@
|
|||
<ChatList>:
|
||||
name: 'chlist'
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: 1,1,1,1
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
MDTabs:
|
||||
id: chat_panel
|
||||
tab_display_mode:'text'
|
||||
|
||||
Tab:
|
||||
text: "Chats"
|
||||
BoxLayout:
|
||||
id: chat_box
|
||||
orientation: 'vertical'
|
||||
ScrollView:
|
||||
id: scroll_y
|
||||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
MDLabel:
|
||||
font_style: 'Caption'
|
||||
theme_text_color: 'Primary'
|
||||
text: 'No Chat'
|
||||
halign: 'center'
|
||||
size_hint_y: None
|
||||
bold: True
|
||||
valign: 'top'
|
||||
# OneLineAvatarListItem:
|
||||
# text: "Single-line item with avatar"
|
||||
# divider: None
|
||||
# _no_ripple_effect: True
|
||||
# ImageLeftWidget:
|
||||
# source: './images/text_images/A.png'
|
||||
# OneLineAvatarListItem:
|
||||
# text: "Single-line item with avatar"
|
||||
# divider: None
|
||||
# _no_ripple_effect: True
|
||||
# ImageLeftWidget:
|
||||
# source: './images/text_images/B.png'
|
||||
# OneLineAvatarListItem:
|
||||
# text: "Single-line item with avatar"
|
||||
# divider: None
|
||||
# _no_ripple_effect: True
|
||||
# ImageLeftWidget:
|
||||
# source: './images/text_images/A.png'
|
||||
Tab:
|
||||
text: "Contacts"
|
||||
BoxLayout:
|
||||
id: contact_box
|
||||
orientation: 'vertical'
|
||||
ScrollView:
|
||||
id: scroll_y
|
||||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
45
src/bitmessagekivy/kv/chat_room.kv
Executable file
|
@ -0,0 +1,45 @@
|
|||
#:import C kivy.utils.get_color_from_hex
|
||||
|
||||
<ChatRoom>:
|
||||
name: 'chroom'
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: 1,1,1,1
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
ScrollView:
|
||||
Label:
|
||||
id: chat_logs
|
||||
text: ''
|
||||
color: C('#101010')
|
||||
text_size: (self.width, None)
|
||||
halign: 'left'
|
||||
valign: 'top'
|
||||
padding: (0, 0) # fixed in Kivy 1.8.1
|
||||
size_hint: (1, None)
|
||||
height: self.texture_size[1]
|
||||
markup: True
|
||||
font_size: sp(20)
|
||||
BoxLayout:
|
||||
height: 50
|
||||
orientation: 'horizontal'
|
||||
padding: 0
|
||||
size_hint: (1, None)
|
||||
|
||||
TextInput:
|
||||
id: message
|
||||
size_hint: (1, 1)
|
||||
multiline: False
|
||||
font_size: sp(20)
|
||||
on_text_validate: root.send_msg()
|
||||
|
||||
MDRaisedButton:
|
||||
text: "Send"
|
||||
elevation_normal: 2
|
||||
opposite_colors: True
|
||||
size_hint: (0.3, 1)
|
||||
pos_hint: {"center_x": .5}
|
||||
on_press: root.send_msg()
|
61
src/bitmessagekivy/kv/common_widgets.kv
Executable file
|
@ -0,0 +1,61 @@
|
|||
<ArrowImg@Image>:
|
||||
source: app.image_path +('/down-arrow.png' if self.parent.is_open == True else '/right-arrow.png')
|
||||
size: 15, 15
|
||||
x: self.parent.x + self.parent.width - self.width - 5
|
||||
y: self.parent.y + self.parent.height/2 - self.height + 5
|
||||
|
||||
<SearchBar@BoxLayout>:
|
||||
# id: search_bar
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
|
||||
MDIconButton:
|
||||
icon: 'magnify'
|
||||
|
||||
MDTextField:
|
||||
id: search_field
|
||||
hint_text: 'Search'
|
||||
on_text: app.searchQuery(self)
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: (0,0,0,1)
|
||||
|
||||
<Loader@MDSpinner>:
|
||||
id: spinner
|
||||
size_hint: None, None
|
||||
size: dp(46), dp(46)
|
||||
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
|
||||
active: False
|
||||
|
||||
<ComposerButton@BoxLayout>:
|
||||
size_hint_y: None
|
||||
height: dp(56)
|
||||
spacing: '10dp'
|
||||
pos_hint: {'center_x':0.45, 'center_y': .1}
|
||||
|
||||
Widget:
|
||||
|
||||
MDFloatingActionButton:
|
||||
icon: 'plus'
|
||||
opposite_colors: True
|
||||
elevation_normal: 8
|
||||
md_bg_color: [0.941, 0, 0,1]
|
||||
on_press: app.root.ids.scr_mngr.current = 'create'
|
||||
on_press: app.clear_composer()
|
||||
|
||||
|
||||
<ToggleBtn>:
|
||||
size_hint: None, None
|
||||
size: dp(36), dp(48)
|
||||
pos_hint: {'center_x': .95, 'center_y': .4}
|
||||
on_active: app.root.ids.sc10.toggleAction(self)
|
||||
|
||||
<CustomTwoLineAvatarIconListItem>:
|
||||
canvas:
|
||||
Color:
|
||||
id: set_clr
|
||||
# rgba: 0.5, 0.5, 0.5, 0.5
|
||||
rgba: 0,0,0,0
|
||||
Rectangle: #woohoo!!!
|
||||
size: self.size
|
||||
pos: self.pos
|
136
src/bitmessagekivy/kv/composer.kv
Executable file
|
@ -0,0 +1,136 @@
|
|||
<DropDownWidget>:
|
||||
ScrollView:
|
||||
id: id_scroll
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
size_hint_y: None
|
||||
height: self.minimum_height + 2 * self.parent.height/4
|
||||
padding: dp(20)
|
||||
spacing: 15
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
MyMDTextField:
|
||||
id: ti
|
||||
hint_text: 'type or select sender address'
|
||||
size_hint_y: None
|
||||
height: 100
|
||||
font_size: dp(15)
|
||||
multiline: False
|
||||
required: True
|
||||
helper_text_mode: "on_error"
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: (0,0,0,1)
|
||||
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
height: dp(40)
|
||||
CustomSpinner:
|
||||
id: btn
|
||||
background_color: app.theme_cls.primary_dark
|
||||
values: app.variable_1
|
||||
on_text: root.auto_fill_fromaddr() if self.text != 'Select' else ''
|
||||
option_cls: Factory.get("ComposerSpinnerOption")
|
||||
#background_color: color_button if self.state == 'normal' else color_button_pressed
|
||||
#background_down: 'atlas://data/images/defaulttheme/spinner'
|
||||
background_normal: ''
|
||||
background_color: app.theme_cls.primary_color
|
||||
color: color_font
|
||||
font_size: '13.5sp'
|
||||
ArrowImg:
|
||||
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
txt_input: txt_input
|
||||
rv: rv
|
||||
size : (890, 60)
|
||||
MyTextInput:
|
||||
id: txt_input
|
||||
size_hint_y: None
|
||||
font_size: '15sp'
|
||||
height: self.parent.height/2
|
||||
hint_text: 'type, select or scan QR code for recipients address'
|
||||
RV:
|
||||
id: rv
|
||||
MDIconButton:
|
||||
icon: 'qrcode-scan'
|
||||
pos_hint: {'center_x': 0, 'center_y': .8}
|
||||
on_release:
|
||||
app.root.ids.scr_mngr.current = 'scanscreen'
|
||||
|
||||
MyMDTextField:
|
||||
id: subject
|
||||
hint_text: 'subject'
|
||||
required: True
|
||||
height: 100
|
||||
font_size: '15sp'
|
||||
size_hint_y: None
|
||||
multiline: False
|
||||
helper_text_mode: "on_error"
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: (0,0,0,1)
|
||||
|
||||
MyMDTextField:
|
||||
id: body
|
||||
multiline: True
|
||||
hint_text: 'body'
|
||||
size_hint_y: None
|
||||
font_size: '15sp'
|
||||
required: True
|
||||
helper_text_mode: "on_error"
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: (0,0,0,1)
|
||||
BoxLayout:
|
||||
spacing:50
|
||||
|
||||
<MyTextInput>:
|
||||
readonly: False
|
||||
multiline: False
|
||||
|
||||
|
||||
<SelectableLabel>:
|
||||
# Draw a background to indicate selection
|
||||
color: 0,0,0,1
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: app.theme_cls.primary_dark if self.selected else (1, 1, 1, 0)
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
<RV>:
|
||||
canvas:
|
||||
Color:
|
||||
rgba: 0,0,0,.2
|
||||
|
||||
Line:
|
||||
rectangle: self.x +1 , self.y, self.width - 2, self.height -2
|
||||
bar_width: 10
|
||||
scroll_type:['bars']
|
||||
viewclass: 'SelectableLabel'
|
||||
SelectableRecycleBoxLayout:
|
||||
default_size: None, dp(20)
|
||||
default_size_hint: 1, None
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
orientation: 'vertical'
|
||||
multiselect: False
|
||||
|
||||
|
||||
<MyMDTextField@MDTextField>:
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: (0,0,0,1)
|
||||
|
||||
|
||||
<ComposerSpinnerOption@SpinnerOption>:
|
||||
font_size: '13.5sp'
|
||||
#background_color: color_button if self.state == 'down' else color_button_pressed
|
||||
#background_down: 'atlas://data/images/defaulttheme/button'
|
||||
background_normal: 'atlas://data/images/defaulttheme/textinput_active'
|
||||
background_color: app.theme_cls.primary_color
|
||||
color: color_font
|
28
src/bitmessagekivy/kv/credits.kv
Executable file
|
@ -0,0 +1,28 @@
|
|||
<Credits>:
|
||||
name: 'credits'
|
||||
ScrollView:
|
||||
do_scroll_x: False
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
OneLineListTitle:
|
||||
id: cred
|
||||
text: "Available Credits"
|
||||
divider: None
|
||||
theme_text_color: 'Primary'
|
||||
_no_ripple_effect: True
|
||||
long_press_time: 1
|
||||
|
||||
OneLineListTitle:
|
||||
id: cred
|
||||
text: root.available_credits
|
||||
divider: None
|
||||
font_style: 'H5'
|
||||
theme_text_color: 'Primary'
|
||||
_no_ripple_effect: True
|
||||
long_press_time: 1
|
||||
AnchorLayout:
|
||||
MDRaisedButton:
|
||||
height: dp(38)
|
||||
text: "+Add more credits"
|
||||
on_press: app.root.ids.scr_mngr.current = 'payment'
|
23
src/bitmessagekivy/kv/draft.kv
Executable file
|
@ -0,0 +1,23 @@
|
|||
<Draft>:
|
||||
name: 'draft'
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
spacing: dp(5)
|
||||
GridLayout:
|
||||
id: identi_tag
|
||||
padding: [20, 20, 0, 5]
|
||||
cols: 1
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
MDLabel:
|
||||
id: tag_label
|
||||
text: ''
|
||||
font_style: 'Subtitle2'
|
||||
BoxLayout:
|
||||
orientation:'vertical'
|
||||
ScrollView:
|
||||
id: scroll_y
|
||||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
ComposerButton:
|
39
src/bitmessagekivy/kv/inbox.kv
Executable file
|
@ -0,0 +1,39 @@
|
|||
<Inbox>:
|
||||
name: 'inbox'
|
||||
#transition: NoTransition()
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
spacing: dp(5)
|
||||
SearchBar:
|
||||
id:inbox_search
|
||||
GridLayout:
|
||||
id: identi_tag
|
||||
padding: [20, 0, 0, 5]
|
||||
cols: 1
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
MDLabel:
|
||||
id: tag_label
|
||||
text: ''
|
||||
font_style: 'Subtitle2'
|
||||
#FloatLayout:
|
||||
# MDScrollViewRefreshLayout:
|
||||
# id: refresh_layout
|
||||
# refresh_callback: root.refresh_callback
|
||||
# root_layout: root.set_root_layout()
|
||||
# MDList:
|
||||
# id: ml
|
||||
BoxLayout:
|
||||
orientation:'vertical'
|
||||
ScrollView:
|
||||
id: scroll_y
|
||||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
Loader:
|
||||
ComposerButton:
|
||||
|
||||
<TimeTagRightSampleWidget>:
|
||||
size_hint:(None, None)
|
||||
font_style: 'Caption'
|
||||
halign: 'center'
|
264
src/bitmessagekivy/kv/login.kv
Executable file
|
@ -0,0 +1,264 @@
|
|||
#:import SlideTransition kivy.uix.screenmanager.SlideTransition
|
||||
<Login>:
|
||||
name:"login"
|
||||
BoxLayout:
|
||||
orientation: "vertical"
|
||||
|
||||
#buttons-area-outer
|
||||
BoxLayout:
|
||||
size_hint_y: .53
|
||||
canvas:
|
||||
Color:
|
||||
rgba: 1,1,1,1
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
ScreenManager:
|
||||
id: check_screenmgr
|
||||
Screen:
|
||||
name: "check_screen"
|
||||
BoxLayout:
|
||||
orientation: "vertical"
|
||||
padding: 0, dp(5), 0, dp(5)
|
||||
spacing: dp(5)
|
||||
|
||||
#label area
|
||||
AnchorLayout:
|
||||
size_hint_y: None
|
||||
height: dp(50)
|
||||
MDLabel:
|
||||
text: "Select method to make an address:"
|
||||
bold: True
|
||||
halign: "center"
|
||||
theme_text_color: "Custom"
|
||||
text_color: .4,.4,.4,1
|
||||
|
||||
#upper-checkbor-area
|
||||
AnchorLayout:
|
||||
size_hint_y: None
|
||||
height: dp(40)
|
||||
BoxLayout:
|
||||
size_hint_x: None
|
||||
width: self.minimum_width
|
||||
|
||||
#check-container
|
||||
AnchorLayout:
|
||||
size_hint_x: None
|
||||
width: dp(40)
|
||||
Check:
|
||||
active: True
|
||||
|
||||
#text-container
|
||||
AnchorLayout:
|
||||
size_hint_x: None
|
||||
width: dp(200)
|
||||
MDLabel:
|
||||
text: "Random Number Generator"
|
||||
|
||||
AnchorLayout:
|
||||
size_hint_y: None
|
||||
height: dp(40)
|
||||
BoxLayout:
|
||||
size_hint_x: None
|
||||
width: self.minimum_width
|
||||
|
||||
#check-container
|
||||
AnchorLayout:
|
||||
size_hint_x: None
|
||||
width: dp(40)
|
||||
Check:
|
||||
|
||||
#text-container
|
||||
AnchorLayout:
|
||||
size_hint_x: None
|
||||
width: dp(200)
|
||||
MDLabel:
|
||||
text: "Pseudo Number Generator"
|
||||
AnchorLayout:
|
||||
MDFillRoundFlatIconButton:
|
||||
icon: "chevron-double-right"
|
||||
text: "Proceed Next"
|
||||
on_release:
|
||||
app.root.ids.scr_mngr.current = 'random'
|
||||
on_press:
|
||||
app.root.ids.sc7.reset_address_label(app)
|
||||
|
||||
#info-area-outer
|
||||
BoxLayout:
|
||||
size_hint_y: .47
|
||||
padding: dp(7)
|
||||
InfoLayout:
|
||||
orientation:"vertical"
|
||||
padding: 0, dp(5), 0, dp(5)
|
||||
canvas:
|
||||
Color:
|
||||
rgba:1,1,1,1
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
Color:
|
||||
rgba: app.theme_cls.primary_color
|
||||
Line:
|
||||
rounded_rectangle: (self.pos[0]+4, self.pos[1]+4, self.width-8,self.height-8, 10, 10, 10, 10, 50)
|
||||
width: dp(1)
|
||||
ScreenManager:
|
||||
id: info_screenmgr
|
||||
|
||||
Screen:
|
||||
name: "info1"
|
||||
ScrollView:
|
||||
bar_width:0
|
||||
do_scroll_x: False
|
||||
|
||||
BoxLayout:
|
||||
orientation: "vertical"
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
|
||||
#note area
|
||||
ContentHead:
|
||||
section_name: "NOTE:"
|
||||
ContentBody:
|
||||
section_text: ("You may generate addresses by using either random numbers or by using a pass-phrase.If you use a pass-phrase, the address is called a deterministic address. The Random Number option is selected by default but deterministic addresses may have several pros and cons.")
|
||||
|
||||
|
||||
#pros area
|
||||
ContentHead:
|
||||
section_name: "PROS:"
|
||||
ContentBody:
|
||||
section_text: ("You can re-create your addresses on any computer from memory you need-not-to worry about backing up your keys.dat file as long as you can remember your pass-phrase.")
|
||||
|
||||
#cons area
|
||||
ContentHead:
|
||||
section_name: "CONS:"
|
||||
ContentBody:
|
||||
section_text: ("You must remember (or write down) your address version number and the stream number along with your pass-phrase.If you choose a weak pass-phrase and someone on the internet can brute-force it, they can read your messages and send messages as you.")
|
||||
|
||||
<Random>:
|
||||
name:"random"
|
||||
ScrollView:
|
||||
id:add_random_bx
|
||||
|
||||
<RandomBoxlayout>:
|
||||
orientation: "vertical"
|
||||
#buttons-area-outer
|
||||
BoxLayout:
|
||||
orientation: "vertical"
|
||||
# padding: 0, dp(5), 0, dp(5)
|
||||
# spacing: dp(5)
|
||||
size_hint_y: .53
|
||||
canvas:
|
||||
Color:
|
||||
rgba: 1,1,1,1
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
#label area
|
||||
AnchorLayout:
|
||||
size_hint_y: None
|
||||
height: dp(50)
|
||||
MDLabel:
|
||||
text: "Enter a label to generate address for:"
|
||||
bold: True
|
||||
halign: "center"
|
||||
theme_text_color: "Custom"
|
||||
text_color: .4,.4,.4,1
|
||||
|
||||
AnchorLayout:
|
||||
size_hint_y: None
|
||||
height: dp(40)
|
||||
MDTextField:
|
||||
id:lab
|
||||
hint_text: "Label"
|
||||
required: True
|
||||
size_hint_x: None
|
||||
width: dp(190)
|
||||
helper_text_mode: "on_error"
|
||||
# helper_text: "Please enter your label name"
|
||||
on_text: app.root.ids.sc7.add_validation(self)
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: (0,0,0,1)
|
||||
|
||||
AnchorLayout:
|
||||
MDFillRoundFlatIconButton:
|
||||
icon: "chevron-double-right"
|
||||
text: "Proceed Next"
|
||||
on_release: app.root.ids.sc7.generateaddress(app)
|
||||
|
||||
Widget:
|
||||
|
||||
#info-area-outer
|
||||
BoxLayout:
|
||||
size_hint_y: .47
|
||||
padding: dp(7)
|
||||
InfoLayout:
|
||||
orientation:"vertical"
|
||||
padding: 0, dp(5), 0, dp(5)
|
||||
canvas:
|
||||
Color:
|
||||
rgba:1,1,1,1
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
Color:
|
||||
rgba: app.theme_cls.primary_color
|
||||
Line:
|
||||
rounded_rectangle: (self.pos[0]+4, self.pos[1]+4, self.width-8,self.height-8, 10, 10, 10, 10, 50)
|
||||
width: dp(1)
|
||||
ScreenManager:
|
||||
id: info_screenmgr
|
||||
|
||||
Screen:
|
||||
name: "info2"
|
||||
ScrollView:
|
||||
bar_width:0
|
||||
do_scroll_x: False
|
||||
|
||||
BoxLayout:
|
||||
orientation: "vertical"
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
|
||||
#note area
|
||||
ContentHead:
|
||||
section_name: "NOTE:"
|
||||
ContentBody:
|
||||
section_text: ("Here you may generate as many addresses as you like..Indeed creating and abandoning addresses is not encouraged.")
|
||||
|
||||
<Check@MDCheckbox>:
|
||||
group: 'group'
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(48)
|
||||
|
||||
<ContentHead@BoxLayout>:
|
||||
section_name: ""
|
||||
orientation: "vertical"
|
||||
size_hint_y: None
|
||||
height: dp(50)
|
||||
padding: dp(20), 0, 0, 0
|
||||
Widget:
|
||||
size_hint_y: None
|
||||
height: dp(25)
|
||||
MDLabel:
|
||||
theme_text_color: "Custom"
|
||||
text_color: .1,.1,.1,.9
|
||||
text: root.section_name
|
||||
bold: True
|
||||
font_style: "Button"
|
||||
|
||||
<ContentBody@BoxLayout>:
|
||||
section_text: ""
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
padding: dp(50), 0, dp(10), 0
|
||||
|
||||
MDLabel:
|
||||
size_hint_y: None
|
||||
height: self.texture_size[1]+dp(10)
|
||||
theme_text_color: "Custom"
|
||||
text_color: 0.3,0.3,0.3,1
|
||||
font_style: "Body1"
|
||||
text: root.section_text
|
80
src/bitmessagekivy/kv/maildetail.kv
Executable file
|
@ -0,0 +1,80 @@
|
|||
<MailDetail>:
|
||||
name: 'mailDetail'
|
||||
ScrollView:
|
||||
do_scroll_x: False
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
# height: dp(bod.height) + self.minimum_height
|
||||
height: self.minimum_height
|
||||
padding: dp(10)
|
||||
# MDLabel:
|
||||
# size_hint_y: None
|
||||
# id: subj
|
||||
# text: root.subject
|
||||
# theme_text_color: 'Primary'
|
||||
# halign: 'left'
|
||||
# font_style: 'H5'
|
||||
# height: dp(40)
|
||||
# on_touch_down: root.allclick(self)
|
||||
OneLineListTitle:
|
||||
id: subj
|
||||
text: root.subject
|
||||
divider: None
|
||||
font_style: 'H5'
|
||||
theme_text_color: 'Primary'
|
||||
_no_ripple_effect: True
|
||||
long_press_time: 1
|
||||
TwoLineAvatarIconListItem:
|
||||
id: subaft
|
||||
text: root.from_addr
|
||||
secondary_text: 'to ' + root.to_addr
|
||||
divider: None
|
||||
on_press: root.detailedPopup()
|
||||
BadgeText:
|
||||
size_hint:(None, None)
|
||||
size:[120, 140] if app.app_platform == 'android' else [64, 80]
|
||||
text: root.time_tag
|
||||
halign:'center'
|
||||
font_style:'Caption'
|
||||
pos_hint: {'center_y': .8}
|
||||
_txt_right_pad: dp(70)
|
||||
font_size: '11sp'
|
||||
MDChip:
|
||||
size_hint: (.16 if app.app_platform == 'android' else .07 , None)
|
||||
label: root.page_type
|
||||
icon: ''
|
||||
pos_hint: {'center_x': .91 if app.app_platform == 'android' else .95, 'center_y': .3}
|
||||
radius: 8
|
||||
height: self.parent.height/4
|
||||
AvatarSampleWidget:
|
||||
source: root.avatarImg
|
||||
MDLabel:
|
||||
text: root.status
|
||||
disabled: True
|
||||
font_style: 'Body2'
|
||||
halign:'left'
|
||||
padding_x: 20
|
||||
# MDLabel:
|
||||
# id: bod
|
||||
# font_style: 'Subtitle2'
|
||||
# theme_text_color: 'Primary'
|
||||
# text: root.message
|
||||
# halign: 'left'
|
||||
# height: self.texture_size[1]
|
||||
MyMDTextField:
|
||||
id: bod
|
||||
size_hint_y: None
|
||||
font_style: 'Subtitle2'
|
||||
text: root.message
|
||||
multiline: True
|
||||
readonly: True
|
||||
line_color_normal: [0,0,0,0]
|
||||
_current_line_color: [0,0,0,0]
|
||||
line_color_focus: [0,0,0,0]
|
||||
markup: True
|
||||
font_size: '15sp'
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: (0,0,0,1)
|
||||
Loader:
|
26
src/bitmessagekivy/kv/myaddress.kv
Executable file
|
@ -0,0 +1,26 @@
|
|||
<MyAddress>:
|
||||
name: 'myaddress'
|
||||
BoxLayout:
|
||||
id: main_box
|
||||
orientation: 'vertical'
|
||||
spacing: dp(5)
|
||||
SearchBar:
|
||||
id: search_bar
|
||||
GridLayout:
|
||||
id: identi_tag
|
||||
padding: [20, 0, 0, 5]
|
||||
cols: 1
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
MDLabel:
|
||||
id: tag_label
|
||||
text: 'My Addresses'
|
||||
font_style: 'Subtitle2'
|
||||
FloatLayout:
|
||||
MDScrollViewRefreshLayout:
|
||||
id: refresh_layout
|
||||
refresh_callback: root.refresh_callback
|
||||
root_layout: root
|
||||
MDList:
|
||||
id: ml
|
||||
Loader:
|
117
src/bitmessagekivy/kv/network.kv
Executable file
|
@ -0,0 +1,117 @@
|
|||
<NetworkStat>:
|
||||
name: 'networkstat'
|
||||
MDTabs:
|
||||
id: tab_panel
|
||||
tab_display_mode:'text'
|
||||
|
||||
Tab:
|
||||
text: "Total connections"
|
||||
ScrollView:
|
||||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
size_hint_y: None
|
||||
height: dp(200)
|
||||
OneLineListItem:
|
||||
text: "Total Connections"
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
size_hint_y: None
|
||||
height: dp(58)
|
||||
MDRaisedButton:
|
||||
size_hint: .6, 0
|
||||
height: dp(40)
|
||||
# text: root.text_variable_1
|
||||
elevation_normal: 2
|
||||
opposite_colors: True
|
||||
pos_hint: {'center_x': .5}
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: root.text_variable_1
|
||||
font_size: '13sp'
|
||||
color: (1,1,1,1)
|
||||
halign: 'center'
|
||||
Tab:
|
||||
text: 'Processes'
|
||||
ScrollView:
|
||||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
size_hint_y: None
|
||||
height: dp(500)
|
||||
OneLineListItem:
|
||||
text: "person-to-person"
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
size_hint_y: None
|
||||
height: dp(58)
|
||||
MDRaisedButton:
|
||||
size_hint: .6, 0
|
||||
height: dp(40)
|
||||
# text: root.text_variable_2
|
||||
elevation_normal: 2
|
||||
opposite_colors: True
|
||||
pos_hint: {'center_x': .5}
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: root.text_variable_2
|
||||
font_size: '13sp'
|
||||
color: (1,1,1,1)
|
||||
halign: 'center'
|
||||
OneLineListItem:
|
||||
text: "Brodcast"
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
size_hint_y: None
|
||||
height: dp(58)
|
||||
MDRaisedButton:
|
||||
size_hint: .6, 0
|
||||
height: dp(40)
|
||||
# text: root.text_variable_3
|
||||
elevation_normal: 2
|
||||
opposite_colors: True
|
||||
pos_hint: {'center_x': .5}
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: root.text_variable_3
|
||||
font_size: '13sp'
|
||||
color: (1,1,1,1)
|
||||
halign: 'center'
|
||||
OneLineListItem:
|
||||
text: "publickeys"
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
size_hint_y: None
|
||||
height: dp(58)
|
||||
MDRaisedButton:
|
||||
size_hint: .6, 0
|
||||
height: dp(40)
|
||||
# text: root.text_variable_4
|
||||
elevation_normal: 2
|
||||
opposite_colors: True
|
||||
pos_hint: {'center_x': .5}
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: root.text_variable_4
|
||||
font_size: '13sp'
|
||||
color: (1,1,1,1)
|
||||
halign: 'center'
|
||||
OneLineListItem:
|
||||
text: "objects"
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
size_hint_y: None
|
||||
height: dp(58)
|
||||
MDRaisedButton:
|
||||
size_hint: .6, 0
|
||||
height: dp(40)
|
||||
# text: root.text_variable_5
|
||||
elevation_normal: 2
|
||||
opposite_colors: True
|
||||
pos_hint: {'center_x': .5}
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: root.text_variable_5
|
||||
font_size: '13sp'
|
||||
color: (1,1,1,1)
|
||||
halign: 'center'
|
253
src/bitmessagekivy/kv/payment.kv
Executable file
|
@ -0,0 +1,253 @@
|
|||
#:import get_color_from_hex kivy.utils.get_color_from_hex
|
||||
|
||||
<Payment>:
|
||||
name: "payment"
|
||||
BoxLayout:
|
||||
ScrollView:
|
||||
bar_width:0
|
||||
do_scroll_x: False
|
||||
#scroll_y:0
|
||||
|
||||
BoxLayout:
|
||||
spacing: dp(8)
|
||||
padding: dp(5)
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
orientation: "vertical"
|
||||
|
||||
ProductCategoryLayout:
|
||||
category_text: "Monthly-Subscriptions"
|
||||
|
||||
ProductLayout:
|
||||
heading_text: "Gas (Play Billing Codelab)"
|
||||
price_text: "$0.99"
|
||||
source: app.image_path + "/payment/buynew1.png"
|
||||
description_text: "Buy gasoline to ride!"
|
||||
product_id: "SKUGASBILLING"
|
||||
|
||||
ProductLayout:
|
||||
heading_text: "Upgrade your car (Play Billing Codelab)"
|
||||
price_text: "$1.49"
|
||||
source: app.image_path + "/payment/buynew1.png"
|
||||
description_text: "Buy a premium outfit for your car!"
|
||||
product_id: "SKUUPGRADECAR"
|
||||
|
||||
ProductLayout:
|
||||
heading_text: "Month in gold status (Play Billing Codelab)"
|
||||
price_text: "$0.99"
|
||||
source: app.image_path + "/payment/buynew1.png"
|
||||
description_text: "Enjoy a gold status for a month!"
|
||||
product_id: "SKUMONTHLYGOLD"
|
||||
|
||||
ProductCategoryLayout:
|
||||
category_text: "One-time payment"
|
||||
|
||||
ProductLayout:
|
||||
heading_text: "Gas (Play Billing Codelab)"
|
||||
price_text: "$0.99"
|
||||
source: app.image_path + "/payment/buynew1.png"
|
||||
description_text: "Buy gasoline to ride!"
|
||||
product_id: "SKUONETIMEGAS"
|
||||
|
||||
ProductCategoryLayout:
|
||||
category_text: "Annual-Subscriptions"
|
||||
|
||||
ProductLayout:
|
||||
heading_text: "Gas (Play Billing Codelab)"
|
||||
price_text: "$0.99"
|
||||
source: app.image_path + "/payment/buynew1.png"
|
||||
description_text: "Buy gasoline to ride!"
|
||||
product_id: "SKUANNUALGAS"
|
||||
|
||||
ProductLayout:
|
||||
heading_text: "Year in gold status (Play Billing Codelab)"
|
||||
price_text: "$10.99"
|
||||
source: app.image_path + "/payment/buynew1.png"
|
||||
description_text: "Enjoy a gold status for a year!"
|
||||
product_id: "SKUANNUALGOLD"
|
||||
|
||||
<ProductCategoryLayout@BoxLayout>:
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
category_text:""
|
||||
|
||||
orientation: "vertical"
|
||||
spacing: 2
|
||||
|
||||
#category area
|
||||
Category:
|
||||
text_: root.category_text
|
||||
|
||||
<Category>:
|
||||
canvas:
|
||||
Color:
|
||||
rgba: 1,1,1,1
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
text_: ""
|
||||
size_hint_y: None
|
||||
height: dp(30)
|
||||
Widget:
|
||||
size_hint_x: None
|
||||
width: dp(20)
|
||||
MDLabel:
|
||||
text: root.text_
|
||||
font_size: sp(15)
|
||||
|
||||
<ProductLayout>:
|
||||
heading_text: ""
|
||||
price_text: ""
|
||||
source: ""
|
||||
description_text: ""
|
||||
|
||||
product_id: ""
|
||||
|
||||
canvas:
|
||||
Color:
|
||||
rgba: 1,1,1,1
|
||||
Rectangle:
|
||||
pos: self.pos
|
||||
size: self.size
|
||||
|
||||
size_hint_y: None
|
||||
height: dp(200)
|
||||
orientation: "vertical"
|
||||
|
||||
#heading area
|
||||
BoxLayout:
|
||||
size_hint_y: 0.3
|
||||
|
||||
#text heading
|
||||
BoxLayout:
|
||||
Widget:
|
||||
size_hint_x: None
|
||||
width: dp(20)
|
||||
MDLabel:
|
||||
text: root.heading_text
|
||||
bold: True
|
||||
|
||||
#price text
|
||||
BoxLayout:
|
||||
size_hint_x:.3
|
||||
MDLabel:
|
||||
text: root.price_text
|
||||
bold: True
|
||||
halign: "right"
|
||||
theme_text_color: "Custom"
|
||||
text_color: 0,0,1,1
|
||||
Widget:
|
||||
size_hint_x: None
|
||||
width: dp(20)
|
||||
|
||||
#details area
|
||||
BoxLayout:
|
||||
size_hint_y: 0.3
|
||||
Widget:
|
||||
size_hint_x: None
|
||||
width: dp(20)
|
||||
|
||||
#image area
|
||||
AnchorLayout:
|
||||
size_hint_x: None
|
||||
width: self.height
|
||||
BoxLayout:
|
||||
canvas:
|
||||
Color:
|
||||
rgba: 1,1,1,1
|
||||
Ellipse:
|
||||
size: self.size
|
||||
pos: self.pos
|
||||
source: root.source
|
||||
Widget:
|
||||
size_hint_x: None
|
||||
width: dp(10)
|
||||
|
||||
#description text
|
||||
BoxLayout:
|
||||
#size_hint_x: 1
|
||||
MDLabel:
|
||||
text: root.description_text
|
||||
font_size: sp(15)
|
||||
|
||||
#Button Area
|
||||
BoxLayout:
|
||||
size_hint_y: 0.4
|
||||
Widget:
|
||||
|
||||
AnchorLayout:
|
||||
anchor_x: "right"
|
||||
MDRaisedButton:
|
||||
elevation_normal: 5
|
||||
text: "BUY"
|
||||
on_release:
|
||||
#print(app)
|
||||
app.open_payment_layout(root.product_id)
|
||||
|
||||
Widget:
|
||||
size_hint_x: None
|
||||
width: dp(20)
|
||||
|
||||
<ListItemWithLabel>:
|
||||
on_release: app.initiate_purchase(self.method_name)
|
||||
recent: False
|
||||
source: ""
|
||||
method_name: ""
|
||||
right_label_text: "Recent" if self.recent else ""
|
||||
|
||||
ImageLeftWidget:
|
||||
source: root.source
|
||||
|
||||
RightLabel:
|
||||
text: root.right_label_text
|
||||
theme_text_color: "Custom"
|
||||
text_color: 0,0,0,.4
|
||||
font_size: sp(12)
|
||||
|
||||
<PaymentMethodLayout>:
|
||||
orientation: "vertical"
|
||||
size_hint_y: None
|
||||
height: "200dp"
|
||||
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
height: dp(40)
|
||||
|
||||
Widget:
|
||||
size_hint_x: None
|
||||
width: dp(20)
|
||||
MDLabel:
|
||||
text: "Select Payment Method"
|
||||
font_size: sp(14)
|
||||
bold: True
|
||||
theme_text_color: "Custom"
|
||||
text_color: 0,0,0,.5
|
||||
|
||||
|
||||
ScrollView:
|
||||
|
||||
GridLayout:
|
||||
cols: 1
|
||||
size_hint_y:None
|
||||
height:self.minimum_height
|
||||
|
||||
ListItemWithLabel:
|
||||
source: app.image_path + "/payment/gplay.png"
|
||||
text: "Google Play"
|
||||
method_name: "gplay"
|
||||
recent: True
|
||||
|
||||
ListItemWithLabel:
|
||||
source: app.image_path + "/payment/btc.png"
|
||||
text: "BTC"
|
||||
method_name: "btc"
|
||||
|
||||
ListItemWithLabel:
|
||||
source: app.image_path + "/payment/paypal.png"
|
||||
text: "Paypal"
|
||||
method_name: "som"
|
||||
|
||||
ListItemWithLabel:
|
||||
source: app.image_path + "/payment/buy.png"
|
||||
text: "One more method"
|
||||
method_name: "omm"
|
329
src/bitmessagekivy/kv/popup.kv
Executable file
|
@ -0,0 +1,329 @@
|
|||
<LoadingPopup>:
|
||||
separator_color: 1, 1, 1, 1
|
||||
background: "White.png"
|
||||
Button:
|
||||
id: btn
|
||||
disabled: True
|
||||
background_disabled_normal: "White.png"
|
||||
Image:
|
||||
source: app.image_path + '/loader.zip'
|
||||
anim_delay: 0
|
||||
#mipmap: True
|
||||
size: root.size
|
||||
|
||||
|
||||
<GrashofPopup>:
|
||||
id: popup_box
|
||||
orientation: 'vertical'
|
||||
# spacing:dp(20)
|
||||
# spacing: "12dp"
|
||||
size_hint_y: None
|
||||
# height: "120dp"
|
||||
height: 1.5*label.height+address.height
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
MDTextField:
|
||||
id: label
|
||||
multiline: False
|
||||
hint_text: "Label"
|
||||
required: True
|
||||
helper_text_mode: "on_error"
|
||||
on_text: root.checkLabel_valid(self)
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: (0,0,0,1)
|
||||
MDTextField:
|
||||
id: address
|
||||
hint_text: "Address"
|
||||
required: True
|
||||
helper_text_mode: "on_error"
|
||||
multiline: False
|
||||
on_text: root.checkAddress_valid(self)
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: (0,0,0,1)
|
||||
|
||||
<AddbookDetailPopup>:
|
||||
id: addbook_popup_box
|
||||
size_hint_y: None
|
||||
height: 2.5*(add_label.height)
|
||||
orientation: 'vertical'
|
||||
spacing:dp(5)
|
||||
MDLabel
|
||||
font_style: 'Subtitle2'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Label"
|
||||
font_size: '17sp'
|
||||
halign: 'left'
|
||||
MDTextField:
|
||||
id: add_label
|
||||
font_style: 'Body1'
|
||||
font_size: '15sp'
|
||||
halign: 'left'
|
||||
text: root.address_label
|
||||
theme_text_color: 'Primary'
|
||||
required: True
|
||||
helper_text_mode: "on_error"
|
||||
on_text: root.checkLabel_valid(self)
|
||||
canvas.before:
|
||||
Color:
|
||||
rgba: (0,0,0,1)
|
||||
MDLabel:
|
||||
font_style: 'Subtitle2'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Address"
|
||||
font_size: '17sp'
|
||||
halign: 'left'
|
||||
Widget:
|
||||
size_hint_y: None
|
||||
height: dp(1)
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDLabel:
|
||||
id: address
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: root.address
|
||||
font_size: '15sp'
|
||||
halign: 'left'
|
||||
IconRightSampleWidget:
|
||||
pos_hint: {'center_x': 0, 'center_y': 1}
|
||||
icon: 'content-copy'
|
||||
on_press: app.copy_composer_text(root.address)
|
||||
|
||||
|
||||
<MyaddDetailPopup>:
|
||||
id: myadd_popup
|
||||
size_hint_y: None
|
||||
spacing:dp(25)
|
||||
height: dp(1.2*(myaddr_label.height))
|
||||
orientation: 'vertical'
|
||||
MDLabel:
|
||||
id: myaddr_label
|
||||
font_style: 'Subtitle2'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Label"
|
||||
font_size: '17sp'
|
||||
halign: 'left'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: root.address_label
|
||||
font_size: '15sp'
|
||||
halign: 'left'
|
||||
MDLabel:
|
||||
font_style: 'Subtitle2'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Address"
|
||||
font_size: '17sp'
|
||||
halign: 'left'
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDLabel:
|
||||
id: label_address
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: root.address
|
||||
font_size: '15sp'
|
||||
halign: 'left'
|
||||
IconRightSampleWidget:
|
||||
pos_hint: {'center_x': 0, 'center_y': 1}
|
||||
icon: 'content-copy'
|
||||
on_press: app.copy_composer_text(root.address)
|
||||
BoxLayout:
|
||||
id: my_add_btn
|
||||
spacing:5
|
||||
orientation: 'horizontal'
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
MDRaisedButton:
|
||||
size_hint: 2, None
|
||||
height: dp(40)
|
||||
on_press: root.send_message_from()
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: 'Send message from'
|
||||
font_size: '13sp'
|
||||
color: (1,1,1,1)
|
||||
halign: 'center'
|
||||
MDRaisedButton:
|
||||
size_hint: 1.5, None
|
||||
height: dp(40)
|
||||
on_press: app.root.ids.scr_mngr.current = 'showqrcode'
|
||||
on_press: app.root.ids.sc15.qrdisplay(root, root.address)
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: 'Show QR code'
|
||||
font_size: '13sp'
|
||||
color: (1,1,1,1)
|
||||
halign: 'center'
|
||||
MDRaisedButton:
|
||||
size_hint: 1.5, None
|
||||
height: dp(40)
|
||||
on_press: root.close_pop()
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: 'Cancel'
|
||||
font_size: '13sp'
|
||||
color: (1,1,1,1)
|
||||
halign: 'center'
|
||||
|
||||
<AppClosingPopup>:
|
||||
id: closing_popup
|
||||
size_hint : (None,None)
|
||||
height: 1.3*(popup_label.height+ my_add_btn.children[0].height)
|
||||
width :app.window_size[0] - (app.window_size[0]/10 if app.app_platform == 'android' else app.window_size[0]/4)
|
||||
background: app.image_path + '/popup.jpeg'
|
||||
auto_dismiss: False
|
||||
separator_height: 0
|
||||
BoxLayout:
|
||||
id: myadd_popup_box
|
||||
size_hint_y: None
|
||||
spacing:dp(70)
|
||||
orientation: 'vertical'
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
spacing:dp(25)
|
||||
MDLabel:
|
||||
id: popup_label
|
||||
font_style: 'Subtitle2'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Bitmessage isn't connected to the network.\n If you quit now, it may cause delivery delays.\n Wait until connected and the synchronisation finishes?"
|
||||
font_size: '17sp'
|
||||
halign: 'center'
|
||||
BoxLayout:
|
||||
id: my_add_btn
|
||||
spacing:5
|
||||
orientation: 'horizontal'
|
||||
MDRaisedButton:
|
||||
size_hint: 1.5, None
|
||||
height: dp(40)
|
||||
on_press: root.closingAction(self.children[0].text)
|
||||
on_press: app.stop()
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: 'Yes'
|
||||
font_size: '13sp'
|
||||
color: (1,1,1,1)
|
||||
halign: 'center'
|
||||
MDRaisedButton:
|
||||
size_hint: 1.5, None
|
||||
height: dp(40)
|
||||
on_press: root.closingAction(self.children[0].text)
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: 'No'
|
||||
font_size: '13sp'
|
||||
color: (1,1,1,1)
|
||||
halign: 'center'
|
||||
MDRaisedButton:
|
||||
size_hint: 1.5, None
|
||||
height: dp(40)
|
||||
#on_press: root.dismiss()
|
||||
on_press: root.closingAction(self.children[0].text)
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: 'Cancel'
|
||||
font_size: '13sp'
|
||||
color: (1,1,1,1)
|
||||
halign: 'center'
|
||||
|
||||
<SenderDetailPopup>:
|
||||
id: myadd_popup
|
||||
size_hint : (None,None)
|
||||
# height: 2*(sd_label.height+ sd_btn.children[0].height)
|
||||
width :app.window_size[0] - (app.window_size[0]/10 if app.app_platform == 'android' else app.window_size[0]/4)
|
||||
background: app.image_path + '/popup.jpeg'
|
||||
auto_dismiss: False
|
||||
separator_height: 0
|
||||
BoxLayout:
|
||||
id: myadd_popup_box
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
spacing:dp(8 if app.app_platform == 'android' else 3)
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
MDLabel:
|
||||
id: from_add_label
|
||||
font_style: 'Subtitle2'
|
||||
theme_text_color: 'Primary'
|
||||
text: "From :"
|
||||
font_size: '15sp'
|
||||
halign: 'left'
|
||||
Widget:
|
||||
size_hint_y: None
|
||||
height: dp(1 if app.app_platform == 'android' else 0)
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
height: 50
|
||||
orientation: 'horizontal'
|
||||
MDLabel:
|
||||
id: sd_label
|
||||
font_style: 'Body2'
|
||||
theme_text_color: 'Primary'
|
||||
text: "[b]" + root.from_addr + "[/b]"
|
||||
font_size: '15sp'
|
||||
halign: 'left'
|
||||
markup: True
|
||||
IconRightSampleWidget:
|
||||
icon: 'content-copy'
|
||||
on_press: app.copy_composer_text(root.from_addr)
|
||||
Widget:
|
||||
id: space_1
|
||||
size_hint_y: None
|
||||
height: dp(2 if app.app_platform == 'android' else 0)
|
||||
BoxLayout:
|
||||
id: to_addtitle
|
||||
Widget:
|
||||
id:space_2
|
||||
size_hint_y: None
|
||||
height: dp(1 if app.app_platform == 'android' else 0)
|
||||
BoxLayout:
|
||||
id: to_addId
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
height: 50
|
||||
MDLabel:
|
||||
font_style: 'Body2'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Date : " + root.time_tag
|
||||
font_size: '15sp'
|
||||
halign: 'left'
|
||||
BoxLayout:
|
||||
id: sd_btn
|
||||
orientation: 'vertical'
|
||||
MDRaisedButton:
|
||||
id: dismiss_btn
|
||||
on_press: root.dismiss()
|
||||
size_hint: .2, 0
|
||||
pos_hint: {'x': 0.8, 'y': 0}
|
||||
MDLabel:
|
||||
font_style: 'H6'
|
||||
text: 'Cancel'
|
||||
font_size: '13sp'
|
||||
color: (1,1,1,1)
|
||||
halign: 'center'
|
||||
|
||||
<ToAddrBoxlayout>:
|
||||
orientation: 'horizontal'
|
||||
MDLabel:
|
||||
font_style: 'Body2'
|
||||
theme_text_color: 'Primary'
|
||||
text: root.to_addr
|
||||
font_size: '15sp'
|
||||
halign: 'left'
|
||||
IconRightSampleWidget:
|
||||
icon: 'content-copy'
|
||||
on_press: app.copy_composer_text(root.to_addr)
|
||||
|
||||
<ToAddressTitle>:
|
||||
orientation: 'vertical'
|
||||
MDLabel:
|
||||
id: to_add_label
|
||||
font_style: 'Subtitle2'
|
||||
theme_text_color: 'Primary'
|
||||
text: "To :"
|
||||
font_size: '15sp'
|
||||
halign: 'left'
|
26
src/bitmessagekivy/kv/sent.kv
Executable file
|
@ -0,0 +1,26 @@
|
|||
<Sent>:
|
||||
name: 'sent'
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
spacing: dp(5)
|
||||
SearchBar:
|
||||
id: sent_search
|
||||
GridLayout:
|
||||
id: identi_tag
|
||||
padding: [20, 0, 0, 5]
|
||||
cols: 1
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
MDLabel:
|
||||
id: tag_label
|
||||
text: ''
|
||||
font_style: 'Subtitle2'
|
||||
BoxLayout:
|
||||
orientation:'vertical'
|
||||
ScrollView:
|
||||
id: scroll_y
|
||||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
Loader:
|
||||
ComposerButton:
|
550
src/bitmessagekivy/kv/settings.kv
Executable file
|
@ -0,0 +1,550 @@
|
|||
<Setting>:
|
||||
name: 'set'
|
||||
MDTabs:
|
||||
id: tab_panel
|
||||
tab_display_mode:'text'
|
||||
|
||||
Tab:
|
||||
text: "User Interface"
|
||||
ScrollView:
|
||||
do_scroll_x: False
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
height: dp(250) + self.minimum_height
|
||||
padding: 10
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'horizontal'
|
||||
height: self.minimum_height
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
# active: True
|
||||
halign: 'center'
|
||||
disabled: True
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Start-on-login not yet supported on your OS"
|
||||
halign: 'left'
|
||||
pos_hint: {'center_x': 0, 'center_y': 0.6}
|
||||
disabled: True
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
padding: [20, 0, 0, 0]
|
||||
spacing: dp(10)
|
||||
height: dp(100) + self.minimum_height
|
||||
# pos_hint: {'center_x': 0, 'center_y': 0.6}
|
||||
BoxLayout:
|
||||
id: box_height
|
||||
orientation: 'vertical'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Tray"
|
||||
halign: 'left'
|
||||
bold: True
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
# active: True
|
||||
halign: 'center'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Start Bitmessage in the tray(don't show main window)"
|
||||
halign: 'left'
|
||||
pos_hint: {'x': 0, 'y': .5}
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
# active: True
|
||||
halign: 'center'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Minimize to tray"
|
||||
halign: 'left'
|
||||
pos_hint: {'x': 0, 'y': .5}
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
# active: True
|
||||
halign: 'center'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Close to tray"
|
||||
halign: 'left'
|
||||
pos_hint: {'x': 0, 'y': .5}
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
height: dp(100) + self.minimum_height
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
# active: True
|
||||
halign: 'center'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Hide connection notifications"
|
||||
halign: 'left'
|
||||
pos_hint: {'x': 0, 'y': 0.2}
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
active: True
|
||||
halign: 'center'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Show notification when message received"
|
||||
halign: 'left'
|
||||
pos_hint: {'x': 0, 'y': 0.2}
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
# active: True
|
||||
halign: 'center'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Run in Portable Mode"
|
||||
halign: 'left'
|
||||
pos_hint: {'x': 0, 'y': 0.2}
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: 'In portable Mode, messages and config files are stored in the same directory as the program rather then the normal application-data folder. This makes it convenient to run Bitmessage from a USB thumb drive.'
|
||||
# text: 'huiiiii'
|
||||
halign: 'left'
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
height: dp(100) + self.minimum_height
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
halign: 'center'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Willingly include unencrypted destination address when sending to a mobile device"
|
||||
halign: 'left'
|
||||
pos_hint: {'x': 0, 'y': 0.2}
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
active: True
|
||||
halign: 'center'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Use identicons"
|
||||
halign: 'left'
|
||||
pos_hint: {'x': 0, 'y': 0.2}
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
halign: 'center'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Reply below Quote"
|
||||
halign: 'left'
|
||||
pos_hint: {'x': 0, 'y': 0.2}
|
||||
Widget:
|
||||
size_hint_y: None
|
||||
height: 10
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
# padding: [0, 10, 0, 0]
|
||||
spacing: 10
|
||||
padding: [20, 0, 0, 0]
|
||||
height: dp(20) + self.minimum_height
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Interface Language"
|
||||
# halign: 'right'
|
||||
bold: True
|
||||
MDDropDownItem:
|
||||
id: drop_item
|
||||
# pos_hint: {'center_x': .5, 'center_y': .5}
|
||||
text: 'italiano'
|
||||
on_release: root.menu.open()
|
||||
on_press: root.set_caller()
|
||||
# MDDropDownItem:
|
||||
# id: dropdown_item
|
||||
# text: 'italiano'
|
||||
# dropdown_max_height: 150
|
||||
# dropdown_bg: [1, 1, 1, 1]
|
||||
# # pos_hint: {'center_x': 0.5, 'center_y': 0}
|
||||
# items: [f"{i}" for i in ['System Setting','U.S. English','italiano','Esperanto','dansk','Deutsch','Pirate English','francais','Nederlands','norsk bokmal','polski','portugues europeu']]
|
||||
BoxLayout:
|
||||
spacing:5
|
||||
orientation: 'horizontal'
|
||||
# pos_hint: {'x':.76}
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
# padding: [0, 10, 0, 0]
|
||||
spacing: 10
|
||||
MDRaisedButton:
|
||||
text: 'Reset'
|
||||
MDRaisedButton:
|
||||
text: 'Ok'
|
||||
Tab:
|
||||
text: 'Network Settings'
|
||||
ScrollView:
|
||||
do_scroll_x: False
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
height: dp(500) + self.minimum_height
|
||||
padding: 10
|
||||
BoxLayout:
|
||||
id: box_height
|
||||
orientation: 'vertical'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Listening port"
|
||||
halign: 'left'
|
||||
bold: True
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
padding: [10, 0, 0, 0]
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Listen for connections on port:"
|
||||
halign: 'left'
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDTextFieldRect:
|
||||
size_hint: None, None
|
||||
size: dp(100), dp(30)
|
||||
text: '8444'
|
||||
pos_hint: {'center_y': .5, 'center_x': .5}
|
||||
input_filter: "int"
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
padding_left: 10
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
# active: True
|
||||
halign: 'center'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "UPnP"
|
||||
halign: 'left'
|
||||
pos_hint: {'x': 0, 'y': 0}
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Proxy server / Tor"
|
||||
halign: 'left'
|
||||
bold: True
|
||||
|
||||
GridLayout:
|
||||
cols: 2
|
||||
padding: [10, 0, 0, 0]
|
||||
MDLabel:
|
||||
size_hint_x: None
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Type:"
|
||||
halign: 'left'
|
||||
MDDropDownItem:
|
||||
id: dropdown_item2
|
||||
dropdown_bg: [1, 1, 1, 1]
|
||||
text: 'none'
|
||||
pos_hint: {'x': 0.9, 'y': 0}
|
||||
items: [f"{i}" for i in ['System Setting','U.S. English']]
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
padding: [30, 0, 0, 0]
|
||||
spacing: 10
|
||||
height: dp(100) + self.minimum_height
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Server hostname:"
|
||||
halign: 'left'
|
||||
MDTextFieldRect:
|
||||
size_hint: None, None
|
||||
size: dp(app.window_size[0]/4), dp(30)
|
||||
hint_text: 'localhost'
|
||||
pos_hint: {'center_y': .5, 'center_x': .5}
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Port:"
|
||||
halign: 'left'
|
||||
# TextInput:
|
||||
# size_hint: None, None
|
||||
# hint_text: '9050'
|
||||
# size: dp(app.window_size[0]/4), dp(30)
|
||||
# input_filter: "int"
|
||||
# readonly: False
|
||||
# multiline: False
|
||||
# font_size: '15sp'
|
||||
MDTextFieldRect:
|
||||
size_hint: None, None
|
||||
size: dp(app.window_size[0]/4), dp(30)
|
||||
hint_text: '9050'
|
||||
pos_hint: {'center_y': .5, 'center_x': .5}
|
||||
input_filter: "int"
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Username:"
|
||||
halign: 'left'
|
||||
MDTextFieldRect:
|
||||
size_hint: None, None
|
||||
size: dp(app.window_size[0]/4), dp(30)
|
||||
pos_hint: {'center_y': .5, 'center_x': .5}
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Pass:"
|
||||
halign: 'left'
|
||||
MDTextFieldRect:
|
||||
size_hint: None, None
|
||||
size: dp(app.window_size[0]/4), dp(30)
|
||||
pos_hint: {'center_y': .5, 'center_x': .5}
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
padding: [30, 0, 0, 0]
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
# active: True
|
||||
halign: 'center'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Authentication"
|
||||
halign: 'left'
|
||||
pos_hint: {'x': 0, 'y': 0}
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
padding: [30, 0, 0, 0]
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
# active: True
|
||||
halign: 'center'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Listen for incoming connections when using proxy"
|
||||
halign: 'left'
|
||||
pos_hint: {'x': 0, 'y': 0}
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
padding: [30, 0, 0, 0]
|
||||
MDCheckbox:
|
||||
id: chkbox
|
||||
size_hint: None, None
|
||||
size: dp(48), dp(50)
|
||||
# active: True
|
||||
halign: 'center'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Only connect to onion services(*.onion)"
|
||||
halign: 'left'
|
||||
pos_hint: {'x': 0, 'y': 0}
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Bandwidth limit"
|
||||
halign: 'left'
|
||||
bold: True
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'horizontal'
|
||||
padding: [30, 0, 0, 0]
|
||||
height: dp(30) + self.minimum_height
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Maximum download rate (kB/s):[0:unlimited]"
|
||||
halign: 'left'
|
||||
MDTextFieldRect:
|
||||
size_hint: None, None
|
||||
size: app.window_size[0]/2, dp(30)
|
||||
hint_text: '0'
|
||||
pos_hint: {'center_y': .5, 'center_x': .5}
|
||||
input_filter: "int"
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'horizontal'
|
||||
padding: [30, 0, 0, 0]
|
||||
height: dp(30) + self.minimum_height
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Maximum upload rate (kB/s):[0:unlimited]"
|
||||
halign: 'left'
|
||||
MDTextFieldRect:
|
||||
size_hint: None, None
|
||||
size: app.window_size[0]/2, dp(30)
|
||||
hint_text: '0'
|
||||
pos_hint: {'center_y': .5, 'center_x': .5}
|
||||
input_filter: "int"
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'horizontal'
|
||||
padding: [30, 0, 0, 0]
|
||||
height: dp(30) + self.minimum_height
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Maximum outbound connections:[0:none]"
|
||||
halign: 'left'
|
||||
MDTextFieldRect:
|
||||
size_hint: None, None
|
||||
size: app.window_size[0]/2, dp(30)
|
||||
hint_text: '8'
|
||||
pos_hint: {'center_y': .5, 'center_x': .5}
|
||||
input_filter: "int"
|
||||
BoxLayout:
|
||||
spacing:5
|
||||
orientation: 'horizontal'
|
||||
# pos_hint: {'x':.76}
|
||||
MDRaisedButton:
|
||||
text: 'Reset'
|
||||
MDRaisedButton:
|
||||
text: 'Ok'
|
||||
Tab:
|
||||
text: 'Resends Expire'
|
||||
ScrollView:
|
||||
do_scroll_x: False
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
height: dp(210 if app.app_platform == 'android' else 100)+ self.minimum_height
|
||||
padding: 20
|
||||
# spacing: 10
|
||||
BoxLayout:
|
||||
# size_hint_y: None
|
||||
id: box1_height
|
||||
orientation: 'vertical'
|
||||
# height: dp(100) + self.minimum_height
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: root.exp_text
|
||||
halign: 'left'
|
||||
BoxLayout:
|
||||
id: box2_height
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
height: dp(30) + self.minimum_height
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Leave these input fields blank for the default behavior."
|
||||
halign: 'left'
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
orientation: 'vertical'
|
||||
padding: [10, 0, 0, 0]
|
||||
height: dp(50) + self.minimum_height
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "Give up after"
|
||||
halign: 'left'
|
||||
MDTextFieldRect:
|
||||
size_hint: None, None
|
||||
size: dp(70), dp(30)
|
||||
text: '0'
|
||||
pos_hint: {'center_y': .5, 'center_x': .5}
|
||||
input_filter: "int"
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "days and"
|
||||
halign: 'left'
|
||||
MDTextFieldRect:
|
||||
size_hint: None, None
|
||||
size: dp(70), dp(30)
|
||||
text: '0'
|
||||
pos_hint: {'center_y': .5, 'center_x': .5}
|
||||
input_filter: "int"
|
||||
MDLabel:
|
||||
font_style: 'Body1'
|
||||
theme_text_color: 'Primary'
|
||||
text: "months"
|
||||
halign: 'left'
|
||||
BoxLayout:
|
||||
size_hint_y: None
|
||||
spacing:5
|
||||
orientation: 'horizontal'
|
||||
# pos_hint: {'left': 0}
|
||||
# pos_hint: {'x':.75}
|
||||
height: dp(50) + self.minimum_height
|
||||
MDRaisedButton:
|
||||
text: 'Reset'
|
||||
MDRaisedButton:
|
||||
text: 'Ok'
|
25
src/bitmessagekivy/kv/trash.kv
Executable file
|
@ -0,0 +1,25 @@
|
|||
<Trash>:
|
||||
name: 'trash'
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
spacing: dp(5)
|
||||
GridLayout:
|
||||
id: identi_tag
|
||||
padding: [20, 20, 0, 5]
|
||||
spacing: dp(5)
|
||||
cols: 1
|
||||
size_hint_y: None
|
||||
height: self.minimum_height
|
||||
MDLabel:
|
||||
id: tag_label
|
||||
text: ''
|
||||
font_style: 'Subtitle2'
|
||||
BoxLayout:
|
||||
orientation:'vertical'
|
||||
ScrollView:
|
||||
id: scroll_y
|
||||
do_scroll_x: False
|
||||
MDList:
|
||||
id: ml
|
||||
Loader:
|
||||
ComposerButton:
|
34
src/bitmessagekivy/uikivysignaler.py
Executable file
|
@ -0,0 +1,34 @@
|
|||
"""
|
||||
Ui Singnaler for kivy interface
|
||||
"""
|
||||
from threading import Thread
|
||||
|
||||
try:
|
||||
import queues
|
||||
import state
|
||||
from semaphores import kivyuisignaler
|
||||
except ModuleNotFoundError:
|
||||
from .. import queues
|
||||
from .. import state
|
||||
from ..semaphores import kivyuisignaler
|
||||
|
||||
class UIkivySignaler(Thread):
|
||||
"""Kivy ui signaler"""
|
||||
|
||||
def run(self):
|
||||
kivyuisignaler.acquire()
|
||||
while state.shutdown == 0:
|
||||
try:
|
||||
command, data = queues.UISignalQueue.get()
|
||||
if command == 'writeNewAddressToTable':
|
||||
address = data[1]
|
||||
state.kivyapp.variable_1.append(address)
|
||||
# elif command == 'rerenderAddressBook':
|
||||
# state.kivyapp.obj_1.refreshs()
|
||||
# Need to discuss this
|
||||
elif command == 'writeNewpaymentAddressToTable':
|
||||
pass
|
||||
elif command == 'updateSentItemStatusByAckdata':
|
||||
state.kivyapp.status_dispatching(data)
|
||||
except Exception as e:
|
||||
print(e)
|
BIN
src/bob.png
Executable file
After Width: | Height: | Size: 640 B |
BIN
src/dave.png
Executable file
After Width: | Height: | Size: 650 B |
BIN
src/eve.png
Executable file
After Width: | Height: | Size: 651 B |
119
src/helper_generic.py
Executable file
|
@ -0,0 +1,119 @@
|
|||
"""
|
||||
Helper Generic perform generic operations for threading.
|
||||
|
||||
Also perform some conversion operations.
|
||||
"""
|
||||
|
||||
import socket
|
||||
import sys
|
||||
import threading
|
||||
import traceback
|
||||
try:
|
||||
import multiprocessing
|
||||
except Exception as e:
|
||||
pass
|
||||
from binascii import hexlify, unhexlify
|
||||
try:
|
||||
import shared
|
||||
import state
|
||||
import queues
|
||||
import shutdown
|
||||
from debug import logger
|
||||
except ModuleNotFoundError:
|
||||
from . import shared
|
||||
from . import state
|
||||
from . import queues
|
||||
from . import shutdown
|
||||
from .debug import logger
|
||||
|
||||
def powQueueSize():
|
||||
curWorkerQueue = queues.workerQueue.qsize()
|
||||
for thread in threading.enumerate():
|
||||
try:
|
||||
if thread.name == "singleWorker":
|
||||
curWorkerQueue += thread.busy
|
||||
except Exception as err:
|
||||
logger.info('Thread error %s', err)
|
||||
return curWorkerQueue
|
||||
|
||||
|
||||
def convertIntToString(n):
|
||||
a = __builtins__.hex(n)
|
||||
if a[-1:] == 'L':
|
||||
a = a[:-1]
|
||||
if (len(a) % 2) == 0:
|
||||
return unhexlify(a[2:])
|
||||
else:
|
||||
return unhexlify('0' + a[2:])
|
||||
|
||||
|
||||
def convertStringToInt(s):
|
||||
return int(hexlify(s), 16)
|
||||
|
||||
|
||||
def allThreadTraceback(frame):
|
||||
id2name = dict([(th.ident, th.name) for th in threading.enumerate()])
|
||||
code = []
|
||||
for threadId, stack in sys._current_frames().items():
|
||||
code.append(
|
||||
'\n# Thread: %s(%d)' % (id2name.get(threadId, ''), threadId))
|
||||
for filename, lineno, name, line in traceback.extract_stack(stack):
|
||||
code.append(
|
||||
'File: "%s", line %d, in %s' % (filename, lineno, name))
|
||||
if line:
|
||||
code.append(' %s' % (line.strip()))
|
||||
print('\n'.join(code))
|
||||
|
||||
|
||||
def signal_handler(signal, frame):
|
||||
try:
|
||||
process = multiprocessing.current_process()
|
||||
except Exception as e:
|
||||
process = threading.current_thread()
|
||||
logger.error(
|
||||
'Got signal %i in %s/%s',
|
||||
signal, process.name, threading.current_thread().name
|
||||
)
|
||||
if process.name == "RegExParser":
|
||||
# on Windows this isn't triggered, but it's fine,
|
||||
# it has its own process termination thing
|
||||
raise SystemExit
|
||||
if "PoolWorker" in process.name:
|
||||
raise SystemExit
|
||||
if threading.current_thread().name not in ("PyBitmessage", "MainThread"):
|
||||
return
|
||||
logger.error("Got signal %i", signal)
|
||||
if shared.thisapp.daemon or not state.enableGUI: # FIXME redundant?
|
||||
shutdown.doCleanShutdown()
|
||||
else:
|
||||
allThreadTraceback(frame)
|
||||
print('Unfortunately you cannot use Ctrl+C when running the UI'
|
||||
' because the UI captures the signal.')
|
||||
|
||||
|
||||
def isHostInPrivateIPRange(host):
|
||||
if ":" in host: # IPv6
|
||||
hostAddr = socket.inet_pton(socket.AF_INET6, host)
|
||||
if hostAddr == ('\x00' * 15) + '\x01':
|
||||
return False
|
||||
if hostAddr[0] == '\xFE' and (ord(hostAddr[1]) & 0xc0) == 0x80:
|
||||
return False
|
||||
if (ord(hostAddr[0]) & 0xfe) == 0xfc:
|
||||
return False
|
||||
elif ".onion" not in host:
|
||||
if host[:3] == '10.':
|
||||
return True
|
||||
if host[:4] == '172.':
|
||||
if host[6] == '.':
|
||||
if int(host[4:6]) >= 16 and int(host[4:6]) <= 31:
|
||||
return True
|
||||
if host[:8] == '192.168.':
|
||||
return True
|
||||
# Multicast
|
||||
if host[:3] >= 224 and host[:3] <= 239 and host[4] == '.':
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def addDataPadding(data, desiredMsgLength=12, paddingChar='\x00'):
|
||||
return data + paddingChar * (desiredMsgLength - len(data))
|
BIN
src/image.svg
Executable file
After Width: | Height: | Size: 704 B |
BIN
src/images/account_multiple.png
Executable file
After Width: | Height: | Size: 9.6 KiB |
BIN
src/images/addressbookadd.png
Executable file
After Width: | Height: | Size: 7.6 KiB |
BIN
src/images/avatar.png
Executable file
After Width: | Height: | Size: 27 KiB |
BIN
src/images/back-button.png
Executable file
After Width: | Height: | Size: 51 KiB |
BIN
src/images/drawer_logo1.png
Executable file
After Width: | Height: | Size: 2.0 KiB |
BIN
src/images/kivy/3.zip
Executable file
BIN
src/images/kivy/black_cross.png
Executable file
After Width: | Height: | Size: 5.1 KiB |
BIN
src/images/kivy/copy_text.png
Executable file
After Width: | Height: | Size: 2.6 KiB |
BIN
src/images/kivy/down-arrow.png
Executable file
After Width: | Height: | Size: 2.3 KiB |
BIN
src/images/kivy/left_arrow.png
Executable file
After Width: | Height: | Size: 2.4 KiB |
BIN
src/images/kivy/loader.gif
Executable file
After Width: | Height: | Size: 13 KiB |
BIN
src/images/kivy/loader.zip
Executable file
BIN
src/images/kivy/red.png
Executable file
After Width: | Height: | Size: 56 KiB |
BIN
src/images/kivy/right-arrow.png
Executable file
After Width: | Height: | Size: 3.1 KiB |
BIN
src/images/kivy/search.png
Executable file
After Width: | Height: | Size: 2.9 KiB |
BIN
src/images/kivy/search_mail.png
Executable file
After Width: | Height: | Size: 10 KiB |
BIN
src/images/kivy/text_images/!.png
Executable file
After Width: | Height: | Size: 4.9 KiB |
BIN
src/images/kivy/text_images/0.png
Executable file
After Width: | Height: | Size: 7.1 KiB |
BIN
src/images/kivy/text_images/1.png
Executable file
After Width: | Height: | Size: 4.9 KiB |
BIN
src/images/kivy/text_images/2.png
Executable file
After Width: | Height: | Size: 6.8 KiB |
BIN
src/images/kivy/text_images/3.png
Executable file
After Width: | Height: | Size: 7.1 KiB |
BIN
src/images/kivy/text_images/4.png
Executable file
After Width: | Height: | Size: 5.8 KiB |
BIN
src/images/kivy/text_images/5.png
Executable file
After Width: | Height: | Size: 6.7 KiB |
BIN
src/images/kivy/text_images/6.png
Executable file
After Width: | Height: | Size: 7.5 KiB |
BIN
src/images/kivy/text_images/7.png
Executable file
After Width: | Height: | Size: 5.8 KiB |
BIN
src/images/kivy/text_images/8.png
Executable file
After Width: | Height: | Size: 7.6 KiB |
BIN
src/images/kivy/text_images/9.png
Executable file
After Width: | Height: | Size: 7.6 KiB |
BIN
src/images/kivy/text_images/A.png
Executable file
After Width: | Height: | Size: 6.7 KiB |
BIN
src/images/kivy/text_images/B.png
Executable file
After Width: | Height: | Size: 6.4 KiB |
BIN
src/images/kivy/text_images/C.png
Executable file
After Width: | Height: | Size: 7.5 KiB |
BIN
src/images/kivy/text_images/D.png
Executable file
After Width: | Height: | Size: 6.2 KiB |
BIN
src/images/kivy/text_images/E.png
Executable file
After Width: | Height: | Size: 4.9 KiB |
BIN
src/images/kivy/text_images/F.png
Executable file
After Width: | Height: | Size: 4.9 KiB |
BIN
src/images/kivy/text_images/G.png
Executable file
After Width: | Height: | Size: 7.4 KiB |
BIN
src/images/kivy/text_images/H.png
Executable file
After Width: | Height: | Size: 4.9 KiB |
BIN
src/images/kivy/text_images/I.png
Executable file
After Width: | Height: | Size: 4.6 KiB |
BIN
src/images/kivy/text_images/J.png
Executable file
After Width: | Height: | Size: 5.7 KiB |
BIN
src/images/kivy/text_images/K.png
Executable file
After Width: | Height: | Size: 6.6 KiB |
BIN
src/images/kivy/text_images/L.png
Executable file
After Width: | Height: | Size: 4.8 KiB |
BIN
src/images/kivy/text_images/M.png
Executable file
After Width: | Height: | Size: 6.4 KiB |
BIN
src/images/kivy/text_images/N.png
Executable file
After Width: | Height: | Size: 6.4 KiB |
BIN
src/images/kivy/text_images/O.png
Executable file
After Width: | Height: | Size: 7.7 KiB |
BIN
src/images/kivy/text_images/P.png
Executable file
After Width: | Height: | Size: 5.8 KiB |
BIN
src/images/kivy/text_images/Q.png
Executable file
After Width: | Height: | Size: 8.1 KiB |
BIN
src/images/kivy/text_images/R.png
Executable file
After Width: | Height: | Size: 6.3 KiB |
BIN
src/images/kivy/text_images/S.png
Executable file
After Width: | Height: | Size: 7.6 KiB |
BIN
src/images/kivy/text_images/T.png
Executable file
After Width: | Height: | Size: 4.7 KiB |
BIN
src/images/kivy/text_images/U.png
Executable file
After Width: | Height: | Size: 6.0 KiB |
BIN
src/images/kivy/text_images/V.png
Executable file
After Width: | Height: | Size: 6.6 KiB |
BIN
src/images/kivy/text_images/W.png
Executable file
After Width: | Height: | Size: 7.6 KiB |
BIN
src/images/kivy/text_images/X.png
Executable file
After Width: | Height: | Size: 7.2 KiB |
BIN
src/images/kivy/text_images/Y.png
Executable file
After Width: | Height: | Size: 6.3 KiB |
BIN
src/images/kivy/text_images/Z.png
Executable file
After Width: | Height: | Size: 6.0 KiB |
BIN
src/images/kivy/transparent.png
Executable file
After Width: | Height: | Size: 24 KiB |
BIN
src/images/kivy/white.png
Executable file
After Width: | Height: | Size: 80 KiB |
38
src/messagetypes/chatmsg.py
Executable file
|
@ -0,0 +1,38 @@
|
|||
import logging
|
||||
|
||||
# from ..messagetypes import MsgBase
|
||||
# pylint: disable=attribute-defined-outside-init
|
||||
|
||||
try:
|
||||
from messagetypes import MsgBase
|
||||
except ModuleNotFoundError:
|
||||
from ..messagetypes import MsgBase
|
||||
logger = logging.getLogger('default')
|
||||
|
||||
|
||||
class Chatmsg(MsgBase):
|
||||
"""Encapsulate a chatmsg"""
|
||||
# pylint: disable=attribute-defined-outside-init
|
||||
|
||||
def decode(self, data):
|
||||
"""Decode a message"""
|
||||
# UTF-8 and variable type validator
|
||||
if isinstance(data["message"], str):
|
||||
# Unicode is depreciated
|
||||
self.message = data["message"]
|
||||
else:
|
||||
# Unicode is depreciated
|
||||
self.message = str(data["message"])
|
||||
|
||||
def encode(self, data):
|
||||
"""Encode a message"""
|
||||
super(Chatmsg, self).__init__()
|
||||
try:
|
||||
self.data["message"] = data["message"]
|
||||
except KeyError as e:
|
||||
logger.error("Missing key %s", e)
|
||||
return self.data
|
||||
|
||||
def process(self):
|
||||
"""Process a message"""
|
||||
logger.debug("Message: %i bytes", len(self.message))
|
3
src/nohup.out
Executable file
|
@ -0,0 +1,3 @@
|
|||
python: can't open file 'main.py.py': [Errno 2] No such file or directory
|
||||
[[1;33mWARNING[0m] [Config ] Older configuration version detected (21 instead of 20)
|
||||
[[1;33mWARNING[0m] [Config ] Upgrading configuration in progress.
|
3
src/semaphores.py
Executable file
|
@ -0,0 +1,3 @@
|
|||
from threading import Semaphore
|
||||
|
||||
kivyuisignaler = Semaphore(0)
|
23
src/tests/test_chatmsg.py
Executable file
|
@ -0,0 +1,23 @@
|
|||
"""
|
||||
Test for chatmsg group
|
||||
"""
|
||||
import unittest
|
||||
from ..messagetypes.chatmsg import Chatmsg
|
||||
|
||||
|
||||
class TestCharMessage(unittest.TestCase):
|
||||
"""
|
||||
Test case for chat message group
|
||||
"""
|
||||
|
||||
# def test_decode(self):
|
||||
# """Test various types of decode method"""
|
||||
# from .. import messagetypes
|
||||
# result = messagetypes.constructObject({'': 'chatmsg', 'message': 'hello world'})
|
||||
# self.assertTrue(isinstance(result.message, str))
|
||||
|
||||
# def test_encode(self):
|
||||
# """Test various types of encode method"""
|
||||
# chat_obj = Chatmsg()
|
||||
# result = chat_obj.encode({'message': 'hello world'})
|
||||
# self.assertTrue(True if result['message'] else False)
|