📄 chmsee_config.c
字号:
/*************************************************************************** * Copyright (C) 2003 by zhong * * zhongz@163.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/#include <sys/types.h>#include <unistd.h>//#include <dirent.h>#include <sys/stat.h>#include <string.h>#include <stdio.h>#include <stdlib.h>#include <gtk/gtk.h>#include "interface.h"#include "chmsee_config.h"void chmsee_init_config(ChmSee *window) { gchar *chmsee_home; chmsee_home = g_strdup_printf("%s/%s",g_get_home_dir(), ".chmsee"); if (!g_file_test (chmsee_home, G_FILE_TEST_IS_DIR)) { mkdir(chmsee_home, 0777); } window->last_dir = g_strdup_printf("%s/%s",chmsee_home, "chmsee_lastdir"); window->bookmarks = g_strdup_printf("%s/%s",chmsee_home, "chmsee_bookmark"); window->last_chm = g_strdup_printf("%s/%s",chmsee_home, "chmsee_lastchm"); g_print("Init Done\n");}void chmsee_load_last_chm_file(FILE *scpItem){}void chmsee_save_last_chm_file(FILE *scpItem){}gchar *chmsee_load_last_chm_dir(ChmSee *window){ gchar *get_dir = NULL; if (!g_file_test (window->last_dir, G_FILE_TEST_EXISTS)) { return (get_dir); } FILE *fp; char lineBuf[256]; fp = fopen(window->last_dir, "r"); if (!fp) { return (get_dir); } while(fgets(lineBuf,512,fp)!=NULL) { get_dir = g_strdup_printf("%s/", lineBuf); } fclose(fp); return (get_dir);}void chmsee_save_last_chm_dir(ChmSee *window, gchar *path){ FILE *file; file = fopen(window->last_dir, "w"); fprintf(file, path); fclose(file);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -