diff --git a/.travis-kivy.yml b/.travis-kivy.yml index 49c99f4d..46ef7963 100644 --- a/.travis-kivy.yml +++ b/.travis-kivy.yml @@ -10,7 +10,6 @@ addons: - libcap-dev - libmtdev-dev - xvfb - - xclip install: - pip3 install -r kivy-requirements.txt - python3 setup.py install diff --git a/COPYING b/COPYING index 279cef2a..078bf213 100644 --- a/COPYING +++ b/COPYING @@ -1,5 +1,5 @@ Copyright (c) 2012-2016 Jonathan Warren -Copyright (c) 2012-2022 The Bitmessage Developers +Copyright (c) 2012-2020 The Bitmessage Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/LICENSE b/LICENSE index fd772201..c2eeff82 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) Copyright (c) 2012-2016 Jonathan Warren -Copyright (c) 2012-2022 The Bitmessage Developers +Copyright (c) 2012-2020 The Bitmessage Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in @@ -91,4 +91,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/buildscripts/androiddev.sh b/buildscripts/androiddev.sh old mode 100755 new mode 100644 index 1634d4c0..c035fea0 --- a/buildscripts/androiddev.sh +++ b/buildscripts/androiddev.sh @@ -58,14 +58,23 @@ install_ndk() } # INSTALL SDK -install_sdk() +function install_sdk() { - ANDROID_SDK_BUILD_TOOLS_VERSION="29.0.2" + if [[ "$get_python_version" -eq " 2 " ]]; + then + ANDROID_SDK_BUILD_TOOLS_VERSION="28.0.3" + elif [[ "$get_python_version" -eq " 3 " ]]; + then + ANDROID_SDK_BUILD_TOOLS_VERSION="29.0.2" + else + exit + fi ANDROID_SDK_HOME="${ANDROID_HOME}/android-sdk" # get the latest version from https://developer.android.com/studio/index.html ANDROID_SDK_TOOLS_VERSION="4333796" ANDROID_SDK_TOOLS_ARCHIVE="sdk-tools-linux-${ANDROID_SDK_TOOLS_VERSION}.zip" ANDROID_SDK_TOOLS_DL_URL="https://dl.google.com/android/repository/${ANDROID_SDK_TOOLS_ARCHIVE}" + echo "Downloading sdk.........................................................................." wget -nc ${ANDROID_SDK_TOOLS_DL_URL} mkdir --parents "${ANDROID_SDK_HOME}" unzip -q "${ANDROID_SDK_TOOLS_ARCHIVE}" -d "${ANDROID_SDK_HOME}" @@ -75,7 +84,7 @@ install_sdk() echo '### Sources for Android SDK Manager' > "${ANDROID_SDK_HOME}/.android/repositories.cfg" # accept Android licenses (JDK necessary!) apt -y update -qq - apt -y install -qq --no-install-recommends openjdk-11-jdk + apt -y install -qq --no-install-recommends openjdk-8-jdk apt -y autoremove yes | "${ANDROID_SDK_HOME}/tools/bin/sdkmanager" "build-tools;${ANDROID_SDK_BUILD_TOOLS_VERSION}" > /dev/null # download platforms, API, build tools @@ -89,14 +98,23 @@ install_sdk() } # INSTALL APACHE-ANT -install_ant() +function install_ant() { - APACHE_ANT_VERSION="1.10.12" + if [[ "$get_python_version" -eq " 2 " ]]; + then + APACHE_ANT_VERSION="1.9.4" + elif [[ "$get_python_version" -eq " 3 " ]]; + then + APACHE_ANT_VERSION="1.10.7" + else + exit + fi APACHE_ANT_ARCHIVE="apache-ant-${APACHE_ANT_VERSION}-bin.tar.gz" APACHE_ANT_DL_URL="http://archive.apache.org/dist/ant/binaries/${APACHE_ANT_ARCHIVE}" APACHE_ANT_HOME="${ANDROID_HOME}/apache-ant" APACHE_ANT_HOME_V="${APACHE_ANT_HOME}-${APACHE_ANT_VERSION}" + echo "Downloading ant.........................................................................." wget -nc ${APACHE_ANT_DL_URL} tar -xf "${APACHE_ANT_ARCHIVE}" -C "${ANDROID_HOME}" ln -sfn "${APACHE_ANT_HOME_V}" "${APACHE_ANT_HOME}" diff --git a/src/api.py b/src/api.py index 9cab1cfe..de220cc4 100644 --- a/src/api.py +++ b/src/api.py @@ -1,5 +1,5 @@ # Copyright (c) 2012-2016 Jonathan Warren -# Copyright (c) 2012-2022 The Bitmessage developers +# Copyright (c) 2012-2020 The Bitmessage developers """ This is not what you run to start the Bitmessage API. diff --git a/src/bitmessagekivy/kv/addressbook.kv b/src/bitmessagekivy/kv/addressbook.kv deleted file mode 100644 index 73b4c1ef..00000000 --- a/src/bitmessagekivy/kv/addressbook.kv +++ /dev/null @@ -1,26 +0,0 @@ -: - 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 deleted file mode 100644 index f1b9387e..00000000 --- a/src/bitmessagekivy/kv/allmails.kv +++ /dev/null @@ -1,25 +0,0 @@ -: - 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 deleted file mode 100644 index e59c32d7..00000000 --- a/src/bitmessagekivy/kv/chat_list.kv +++ /dev/null @@ -1,58 +0,0 @@ -: - 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: app.tr._("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: app.tr._('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: app.tr._("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 deleted file mode 100644 index 40843c47..00000000 --- a/src/bitmessagekivy/kv/chat_room.kv +++ /dev/null @@ -1,45 +0,0 @@ -#: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: app.tr._("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 deleted file mode 100644 index 792fef1e..00000000 --- a/src/bitmessagekivy/kv/common_widgets.kv +++ /dev/null @@ -1,62 +0,0 @@ -: - 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/credits.kv b/src/bitmessagekivy/kv/credits.kv deleted file mode 100644 index b5eb3db7..00000000 --- a/src/bitmessagekivy/kv/credits.kv +++ /dev/null @@ -1,28 +0,0 @@ -: - name: 'credits' - ScrollView: - do_scroll_x: False - BoxLayout: - size_hint_y: None - orientation: 'vertical' - OneLineListTitle: - id: cred - text: app.tr._("Available Credits") - divider: None - theme_text_color: 'Primary' - _no_ripple_effect: True - long_press_time: 1 - - OneLineListTitle: - id: cred - text: app.tr._(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: app.tr._("+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 deleted file mode 100644 index 56682d2b..00000000 --- a/src/bitmessagekivy/kv/draft.kv +++ /dev/null @@ -1,23 +0,0 @@ -: - 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 deleted file mode 100644 index b9cc8566..00000000 --- a/src/bitmessagekivy/kv/inbox.kv +++ /dev/null @@ -1,39 +0,0 @@ -: - 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 deleted file mode 100644 index 44e24c04..00000000 --- a/src/bitmessagekivy/kv/login.kv +++ /dev/null @@ -1,264 +0,0 @@ -#: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: app.tr._("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: app.tr._("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: app.tr._("Pseudo Number Generator") - AnchorLayout: - MDFillRoundFlatIconButton: - icon: "chevron-double-right" - text: app.tr._("Proceed Next") - on_release: - app.root.ids.scr_mngr.current = 'random' - on_press: - app.root.ids.sc7.reset_address_label() - - #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: app.tr._("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: app.tr._("Proceed Next") - on_release: app.root.ids.sc7.generateaddress() - - 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: app.tr._(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: app.tr._(root.section_text) diff --git a/src/bitmessagekivy/kv/maildetail.kv b/src/bitmessagekivy/kv/maildetail.kv deleted file mode 100644 index e98b8661..00000000 --- a/src/bitmessagekivy/kv/maildetail.kv +++ /dev/null @@ -1,87 +0,0 @@ -: - 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: app.tr._(root.subject) - divider: None - font_style: 'H5' - theme_text_color: 'Primary' - _no_ripple_effect: True - long_press_time: 1 - TwoLineAvatarIconListItem: - id: subaft - text: app.tr._(root.from_addr) - secondary_text: app.tr._('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: app.tr._(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 .08 , None) - text: app.tr._(root.page_type) - icon: '' - text_color: (1,1,1,1) - 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: - - -: - canvas.before: - Color: - rgba: (0,0,0,1) diff --git a/src/bitmessagekivy/kv/msg_composer.kv b/src/bitmessagekivy/kv/msg_composer.kv deleted file mode 100644 index 82a2a8cb..00000000 --- a/src/bitmessagekivy/kv/msg_composer.kv +++ /dev/null @@ -1,178 +0,0 @@ -: - name: 'create' - Loader: - - -: - ScrollView: - id: id_scroll - BoxLayout: - orientation: 'vertical' - size_hint_y: None - height: self.minimum_height + 3 * self.parent.height/5 - padding: dp(20) - spacing: 15 - BoxLayout: - orientation: 'vertical' - MDTextField: - id: ti - size_hint_y: None - hint_text: 'Type or Select sender address' - icon_right: 'account' - icon_right_color: app.theme_cls.primary_light - font_size: '15sp' - multiline: False - required: True - # height: self.parent.height/2 - height: 100 - current_hint_text_color: 0,0,0,0.5 - 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: - - - RelativeLayout: - 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' - color: color_font - # height: self.parent.height/2 - current_hint_text_color: 0,0,0,0.5 - height: 100 - hint_text: app.tr._('Type or Scan QR code for recipients address') - canvas.before: - Color: - rgba: (0,0,0,1) - - RV: - id: rv - MDIconButton: - icon: 'qrcode-scan' - pos_hint: {'center_x': 0.95, 'y': 0.6} - on_release: - if root.is_camara_attached(): app.root.ids.scr_mngr.current = 'scanscreen' - else: root.camera_alert() - on_press: - app.root.ids.sc23.get_screen('composer') - - MyMDTextField: - id: subject - hint_text: 'Subject' - height: 100 - font_size: '15sp' - icon_right: 'notebook-outline' - icon_right_color: app.theme_cls.primary_light - current_hint_text_color: 0,0,0,0.5 - font_color_normal: 0, 0, 0, 1 - size_hint_y: None - required: True - multiline: False - helper_text_mode: "on_focus" - 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) - ScrollView: - id: scrlv - MDTextField: - id: body - hint_text: 'Body' - mode: "fill" - fill_color: 1/255, 144/255, 254/255, 0.1 - multiline: True - font_color_normal: 0, 0, 0, .4 - icon_right: 'grease-pencil' - icon_right_color: app.theme_cls.primary_light - size_hint: 1, 1 - height: app.window_size[1]/4 - canvas.before: - Color: - rgba: 125/255, 125/255, 125/255, 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/myaddress.kv b/src/bitmessagekivy/kv/myaddress.kv deleted file mode 100644 index 93496eeb..00000000 --- a/src/bitmessagekivy/kv/myaddress.kv +++ /dev/null @@ -1,33 +0,0 @@ -: - 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: app.tr._('My Addresses') - font_style: 'Subtitle2' - FloatLayout: - MDScrollViewRefreshLayout: - id: refresh_layout - refresh_callback: root.refresh_callback - root_layout: root - MDList: - id: ml - Loader: - - -: - 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) \ No newline at end of file diff --git a/src/bitmessagekivy/kv/network.kv b/src/bitmessagekivy/kv/network.kv deleted file mode 100644 index b77dea26..00000000 --- a/src/bitmessagekivy/kv/network.kv +++ /dev/null @@ -1,131 +0,0 @@ -: - name: 'networkstat' - MDTabs: - id: tab_panel - tab_display_mode:'text' - - Tab: - text: app.tr._("Total connections") - ScrollView: - do_scroll_x: False - MDList: - id: ml - size_hint_y: None - height: dp(200) - OneLineListItem: - text: app.tr._("Total Connections") - _no_ripple_effect: True - BoxLayout: - orientation: 'vertical' - size_hint_y: None - height: dp(58) - MDRaisedButton: - _no_ripple_effect: True - # size_hint: .6, 0 - # height: dp(40) - text: app.tr._(root.text_variable_1) - elevation_normal: 2 - opposite_colors: True - pos_hint: {'center_x': .5} - # MDLabel: - # font_style: 'H6' - # text: app.tr._(root.text_variable_1) - # font_size: '13sp' - # color: (1,1,1,1) - # halign: 'center' - Tab: - text: app.tr._('Processes') - ScrollView: - do_scroll_x: False - MDList: - id: ml - size_hint_y: None - height: dp(500) - OneLineListItem: - text: app.tr._("person-to-person") - _no_ripple_effect: True - - BoxLayout: - orientation: 'vertical' - size_hint_y: None - height: dp(58) - MDRaisedButton: - _no_ripple_effect: True - # size_hint: .6, 0 - # height: dp(40) - text: app.tr._(root.text_variable_2) - elevation_normal: 2 - opposite_colors: True - pos_hint: {'center_x': .5} - # MDLabel: - # font_style: 'H6' - # text: app.tr._(root.text_variable_2) - # font_size: '13sp' - # color: (1,1,1,1) - # halign: 'center' - OneLineListItem: - text: app.tr._("Brodcast") - _no_ripple_effect: True - - BoxLayout: - orientation: 'vertical' - size_hint_y: None - height: dp(58) - MDRaisedButton: - _no_ripple_effect: True - # size_hint: .6, 0 - # height: dp(40) - text: app.tr._(root.text_variable_3) - elevation_normal: 2 - opposite_colors: True - pos_hint: {'center_x': .5} - # MDLabel: - # font_style: 'H6' - # text: app.tr._(root.text_variable_3) - # font_size: '13sp' - # color: (1,1,1,1) - # halign: 'center' - OneLineListItem: - text: app.tr._("publickeys") - _no_ripple_effect: True - - BoxLayout: - orientation: 'vertical' - size_hint_y: None - height: dp(58) - MDRaisedButton: - _no_ripple_effect: True - # size_hint: .6, 0 - # height: dp(40) - text: app.tr._(root.text_variable_4) - elevation_normal: 2 - opposite_colors: True - pos_hint: {'center_x': .5} - # MDLabel: - # font_style: 'H6' - # text: app.tr._(root.text_variable_4) - # font_size: '13sp' - # color: (1,1,1,1) - # halign: 'center' - OneLineListItem: - text: app.tr._("objects") - _no_ripple_effect: True - - BoxLayout: - orientation: 'vertical' - size_hint_y: None - height: dp(58) - MDRaisedButton: - _no_ripple_effect: True - # size_hint: .6, 0 - #height: dp(40) - text: app.tr._(root.text_variable_5) - elevation_normal: 2 - opposite_colors: True - pos_hint: {'center_x': .5} - # MDLabel: - # font_style: 'H6' - # text: app.tr._(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 deleted file mode 100644 index 542e8e0e..00000000 --- a/src/bitmessagekivy/kv/payment.kv +++ /dev/null @@ -1,253 +0,0 @@ -#: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 deleted file mode 100644 index 217d9131..00000000 --- a/src/bitmessagekivy/kv/popup.kv +++ /dev/null @@ -1,333 +0,0 @@ -: - 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: label.height+address.height - BoxLayout: - orientation: 'vertical' - MDTextField: - id: label - multiline: False - hint_text: app.tr._("Label") - required: True - icon_right: 'label' - helper_text_mode: "on_error" - on_text: root.checkLabel_valid(self) - canvas.before: - Color: - rgba: (0,0,0,1) - MDTextField: - id: address - hint_text: app.tr._("Address") - required: True - icon_right: 'book-plus' - 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: app.tr._("Label") - font_size: '17sp' - halign: 'left' - MDTextField: - id: add_label - font_style: 'Body1' - font_size: '15sp' - halign: 'left' - text: app.tr._(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: app.tr._("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: app.tr._(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 - height: "130dp" - spacing:dp(25) - - #height: dp(1.5*(myaddr_label.height)) - orientation: 'vertical' - MDLabel: - id: myaddr_label - font_style: 'Subtitle2' - theme_text_color: 'Primary' - text: app.tr._("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: app.tr._("Address") - font_size: '17sp' - halign: 'left' - BoxLayout: - orientation: 'horizontal' - MDLabel: - id: label_address - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._(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: app.tr._('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: app.tr._('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: app.tr._('Cancel') - font_size: '13sp' - color: (1,1,1,1) - halign: 'center' - -: - id: closing_popup - size_hint : (None,None) - height: 1.4*(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: app.tr._("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: app.tr._('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: app.tr._('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: app.tr._('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: app.tr._("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: app.tr._("[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: app.tr._("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: app.tr._('Cancel') - font_size: '13sp' - color: (1,1,1,1) - halign: 'center' - -: - orientation: 'horizontal' - MDLabel: - font_style: 'Body2' - theme_text_color: 'Primary' - text: app.tr._(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/qrcode.kv b/src/bitmessagekivy/kv/qrcode.kv deleted file mode 100644 index cadaa996..00000000 --- a/src/bitmessagekivy/kv/qrcode.kv +++ /dev/null @@ -1,33 +0,0 @@ -: - name: 'showqrcode' - BoxLayout: - orientation: 'vertical' - size_hint: (None, None) - pos_hint:{'center_x': .5, 'top': 0.9} - size: (app.window_size[0]/1.8, app.window_size[0]/1.8) - id: qr - BoxLayout: - orientation: 'vertical' - MyMDTextField: - size_hint_y: None - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._(root.address) - 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] - halign: 'center' - font_size: dp(15) - bold: True - canvas.before: - Color: - rgba: (0,0,0,1) - # MDLabel: - # size_hint_y: None - # font_style: 'Body1' - # theme_text_color: 'Primary' - # text: "[b]BM-2cV7Y8imvAevK6z6YmhYRcj2t7rghBtDSZ[/b]" - # markup: True - # pos_hint: {'x': .28, 'y': 0.6} \ No newline at end of file diff --git a/src/bitmessagekivy/kv/scan_screen.kv b/src/bitmessagekivy/kv/scan_screen.kv deleted file mode 100644 index dbcff5a1..00000000 --- a/src/bitmessagekivy/kv/scan_screen.kv +++ /dev/null @@ -1,2 +0,0 @@ -: - name:'scanscreen' \ No newline at end of file diff --git a/src/bitmessagekivy/kv/scanner.kv b/src/bitmessagekivy/kv/scanner.kv deleted file mode 100644 index 1c56f6c2..00000000 --- a/src/bitmessagekivy/kv/scanner.kv +++ /dev/null @@ -1,37 +0,0 @@ -#:import ZBarSymbol pyzbar.pyzbar.ZBarSymbol - -BoxLayout: - orientation: 'vertical' - ZBarCam: - id: zbarcam - # optional, by default checks all types - code_types: ZBarSymbol.QRCODE, ZBarSymbol.EAN13 - scan_callback: app._after_scan - scanner_line_y_initial: self.size[1]/2 +self.qrwidth/2 - scanner_line_y_final: self.size[1]/2-self.qrwidth/2 - - canvas: - Color: - rgba: 0,0,0,.25 - - #left rect - Rectangle: - pos: self.pos[0], self.pos[1] - size: self.size[0]/2-self.qrwidth/2, self.size[1] - - #right rect - Rectangle: - pos: self.size[0]/2+self.qrwidth/2, 0 - size: self.size[0]/2-self.qrwidth/2, self.size[1] - - #top rect - Rectangle: - pos: self.size[0]/2-self.qrwidth/2, self.size[1]/2+self.qrwidth/2 - size: self.qrwidth, self.size[1]/2-self.qrwidth/2 - - #bottom rect - Rectangle: - pos: self.size[0]/2-self.qrwidth/2, 0 - size: self.qrwidth, self.size[1]/2-self.qrwidth/2 - - \ No newline at end of file diff --git a/src/bitmessagekivy/kv/sent.kv b/src/bitmessagekivy/kv/sent.kv deleted file mode 100644 index 11477ed6..00000000 --- a/src/bitmessagekivy/kv/sent.kv +++ /dev/null @@ -1,26 +0,0 @@ -: - 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 deleted file mode 100644 index 609c8e80..00000000 --- a/src/bitmessagekivy/kv/settings.kv +++ /dev/null @@ -1,964 +0,0 @@ -: - name: 'set' - MDTabs: - id: tab_panel - tab_display_mode:'text' - - Tab: - text: app.tr._("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: app.tr._("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: app.tr._("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: app.tr._("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: app.tr._("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: app.tr._("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: app.tr._("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: app.tr._("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: app.tr._("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: app.tr._('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: app.tr._("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: app.tr._("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: app.tr._("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: app.tr._("Interface Language") - # halign: 'right' - bold: True - MDDropDownItem: - id: dropdown_item - text: "System Setting" - # pos_hint: {"center_x": .5, "center_y": .6} - # current_item: "Item 0" - # on_release: root.menu.open() - BoxLayout: - spacing:5 - orientation: 'horizontal' - # pos_hint: {'x':.76} - BoxLayout: - orientation: 'horizontal' - spacing: 10 - MDRaisedButton: - text: app.tr._('Apply') - # on_press: root.change_language() - 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: app.tr._("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: app.tr._("Listen for connections on port:") - halign: 'left' - BoxLayout: - orientation: 'horizontal' - MDTextFieldRect: - size_hint: None, None - size: dp(100), dp(30) - text: app.tr._('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: app.tr._("UPnP") - halign: 'left' - pos_hint: {'x': 0, 'y': 0} - BoxLayout: - orientation: 'vertical' - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._("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: app.tr._("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: app.tr._("Server hostname:") - halign: 'left' - MDTextFieldRect: - size_hint: None, None - size: dp(app.window_size[0]/4), dp(30) - hint_text: app.tr._('localhost') - pos_hint: {'center_y': .5, 'center_x': .5} - BoxLayout: - orientation: 'horizontal' - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._("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: app.tr._('9050') - pos_hint: {'center_y': .5, 'center_x': .5} - input_filter: "int" - BoxLayout: - orientation: 'horizontal' - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._("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: app.tr._("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: app.tr._("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: app.tr._("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: app.tr._("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: app.tr._("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: app.tr._("Maximum download rate (kB/s):[0:unlimited]") - halign: 'left' - MDTextFieldRect: - size_hint: None, None - size: app.window_size[0]/2, dp(30) - hint_text: app.tr._('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: app.tr._("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: app.tr._("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: app.tr._('Apply') - Tab: - text: 'Demanded Difficulty' - ScrollView: - do_scroll_x: False - - BoxLayout: - size_hint_y: None - orientation: 'vertical' - height: dp(300) + self.minimum_height - padding: 10 - BoxLayout: - id: box_height - orientation: 'vertical' - # MDLabel: - # font_style: 'Body1' - # theme_text_color: 'Primary' - # text: app.tr._("Listening port") - # halign: 'left' - # bold: True - - # 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: app.tr._(root.exp_text) - text: "\n\n\nWhen someone sends you a message, their computer must first complete some work. The difficulty of this work, by default, is 1. You may raise this default for new addresses you create by changing the values here. Any new addresses you create will require senders to meet the higher difficulty. There is one exception: if you add a friend or acquaintance to your address book, Bitmessage will automatically notify them when you next send a message that they need only complete the minimum amount of work: difficulty 1.\n\n" - halign: 'left' - - BoxLayout: - orientation: 'horizontal' - padding: 5 - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._("Total difficulty:") - halign: 'left' - MDTextFieldRect: - size_hint: None, None - size: dp(app.window_size[0]/4), dp(30) - hint_text: app.tr._('00000.0') - pos_hint: {'center_y': .5, 'center_x': .5} - input_filter: "int" - - BoxLayout: - # size_hint_y: None - id: box1_height - orientation: 'vertical' - padding: 5 - # height: dp(100) + self.minimum_height - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - # text: app.tr._(root.exp_text) - text: "The 'Total difficulty' affects the absolute amount of work the sender must complete. Doubling this value doubles the amount of work." - halign: 'left' - - BoxLayout: - orientation: 'horizontal' - spacing: 0 - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._("Small message difficulty:") - halign: 'left' - MDTextFieldRect: - size_hint: None, None - size: dp(app.window_size[0]/4), dp(30) - hint_text: app.tr._('00000.0') - pos_hint: {'center_y': .5, 'center_x': .5} - input_filter: "int" - - - BoxLayout: - size_hint_y: None - padding: 0 - id: box1_height - orientation: 'vertical' - # height: dp(100) + self.minimum_height - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - # text: app.tr._(root.exp_text) - text: "The 'Small message difficulty' mostly only affects the difficulty of sending small messages. Doubling this value makes it almost twice as difficult to send a small message but doesn't really affect large messages." - 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: app.tr._("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: app.tr._("Give up after") - # halign: 'left' - # MDTextFieldRect: - # size_hint: None, None - # size: dp(70), dp(30) - # text: app.tr._('0') - # # pos_hint: {'center_y': .5, 'center_x': .5} - # input_filter: "int" - # MDLabel: - # font_style: 'Body1' - # theme_text_color: 'Primary' - # text: app.tr._("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:10 - orientation: 'horizontal' - # pos_hint: {'left': 0} - # pos_hint: {'x':.75} - height: dp(10) + self.minimum_height - MDRaisedButton: - text: app.tr._('Cancel') - MDRaisedButton: - text: app.tr._('Apply') - - Tab: - text: 'Max acceptable Difficulty' - 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' - spacing: 10 - - # pos_hint: {'x': 0, 'y': 0.2} - # height: dp(100) + self.minimum_height - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - # text: app.tr._(root.exp_text) - text: "\n\n\nHere you may set the maximum amount of work you are willing to do to send a message to another person. Setting these values to 0 means that any value is acceptable." - halign: 'left' - # BoxLayout: - # id: box2_height - # size_hint_y: None - # orientation: 'vertical' - # height: dp(40) + self.minimum_height - # BoxLayout: - # size_hint_y: None - # orientation: 'vertical' - # padding: [10, 0, 0, 0] - # height: dp(50) + self.minimum_height - - GridLayout: - cols: 2 - padding: [10, 0, 0, 0] - - BoxLayout: - size_hint_y: None - orientation: 'vertical' - padding: [10, 0, 0, 0] - spacing: 10 - height: dp(50) + self.minimum_height - BoxLayout: - orientation: 'horizontal' - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._("Maximum acceptable total difficulty:") - halign: 'left' - MDTextFieldRect: - size_hint: None, None - size: dp(app.window_size[0]/4), dp(30) - hint_text: app.tr._('00000.0') - pos_hint: {'center_y': .5, 'center_x': .5} - input_filter: "int" - - BoxLayout: - orientation: 'horizontal' - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._("Hardware GPU acceleration (OpenCL):") - halign: 'left' - MDDropDownItem: - id: dropdown_item - text: "None" - pos_hint: {"center_x": 0, "center_y": 0} - # current_item: "Item 0" - # on_release: root.menu.open() - - # BoxLayout: - # size_hint_y: None - # spacing:5 - # orientation: 'horizontal' - # pos_hint: {'center_y': .4, 'center_x': 1.15} - # halign: 'right' - - BoxLayout: - size_hint_y: None - spacing:5 - orientation: 'horizontal' - pos_hint: {'center_y': 1, 'center_x': 1.15} - halign: 'right' - # pos_hint: {'left': 0} - # pos_hint: {'x':.75} - height: dp(50) + self.minimum_height - MDRaisedButton: - text: app.tr._('Cancel') - MDRaisedButton: - text: app.tr._('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: app.tr._(root.exp_text) - text: "By default, if you send a message to someone and he is offline for more than two days, Bitmessage will send the message again after an additional two days. This will be continued with exponential backoff forever; messages will be resent after 5, 10, 20 days ect. until the receiver acknowledges them. Here you may change that behavior by having Bitmessage give up after a certain number of days or months." - 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: app.tr._("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: app.tr._("Give up after") - halign: 'left' - MDTextFieldRect: - size_hint: None, None - size: dp(70), dp(30) - text: app.tr._('0') - pos_hint: {'center_y': .5, 'center_x': .5} - input_filter: "int" - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._("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: app.tr._('Cancel') - MDRaisedButton: - text: app.tr._('Apply') - - Tab: - text: 'Namecoin Integration' - 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' - spacing: 10 - - # pos_hint: {'x': 0, 'y': 0.2} - # height: dp(100) + self.minimum_height - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - # text: app.tr._(root.exp_text) - text: "\n\n\n\n\n\nBitmessage can utilize a different Bitcoin-based program called Namecoin to make addresses human-friendly. For example, instead of having to tell your friend your long Bitmessage address, you can simply tell him to send a message to test.\n\n(Getting your own Bitmessage address into Namecoin is still rather difficult).\n\nBitmessage can use either namecoind directly or a running nmcontrol instance\n\n" - halign: 'left' - - BoxLayout: - id: box2_height - size_hint_y: None - orientation: 'vertical' - height: dp(40) + self.minimum_height - BoxLayout: - size_hint_y: None - orientation: 'vertical' - padding: [10, 0, 0, 0] - height: dp(50) + self.minimum_height - - BoxLayout: - orientation: 'horizontal' - padding: [10, 0, 0, 0] - - 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: app.tr._("UPnP") - # halign: 'left' - # pos_hint: {'x': 0, 'y': 0} - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._("Connect to:") - halign: 'left' - - # MDCheckbox: - # id: chkbox - # size_hint: None, None - # size: dp(48), dp(50) - # # active: True - # halign: 'center' - Check: - active: True - pos_hint: {'x': 0, 'y': -0.2} - - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._("Namecoind") - halign: 'left' - pos_hint: {'x': 0, 'y': 0} - - Check: - active: False - pos_hint: {'x': 0, 'y': -0.2} - - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._("NMControl") - halign: 'left' - pos_hint: {'x': 0, 'y': 0} - - GridLayout: - cols: 2 - padding: [10, 0, 0, 0] - - 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: app.tr._("hostname:") - halign: 'left' - MDTextFieldRect: - size_hint: None, None - size: dp(app.window_size[0]/4), dp(30) - hint_text: app.tr._('localhost') - pos_hint: {'center_y': .5, 'center_x': .5} - BoxLayout: - orientation: 'horizontal' - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._("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: app.tr._('9050') - pos_hint: {'center_y': .5, 'center_x': .5} - input_filter: "int" - BoxLayout: - orientation: 'horizontal' - MDLabel: - font_style: 'Body1' - theme_text_color: 'Primary' - text: app.tr._("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: app.tr._("Password:") - halign: 'left' - - MDTextFieldRect: - size_hint: None, None - size: dp(app.window_size[0]/4), dp(30) - pos_hint: {'center_y': .5, 'center_x': .5} - password: True - - - BoxLayout: - size_hint_y: None - spacing:5 - orientation: 'horizontal' - pos_hint: {'center_y': .4, 'center_x': 1.15} - halign: 'right' - # pos_hint: {'left': 0} - # pos_hint: {'x':.75} - height: dp(50) + self.minimum_height - MDRaisedButton: - text: app.tr._('Cancel') - MDRaisedButton: - text: app.tr._('Apply') - MDRaisedButton: - text: app.tr._('OK') - Loader: \ No newline at end of file diff --git a/src/bitmessagekivy/kv/trash.kv b/src/bitmessagekivy/kv/trash.kv deleted file mode 100644 index 97bcf7d7..00000000 --- a/src/bitmessagekivy/kv/trash.kv +++ /dev/null @@ -1,25 +0,0 @@ -: - 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: diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index e60813b3..84313ab9 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -3,7 +3,7 @@ The PyBitmessage startup script """ # Copyright (c) 2012-2016 Jonathan Warren -# Copyright (c) 2012-2022 The Bitmessage developers +# Copyright (c) 2012-2020 The Bitmessage developers # Distributed under the MIT/X11 software license. See the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/bitmessageqt/about.ui b/src/bitmessageqt/about.ui index 49bd4eca..7073bbd1 100644 --- a/src/bitmessageqt/about.ui +++ b/src/bitmessageqt/about.ui @@ -46,7 +46,7 @@ - <html><head/><body><p>Copyright © 2012-2016 Jonathan Warren<br/>Copyright © 2012-2022 The Bitmessage Developers</p></body></html> + <html><head/><body><p>Copyright © 2012-2016 Jonathan Warren<br/>Copyright © 2012-2020 The Bitmessage Developers</p></body></html> Qt::AlignLeft diff --git a/src/bitmessageqt/dialogs.py b/src/bitmessageqt/dialogs.py index dc31e266..e76dd84e 100644 --- a/src/bitmessageqt/dialogs.py +++ b/src/bitmessageqt/dialogs.py @@ -45,7 +45,7 @@ class AboutDialog(QtGui.QDialog): try: self.label_2.setText( self.label_2.text().replace( - '2022', str(last_commit.get('time').year) + '2020', str(last_commit.get('time').year) )) except AttributeError: pass diff --git a/src/bmconfigparser.py b/src/bmconfigparser.py index 8bc425c8..4798dda4 100644 --- a/src/bmconfigparser.py +++ b/src/bmconfigparser.py @@ -69,7 +69,6 @@ class BMConfigParser(SafeConfigParser): raise ValueError("Invalid value %s" % value) return SafeConfigParser.set(self, section, option, value) - # pylint: disable=redefined-builtin, too-many-return-statements def get(self, section, option, raw=False, vars=None): if sys.version_info[0] == 3: # pylint: disable=arguments-differ @@ -188,7 +187,7 @@ class BMConfigParser(SafeConfigParser): try: if not self.validate( section, option, - self[section][option] # pylint: disable=unsubscriptable-object + self[section][option] ): try: newVal = BMConfigDefaults[section][option] diff --git a/src/network/addrthread.py b/src/network/addrthread.py index 8b46750f..fea0910e 100644 --- a/src/network/addrthread.py +++ b/src/network/addrthread.py @@ -3,12 +3,13 @@ Announce addresses as they are received from other hosts """ from six.moves import queue - +# magic imports! import state from helper_random import randomshuffle -from network.assemble import assemble_addr +from protocol import assembleAddrMessage +from queues import addrQueue # FIXME: init with queue from network.connectionpool import BMConnectionPool -from queues import addrQueue + from threads import StoppableThread @@ -41,7 +42,7 @@ class AddrThread(StoppableThread): continue filtered.append((stream, peer, seen)) if filtered: - i.append_write_buf(assemble_addr(filtered)) + i.append_write_buf(assembleAddrMessage(filtered)) addrQueue.iterate() for i in range(len(chunk)): diff --git a/src/network/announcethread.py b/src/network/announcethread.py index e34ed963..bbb56dd3 100644 --- a/src/network/announcethread.py +++ b/src/network/announcethread.py @@ -3,10 +3,12 @@ Announce myself (node address) """ import time +# magic imports! import state from bmconfigparser import BMConfigParser -from network.assemble import assemble_addr +from protocol import assembleAddrMessage from network.connectionpool import BMConnectionPool + from node import Peer from threads import StoppableThread @@ -40,4 +42,4 @@ class AnnounceThread(StoppableThread): BMConfigParser().safeGetInt( 'bitmessagesettings', 'port')), time.time()) - connection.append_write_buf(assemble_addr([addr])) + connection.append_write_buf(assembleAddrMessage([addr])) diff --git a/src/network/bmproto.py b/src/network/bmproto.py index 008eadb0..5b073869 100644 --- a/src/network/bmproto.py +++ b/src/network/bmproto.py @@ -25,7 +25,7 @@ from network.bmobject import ( BMObjectInvalidError, BMObjectUnwantedStreamError ) from network.constants import ( - ADDRESS_ALIVE, MAX_MESSAGE_SIZE, MAX_OBJECT_COUNT, + ADDRESS_ALIVE, MAX_MESSAGE_SIZE, MAX_OBJECT_PAYLOAD_SIZE, MAX_TIME_OFFSET ) from network.dandelion import Dandelion @@ -350,7 +350,7 @@ class BMProto(AdvancedDispatcher, ObjectTracker): """ items = self.decode_payload_content("l32s") - if len(items) > MAX_OBJECT_COUNT: + if len(items) > protocol.MAX_OBJECT_COUNT: logger.error( 'Too many items in %sinv message!', 'd' if dandelion else '') raise BMProtoExcessiveDataError() diff --git a/src/network/constants.py b/src/network/constants.py index f8f4120f..a4a2fcc5 100644 --- a/src/network/constants.py +++ b/src/network/constants.py @@ -5,8 +5,6 @@ Network protocol constants #: address is online if online less than this many seconds ago ADDRESS_ALIVE = 10800 -#: protocol specification says max 1000 addresses in one addr command -MAX_ADDR_COUNT = 1000 #: ~1.6 MB which is the maximum possible size of an inv message. MAX_MESSAGE_SIZE = 1600100 #: 2**18 = 256kB is the maximum size of an object payload diff --git a/src/network/tcp.py b/src/network/tcp.py index ff778378..33f8edbb 100644 --- a/src/network/tcp.py +++ b/src/network/tcp.py @@ -20,9 +20,7 @@ from bmconfigparser import BMConfigParser from helper_random import randomBytes from inventory import Inventory from network.advanceddispatcher import AdvancedDispatcher -from network.assemble import assemble_addr from network.bmproto import BMProto -from network.constants import MAX_OBJECT_COUNT from network.dandelion import Dandelion from network.objectracker import ObjectTracker from network.socks4a import Socks4aConnection @@ -205,7 +203,7 @@ class TCPConnection(BMProto, TLSDispatcher): for peer, params in addrs[substream]: templist.append((substream, peer, params["lastseen"])) if templist: - self.append_write_buf(assemble_addr(templist)) + self.append_write_buf(protocol.assembleAddrMessage(templist)) def sendBigInv(self): """ @@ -244,7 +242,7 @@ class TCPConnection(BMProto, TLSDispatcher): # Remove -1 below when sufficient time has passed for users to # upgrade to versions of PyBitmessage that accept inv with 50,000 # items - if objectCount >= MAX_OBJECT_COUNT - 1: + if objectCount >= protocol.MAX_OBJECT_COUNT - 1: sendChunk() payload = b'' objectCount = 0 diff --git a/src/protocol.py b/src/protocol.py index 1934d9cc..fc65a580 100644 --- a/src/protocol.py +++ b/src/protocol.py @@ -22,6 +22,7 @@ from bmconfigparser import BMConfigParser from debug import logger from fallback import RIPEMD160Hash from helper_sql import sqlExecute +from network.node import Peer from version import softwareVersion # Service flags @@ -55,6 +56,9 @@ OBJECT_ONIONPEER = 0x746f72 OBJECT_I2P = 0x493250 OBJECT_ADDR = 0x61646472 +#: protocol specification says max 1000 addresses in one addr command +MAX_ADDR_COUNT = 1000 + eightBytesOfRandomDataUsedToDetectConnectionsToSelf = pack( '>Q', random.randrange(1, 18446744073709551615)) @@ -295,6 +299,28 @@ def CreatePacket(command, payload=b''): return bytes(b) +def assembleAddrMessage(peerList): + """Create address command""" + if isinstance(peerList, Peer): + peerList = [peerList] + if not peerList: + return b'' + retval = b'' + for i in range(0, len(peerList), MAX_ADDR_COUNT): + payload = encodeVarint(len(peerList[i:i + MAX_ADDR_COUNT])) + for stream, peer, timestamp in peerList[i:i + MAX_ADDR_COUNT]: + # 64-bit time + payload += pack('>Q', timestamp) + payload += pack('>I', stream) + # service bit flags offered by this node + payload += pack('>q', 1) + payload += encodeHost(peer.host) + # remote port + payload += pack('>H', peer.port) + retval += CreatePacket('addr', payload) + return retval + + def assembleVersionMessage( remoteHost, remotePort, participatingStreams, server=False, nodeid=None ): diff --git a/src/queues.py b/src/queues.py index d86d36fa..4a9b98d2 100644 --- a/src/queues.py +++ b/src/queues.py @@ -8,13 +8,7 @@ from six.moves import queue try: from multiqueue import MultiQueue except ImportError: - try: - from .multiqueue import MultiQueue - except ImportError: - import sys - if 'bitmessagemock' not in sys.modules: - raise - MultiQueue = queue.Queue + from .multiqueue import MultiQueue class ObjectProcessorQueue(queue.Queue): diff --git a/src/state.py b/src/state.py index ee39e094..be81992d 100644 --- a/src/state.py +++ b/src/state.py @@ -51,10 +51,6 @@ discoveredPeers = {} dandelion = 0 -kivy = False - -kivyapp = None - testmode = False clientHasReceivedIncomingConnections = False