Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解决在导出字典文件后,出现多个explorer进程的问题,并且升级文件对话框为 Win7 样式 #1193

Merged
merged 3 commits into from
Apr 21, 2024

Conversation

ccyybn
Copy link
Contributor

@ccyybn ccyybn commented Apr 16, 2024

旧对话框的字体粗细很怪

Snipaste_2024-04-16_15-38-46

新样式

Snipaste_2024-04-18_02-57-34

@ccyybn ccyybn force-pushed the weasel_dict_manager branch 2 times, most recently from a0bee66 to 021dd74 Compare April 16, 2024 08:31
@fxliang
Copy link
Contributor

fxliang commented Apr 16, 2024

用资源文件处理字符串表的项,另外那些原来未删除的确认无用的注释删除 了吧

…file, updating the file dialog box to win7 style.
@fxliang
Copy link
Contributor

fxliang commented Apr 16, 2024

已经是cpp17标准,直接用std::filesystem::path来处理路径更简单安全

@ccyybn
Copy link
Contributor Author

ccyybn commented Apr 16, 2024

@fxliang 搞定了

Copy link
Member

@lotem lotem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

威武

@ccyybn ccyybn force-pushed the weasel_dict_manager branch 2 times, most recently from 3144b54 to 939abca Compare April 17, 2024 20:08
@ccyybn
Copy link
Contributor Author

ccyybn commented Apr 17, 2024

传入 COMDLG_FILTERSPEC 的文件类型名称,第一项不能为CString,否则对话框的第一项,有小概率变成奇怪的随机字符串,目前已通过将其转换为 const std::wstring 解决

https://github.com/rime/weasel/compare/3144b54771166d3bdab8762b6f0ec7c2100cfcee..939abcad0397af5658c1b4de1fa7d501d7c1b9d0

image
image

@fxliang fxliang merged commit f877364 into rime:master Apr 21, 2024
1 check passed
@ccyybn
Copy link
Contributor Author

ccyybn commented Apr 21, 2024

@fxliang 可能 filepath 也要处理一下(替换成反斜杠 \),如果用户在 sync_dir 里面配置的是 正斜杠 sync_dir: C:/Users/oo/Desktop,不处理的话 输出词典快照 打开的始终是 Documents文件夹

image

image

@fxliang
Copy link
Contributor

fxliang commented Apr 21, 2024

是指这样吗

distribution_code_name: Weasel
distribution_name: "小狼毫"
distribution_version: 0.15.0.0
install_time: "Sat May 28 13:58:04 2022"
installation_id: office_pc
rime_version: 1.11.0
update_time: "Tue Apr 16 20:05:13 2024"
syn_dir: "C:/Users/DELL/Desktop/weasel/data中文/sync"

filesystem::path自动处理路径分隔符的

@ccyybn
Copy link
Contributor Author

ccyybn commented Apr 21, 2024

是指这样吗

distribution_code_name: Weasel
distribution_name: "小狼毫"
distribution_version: 0.15.0.0
install_time: "Sat May 28 13:58:04 2022"
installation_id: office_pc
rime_version: 1.11.0
update_time: "Tue Apr 16 20:05:13 2024"
syn_dir: "C:/Users/DELL/Desktop/weasel/data中文/sync"

filesystem::path自动处理路径分隔符的

是的,但是上面应该只有directory被处理了吧,filepath作为被选中的文件没有处理也会出问题

@fxliang
Copy link
Contributor

fxliang commented Apr 21, 2024

是指这样吗

distribution_code_name: Weasel
distribution_name: "小狼毫"
distribution_version: 0.15.0.0
install_time: "Sat May 28 13:58:04 2022"
installation_id: office_pc
rime_version: 1.11.0
update_time: "Tue Apr 16 20:05:13 2024"
syn_dir: "C:/Users/DELL/Desktop/weasel/data中文/sync"

filesystem::path自动处理路径分隔符的

是的,但是上面应该只有directory被处理了吧,filepath作为被选中的文件没有处理也会出问题

怎么复现?我目前没有复现你描述的问题

fxliang added a commit that referenced this pull request Apr 21, 2024
@ccyybn
Copy link
Contributor Author

ccyybn commented Apr 21, 2024

是指这样吗

distribution_code_name: Weasel
distribution_name: "小狼毫"
distribution_version: 0.15.0.0
install_time: "Sat May 28 13:58:04 2022"
installation_id: office_pc
rime_version: 1.11.0
update_time: "Tue Apr 16 20:05:13 2024"
syn_dir: "C:/Users/DELL/Desktop/weasel/data中文/sync"

filesystem::path自动处理路径分隔符的

是的,但是上面应该只有directory被处理了吧,filepath作为被选中的文件没有处理也会出问题

怎么复现?我目前没有复现你描述的问题

2024-04-21-05-58-04.mp4

@ccyybn
Copy link
Contributor Author

ccyybn commented Apr 21, 2024

@fxliang 这个视频前半部分就是有问题的正斜杠 / 演示,后面配置里改成反斜杠 \ 就好了

@fxliang
Copy link
Contributor

fxliang commented Apr 21, 2024

@fxliang 这个视频前半部分就是有问题的正斜杠 / 演示,后面配置里改成反斜杠 \ 就好了

似乎是,但是为什么这里path没成功,没理解。或者我再试试或看时间revert 掉那个commit

@ccyybn
Copy link
Contributor Author

ccyybn commented Apr 21, 2024

@fxliang 这个视频前半部分就是有问题的正斜杠 / 演示,后面配置里改成反斜杠 \ 就好了

似乎是,但是为什么这里path没成功,没理解。或者我再试试或看时间revert 掉那个commit

  std::wstring directory = std::filesystem::path(filepath).parent_path().wstring();

如果上面这行代码不会把 filepath 自身里面的斜杠替换 , 那下面用 filepath 的时候就会出问题

std::vector v;
v.push_back(ILCreateFromPath(filepath.c_str()));
SHOpenFolderAndSelectItems(folder, v.size(), (LPCITEMIDLIST*)v.data(), 0);

@fxliang
Copy link
Contributor

fxliang commented Apr 22, 2024

@fxliang 这个视频前半部分就是有问题的正斜杠 / 演示,后面配置里改成反斜杠 \ 就好了

似乎是,但是为什么这里path没成功,没理解。或者我再试试或看时间revert 掉那个commit

  std::wstring directory = std::filesystem::path(filepath).parent_path().wstring();

如果上面这行代码不会把 filepath 自身里面的斜杠替换 , 那下面用 filepath 的时候就会出问题

std::vector v; v.push_back(ILCreateFromPath(filepath.c_str())); SHOpenFolderAndSelectItems(folder, v.size(), (LPCITEMIDLIST*)v.data(), 0);

我没有理解的是下面的filepath同样用filesystem::path处理,不行,上面folder的可以。先不理了,我revert了那个修改的commit了

@lotem
Copy link
Member

lotem commented Apr 22, 2024

ILCreateFromPath(filepath.c_str())

不要自己手動替換分隔符。試試在給出字符串路徑之前調用 path::make_preferred

wxyzh pushed a commit to wxyzh/weasel that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants