Пример #1
0
 def _update_list(self, *args, **kwargs):
     if len(self.all_monitors) > 0:
         enabled_monitors = []
         for mid in self.config['monitors'].values():
             for monitor in self.all_monitors:
                 if mid == monitor['mid']:
                     enabled_monitors.append(monitor)
         for monitor in enabled_monitors + [
             m for m in self.all_monitors
             if m['mid'] not in self.config['monitors'].values()
         ]:
             item = SortableSettingBoolean(
                 panel=self,
                 title=monitor['name'],
                 desc=monitor['mid'],
                 section='monitors',
                 key=monitor['mid']
             )
             self.add_widget(item)
             self.monitors_items.append(item)
     else:
         item = SettingItem(
             panel=self,
             title='No monitors to show',
             desc=''
         )
         self.add_widget(item)
         self.monitors_items.append(item)
Пример #2
0
 def __init__(self, *args, **kwargs):
     self.fetch_func = kwargs.pop('fetch_func', None)
     super().__init__(*args, **kwargs)
     self.monitors_items = []
     self.all_monitors = []
     self._do_update_list = Clock.create_trigger(self._update_list)
     self._list_thread = threading.Thread(target=self._fetch_monitors,
                                          daemon=True)
     self.add_widget(
         SettingItem(panel=self,
                     title='Refresh',
                     desc='Get all monitors list',
                     on_release=self.refresh_touch))
Пример #3
0
    def generate_settings(self):

        settings_panel = Settings()  #create instance of Settings

        #        def add_one_panel(from_instance):
        #            panel = SettingsPanel(title="I like trains", settings=self)
        #            panel.add_widget(AsyncImage(source="http://i3.kym-cdn.com/entries/icons/original/000/004/795/I-LIKE-TRAINS.jpg"))
        #            settings_panel.add_widget(panel)
        #            print "Hello World from ", from_instance

        panel = SettingsPanel(
            title="Engine")  #create instance of left side panel
        item1 = SettingItem(
            panel=panel,
            title="Board")  #create instance of one item in left side panel
        item2 = SettingItem(
            panel=panel,
            title="Level")  #create instance of one item in left side panel

        #        item2 = SettingTitle(title="Level") #another widget in left side panel
        #        button = Button(text="Add one more panel")

        #        item1.add_widget(button) #add widget to item1 in left side panel
        #        button.bind(on_release=add_one_panel) #bind that button to function

        panel.add_widget(item1)  # add item1 to left side panel
        panel.add_widget(item2)  # add item2 to left side panel
        settings_panel.add_widget(
            panel)  #add left side panel itself to the settings menu

        def go_back():
            self.root.current = 'main'

        settings_panel.on_close = go_back

        return settings_panel  # show the settings interface
Пример #4
0
def BrowserPop(self):
    layout = GridLayout(cols=1, size_hint=(None, 1.0), width=700)
    layout.bind(minimum_height=layout.setter('height'))
    panel = SettingsPanel(title="Browser Mods", settings=self)   
    main = BoxLayout(orientation = 'vertical')
    root = ScrollView(size_hint=(None, None),bar_margin=-11, bar_color=(47 / 255., 167 / 255., 212 / 255., 1.), do_scroll_x=False)
    root.size = (600, 400)
    root.add_widget(layout)
    main.add_widget(root)
    done = Button(text ='Done Choosing Options')
    main.add_widget(done)
    if 'const/4 v0, 0x4' in open("%s/BrowserSettings.smali" % (Browser)).read():
        fp = open("%s/BrowserSettings.smali" % (Browser), "r")
        lines = fp.readlines()
        fp.close()
        tabs = SettingItem(panel = panel, title = "Unlimited Browser Tabs",disabled=False, desc = "Allows Unlimited number of browser tabs to be open")
        for i in range(len(lines)):
            if 'const/4 v0, 0x4' in open("%s/BrowserSettings.smali" % (Browser)).read():
                tabs_switch = Switch(active=False)
                continue
            if 'const/4 v0, 0x4' in open("%s/BrowserSettings.smali" % (Browser)).read():
                tabs_switch = Switch(active=True)
        tabs.add_widget(tabs_switch)
        layout.add_widget(tabs)
    
        def callback(instance, value):
            tabs_state(instance, value)
        tabs_switch.bind(active=callback)
    
    popup = Popup(background='atlas://images/eds/pop', title='Browser Mods', content=main, auto_dismiss=False, size_hint=(None, None), size=(630, 500))
    popup.open()

    def finish(self):
        finish_browser(self)
        popup.dismiss()
    done.bind(on_release=finish)
Пример #5
0
    def cm_branch(self):
        config.read('%s/eds.ini' % Usr)
        Box = BoxLayout(orientation="vertical", spacing=10)
        base = SettingsPanel(title="", settings=self)
        btn_layout = GridLayout(cols=2, spacing=10)
        select = Button(text="Select")
        btn_layout.add_widget(select)
        cancel = Button(text='Cancel')
        btn_layout.add_widget(cancel)
        base.bind(minimum_height=base.setter('height'))

        #################################################
        # Removed branch type selection menu because I think it was useless
        # Should be the same for Aosp and CM
        # If not I can redo it.
        #################################################

        Cm7 = SettingItem(panel=base,
                          title="Cyanogenmod 7",
                          disabled=False,
                          desc="Android 2.3,  kernel 2.6.35,  Api 9-10 ")
        Cm7_radio = CheckBox(group='base', active=False)
        Cm7.add_widget(Cm7_radio)
        base.add_widget(Cm7)

        Cm9 = SettingItem(panel=base,
                          title="Cyanogenmod 9",
                          disabled=False,
                          desc="Android 4.0,  kernel 3.0.1,  Api 14-15")
        Cm9_radio = CheckBox(group='base', active=False)
        Cm9.add_widget(Cm9_radio)
        base.add_widget(Cm9)

        Cm10 = SettingItem(panel=base,
                           title="Cyanogenmod 10",
                           disabled=False,
                           desc="Android 4.1,  kernel 3.1.10,  Api 16-?")
        Cm10_radio = CheckBox(group='base', active=False)
        Cm10.add_widget(Cm10_radio)
        base.add_widget(Cm10)

        # for root widget do_scroll_y=True to enable scrolling
        root = ScrollView(size_hint=(None, None),
                          size=(525, 240),
                          do_scroll_x=False,
                          do_scroll_y=False)
        root.add_widget(base)
        Box.add_widget(root)
        Box.add_widget(btn_layout)

        ########################################
        # This should be working fine
        # Not sure if there is a better way to do this
        #########################################

        def on_checkbox(checkbox, value):
            title = Cm7.title
            if value:
                bra.text = "[b][color=#adadad]Current Branch =[/color][/b] cm-gb"
                config.set("Source", "branch", "cm-gb")
            else:
                pass

        Cm7_radio.bind(active=on_checkbox)

        def checkbox_active(checkbox, value):
            title = Cm9.title
            if value:
                bra.text = "[b][color=#adadad]Current Branch =[/color][/b] cm-ics"
                config.set("Source", "branch", "cm-ics")
            else:
                pass

        Cm9_radio.bind(active=checkbox_active)

        def on_active(checkbox, value):
            title = Cm10.title
            if value:
                bra.text = "[b][color=#adadad]Current Branch =[/color][/b] cm-jb"
                config.set("Source", "branch", "cm-jb")
            else:
                pass

        Cm10_radio.bind(active=on_active)

        def set_branch(self):
            config.write()

        select.bind(on_release=set_branch)

        popup = Popup(background='atlas://images/eds/pop',
                      title='Branch Selection',
                      content=Box,
                      auto_dismiss=True,
                      size_hint=(None, None),
                      size=(550, 350))
        select.bind(on_release=popup.dismiss)
        cancel.bind(on_release=popup.dismiss)
        popup.open()
Пример #6
0
    def aosp_branch(self):
        config.read('%s/eds.ini' % Usr)
        Box = BoxLayout(orientation="vertical", spacing=10)
        base = SettingsPanel(title="", settings=self)
        btn_layout = GridLayout(cols=2, spacing=10)
        select = Button(text="Select")
        btn_layout.add_widget(select)
        cancel = Button(text='Cancel')
        btn_layout.add_widget(cancel)
        base.bind(minimum_height=base.setter('height'))

        GB = SettingItem(panel=base,
                         title="Gingerbread",
                         disabled=False,
                         desc="Android 2.3,  kernel 2.6.35,  Api 9-10 ")
        GB_radio = CheckBox(group='base', active=False)
        GB.add_widget(GB_radio)
        base.add_widget(GB)

        ICS = SettingItem(panel=base,
                          title="Ice Cream Sandwitch",
                          disabled=False,
                          desc="Android 4.0,  kernel 3.0.1,  Api 14-15")
        ICS_radio = CheckBox(group='base', active=False)
        ICS.add_widget(ICS_radio)
        base.add_widget(ICS)

        JB = SettingItem(panel=base,
                         title="Jellybean",
                         disabled=False,
                         desc="Android 4.1,  kernel 3.1.10,  Api 16-?")
        JB_radio = CheckBox(group='base', active=False)
        JB.add_widget(JB_radio)
        base.add_widget(JB)

        # for root widget do_scroll_y=True to enable scrolling
        root = ScrollView(size_hint=(None, None),
                          size=(525, 240),
                          do_scroll_x=False,
                          do_scroll_y=False)
        root.add_widget(base)
        Box.add_widget(root)
        Box.add_widget(btn_layout)

        ########################################
        # This should be working fine
        # Not sure if there is a better way to do this
        #########################################

        def on_checkbox(checkbox, value):
            title = GB.title
            if value:
                bra.text = "[b][color=#adadad]Current Branch =[/color][/b] aosp-gb"
                config.set("Source", "branch", "aosp-gb")
            else:
                pass

        GB_radio.bind(active=on_checkbox)

        def checkbox_active(checkbox, value):
            title = ICS.title
            if value:
                bra.text = "[b][color=#adadad]Current Branch =[/color][/b] aosp-ics"
                config.set("Source", "branch", "aosp-ics")
            else:
                pass

        ICS_radio.bind(active=checkbox_active)

        def on_active(checkbox, value):
            title = JB.title
            if value:
                bra.text = "[b][color=#adadad]Current Branch =[/color][/b] aosp-jb"
                config.set("Source", "branch", "aosp-jb")
            else:
                pass

        JB_radio.bind(active=on_active)

        def set_branch(self):
            config.write()

        select.bind(on_release=set_branch)

        popup = Popup(background='atlas://images/eds/pop',
                      title='Branch Selection',
                      content=Box,
                      auto_dismiss=True,
                      size_hint=(None, None),
                      size=(550, 350))
        select.bind(on_release=popup.dismiss)
        cancel.bind(on_release=popup.dismiss)
        popup.open()
Пример #7
0
def MmsPop(self):
    layout = GridLayout(cols=1, size_hint=(None, 1.0), width=700)
    layout.bind(minimum_height=layout.setter('height'))
    panel = SettingsPanel(title="Mms Mods", settings=self)
    main = BoxLayout(orientation='vertical')
    root = ScrollView(size_hint=(None, None),
                      bar_margin=-11,
                      bar_color=(47 / 255., 167 / 255., 212 / 255., 1.),
                      do_scroll_x=False)
    root.size = (600, 400)
    root.add_widget(layout)
    main.add_widget(root)
    done = Button(text='Done Choosing Options')
    main.add_widget(done)
    if """    .line 77
    const/4 v0, 0x1

    sput-boolean v0, Lcom/android/mms/model/ImageModel;->mCheckResolution:Z""" in open(
            "%s/ImageModel.smali" % (Mms)).read():
        fp = open("%s/ImageModel.smali" % (Mms), "r")
        lines = fp.readlines()
        fp.close()
        comp = SettingItem(panel=panel,
                           title="Remove Mms Compression",
                           disabled=False,
                           desc="Disables Compression of Mms Messages")
        for i in range(len(lines)):
            if """    .line 77
    const/4 v0, 0x1

    sput-boolean v0, Lcom/android/mms/model/ImageModel;->mCheckResolution:Z""" in open(
                    "%s/ImageModel.smali" % (Mms)).read():
                comp_switch = Switch(active=False)
                continue
            if """    .line 77
    const/4 v0, 0x1

    sput-boolean v0, Lcom/android/mms/model/ImageModel;->mCheckResolution:Z""" in open(
                    "%s/ImageModel.smali" % (Mms)).read():
                comp_switch = Switch(active=True)
        comp.add_widget(comp_switch)
        layout.add_widget(comp)

        def callback(instance, value):
            comp_state(instance, value)

        comp_switch.bind(active=callback)

    popup = Popup(background='atlas://images/eds/pop',
                  title='Mms Mods',
                  content=main,
                  auto_dismiss=False,
                  size_hint=(None, None),
                  size=(630, 500))
    popup.open()

    def finish(self):
        finish_comp(self)
        popup.dismiss()

    done.bind(on_release=finish)
Пример #8
0
def credits_popup(self):
    layout = GridLayout(cols=1, size_hint=(None, 1.4), width=700)
    layout.bind(minimum_height=layout.setter('height'))
    panel = SettingsPanel(title="Credits", settings=self)   
    main = BoxLayout(orientation = 'vertical')
    root = ScrollView(size_hint=(None, None),bar_margin=-11, bar_color=(47 / 255., 167 / 255., 212 / 255., 1.), do_scroll_x=False)
    root.size = (600, 400)
    root.add_widget(layout)
    main.add_widget(root)
    done = Button(text ='Close')
    main.add_widget(done)

    wes_btns = GridLayout(cols=3, spacing=10, padding=5)
    wes_twit = CustomButton(text='Twitter', size_hint_x=None, size_hint_y=30, width=60)
    wes_btns.add_widget(wes_twit)
    wes_contact = CustomButton(text='Gmail', size_hint_x=None, size_hint_y=30, width=60)
    wes_btns.add_widget(wes_contact)
    wes_site = CustomButton(text='Site', size_hint_x=None, size_hint_y=30, width=60)
    wes_btns.add_widget(wes_site)

    wes = SettingItem(panel = panel, title = "Wes342",disabled=False, desc = "Lead Developer:  -  Python,  xml,  java,  smali,  json\nLead Site Maintainer: - Html,  Xml,  Php")
    wes.add_widget(wes_btns)
    layout.add_widget(wes)

    sac_btns = GridLayout(cols=3, spacing=10, padding=5)
    sac_twit = CustomButton(text='Twitter',size_hint_x=None, size_hint_y=60, width=60)
    sac_btns.add_widget(sac_twit)
    sac_contact = CustomButton(text='Gmail',size_hint_x=None, size_hint_y=60, width=60)
    sac_btns.add_widget(sac_contact)
    sac_site = CustomButton(text='Site',size_hint_x=None, size_hint_y=60, width=60)
    sac_btns.add_widget(sac_site)
    
    zar_btns = GridLayout(cols=3, spacing=10, padding=5)
    zar_twit = CustomButton(text='Twitter',size_hint_x=None, size_hint_y=60, width=60)
    zar_btns.add_widget(zar_twit)
    zar_contact = CustomButton(text='Gmail',size_hint_x=None, size_hint_y=60, width=60)
    zar_btns.add_widget(zar_contact)
    zar_site = CustomButton(text='Site',size_hint_x=None, size_hint_y=60, width=60)
    zar_btns.add_widget(zar_site)

    sac = SettingItem(panel = panel, title = "Sac23",disabled=False, desc = "Lead Developer:  -  Android,  xml,  smali")
    sac.add_widget(sac_btns)
    layout.add_widget(sac)

    zar = SettingItem(panel = panel, title = "Zarboz",disabled=False, desc = "Kernel Development:  -  Source, Make, Github")
    zar.add_widget(zar_btns)
    layout.add_widget(zar)
   
   
    thanks = SettingItem(panel = panel, title = "Credits",disabled=True, desc = Credits)
    layout.add_widget(thanks)
    
    donors = SettingItem(panel = panel, title = "Donors",disabled=True, desc = Donors)
    layout.add_widget(donors)

    popup = Popup(background='atlas://images/eds/pop', title='Credits', content=main, auto_dismiss=True, size_hint=(None, None), size=(630, 500))
    popup.open()
    done.bind(on_release=popup.dismiss)

    def wes_twitter(self):
        webbrowser.open('http://twitter.com/wes342')
    wes_twit.bind(on_press=wes_twitter)
    
    def wes_gtalk(self):
        webbrowser.open("mailto:[email protected]")
    wes_contact.bind(on_press=wes_gtalk)
    
    def wes_website(self):
        webbrowser.open('http://easydevstudio.com/home')
    wes_site.bind(on_press=wes_website)
       
    def sac_twitter(self):
        webbrowser.open('http://twitter.com/sac232')
    sac_twit.bind(on_press=sac_twitter)

    def sac_gtalk(self):
        webbrowser.open("mailto:[email protected]")
    sac_contact.bind(on_press=sac_gtalk)
    
    def sac_website(self):
        webbrowser.open('http://citycollisioncenter.com')
    sac_site.bind(on_press=sac_website)
    
    def zar_twitter(self):
        webbrowser.open('http://twitter.com/zarboz')
    zar_twit.bind(on_press=zar_twitter)

    def zar_gtalk(self):
        webbrowser.open("mailto:[email protected]")
    zar_contact.bind(on_press=zar_gtalk)
    
    def zar_website(self):
        webbrowser.open('https://github.com/zarboz')
    zar_site.bind(on_press=zar_website)