def delLang(self): curlang = config.osd.language.value lang = curlang languageList = language.getLanguageListSelection() for t in languageList: if curlang == t[0]: lang = t[1] break self.session.openWithCallback(self.delLangCB, MessageBox, _("Do you want to delete all other languages?") + _(" Except %s") %(lang), default = False)
def __init__(self, session, type = 0, needupdate = True): Screen.__init__(self, session) Screen.setTitle(self, _("Downloadable plugins")) self.type = type self.needupdate = needupdate self.createPluginFilter() self.LanguageList = language.getLanguageListSelection() self.container = eConsoleAppContainer() self.container.appClosed.append(self.runFinished) self.container.dataAvail.append(self.dataAvail) self.onLayoutFinish.append(self.startRun) self.onShown.append(self.setWindowTitle) self.list = [] self["list"] = PluginList(self.list) self.pluginlist = [] self.expanded = [] self.installedplugins = [] self.plugins_changed = False self.reload_settings = False self.check_settings = False self.check_bootlogo = False self.install_settings_name = '' self.remove_settings_name = '' self.onChangedEntry = [] self["list"].onSelectionChanged.append(self.selectionChanged) if self.type == self.DOWNLOAD: self["text"] = Label(_("Downloading plugin information. Please wait...")) if self.type == self.REMOVE: self["text"] = Label(_("Getting plugin information. Please wait...")) elif self.type == self.TOOGLE: self["text"] = Label(_("Getting plugin information. Please wait...")) self.run = 0 self.remainingdata = "" self["actions"] = ActionMap(["WizardActions"], { "ok": self.go, "back": self.requestClose, }) if os.path.isfile('/usr/bin/opkg'): self.ipkg = '/usr/bin/opkg' self.ipkg_install = self.ipkg + ' install --force-overwrite' self.ipkg_remove = self.ipkg + ' remove --autoremove --force-depends' self.ipkg_toogle = self.ipkg + ' flag hold' else: self.ipkg = 'ipkg' self.ipkg_install = 'ipkg install --force-overwrite -force-defaults' self.ipkg_remove = self.ipkg + ' remove' self.ipkg_toogle = self.ipkg + ' flag hold'
def delLang(self): # print "[LanguageSelection] deleting language" curlang = config.osd.language.value lang = curlang languageList = language.getLanguageListSelection() # print "[LanguageSelection] deleting language lang = %s, languagelist = %s", %(lang, languageList) for t in languageList: if curlang == t[0]: lang = t[1] break self.session.openWithCallback( self.delLangCB, MessageBox, _("Select 'Yes' to delete all languages except English and current language:\n\nSelect 'No' to delete only the chosen language:\n\n" ) + _("%s") % (lang), default=True)
def delLangCB(self, answer): if answer: language.delLanguage() language.activateLanguage(self.oldActiveLanguage) self.updateList() self.selectActiveLanguage() else: curlang = config.osd.language.value lang = curlang languageList = language.getLanguageListSelection() # print "[LanguageSelection] deleting language lang = %s, languagelist = %s", %(lang, languageList) for t in languageList: if curlang == t[0]: lang = t[1] break self.session.openWithCallback(self.deletelanguagesCB, MessageBox, _("Do you really want to delete selected language:\n\n") + _("%s") %(lang), default = False)
def __init__(self, session, type=0, needupdate=True): Screen.__init__(self, session) Screen.setTitle(self, _("Download plugins")) self.type = type self.needupdate = needupdate self.createPluginFilter() self.LanguageList = language.getLanguageListSelection() self.container = eConsoleAppContainer() self.container.appClosed.append(self.runFinished) self.container.dataAvail.append(self.dataAvail) self.onLayoutFinish.append(self.startRun) self.onShown.append(self.setWindowTitle) self.list = [] self["list"] = PluginList(self.list) self.pluginlist = [] self.expanded = [] self.installedplugins = [] self.plugins_changed = False self.reload_settings = False self.check_settings = False self.check_bootlogo = False self.install_settings_name = '' self.remove_settings_name = '' self.onChangedEntry = [] self["list"].onSelectionChanged.append(self.selectionChanged) if self.type == self.DOWNLOAD: self["text"] = Label( _("Downloading plugin information. Please wait...")) elif self.type == self.REMOVE: self["text"] = Label( _("Getting plugin information. Please wait...")) self.run = 0 self.remainingdata = "" self["actions"] = ActionMap(["WizardActions"], { "ok": self.go, "back": self.requestClose, }) self.opkg = '/usr/bin/opkg' self.opkg_install = self.opkg + ' install --force-overwrite' self.opkg_remove = self.opkg + ' remove --autoremove --force-depends'
def __init__(self, session, type=0, needupdate=True): Screen.__init__(self, session) Screen.setTitle(self, _('Downloadable plugins')) self.type = type self.needupdate = needupdate self.createPluginFilter() self.LanguageList = language.getLanguageListSelection() self.container = eConsoleAppContainer() self.container.appClosed.append(self.runFinished) self.container.dataAvail.append(self.dataAvail) self.onLayoutFinish.append(self.startRun) self.onShown.append(self.setWindowTitle) self.list = [] self['list'] = PluginList(self.list) self.pluginlist = [] self.expanded = [] self.installedplugins = [] self.plugins_changed = False self.reload_settings = False self.check_settings = False self.check_bootlogo = False self.install_settings_name = '' self.remove_settings_name = '' self.onChangedEntry = [] self['list'].onSelectionChanged.append(self.selectionChanged) if self.type == self.DOWNLOAD: self['text'] = Label( _('Downloading plugin information. Please wait...')) elif self.type == self.REMOVE: self['text'] = Label( _('Getting plugin information. Please wait...')) self.run = 0 self.remainingdata = '' self['actions'] = ActionMap(['WizardActions'], { 'ok': self.go, 'back': self.requestClose }) if os.path.isfile('/usr/bin/opkg'): self.ipkg = '/usr/bin/opkg' self.ipkg_install = self.ipkg + ' install --force-overwrite' self.ipkg_remove = self.ipkg + ' remove --autoremove --force-depends' else: self.ipkg = 'ipkg' self.ipkg_install = 'ipkg install --force-overwrite -force-defaults' self.ipkg_remove = self.ipkg + ' remove --autoremove --force-depends'
def deletelanguagesCB(self, anwser): if anwser: language.delLanguage() self.close() def cancel(self): language.activateLanguage(self.oldActiveLanguage) config.osd.language.setValue(self.oldActiveLanguage) config.osd.language.save() self.close() def delLang(self): curlang = config.osd.language.value lang = curlang languageList = language.getLanguageListSelection() for t in languageList: if curlang == t[0]: lang = t[1] break self.session.openWithCallback(self.delLangCB, MessageBox, _("Do you want to delete all other languages?") + _(" Except %s") %(lang), default = False) def delLangCB(self, anwser): if anwser: language.delLanguage() language.activateLanguage(self.oldActiveLanguage) self.updateList() self.selectActiveLanguage() def run(self, justlocal = False): print "updating language..."
def __init__(self, session, type=0, needupdate=True, menu_path="", skin_name=None): Screen.__init__(self, session) self.menu_path = menu_path self.type = type self.needupdate = needupdate self.skinName = ["PluginDownloadBrowser"] if isinstance(skin_name, str): self.skinName.insert(0, skin_name) self["menu_path_compressed"] = StaticText("") if self.type == self.DOWNLOAD: config.misc.pluginbrowser.po.value = True screentitle = _("Install plugins") if config.usage.show_menupath.value == 'large': self.menu_path += screentitle title = self.menu_path self["menu_path_compressed"].setText("") elif config.usage.show_menupath.value == 'small': title = screentitle self["menu_path_compressed"].setText( self.menu_path + " >" if not self.menu_path.endswith(' / ') else self.menu_path[:-3] + " >" or "") else: title = screentitle self["menu_path_compressed"].setText("") elif self.type == self.REMOVE: config.misc.pluginbrowser.po.value = False screentitle = _("Remove plugins") if config.usage.show_menupath.value == 'large': self.menu_path += screentitle title = self.menu_path self["menu_path_compressed"].setText("") elif config.usage.show_menupath.value == 'small': title = screentitle self["menu_path_compressed"].setText( self.menu_path + " >" if not self.menu_path.endswith(' / ') else self.menu_path[:-3] + " >" or "") else: title = screentitle self["menu_path_compressed"].setText("") self.setTitle(title) self.createPluginFilter() self.LanguageList = language.getLanguageListSelection() self.container = eConsoleAppContainer() self.container.appClosed.append(self.runFinished) self.container.dataAvail.append(self.dataAvail) self.onLayoutFinish.append(self.startRun) self.list = [] self["list"] = PluginList(self.list) self.pluginlist = [] self.expanded = [] self.installedplugins = [] self.plugins_changed = False self.reload_settings = False self.check_settings = False self.check_bootlogo = False self.install_settings_name = '' self.remove_settings_name = '' self.onChangedEntry = [] self["list"].onSelectionChanged.append(self.selectionChanged) if self.type == self.DOWNLOAD: self["text"] = Label( _("Downloading plugin information. Please wait...")) elif self.type == self.REMOVE: self["text"] = Label( _("Getting plugin information. Please wait...")) self.run = 0 self.remainingdata = "" self["actions"] = ActionMap(["WizardActions"], { "ok": self.go, "back": self.requestClose, }) if os.path.isfile('/usr/bin/opkg'): self.ipkg = '/usr/bin/opkg' self.ipkg_install = self.ipkg + ' install' self.ipkg_remove = self.ipkg + ' remove --autoremove' else: self.ipkg = 'ipkg' self.ipkg_install = 'ipkg install -force-defaults' self.ipkg_remove = self.ipkg + ' remove'