1
0

reorganize files and bring code inline with current master

Conflicts:
	lib/simple_config.py
This commit is contained in:
akshayaurora
2014-06-05 06:12:29 +05:30
committed by ThomasV
parent 9938316400
commit c121c1aa4e
67 changed files with 5360 additions and 2408 deletions

View File

@@ -1,286 +0,0 @@
#:import TabbedCarousel electrum_gui.kivy.tabbed_carousel.TabbedCarousel
#:import ScreenDashboard electrum_gui.kivy.screens.ScreenDashboard
#:import Factory kivy.factory.Factory
#:import Carousel electrum_gui.kivy.carousel.Carousel
Screen:
canvas.before:
Color:
rgba: 0.917, 0.917, 0.917, 1
Rectangle:
size: self.size
pos: self.pos
BoxLayout:
orientation: 'vertical'
ActionBar:
id: action_bar
size_hint: 1, None
height: '40dp'
border: 4, 4, 4, 4
background_image: 'atlas://gui/kivy/theming/light/action_bar'
ScreenManager:
id: manager
ScreenTabs:
id: tabs
name: "tabs"
#ScreenPassword:
# id: password
# name: 'password'
<TabbedCarousel>
carousel: carousel
do_default_tab: False
Carousel:
scroll_timeout: 190
anim_type: 'out_quart'
min_move: .05
anim_move_duration: .1
anim_cancel_duration: .54
scroll_distance: '10dp'
on_index: root.on_index(*args)
id: carousel
################################
## Cards (under Dashboard)
################################
<Card@GridLayout>
cols: 1
padding: '12dp' , '22dp', '12dp' , '12dp'
spacing: '12dp'
size_hint: 1, None
height: max(100, self.minimum_height)
canvas.before:
Color:
rgba: 1, 1, 1, 1
BorderImage:
border: 9, 9, 9, 9
source: 'atlas://gui/kivy/theming/light/card'
size: self.size
pos: self.pos
<CardLabel@Label>
color: 0.45, 0.45, 0.45, 1
size_hint: 1, None
text: ''
text_size: self.width, None
height: self.texture_size[1]
halign: 'left'
valign: 'top'
<CardButton@Button>
background_normal: 'atlas://gui/kivy/theming/light/card_btn'
bold: True
font_size: '10sp'
color: 0.699, 0.699, 0.699, 1
size_hint: None, None
size: self.texture_size[0] + dp(32), self.texture_size[1] + dp(7)
<CardSeparator@Widget>
size_hint: 1, None
height: dp(1)
color: .909, .909, .909, 1
canvas:
Color:
rgba: root.color if root.color else (0, 0, 0, 0)
Rectangle:
size: self.size
pos: self.pos
<CardRecentActivity@Card>
BoxLayout:
size_hint: 1, None
height: lbl.height
CardLabel:
id: lbl
text: _('RECENT ACTIVITY')
CardButton:
id: btn_see_all
text: _('SEE ALL')
font_size: '12sp'
on_release: app.gui.main_gui.update_history(see_all=True)
GridLayout:
id: content
spacing: '7dp'
cols: 1
size_hint: 1, None
height: self.minimum_height
CardSeparator
<CardPaymentRequest@Card>
CardLabel:
text: _('PAYMENT REQUEST')
CardSeparator:
<CardStatusInfo@Card>
status: app.status
base_unit: 'BTC'
quote_text: '.'
unconfirmed: '.'
BoxLayout:
size_hint: 1, None
height: '72dp'
IconButton:
mipmap: True
color: .90, .90, .90, 1
source: 'atlas://gui/kivy/theming/light/qrcode'
size_hint: None, 1
width: self.height
on_release:
Factory.WalletAddressesDialog().open()
GridLayout:
id: grid
cols: 1
orientation: 'vertical'
CardLabel:
halign: 'right'
valign: 'top'
bold: True
size_hint: 1, None
font_size: '38sp'
text:
'[color=#4E4F4F]{}[/color]'\
'[sup][color=9b948d]{}[/color][/sup]'\
.format(unicode(root.status), root.base_unit)
CardLabel
halign: 'right'
markup: True
font_size: '15dp'
text: '[color=#c3c3c3]{}[/color]'.format(root.quote_text)
CardLabel
halign: 'right'
markup: True
text: '[color=#c3c3c3]{}[/color]'.format(root.unconfirmed)
<DashboardActionView@ActionView>
ActionPrevious:
id: action_previous
app_icon: 'atlas://gui/kivy/theming/light/wallets'
with_previous: False
size_hint: None, 1
mipmap: True
width: '77dp'
ActionButton:
id: action_logo
important: True
size_hint: 1, 1
markup: True
mipmap: True
bold: True
font_size: '22dp'
icon: 'atlas://gui/kivy/theming/light/logo'
minimum_width: '1dp'
ActionButton:
id: action_contact
important: True
width: '25dp'
icon: 'atlas://gui/kivy/theming/light/add_contact'
text: 'Add Contact'
on_release: NewContactDialog().open()
ActionOverflow:
id: action_preferences
canvas.after:
Color:
rgba: 1, 1, 1, 1
border: 0, 0, 0, 0
overflow_image: 'atlas://gui/kivy/theming/light/settings'
width: '32dp'
ActionButton:
text: _('Seed')
on_release:
action_preferences._dropdown.dismiss()
if app.wallet.seed: app.gui.main_gui.protected_seed_dialog(self)
ActionButton:
text: _('Password')
ActionButton:
text: _('Network')
on_release:
app.root.current = 'screen_network'
action_preferences._dropdown.dismiss()
ActionButton:
text: _('Preferences')
on_release:
action_preferences._dropdown.dismiss()
app.gui.main_gui.show_settings_dialog(self)
<ScreenDashboard>
action_view: Factory.DashboardActionView()
ScrollView:
do_scroll_x: False
RelativeLayout:
size_hint: 1, None
height: grid.height
GridLayout
id: grid
cols: 1 #if root.width < root.height else 2
size_hint: 1, None
height: self.minimum_height
padding: '12dp'
spacing: '12dp'
GridLayout:
cols: 1
size_hint: 1, None
height: self.minimum_height
spacing: '12dp'
orientation: 'vertical'
CardStatusInfo:
id: status_card
CardPaymentRequest:
id: payment_card
CardRecentActivity:
id: recent_activity_card
<CleanHeader@TabbedPanelHeader>
border: 0, 0, 4, 0
markup: False
color: (0.191, 0.558, 0.742, 1) if self.state == 'down' else (0.636, 0.636, 0.636, 1)
text_size: self.size
halign: 'center'
valign: 'middle'
bold: True
font_size: '12sp'
background_normal: 'atlas://gui/kivy/theming/light/tab_btn'
background_disabled_normal: 'atlas://gui/kivy/theming/light/tab_btn_disabled'
background_down: 'atlas://gui/kivy/theming/light/tab_btn_pressed'
canvas.before:
Color:
rgba: 1, 1, 1, .7
Rectangle:
size: self.size
pos: self.x + 1, self.y - 1
texture: self.texture
<ScreenTabs@Screen>
TabbedCarousel:
id: panel
background_image: 'atlas://gui/kivy/theming/light/tab'
strip_image: 'atlas://gui/kivy/theming/light/tab_strip'
strip_border: 4, 0, 2, 0
ScreenDashboard:
id: screen_dashboard
tab: tab_dashboard
#ScreenSend:
# id: screen_send
# tab: tab_send
#ScreenReceive:
# id: screen_receive
# tab: tab_receive
#ScreenContacts:
# id: screen_contacts
# tab: tab_contacts
CleanHeader:
id: tab_dashboard
text: _('DASHBOARD')
slide: 0
#CleanHeader:
# id: tab_send
# text: _('SEND')
# slide: 1
#CleanHeader:
# id: tab_receive
# text: _('RECEIVE')
# slide: 2
#CleanHeader:
# id: tab_contacts
# text: _('CONTACTS')
# slide: 3

View File

@@ -0,0 +1,129 @@
<ScreenReceiveContent@BoxLayout>
opacity: 0
padding: '12dp', '12dp', '12dp', '12dp'
spacing: '12dp'
mode: 'qr'
orientation: 'vertical'
SendReceiveToggle
SendToggle:
id: toggle_qr
text: 'QR'
state: 'down' if root.mode == 'qr' else 'normal'
source: 'atlas://gui/kivy/theming/light/qrcode'
background_down: 'atlas://gui/kivy/theming/light/btn_send_address'
on_release:
if root.mode == 'qr': root.mode = 'nr'
root.mode = 'qr'
SendToggle:
id: toggle_nfc
text: 'NFC'
state: 'down' if root.mode == 'nfc' else 'normal'
source: 'atlas://gui/kivy/theming/light/nfc'
background_down: 'atlas://gui/kivy/theming/light/btn_send_nfc'
on_release:
if root.mode == 'nfc': root.mode = 'nr'
root.mode = 'nfc'
GridLayout:
id: grid
cols: 1
#size_hint: 1, None
#height: self.minimum_height
SendReceiveCardTop
height: '110dp'
BoxLayout:
size_hint: 1, None
height: '42dp'
rows: 1
Label:
color: amount_e.foreground_color
bold: True
text_size: self.size
valign: 'bottom'
font_size: '22sp'
text: app.base_unit
size_hint_x: .25
ELTextInput:
id: amount_e
input_type: 'number'
multiline: False
bold: True
font_size: '50sp'
foreground_color: .308, .308, .308, 1
background_normal: 'atlas://gui/kivy/theming/light/tab_btn'
pos_hint: {'top': 1.5}
size_hint: .7, None
height: '67dp'
hint_text: 'Amount'
text: '0.0'
on_text_validate: payto_e.focus = True
CardSeparator
BoxLayout:
size_hint: 1, None
height: '32dp'
spacing: '5dp'
Label:
id: lbl_quote
font_size: '12dp'
size_hint: .5, 1
color: .761, .761, .761, 1
#text: app.create_quote_text(Decimal(amount_e.text))
text_size: self.size
halign: 'left'
valign: 'middle'
Label:
color: lbl_quote.color
font_size: '12dp'
text: 'Ask to scan the QR below'
text_size: self.size
halign: 'right'
valign: 'middle'
SendReceiveBlueBottom
id: blue_bottom
padding: '12dp', 0, '12dp', '12dp'
WalletSelector:
id: wallet_selection
foreground_color: blue_bottom.foreground_color
opacity: 1 if app.expert_mode else 0
size_hint: 1, None
height: blue_bottom.item_height if app.expert_mode else 0
CardSeparator
opacity: wallet_selection.opacity
color: blue_bottom.foreground_color
AddressSelector:
id: address_selection
foreground_color: blue_bottom.foreground_color
opacity: 1 if app.expert_mode else 0
size_hint: 1, None
height: blue_bottom.item_height if app.expert_mode else 0
on_text:
if not args[1].startswith('Select'):\
qr.data = app.encode_uri(self.text)
CardSeparator
opacity: address_selection.opacity
color: blue_bottom.foreground_color
Widget:
size_hint_y: None
height: dp(10)
BoxLayout
#size_hint: 1, None
#height: '160dp' if app.expert_mode else '220dp'
Widget
QRCodeWidget:
id: qr
size_hint: None, 1
width: self.height
data: app.encode_uri(app.wallet.addresses()[0]) if app.wallet.addresses() else ''
on_touch_down:
if self.collide_point(*args[1].pos):\
app.show_info_bubble(icon=self.ids.qrimage.texture, text='texture')
Widget
CreateAccountButtonGreen:
background_color: (1, 1, 1, 1) if self.disabled else ((.258, .80, .388, 1) if self.state == 'normal' else (.203, .490, .741, 1))
text: _('Goto next step') if app.wallet.seed else _('Create unsigned transaction')
size_hint_y: None
height: '38dp'
disabled: True if wallet_selection.opacity == 0 else False
on_release:
message = 'sending {} {} to {}'.format(\
app.base_unit, amount_e.text, payto_e.text)
app.gui.main_gui.do_send(self, message=message)

View File

@@ -0,0 +1,187 @@
<TextInputSendBlue@TextInput>
padding: '5dp'
size_hint: 1, None
height: '27dp'
pos_hint: {'center_y':.5}
multiline: False
hint_text_color: self.foreground_color
foreground_color: .843, .914, .972, 1
background_color: 1, 1, 1, 1
background_normal: 'atlas://gui/kivy/theming/light/tab_btn'
background_active: 'atlas://gui/kivy/theming/light/textinput_active'
<ScreenSendContent@BoxLayout>
opacity: 0
padding: '12dp', '12dp', '12dp', '12dp'
spacing: '12dp'
orientation: 'vertical'
mode: 'address'
SendReceiveToggle:
SendToggle:
id: toggle_address
text: 'ADDRESS'
group: 'send_type'
state: 'down' if root.mode == 'address' else 'normal'
source: 'atlas://gui/kivy/theming/light/globe'
background_down: 'atlas://gui/kivy/theming/light/btn_send_address'
on_release:
if root.mode == 'address': root.mode = 'fc'
root.mode = 'address'
SendToggle:
id: toggle_nfc
text: 'NFC'
group: 'send_type'
state: 'down' if root.mode == 'nfc' else 'normal'
source: 'atlas://gui/kivy/theming/light/nfc'
background_down: 'atlas://gui/kivy/theming/light/btn_send_nfc'
on_release:
if root.mode == 'nfc': root.mode = 'str'
root.mode = 'nfc'
GridLayout:
id: grid
cols: 1
size_hint: 1, None
height: self.minimum_height
SendReceiveCardTop
id: card_address
BoxLayout
size_hint: 1, None
height: '42dp'
rows: 1
Label
bold: True
color: amount_e.foreground_color
text_size: self.size
valign: 'bottom'
font_size: '22sp'
text: app.base_unit
size_hint_x: .25
ELTextInput:
id: amount_e
input_type: 'number'
multiline: False
bold: True
font_size: '50sp'
foreground_color: .308, .308, .308, 1
background_normal: 'atlas://gui/kivy/theming/light/tab_btn'
pos_hint: {'top': 1.5}
size_hint: .7, None
height: '67dp'
hint_text: 'Amount'
text: '0.0'
on_text_validate: payto_e.focus = True
CardSeparator
BoxLayout:
size_hint: 1, None
height: '42dp'
spacing: '5dp'
Label:
font_size: '12dp'
color: lbl_fee.color
text: app.gui.main_gui.create_quote_text(Decimal(amount_e.text)) if hasattr(app, 'gui') else '0'
text_size: self.size
halign: 'left'
valign: 'middle'
Label:
id: lbl_fee
color: .761, .761, .761, 1
font_size: '12dp'
text: '[b]{}[/b] of fee'.format(fee_e.value)
text_size: self.size
halign: 'right'
valign: 'middle'
IconButton:
id: fee_e
source: 'atlas://gui/kivy/theming/light/contact'
text: str(self.value)
value: .0005
pos_hint: {'center_y': .5}
size_hint: None, None
size: '32dp', '32dp'
on_release: print 'TODO'
SendReceiveBlueBottom:
id: blue_bottom
size_hint: 1, None
height: self.minimum_height
BoxLayout
size_hint: 1, None
height: blue_bottom.item_height
spacing: '5dp'
Image:
source: 'atlas://gui/kivy/theming/light/contact'
size_hint: None, None
size: '22dp', '22dp'
pos_hint: {'center_y': .5}
TextInputSendBlue:
id: payto_e
hint_text: "Enter Contact or adress"
on_text_validate:
Factory.Animation(opacity=1,\
height=blue_bottom.item_height)\
.start(message_selection)
message_e.focus = True
Widget:
size_hint: None, None
width: dp(2)
height: qr.height
pos_hint: {'center_y':.5}
canvas.after:
Rectangle:
size: self.size
pos: self.pos
IconButton:
id: qr
source: 'atlas://gui/kivy/theming/light/qrcode'
pos_hint: {'center_y': .5}
size_hint: None, None
size: '22dp', '22dp'
CardSeparator
opacity: message_selection.opacity
color: blue_bottom.foreground_color
BoxLayout:
id: message_selection
opacity: 1 if app.expert_mode else 0
size_hint: 1, None
height: blue_bottom.item_height if app.expert_mode else 0
spacing: '5dp'
Image:
source: 'atlas://gui/kivy/theming/light/pen'
size_hint: None, None
size: '22dp', '22dp'
pos_hint: {'center_y': .5}
TextInputSendBlue:
id: message_e
hint_text: 'Enter description here'
on_text_validate:
anim = Factory.Animation(opacity=1, height=blue_bottom.item_height)
anim.start(wallet_selection)
#anim.start(address_selection)
CardSeparator
opacity: wallet_selection.opacity
color: blue_bottom.foreground_color
WalletSelector:
id: wallet_selection
foreground_color: blue_bottom.foreground_color
opacity: 1 if app.expert_mode else 0
size_hint: 1, None
height: blue_bottom.item_height if app.expert_mode else 0
CardSeparator
opacity: address_selection.opacity
color: blue_bottom.foreground_color
AddressSelector:
id: address_selection
foreground_color: blue_bottom.foreground_color
opacity: 1 if app.expert_mode else 0
size_hint: 1, None
height: blue_bottom.item_height if app.expert_mode else 0
CreateAccountButtonGreen:
background_color: (1, 1, 1, 1) if self.disabled else ((.258, .80, .388, 1) if self.state == 'normal' else (.203, .490, .741, 1))
text: _('Goto next step') if app.wallet.seed else _('Create unsigned transaction')
size_hint_y: None
height: '38dp'
disabled: True if wallet_selection.opacity == 0 else False
on_release:
message = 'sending {} {} to {}'.format(\
app.base_unit, amount_e.text, payto_e.text)
app.gui.main_gui.do_send(self, message=message)
Widget