2018-07-18 14:49:39 +02:00
|
|
|
import os
|
2018-07-24 12:05:39 +02:00
|
|
|
import shutdown
|
2018-07-09 13:17:59 +02:00
|
|
|
from kivy.app import App
|
2018-07-18 14:49:39 +02:00
|
|
|
from kivy.lang import Builder
|
|
|
|
from kivy.uix.screenmanager import Screen
|
|
|
|
from kivy.properties import ObjectProperty, StringProperty
|
|
|
|
from kivymd.theming import ThemeManager
|
|
|
|
from kivy.uix.widget import Widget
|
2018-07-24 12:05:39 +02:00
|
|
|
from kivy.uix.boxlayout import BoxLayout
|
2018-07-18 14:49:39 +02:00
|
|
|
from kivymd.toolbar import Toolbar
|
2018-07-24 12:05:39 +02:00
|
|
|
from navigationdrawer import NavigationDrawer
|
2018-07-18 14:49:39 +02:00
|
|
|
from kivy.uix.label import Label
|
|
|
|
from kivy.uix.textinput import TextInput
|
|
|
|
from kivy.clock import Clock
|
2018-07-24 12:05:39 +02:00
|
|
|
from bmconfigparser import BMConfigParser
|
|
|
|
from kivy.properties import BooleanProperty
|
|
|
|
statusIconColor = 'red'
|
|
|
|
|
2018-07-07 14:11:58 +02:00
|
|
|
|
2018-07-24 12:05:39 +02:00
|
|
|
class NavigateApp(App, TextInput):
|
2018-07-18 14:49:39 +02:00
|
|
|
theme_cls = ThemeManager()
|
|
|
|
nav_drawer = ObjectProperty()
|
2018-07-03 11:08:02 +02:00
|
|
|
|
2018-07-18 14:49:39 +02:00
|
|
|
def build(self):
|
|
|
|
main_widget = Builder.load_file(os.path.join(os.path.dirname(__file__), 'main.kv'))
|
|
|
|
self.nav_drawer = Navigator()
|
|
|
|
return main_widget
|
2018-07-03 12:06:20 +02:00
|
|
|
|
2018-07-18 14:49:39 +02:00
|
|
|
def say_exit(self):
|
|
|
|
print ("**************************EXITING FROM APPLICATION*****************************")
|
|
|
|
App.get_running_app().stop()
|
|
|
|
shutdown.doCleanShutdown()
|
2018-07-03 12:06:20 +02:00
|
|
|
|
2018-07-24 12:05:39 +02:00
|
|
|
|
2018-07-18 14:49:39 +02:00
|
|
|
class Navigator(NavigationDrawer):
|
|
|
|
image_source = StringProperty('images/me.jpg')
|
|
|
|
title = StringProperty('Navigation')
|
2018-07-03 12:06:20 +02:00
|
|
|
|
|
|
|
|
2018-07-18 14:49:39 +02:00
|
|
|
class Inbox(Screen):
|
2018-07-24 12:05:39 +02:00
|
|
|
def __init__(self, **kwargs):
|
|
|
|
super(Inbox, self).__init__(**kwargs)
|
2018-07-18 14:49:39 +02:00
|
|
|
val_y = .1
|
|
|
|
val_z = 0
|
|
|
|
my_box1 = BoxLayout(orientation='vertical')
|
|
|
|
for i in range(1, 5):
|
|
|
|
my_box1.add_widget(Label(text="I am in inbox", size_hint = (.3,.1), pos_hint = {'x': val_z,'top': val_y},color = (0,0,0,1), background_color = (0,0,0,0)))
|
2018-07-24 12:05:39 +02:00
|
|
|
val_y += .1
|
2018-07-18 14:49:39 +02:00
|
|
|
self.add_widget(my_box1)
|
2018-07-03 11:08:02 +02:00
|
|
|
|
2018-07-24 12:05:39 +02:00
|
|
|
|
2018-07-18 14:49:39 +02:00
|
|
|
class Sent(Screen):
|
2018-07-24 12:05:39 +02:00
|
|
|
def __init__(self, **kwargs):
|
|
|
|
super(Sent, self).__init__(**kwargs)
|
2018-07-18 14:49:39 +02:00
|
|
|
val_y = .1
|
|
|
|
val_z = 0
|
|
|
|
my_box1 = BoxLayout(orientation='vertical')
|
|
|
|
for i in range(1, 5):
|
|
|
|
my_box1.add_widget(Label(text="I am in sent", size_hint = (.3,.1), pos_hint = {'x': val_z,'top': val_y},color = (0,0,0,1), background_color = (0,0,0,0)))
|
2018-07-24 12:05:39 +02:00
|
|
|
val_y += .1
|
2018-07-18 14:49:39 +02:00
|
|
|
self.add_widget(my_box1)
|
2018-07-03 11:08:02 +02:00
|
|
|
|
2018-07-24 12:05:39 +02:00
|
|
|
|
2018-07-18 14:49:39 +02:00
|
|
|
class Trash(Screen):
|
2018-07-24 12:05:39 +02:00
|
|
|
def __init__(self, **kwargs):
|
|
|
|
super(Trash, self).__init__(**kwargs)
|
2018-07-19 13:47:37 +02:00
|
|
|
val_y = .1
|
|
|
|
val_z = 0
|
|
|
|
my_box1 = BoxLayout(orientation='vertical')
|
|
|
|
for i in range(1, 5):
|
|
|
|
my_box1.add_widget(Label(text="I am in trash", size_hint = (.3,.1), pos_hint = {'x': val_z,'top': val_y},color = (0,0,0,1), background_color = (0,0,0,0)))
|
2018-07-24 12:05:39 +02:00
|
|
|
val_y += .1
|
2018-07-19 13:47:37 +02:00
|
|
|
self.add_widget(my_box1)
|
2018-07-03 11:08:02 +02:00
|
|
|
|
|
|
|
|
2018-07-18 14:49:39 +02:00
|
|
|
class Dialog(Screen):
|
|
|
|
pass
|
2018-07-03 11:08:02 +02:00
|
|
|
|
|
|
|
|
2018-07-18 14:49:39 +02:00
|
|
|
class Test(Screen):
|
|
|
|
pass
|
2018-07-03 11:08:02 +02:00
|
|
|
|
2018-07-07 14:11:58 +02:00
|
|
|
|
2018-07-24 12:05:39 +02:00
|
|
|
class Create(Screen, Widget):
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super(Create, self).__init__(*args, **kwargs)
|
|
|
|
Clock.schedule_once(self.init_ui, 0)
|
|
|
|
|
|
|
|
def init_ui(self, dt=0):
|
|
|
|
# self.ids['recipent'].bind(text=self.on_text)
|
|
|
|
pass
|
|
|
|
|
|
|
|
def showmeaddresses(self):
|
|
|
|
return BMConfigParser().addresses()
|
|
|
|
|
|
|
|
def send(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class NewIdentity(Screen):
|
|
|
|
is_active = BooleanProperty(False)
|
|
|
|
|
2018-07-18 14:49:39 +02:00
|
|
|
if __name__ == '__main__':
|
|
|
|
NavigateApp().run()
|