diff --git a/src/.buildozer/android/platform/python-for-android b/src/.buildozer/android/platform/python-for-android new file mode 160000 index 00000000..0610d207 --- /dev/null +++ b/src/.buildozer/android/platform/python-for-android @@ -0,0 +1 @@ +Subproject commit 0610d207c55d7bf36a98af985d72ae4767678727 diff --git a/src/alice.png b/src/alice.png new file mode 100755 index 00000000..3f6c6a92 Binary files /dev/null and b/src/alice.png differ diff --git a/src/bitmessagekivy/android/python-for-android/recipes/bitmsghash/__init__.py b/src/bitmessagekivy/android/python-for-android/recipes/bitmsghash/__init__.py new file mode 100755 index 00000000..4566ebfb --- /dev/null +++ b/src/bitmessagekivy/android/python-for-android/recipes/bitmsghash/__init__.py @@ -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() diff --git a/src/bitmessagekivy/identiconGeneration.py b/src/bitmessagekivy/identiconGeneration.py new file mode 100755 index 00000000..0f8c4203 --- /dev/null +++ b/src/bitmessagekivy/identiconGeneration.py @@ -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 diff --git a/src/bitmessagekivy/kv/addressbook.kv b/src/bitmessagekivy/kv/addressbook.kv new file mode 100755 index 00000000..73b4c1ef --- /dev/null +++ b/src/bitmessagekivy/kv/addressbook.kv @@ -0,0 +1,26 @@ +: + 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: \ No newline at end of file diff --git a/src/bitmessagekivy/kv/allmails.kv b/src/bitmessagekivy/kv/allmails.kv new file mode 100755 index 00000000..f1b9387e --- /dev/null +++ b/src/bitmessagekivy/kv/allmails.kv @@ -0,0 +1,25 @@ +: + 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: \ No newline at end of file diff --git a/src/bitmessagekivy/kv/chat_list.kv b/src/bitmessagekivy/kv/chat_list.kv new file mode 100755 index 00000000..2a480abf --- /dev/null +++ b/src/bitmessagekivy/kv/chat_list.kv @@ -0,0 +1,58 @@ +: + 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 diff --git a/src/bitmessagekivy/kv/chat_room.kv b/src/bitmessagekivy/kv/chat_room.kv new file mode 100755 index 00000000..25edfd69 --- /dev/null +++ b/src/bitmessagekivy/kv/chat_room.kv @@ -0,0 +1,45 @@ +#:import C kivy.utils.get_color_from_hex + +: + 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() diff --git a/src/bitmessagekivy/kv/common_widgets.kv b/src/bitmessagekivy/kv/common_widgets.kv new file mode 100755 index 00000000..d69e648c --- /dev/null +++ b/src/bitmessagekivy/kv/common_widgets.kv @@ -0,0 +1,61 @@ +: + 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 + +: + # 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) + +: + id: spinner + size_hint: None, None + size: dp(46), dp(46) + pos_hint: {'center_x': 0.5, 'center_y': 0.5} + active: False + +: + 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() + + +: + 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) + +: + 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 \ No newline at end of file diff --git a/src/bitmessagekivy/kv/composer.kv b/src/bitmessagekivy/kv/composer.kv new file mode 100755 index 00000000..4931fd56 --- /dev/null +++ b/src/bitmessagekivy/kv/composer.kv @@ -0,0 +1,136 @@ +: + 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 + +: + readonly: False + multiline: False + + +: + # 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 + +: + 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 + + +: + canvas.before: + Color: + rgba: (0,0,0,1) + + +: + 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 \ No newline at end of file diff --git a/src/bitmessagekivy/kv/credits.kv b/src/bitmessagekivy/kv/credits.kv new file mode 100755 index 00000000..f6d037d2 --- /dev/null +++ b/src/bitmessagekivy/kv/credits.kv @@ -0,0 +1,28 @@ +: + 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' diff --git a/src/bitmessagekivy/kv/draft.kv b/src/bitmessagekivy/kv/draft.kv new file mode 100755 index 00000000..56682d2b --- /dev/null +++ b/src/bitmessagekivy/kv/draft.kv @@ -0,0 +1,23 @@ +: + 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: \ No newline at end of file diff --git a/src/bitmessagekivy/kv/inbox.kv b/src/bitmessagekivy/kv/inbox.kv new file mode 100755 index 00000000..b9cc8566 --- /dev/null +++ b/src/bitmessagekivy/kv/inbox.kv @@ -0,0 +1,39 @@ +: + 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: + +: + size_hint:(None, None) + font_style: 'Caption' + halign: 'center' diff --git a/src/bitmessagekivy/kv/login.kv b/src/bitmessagekivy/kv/login.kv new file mode 100755 index 00000000..2b923b90 --- /dev/null +++ b/src/bitmessagekivy/kv/login.kv @@ -0,0 +1,264 @@ +#:import SlideTransition kivy.uix.screenmanager.SlideTransition +: + 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.") + +: + name:"random" + ScrollView: + id:add_random_bx + +: + 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.") + +: + group: 'group' + size_hint: None, None + size: dp(48), dp(48) + +: + 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" + +: + 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 diff --git a/src/bitmessagekivy/kv/maildetail.kv b/src/bitmessagekivy/kv/maildetail.kv new file mode 100755 index 00000000..3d51f657 --- /dev/null +++ b/src/bitmessagekivy/kv/maildetail.kv @@ -0,0 +1,80 @@ +: + 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: \ No newline at end of file diff --git a/src/bitmessagekivy/kv/myaddress.kv b/src/bitmessagekivy/kv/myaddress.kv new file mode 100755 index 00000000..39027b1c --- /dev/null +++ b/src/bitmessagekivy/kv/myaddress.kv @@ -0,0 +1,26 @@ +: + 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: diff --git a/src/bitmessagekivy/kv/network.kv b/src/bitmessagekivy/kv/network.kv new file mode 100755 index 00000000..c7cb9a2f --- /dev/null +++ b/src/bitmessagekivy/kv/network.kv @@ -0,0 +1,117 @@ +: + 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' diff --git a/src/bitmessagekivy/kv/payment.kv b/src/bitmessagekivy/kv/payment.kv new file mode 100755 index 00000000..542e8e0e --- /dev/null +++ b/src/bitmessagekivy/kv/payment.kv @@ -0,0 +1,253 @@ +#:import get_color_from_hex kivy.utils.get_color_from_hex + +: + 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" + +: + size_hint_y: None + height: self.minimum_height + category_text:"" + + orientation: "vertical" + spacing: 2 + + #category area + Category: + text_: root.category_text + +: + 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) + +: + 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) + +: + 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) + +: + 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" \ No newline at end of file diff --git a/src/bitmessagekivy/kv/popup.kv b/src/bitmessagekivy/kv/popup.kv new file mode 100755 index 00000000..2feaf27d --- /dev/null +++ b/src/bitmessagekivy/kv/popup.kv @@ -0,0 +1,329 @@ +: + 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 + + +: + 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) + +: + 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) + + +: + 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' + +: + 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' + +: + 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' + +: + 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) + +: + orientation: 'vertical' + MDLabel: + id: to_add_label + font_style: 'Subtitle2' + theme_text_color: 'Primary' + text: "To :" + font_size: '15sp' + halign: 'left' \ No newline at end of file diff --git a/src/bitmessagekivy/kv/sent.kv b/src/bitmessagekivy/kv/sent.kv new file mode 100755 index 00000000..11477ed6 --- /dev/null +++ b/src/bitmessagekivy/kv/sent.kv @@ -0,0 +1,26 @@ +: + 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: \ No newline at end of file diff --git a/src/bitmessagekivy/kv/settings.kv b/src/bitmessagekivy/kv/settings.kv new file mode 100755 index 00000000..98307c93 --- /dev/null +++ b/src/bitmessagekivy/kv/settings.kv @@ -0,0 +1,550 @@ +: + 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' diff --git a/src/bitmessagekivy/kv/trash.kv b/src/bitmessagekivy/kv/trash.kv new file mode 100755 index 00000000..71708e6d --- /dev/null +++ b/src/bitmessagekivy/kv/trash.kv @@ -0,0 +1,25 @@ +: + 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: \ No newline at end of file diff --git a/src/bitmessagekivy/uikivysignaler.py b/src/bitmessagekivy/uikivysignaler.py new file mode 100755 index 00000000..f8c88a6a --- /dev/null +++ b/src/bitmessagekivy/uikivysignaler.py @@ -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) diff --git a/src/bob.png b/src/bob.png new file mode 100755 index 00000000..74aeb99e Binary files /dev/null and b/src/bob.png differ diff --git a/src/dave.png b/src/dave.png new file mode 100755 index 00000000..e8d7bd0b Binary files /dev/null and b/src/dave.png differ diff --git a/src/eve.png b/src/eve.png new file mode 100755 index 00000000..e11ff6f5 Binary files /dev/null and b/src/eve.png differ diff --git a/src/helper_generic.py b/src/helper_generic.py new file mode 100755 index 00000000..cfb26278 --- /dev/null +++ b/src/helper_generic.py @@ -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)) diff --git a/src/image.svg b/src/image.svg new file mode 100755 index 00000000..bef2b802 Binary files /dev/null and b/src/image.svg differ diff --git a/src/images/account_multiple.png b/src/images/account_multiple.png new file mode 100755 index 00000000..11271619 Binary files /dev/null and b/src/images/account_multiple.png differ diff --git a/src/images/addressbookadd.png b/src/images/addressbookadd.png new file mode 100755 index 00000000..82af2f63 Binary files /dev/null and b/src/images/addressbookadd.png differ diff --git a/src/images/avatar.png b/src/images/avatar.png new file mode 100755 index 00000000..b006bfa2 Binary files /dev/null and b/src/images/avatar.png differ diff --git a/src/images/back-button.png b/src/images/back-button.png new file mode 100755 index 00000000..e260b08b Binary files /dev/null and b/src/images/back-button.png differ diff --git a/src/images/drawer_logo1.png b/src/images/drawer_logo1.png new file mode 100755 index 00000000..4152cc40 Binary files /dev/null and b/src/images/drawer_logo1.png differ diff --git a/src/images/kivy/3.zip b/src/images/kivy/3.zip new file mode 100755 index 00000000..34d555fe Binary files /dev/null and b/src/images/kivy/3.zip differ diff --git a/src/images/kivy/black_cross.png b/src/images/kivy/black_cross.png new file mode 100755 index 00000000..a71b611b Binary files /dev/null and b/src/images/kivy/black_cross.png differ diff --git a/src/images/kivy/copy_text.png b/src/images/kivy/copy_text.png new file mode 100755 index 00000000..dcc63611 Binary files /dev/null and b/src/images/kivy/copy_text.png differ diff --git a/src/images/kivy/down-arrow.png b/src/images/kivy/down-arrow.png new file mode 100755 index 00000000..bf3e864c Binary files /dev/null and b/src/images/kivy/down-arrow.png differ diff --git a/src/images/kivy/left_arrow.png b/src/images/kivy/left_arrow.png new file mode 100755 index 00000000..0f01c425 Binary files /dev/null and b/src/images/kivy/left_arrow.png differ diff --git a/src/images/kivy/loader.gif b/src/images/kivy/loader.gif new file mode 100755 index 00000000..29064d57 Binary files /dev/null and b/src/images/kivy/loader.gif differ diff --git a/src/images/kivy/loader.zip b/src/images/kivy/loader.zip new file mode 100755 index 00000000..c80a3a17 Binary files /dev/null and b/src/images/kivy/loader.zip differ diff --git a/src/images/kivy/red.png b/src/images/kivy/red.png new file mode 100755 index 00000000..2570e26a Binary files /dev/null and b/src/images/kivy/red.png differ diff --git a/src/images/kivy/right-arrow.png b/src/images/kivy/right-arrow.png new file mode 100755 index 00000000..8f136a77 Binary files /dev/null and b/src/images/kivy/right-arrow.png differ diff --git a/src/images/kivy/search.png b/src/images/kivy/search.png new file mode 100755 index 00000000..42a1e45a Binary files /dev/null and b/src/images/kivy/search.png differ diff --git a/src/images/kivy/search_mail.png b/src/images/kivy/search_mail.png new file mode 100755 index 00000000..7b38e9b4 Binary files /dev/null and b/src/images/kivy/search_mail.png differ diff --git a/src/images/kivy/text_images/!.png b/src/images/kivy/text_images/!.png new file mode 100755 index 00000000..bac2f246 Binary files /dev/null and b/src/images/kivy/text_images/!.png differ diff --git a/src/images/kivy/text_images/0.png b/src/images/kivy/text_images/0.png new file mode 100755 index 00000000..2b8b63e3 Binary files /dev/null and b/src/images/kivy/text_images/0.png differ diff --git a/src/images/kivy/text_images/1.png b/src/images/kivy/text_images/1.png new file mode 100755 index 00000000..3918f6d3 Binary files /dev/null and b/src/images/kivy/text_images/1.png differ diff --git a/src/images/kivy/text_images/2.png b/src/images/kivy/text_images/2.png new file mode 100755 index 00000000..0cf202e9 Binary files /dev/null and b/src/images/kivy/text_images/2.png differ diff --git a/src/images/kivy/text_images/3.png b/src/images/kivy/text_images/3.png new file mode 100755 index 00000000..f9d612dd Binary files /dev/null and b/src/images/kivy/text_images/3.png differ diff --git a/src/images/kivy/text_images/4.png b/src/images/kivy/text_images/4.png new file mode 100755 index 00000000..f2ab33e1 Binary files /dev/null and b/src/images/kivy/text_images/4.png differ diff --git a/src/images/kivy/text_images/5.png b/src/images/kivy/text_images/5.png new file mode 100755 index 00000000..09d6e56e Binary files /dev/null and b/src/images/kivy/text_images/5.png differ diff --git a/src/images/kivy/text_images/6.png b/src/images/kivy/text_images/6.png new file mode 100755 index 00000000..e385a954 Binary files /dev/null and b/src/images/kivy/text_images/6.png differ diff --git a/src/images/kivy/text_images/7.png b/src/images/kivy/text_images/7.png new file mode 100755 index 00000000..55fc4f77 Binary files /dev/null and b/src/images/kivy/text_images/7.png differ diff --git a/src/images/kivy/text_images/8.png b/src/images/kivy/text_images/8.png new file mode 100755 index 00000000..2a3fa76f Binary files /dev/null and b/src/images/kivy/text_images/8.png differ diff --git a/src/images/kivy/text_images/9.png b/src/images/kivy/text_images/9.png new file mode 100755 index 00000000..81ad9084 Binary files /dev/null and b/src/images/kivy/text_images/9.png differ diff --git a/src/images/kivy/text_images/A.png b/src/images/kivy/text_images/A.png new file mode 100755 index 00000000..64ed6110 Binary files /dev/null and b/src/images/kivy/text_images/A.png differ diff --git a/src/images/kivy/text_images/B.png b/src/images/kivy/text_images/B.png new file mode 100755 index 00000000..2db56c1f Binary files /dev/null and b/src/images/kivy/text_images/B.png differ diff --git a/src/images/kivy/text_images/C.png b/src/images/kivy/text_images/C.png new file mode 100755 index 00000000..47a4052c Binary files /dev/null and b/src/images/kivy/text_images/C.png differ diff --git a/src/images/kivy/text_images/D.png b/src/images/kivy/text_images/D.png new file mode 100755 index 00000000..2549ffc2 Binary files /dev/null and b/src/images/kivy/text_images/D.png differ diff --git a/src/images/kivy/text_images/E.png b/src/images/kivy/text_images/E.png new file mode 100755 index 00000000..5d631611 Binary files /dev/null and b/src/images/kivy/text_images/E.png differ diff --git a/src/images/kivy/text_images/F.png b/src/images/kivy/text_images/F.png new file mode 100755 index 00000000..43086f38 Binary files /dev/null and b/src/images/kivy/text_images/F.png differ diff --git a/src/images/kivy/text_images/G.png b/src/images/kivy/text_images/G.png new file mode 100755 index 00000000..32d1709d Binary files /dev/null and b/src/images/kivy/text_images/G.png differ diff --git a/src/images/kivy/text_images/H.png b/src/images/kivy/text_images/H.png new file mode 100755 index 00000000..279bd1ce Binary files /dev/null and b/src/images/kivy/text_images/H.png differ diff --git a/src/images/kivy/text_images/I.png b/src/images/kivy/text_images/I.png new file mode 100755 index 00000000..c88f048d Binary files /dev/null and b/src/images/kivy/text_images/I.png differ diff --git a/src/images/kivy/text_images/J.png b/src/images/kivy/text_images/J.png new file mode 100755 index 00000000..15331171 Binary files /dev/null and b/src/images/kivy/text_images/J.png differ diff --git a/src/images/kivy/text_images/K.png b/src/images/kivy/text_images/K.png new file mode 100755 index 00000000..9afcadd7 Binary files /dev/null and b/src/images/kivy/text_images/K.png differ diff --git a/src/images/kivy/text_images/L.png b/src/images/kivy/text_images/L.png new file mode 100755 index 00000000..e841b9d9 Binary files /dev/null and b/src/images/kivy/text_images/L.png differ diff --git a/src/images/kivy/text_images/M.png b/src/images/kivy/text_images/M.png new file mode 100755 index 00000000..10de35e9 Binary files /dev/null and b/src/images/kivy/text_images/M.png differ diff --git a/src/images/kivy/text_images/N.png b/src/images/kivy/text_images/N.png new file mode 100755 index 00000000..2d235d06 Binary files /dev/null and b/src/images/kivy/text_images/N.png differ diff --git a/src/images/kivy/text_images/O.png b/src/images/kivy/text_images/O.png new file mode 100755 index 00000000..c0cc972a Binary files /dev/null and b/src/images/kivy/text_images/O.png differ diff --git a/src/images/kivy/text_images/P.png b/src/images/kivy/text_images/P.png new file mode 100755 index 00000000..57ec5012 Binary files /dev/null and b/src/images/kivy/text_images/P.png differ diff --git a/src/images/kivy/text_images/Q.png b/src/images/kivy/text_images/Q.png new file mode 100755 index 00000000..27ffd18b Binary files /dev/null and b/src/images/kivy/text_images/Q.png differ diff --git a/src/images/kivy/text_images/R.png b/src/images/kivy/text_images/R.png new file mode 100755 index 00000000..090646f5 Binary files /dev/null and b/src/images/kivy/text_images/R.png differ diff --git a/src/images/kivy/text_images/S.png b/src/images/kivy/text_images/S.png new file mode 100755 index 00000000..444419cf Binary files /dev/null and b/src/images/kivy/text_images/S.png differ diff --git a/src/images/kivy/text_images/T.png b/src/images/kivy/text_images/T.png new file mode 100755 index 00000000..ace7b36b Binary files /dev/null and b/src/images/kivy/text_images/T.png differ diff --git a/src/images/kivy/text_images/U.png b/src/images/kivy/text_images/U.png new file mode 100755 index 00000000..a47f326e Binary files /dev/null and b/src/images/kivy/text_images/U.png differ diff --git a/src/images/kivy/text_images/V.png b/src/images/kivy/text_images/V.png new file mode 100755 index 00000000..da07d0ac Binary files /dev/null and b/src/images/kivy/text_images/V.png differ diff --git a/src/images/kivy/text_images/W.png b/src/images/kivy/text_images/W.png new file mode 100755 index 00000000..a00f9d7c Binary files /dev/null and b/src/images/kivy/text_images/W.png differ diff --git a/src/images/kivy/text_images/X.png b/src/images/kivy/text_images/X.png new file mode 100755 index 00000000..be919fc4 Binary files /dev/null and b/src/images/kivy/text_images/X.png differ diff --git a/src/images/kivy/text_images/Y.png b/src/images/kivy/text_images/Y.png new file mode 100755 index 00000000..4819bbd1 Binary files /dev/null and b/src/images/kivy/text_images/Y.png differ diff --git a/src/images/kivy/text_images/Z.png b/src/images/kivy/text_images/Z.png new file mode 100755 index 00000000..7d1c8e01 Binary files /dev/null and b/src/images/kivy/text_images/Z.png differ diff --git a/src/images/kivy/transparent.png b/src/images/kivy/transparent.png new file mode 100755 index 00000000..26529139 Binary files /dev/null and b/src/images/kivy/transparent.png differ diff --git a/src/images/kivy/white.png b/src/images/kivy/white.png new file mode 100755 index 00000000..0542f499 Binary files /dev/null and b/src/images/kivy/white.png differ diff --git a/src/messagetypes/chatmsg.py b/src/messagetypes/chatmsg.py new file mode 100755 index 00000000..9c94c04a --- /dev/null +++ b/src/messagetypes/chatmsg.py @@ -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)) diff --git a/src/nohup.out b/src/nohup.out new file mode 100755 index 00000000..1e343a48 --- /dev/null +++ b/src/nohup.out @@ -0,0 +1,3 @@ +python: can't open file 'main.py.py': [Errno 2] No such file or directory +[WARNING] [Config ] Older configuration version detected (21 instead of 20) +[WARNING] [Config ] Upgrading configuration in progress. diff --git a/src/semaphores.py b/src/semaphores.py new file mode 100755 index 00000000..960d86a9 --- /dev/null +++ b/src/semaphores.py @@ -0,0 +1,3 @@ +from threading import Semaphore + +kivyuisignaler = Semaphore(0) diff --git a/src/tests/test_chatmsg.py b/src/tests/test_chatmsg.py new file mode 100755 index 00000000..e2d54b2c --- /dev/null +++ b/src/tests/test_chatmsg.py @@ -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)