def menu_loadTheme(self):
""" callback for load_theme menu item """
newTheme = tkFileDialog.askopenfilename(initialdir=self.themeRootPath, filetypes=[('Theme', '*.json')], title='Open Theme')
if newTheme and not newTheme.startswith(self.themeRootPath):
tkMessageBox.showerror(message='Theme not in root folder: '+self.themeRootPath)
print newTheme, self.themeRootPath
return
if not newTheme or (self.theme and not tkMessageBox.askokcancel(title='Loading theme', message='current theme will be lost. continue?')):
return
pathname, filename = os.path.split(newTheme)
basename, themename = os.path.split(pathname)
self.loadTheme(themename)
评论列表
文章目录