Commit b566fda9 authored by Shashank Kumar's avatar Shashank Kumar

refactored

parent 118f4c6d
......@@ -2,13 +2,16 @@
Modules containing Blog classes
'''
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
Builder.load_file('./ui/blog.kv')
from modules.module_box.module_box import ModuleBox
class Blog(BoxLayout):
'''
Blog class for tutorials and tools
'''
def __init__(self, **kwargs):
super(Blog, self).__init__(**kwargs)
self.module_box = ModuleBox("blog")
self.add_widget(self.module_box)
......@@ -2,13 +2,16 @@
Modules containing Communication classes
'''
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
Builder.load_file('./ui/communication.kv')
from modules.module_box.module_box import ModuleBox
class Communication(BoxLayout):
'''
Communication class for tutorials and tools
'''
def __init__(self, **kwargs):
super(Communication, self).__init__(**kwargs)
self.module_box = ModuleBox("communication")
self.add_widget(self.module_box)
......@@ -4,7 +4,6 @@ Modules containing How To Use classes
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
Builder.load_file('./ui/how_to_use.kv')
......
......@@ -2,13 +2,16 @@
Modules containing Version Control System classes
'''
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
Builder.load_file('./ui/vcs.kv')
from modules.module_box.module_box import ModuleBox
class VCS(BoxLayout):
'''
VCS class for tutorials and tools
'''
def __init__(self, **kwargs):
super(VCS, self).__init__(**kwargs)
self.module_box = ModuleBox("vcs")
self.add_widget(self.module_box)
......@@ -2,13 +2,16 @@
Modules containing Way Ahead classes
'''
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
Builder.load_file('./ui/way_ahead.kv')
from modules.module_box.module_box import ModuleBox
class WayAhead(BoxLayout):
'''
WayAhead class for tutorials and tools
'''
def __init__(self, **kwargs):
super(WayAhead, self).__init__(**kwargs)
self.module_box = ModuleBox("way_ahead")
self.add_widget(self.module_box)
......@@ -18,9 +18,6 @@ from modules.course_modules.encryption.encryption import Encryption
from modules.course_modules.how_to_use.how_to_use import HowToUse
from modules.course_modules.vcs.vcs import VCS
from modules.course_modules.way_ahead.way_ahead import WayAhead
from modules.settings.application import ApplicationSettings
from modules.settings.profile import ProfileSettings
from modules.settings.theme import ThemeSettings
Builder.load_file('./ui/dashboard.kv')
......
......@@ -48,6 +48,7 @@ class ModuleToolsMenu(BoxLayout):
tool_key = '_'.join(tool['title'].lower().split())
self.all_tools[tool_key] = tool
self.populate_tools_menu()
self.ids['module_tools_menu'].add_widget(Factory.InvitingContributors())
def populate_tools_menu(self):
'''
......@@ -73,8 +74,6 @@ class ModuleToolsMenu(BoxLayout):
self.ids['module_tools_menu'].add_widget(tool_box_widget)
self.import_tool_modules(key)
self.ids['module_tools_menu'].add_widget(Factory.InvitingContributors())
def import_tool_modules(self, tool_to_import):
'''
import_tool_modules try to import tool_to_import named module and also
......
......@@ -50,6 +50,7 @@ class ModuleTutorialsMenu(BoxLayout):
tutorial_key = '_'.join(tutorial['title'].lower().split())
self.all_tutorials[tutorial_key] = tutorial
self.populate_tutorials_menu()
self.ids['module_tutorials_menu'].add_widget(Factory.InvitingContributors())
def populate_tutorials_menu(self):
'''
......@@ -76,8 +77,6 @@ class ModuleTutorialsMenu(BoxLayout):
tutorial_box_widget.ids['tutorial_box_difficulty'].text = t_d
self.ids['module_tutorials_menu'].add_widget(tutorial_box_widget)
self.ids['module_tutorials_menu'].add_widget(Factory.InvitingContributors())
def get_tutorial_modules(self, tutorial_to_import):
'''
return requested tutorial by calling get_tutorial_widget of
......
'''
Modules containing Application Settings classes
'''
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
Builder.load_file('./ui/application_settings.kv')
class ApplicationSettings(BoxLayout):
'''
ApplicationSettings class for settings related to New
Contributor Wizard application
'''
'''
Modules containing Profile Settings classes
'''
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
Builder.load_file('./ui/profile_settings.kv')
class ProfileSettings(BoxLayout):
'''
ProfileSettings class for settings related to signed in user
'''
'''
Modules containing Theme Settings classes
'''
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
Builder.load_file('./ui/theme_settings.kv')
class ThemeSettings(BoxLayout):
'''
ThemeSettings class for settings related to Theme of application
'''
<ApplicationSettings>:
orientation: 'vertical'
canvas.before:
Color:
rgba: 1, 1, 1, 1
Rectangle:
pos: self.pos
size: self.size
Label:
text: 'Application'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
color: 0, 0, 0, 1
Label:
text: 'Settings'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
color: 0, 0, 0, 1
<Blog>:
Label:
text: 'Blog'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
\ No newline at end of file
<CLI>:
orientation: 'vertical'
Label:
text: 'Command'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
Label:
text: 'Line'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
Label:
text: 'Inteface'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
\ No newline at end of file
<Communication>:
Label:
text: 'Communication'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
\ No newline at end of file
......@@ -103,15 +103,6 @@
Screen
name: 'way_ahead_screen'
WayAhead
Screen
name: 'application_settings_screen'
ApplicationSettings
Screen
name: 'profile_settings_screen'
ProfileSettings
Screen
name: 'theme_settings_screen'
ThemeSettings
<MenuButton@ButtonBehavior+BoxLayout>
size_hint: 1, 0.142
......
<ProfileSettings>:
orientation: 'vertical'
canvas.before:
Color:
rgba: 1, 1, 1, 1
Rectangle:
pos: self.pos
size: self.size
Label:
text: 'Profile'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
color: 0, 0, 0, 1
Label:
text: 'Settings'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
color: 0, 0, 0, 1
\ No newline at end of file
<ThemeSettings>:
orientation: 'vertical'
canvas.before:
Color:
rgba: 1, 1, 1, 1
Rectangle:
pos: self.pos
size: self.size
Label:
text: 'Theme'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
color: 0, 0, 0, 1
Label:
text: 'Settings'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
color: 0, 0, 0, 1
<VCS>:
orientation: 'vertical'
Label:
text: 'Version'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
Label:
text: 'Control'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
Label:
text: 'System'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
<WayAhead>:
Label:
text: 'Way Ahead'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 50
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment