def __init__(self): self.isearch_value = "" self.isearch_type = clnch_ini.get("MISC", "isearch_type", "partial") self.migemo_pattern = None self.migemo_re_pattern = "" self.migemo_re_object = None self.migemo_re_result = None self.migemo_dll_path = clnch_ini.get("MISC", "migemo_dll_path", "") self.migemo_dict_path = clnch_ini.get("MISC", "migemo_dict_path", "")
def _configTheme(main_window): def enumThemes(): theme_list = [] theme_parent = os.path.join(ckit.getAppExePath(), "theme") theme_dir_list = os.listdir(theme_parent) for theme_dir in theme_dir_list: if os.path.exists(os.path.join(theme_parent, theme_dir, "theme.ini")): theme_list.append(theme_dir) return theme_list theme_list = enumThemes() current_theme_name = clnch_ini.get("THEME", "name", "") try: initial_select = theme_list.index(current_theme_name) except: initial_select = 0 result = clnch_listwindow.popMenu(main_window, 40, 16, "テーマ", theme_list, initial_select) if result < 0: return clnch_ini.set("THEME", "name", theme_list[result]) main_window.reloadTheme() return False
def _configTheme(main_window): def enumThemes(): theme_list = [] theme_parent = os.path.join(ckit.getAppExePath(), 'theme') theme_dir_list = os.listdir(theme_parent) for theme_dir in theme_dir_list: if os.path.exists( os.path.join(theme_parent, theme_dir, "theme.ini")): theme_list.append(theme_dir) return theme_list theme_list = enumThemes() current_theme_name = clnch_ini.get("THEME", "name", "") try: initial_select = theme_list.index(current_theme_name) except: initial_select = 0 result = clnch_listwindow.popMenu(main_window, 40, 16, "テーマ", theme_list, initial_select) if result < 0: return clnch_ini.set("THEME", "name", theme_list[result]) main_window.reloadTheme() return False
def _configDirectorySeparator(main_window): items = [] items.append(("スラッシュ : / ", "slash")) items.append(("バックスラッシュ : \\ ", "backslash")) directory_separator = clnch_ini.get("MISC", "directory_separator", "backslash") initial_select = 0 for i in range(len(items)): if items[i][1] == directory_separator: initial_select = i break result = clnch_listwindow.popMenu(main_window, 40, 16, "ディレクトリ区切り文字", items, initial_select) if result < 0: return clnch_ini.set("MISC", "directory_separator", items[result][1]) if items[result][1] == "slash": ckit.setPathSlash(True) else: ckit.setPathSlash(False)
def __init__( self ): self.isearch_value = "" self.isearch_type = clnch_ini.get( "MISC", "isearch_type", "partial" ) self.migemo_pattern = None self.migemo_re_pattern = "" self.migemo_re_object = None self.migemo_re_result = None
def load( self, section ): for i in range(100): try: item =ckit.normPath( clnch_ini.get( section, "playlist_%d"%(i,) ) ) self.items.append(item) except: break self.cursor = clnch_ini.getint( section, "track", 0 ) self.position = clnch_ini.getint( section, "position", 0 ) self.cursor = min( self.cursor, len(self.items) ) self.song_name = self.items[self.cursor] self.play() self.seek(self.position) self.pause() self.main_window.paint()
def _configFontName(main_window): font_list = main_window.enumFonts() current_font_name = clnch_ini.get("FONT", "name", "") try: initial_select = font_list.index(current_font_name) except: initial_select = 0 result = clnch_listwindow.popMenu(main_window, 40, 16, "フォント", font_list, initial_select) if result < 0: return clnch_ini.set("FONT", "name", font_list[result]) main_window.updateFont()
def load(self, section): for i in range(100): try: item = ckit.normPath( clnch_ini.get(section, "playlist_%d" % (i, ))) self.items.append(item) except: break self.cursor = clnch_ini.getint(section, "track", 0) self.position = clnch_ini.getint(section, "position", 0) self.cursor = min(self.cursor, len(self.items)) self.song_name = self.items[self.cursor] self.play() self.seek(self.position) self.pause() self.main_window.paint()
def _configAutoComplete(main_window): items = [] items.append(("自動補完しない", "0")) items.append(("自動補完する", "1")) auto_complete = clnch_ini.get("MISC", "auto_complete", "1") initial_select = 0 for i in range(len(items)): if items[i][1] == auto_complete: initial_select = i break result = clnch_listwindow.popMenu(main_window, 40, 16, "自動補完", items, initial_select) if result < 0: return clnch_ini.set("MISC", "auto_complete", items[result][1])
def _configHotKeyBehavior(main_window): items = [] items.append(("アクティブ化", "activate")) items.append(("トグル", "toggle")) hotkey_behavior = clnch_ini.get("MISC", "hotkey_behavior", "activate") initial_select = 0 for i in range(len(items)): if items[i][1] == hotkey_behavior: initial_select = i break result = clnch_listwindow.popMenu(main_window, 40, 16, "ホットキー動作設定", items, initial_select) if result < 0: return clnch_ini.set("MISC", "hotkey_behavior", items[result][1]) main_window.updateHotKey()
def _configInactive(main_window): items = [] items.append(("空欄", "empty")) items.append(("時計", "clock")) items.append(("非表示", "hide")) inactive_behavior = clnch_ini.get("MISC", "inactive_behavior", "clock") initial_select = 0 for i in range(len(items)): if items[i][1] == inactive_behavior: initial_select = i break result = clnch_listwindow.popMenu(main_window, 40, 16, "非アクティブ時の動作", items, initial_select) if result < 0: return clnch_ini.set("MISC", "inactive_behavior", items[result][1]) main_window.updateInactiveBehavior()
def _configKeyMap(main_window): items = [] items.append(("101キーボード", "101")) items.append(("106キーボード", "106")) default_keymap = clnch_ini.get("MISC", "default_keymap", "106") initial_select = 0 for i in range(len(items)): if items[i][1] == default_keymap: initial_select = i break result = clnch_listwindow.popMenu(main_window, 40, 16, "キー割り当て", items, initial_select) if result < 0: return clnch_ini.set("MISC", "default_keymap", items[result][1]) main_window.configure()
def _configTopMost(main_window): items = [] items.append(("通常", "0")) items.append(("最前面", "1")) items.append(("最前面のなかの最前面", "2")) topmost = clnch_ini.get("GEOMETRY", "topmost", "0") initial_select = 0 for i in range(len(items)): if items[i][1] == topmost: initial_select = i break result = clnch_listwindow.popMenu(main_window, 40, 16, "ウインドウの最前面表示", items, initial_select) if result < 0: return clnch_ini.set("GEOMETRY", "topmost", items[result][1]) main_window.updateTopMost()
def updateFont(self): fontname = clnch_ini.get( "FONT", "name", "" ) self.setFont( fontname, clnch_ini.getint( "FONT", "size", 12 ) ) window_rect = self.getWindowRect() self.setPosSize( window_rect[0], window_rect[1], self.width(), self.height(), 0 )