mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-05-10 10:19:47 +08:00
feat: 新增导入导出功能,支持备份和恢复 PATH 配置
- 添加 import_export 模块,实现 JSON 格式的导入导出 - 在界面中添加导入和导出按钮,并配置回调函数 - 更新配置文件,增加相关文本和状态提示 - 在非管理员权限下禁用导入按钮
This commit is contained in:
@@ -84,6 +84,8 @@ int main(int argc, char **argv)
|
||||
// 检查管理员权限
|
||||
if (!check_admin())
|
||||
{
|
||||
IupMessage("警告", lua_config_get_string("status", "admin_warning"));
|
||||
|
||||
Ihandle *lbl_status = IupGetDialogChild(dlg, "LBL_STATUS");
|
||||
if (lbl_status)
|
||||
IupSetAttribute(lbl_status, "TITLE", lua_config_get_string("status", "readonly"));
|
||||
@@ -113,6 +115,13 @@ int main(int argc, char **argv)
|
||||
IupSetAttribute(btn_clean, "ACTIVE", "NO");
|
||||
if (btn_ok)
|
||||
IupSetAttribute(btn_ok, "ACTIVE", "NO");
|
||||
|
||||
Ihandle *btn_import = IupGetDialogChild(dlg, "BTN_IMPORT");
|
||||
Ihandle *btn_export = IupGetDialogChild(dlg, "BTN_EXPORT");
|
||||
if (btn_import)
|
||||
IupSetAttribute(btn_import, "ACTIVE", "NO");
|
||||
if (btn_export)
|
||||
IupSetAttribute(btn_export, "ACTIVE", "NO");
|
||||
}
|
||||
|
||||
IupShowXY(dlg, IUP_CENTER, IUP_CENTER);
|
||||
|
||||
Reference in New Issue
Block a user