예제 #1
0
파일: wordmobi.py 프로젝트: bohwaz/wordmobi
    def __init__(self):
        app.screen='normal' # TODO check all app.xyz use
        app.directional_pad = False
        LABELS.set_locale(DB["language"])
        self.wp_icon = Icon(MIFFILE,16384+14,16384+14)
        self.blogs = json.loads(DB["blog_list"])
        items = [ (b["account"],b["blog"],self.wp_icon) for b in self.blogs ]
        menu = [(LABELS.loc.wm_menu_exit, self.close_app)] 
        Application.__init__(self,  u"Wordmobi", Listbox( items, self.check_update_value ))
        self._update_menu()

        # TODO
        # {
        # Temporary fix before changing how persistence is treated.
        # New persistence module must be created to avoid this line and e32db.
        __changed = False
        for n in range(len(self.blogs)):
            if not self.blogs[n].has_key("api_key"):
                self.blogs[n]["api_key"] = ""
                __changed = True
        if __changed:
            DB["blog_list"]=json.dumps(self.blogs)
            DB.save()
        #
        # }
        #
        self.dlg = None
        sel_access_point()

        if not TOUCH_ENABLED:
            self.bind(key_codes.EKeyRightArrow, self.check_update_value)
            self.bind(key_codes.EKeyLeftArrow, self.close_app)
예제 #2
0
파일: settings.py 프로젝트: bohwaz/wordmobi
 def blog_cbk(self):
     self.lock_ui()
     if not self.dlg.cancel:
         DB["blog_list"]=json.dumps(self.dlg.blogs)
         DB.save()
         BLOG.check_persistence(self.dlg.blogs)
     self.unlock_ui()
     self.refresh()
     return True
예제 #3
0
파일: settings.py 프로젝트: bohwaz/wordmobi
 def twitter_cbk(self):
     self.lock_ui()
     if not self.dlg.cancel:
         DB["twitter_enabled"]= self.dlg.twitter_enabled
         DB["twitter_user"] = self.dlg.twitter_user
         DB["twitter_pass"] = self.dlg.twitter_password
         DB.save()
     self.unlock_ui()
     self.refresh()
     return True
예제 #4
0
파일: settings.py 프로젝트: bohwaz/wordmobi
 def proxy_cbk(self):
     self.lock_ui()
     if not self.dlg.cancel:
         DB["proxy_enabled"]= self.dlg.proxy_enabled
         DB["proxy_addr"] = self.dlg.proxy_address
         DB["proxy_user"] = self.dlg.proxy_user
         DB["proxy_pass"] = self.dlg.proxy_password
         DB["proxy_port"] = utf8_to_unicode( str(self.dlg.proxy_port) )
         DB.save()
     self.unlock_ui()
     self.refresh()
     return True
예제 #5
0
파일: settings.py 프로젝트: bohwaz/wordmobi
 def language(self):
     langs = [(LABELS.loc.st_menu_en_us, u"en_us"),
              (LABELS.loc.st_menu_pt_br, u"pt_br"),
              (LABELS.loc.st_menu_es, u"es"),
              (LABELS.loc.st_menu_tr, u"tr"),
              (LABELS.loc.st_menu_it, u"it"),
              (LABELS.loc.st_menu_nl, u"nl"),
              (LABELS.loc.st_menu_de, u"de"),
              (LABELS.loc.st_menu_ro, u"ro"),
              (LABELS.loc.st_menu_zh_cn, u"zh_cn"),
              (LABELS.loc.st_menu_fr, u"fr"),
              (LABELS.loc.st_menu_ru, u"ru"),
              (LABELS.loc.st_menu_id, u"id")]
     langs.sort()
     item = popup_menu(map(lambda x:x[0], langs), LABELS.loc.st_pmenu_lang )
     if item is not None:
         loc = langs[item][1]
         if DB["language"] != loc:
             LABELS.set_locale(loc)
             DB["language"] = loc
             DB.save()
             self.refresh()
             BLOG.refresh() # update global defines
             self.lang_changed = True