Skip to content

refactor: rewrite settings to support object#858

Closed
neko-para wants to merge 110 commits intov7.0from
support-object
Closed

refactor: rewrite settings to support object#858
neko-para wants to merge 110 commits intov7.0from
support-object

Conversation

@neko-para
Copy link
Copy Markdown
Contributor

@neko-para neko-para commented Jun 5, 2021

update genSettings.py, SettingsInfo.xxx to support Object and QMap:xxx.

Description

I restructured the valuewrapper, so that it can support recursive widget.
Also, I add a SettingIter to correctly locate the SettingInfo, with extra infomation(the key of object or qmap),

Related Issues / Pull Requests

#532

Checklist

Check the old codes to see how to implement some of these:

update genSettings.py, SettingsInfo.xxx to support Object and QMap:xxx.

Still WIP yet.
@neko-para neko-para added the work in progress The work has been started and is in progress. label Jun 5, 2021
@neko-para neko-para marked this pull request as draft June 5, 2021 16:18
@neko-para
Copy link
Copy Markdown
Contributor Author

@ouuan @coder3101 As it will be a quite huge work, I'd like to know yours opinions.

@neko-para neko-para closed this Jun 5, 2021
@neko-para neko-para reopened this Jun 5, 2021
neko-para added 3 commits June 6, 2021 14:47
Use Object to emulate QMap:xxx
Fix snippets functions
Update genSettings.py
Finish MapWrapper.
Add PreferencesTemplate to replace PreferencesPageTemplate.
Fix some bugs.
@neko-para neko-para self-assigned this Jun 6, 2021
neko-para added 3 commits June 6, 2021 23:18
Now it seems to be runnable.
fix QSplitter error expanding.
fix add empty key.
add parentheses test.
@neko-para neko-para marked this pull request as ready for review June 8, 2021 13:37
neko-para added 2 commits June 9, 2021 16:04
add an extra method for SettingIter.
Fix previous dependency check.
Add setting locating methods to support depends to setting above.
@neko-para
Copy link
Copy Markdown
Contributor Author

neko-para commented Jun 9, 2021

Up to now, almost all previous features have been finished.

plans todo:

  • add a config to remove labels widget in SettingsWrapper's FormLayout
  • allow adding more specialized actions for Object
  • fix warning QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout
  • allow restricting keys of Object
  • allow Object to have non-empty default value
  • fix immediatelyApply

@ouuan
Copy link
Copy Markdown
Member

ouuan commented Jun 9, 2021

fix warning QLayout: Attempting to add QLayout "" to QWidget "", which already has a layout

#541 (comment)

Use xxx@ to store keys of Objects.
allow select specified keys.
allow regex checking.
now we can use object and array in param.
@neko-para
Copy link
Copy Markdown
Contributor Author

neko-para commented Jun 10, 2021

Here comes a problem. QVariant cannot store function. It'll be hard to solve adding more specialized actions for Object by param.
Maybe add an extra key in settings info to store functions(e.g. QMap<QString, std::function<QVariant(QVariant)>>), and onApply could also use it.

fix immediatelyApply
@neko-para
Copy link
Copy Markdown
Contributor Author

neko-para commented Jun 11, 2021

I think it's not a good idea to store methods in json. Some of actions are quite long(e.g. import snippets from file), and you have to write all these things in a json string. We could add an extra source code to store all these functions, and let py link them to setting info.


After all, we can just include a header in settinginfo.cpp and call them directly in the lambda py generated.

Add SettingsMethods to store complex functions.
Add some methods to MapWrapper.
Move docLink of checkbox to the old place.
@coder3101
Copy link
Copy Markdown
Member

Yes, vcpkg is a general package manager for c++. These changes will certainly need some changes in release pipeline as well. Like does vcpkg builds as shared library? If yes we need to add to exe bundle.

@neko-para
Copy link
Copy Markdown
Contributor Author

Yes, vcpkg is a general package manager for c++. These changes will certainly need some changes in release pipeline as well. Like does vcpkg builds as shared library? If yes we need to add to exe bundle.

Yes, it is a dll. I'll add it to the bundle later. I'd like to check the deb first.

@neko-para
Copy link
Copy Markdown
Contributor Author

Actually I'm wondering why there isn't a script to build the deb? We write every commands in the workflow.

@neko-para neko-para requested a review from coder3101 July 27, 2021 10:28
@neko-para
Copy link
Copy Markdown
Contributor Author

I've add the shared library on windows to the exe bundle.

@coder3101
Copy link
Copy Markdown
Member

We should merge master to this branch, and check if all release components like Deb, exe, DMG are working. Take help from @swift-zym he has macOS.

@neko-para
Copy link
Copy Markdown
Contributor Author

Why there is target_link_libraries(diff_match_patch PRIVATE Qt5::Core) in CMakeLists.txt? After auto merge it come up, but I cannot find the reason.

update translations.
@ouuan
Copy link
Copy Markdown
Member

ouuan commented Jul 31, 2021

Why there is target_link_libraries(diff_match_patch PRIVATE Qt5::Core) in CMakeLists.txt? After auto merge it come up, but I cannot find the reason.

I tried the merge and there's a conflict in CMakeLists.txt. Maybe you incorrectly resolved it.

@neko-para
Copy link
Copy Markdown
Contributor Author

I reset to previous and find out that it has been there before. It may come from older commit.

@neko-para
Copy link
Copy Markdown
Contributor Author

This code is from f52c378

@neko-para
Copy link
Copy Markdown
Contributor Author

After all, we have solved it. @ouuan Do you know anything about that AUR build test? It breaks again.

@ouuan
Copy link
Copy Markdown
Member

ouuan commented Jul 31, 2021

@ouuan Do you know anything about that AUR build test? It breaks again.

You can try giving gen_settings a separate CMakeLists.txt.

@neko-para
Copy link
Copy Markdown
Contributor Author

This looks strange. src/Settings/CMakeLists.txt is supposed to build the whole src/Settings directory. I suggest moving genSettings.cpp to a new directory src/Settings/GenSettings or somewhere else.

Maybe src/Settings/gen?

Copy link
Copy Markdown
Member

@coder3101 coder3101 left a comment

Choose a reason for hiding this comment

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

Sync with master and We can approve it.

@neko-para
Copy link
Copy Markdown
Contributor Author

@coder3101 After some talks with @ouuan, he suggests me to revert and create better-described commits for those changed files. I think it's good and I'll do it later.

@neko-para neko-para marked this pull request as draft August 4, 2021 08:19
@neko-para
Copy link
Copy Markdown
Contributor Author

I'll create a new PR and this PR could be the logs.

neko-para added a commit that referenced this pull request Aug 4, 2021
Plz refer to old PR #858 for details.
@ouuan
Copy link
Copy Markdown
Member

ouuan commented Aug 6, 2021

Close this in favor of #955.

@ouuan ouuan closed this Aug 6, 2021
@coder3101 coder3101 removed this from the v7.0 milestone Aug 6, 2021
@coder3101 coder3101 deleted the support-object branch June 16, 2022 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting for translation:RU Associated PR is waiting for russian translations to be updated

Projects

None yet

3 participants