Skip to content

feat: add option to disable CF Tool#1439

Merged
coder3101 merged 9 commits into
cpeditor:masterfrom
yushiuan9499:master
Jun 7, 2025
Merged

feat: add option to disable CF Tool#1439
coder3101 merged 9 commits into
cpeditor:masterfrom
yushiuan9499:master

Conversation

@yushiuan9499

Copy link
Copy Markdown
Contributor

Description

I add a option to disable the CF Tool.
The enable/disable checkbox is at Preferences > Extensions > CF Tool.
If it is disable, the submit button will be hidden and the cf tool won't be checked (so won't show the warning).

Also, I add the Traditional Chinese translations for the descriptions of the checkbox.

Related Issues / Pull Requests

ref #1413

Motivation and Context

How Has This Been Tested?

OS: Ubuntu 24.04
Language: English&zh-TW (To check the translation)

  1. Use Competitive Companion to get the problems on Codeforces and atcoder.
  2. Toggle the enable CF Tool option.
  3. Add another codeforces problem.
  4. Toggle the enable CF Tool option.

Screenshots (if appropriate)

Checklist

  • If the key of a setting is changed, the old attribute is updated or it is resolved in SettingsUpdater.
  • If there are changes of the text displayed in the UI, they are wrapped in tr() or QCoreApplication::translate().
  • If needed, I have opened a pull request or an issue to update the documentation.
  • If these changes are notable, they are documented in CHANGELOG.md.

Additional text

@coder3101 coder3101 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In apply setting, If CF tool is disabled you can delete all its pointers (and UI), if enabled you can create new pointers and UI by calling setupCFTool.

Comment thread src/Settings/settings.json
@yushiuan9499

Copy link
Copy Markdown
Contributor Author

Sorry, I cannot find setupCFTool. Do you mean setCFToolUI?

@coder3101

Copy link
Copy Markdown
Member

yes

  add a function called removeCFToolUI to remove submit button from ui
  and delete pointers related to cf tool
@yushiuan9499

Copy link
Copy Markdown
Contributor Author

I have push the commits.

The depends fields are added in CF/Path and CF/Show Toast Messages.
And I write a function called removeCFToolUI, which will remove the submit button from ui
and delete cftool & submitToCodeforces pointers

Comment thread src/Settings/settings.json Outdated
Comment thread src/mainwindow.cpp
Comment thread src/Settings/PreferencesWindow.cpp Outdated
Co-authored-by: Ashar <coder3101@users.noreply.github.com>
Comment thread src/Settings/PreferencesWindow.cpp
@coder3101

Copy link
Copy Markdown
Member

Once last thing, Under "Added" section of CHANGELOG.md document this change. You can follow the same format we follow for other changes. Thanks for your contribution!

@yushiuan9499

Copy link
Copy Markdown
Contributor Author

Ok, I will add it.

@coder3101 coder3101 linked an issue Jun 7, 2025 that may be closed by this pull request
5 tasks
@coder3101 coder3101 enabled auto-merge (squash) June 7, 2025 14:09
@coder3101 coder3101 merged commit ac3c17a into cpeditor:master Jun 7, 2025
8 checks passed
@coder3101

Copy link
Copy Markdown
Member

@all-contributors please add @yushiuan9499 for code

@ouuan

ouuan commented Jun 7, 2025

Copy link
Copy Markdown
Member

@all-contributors please add @yushiuan9499 for code

@coder3101

Copy link
Copy Markdown
Member

Bot seems upset, it won't respond to us any more. 🤣 On another note, I would propose removing it and all contributors files as GitHub's contribution page already include code and translation contributions

@ouuan

ouuan commented Jun 7, 2025

Copy link
Copy Markdown
Member

On another note, I would propose removing it and all contributors files as GitHub's contribution page already include code and translation contributions

The GitHub contributor page is always there, and the rationale is to include more than code (commit) contributors. However, I agree that we may remove it if the bot always fails.

@yushiuan9499 yushiuan9499 deleted the master branch June 8, 2025 04:44
@yushiuan9499 yushiuan9499 restored the master branch June 8, 2025 04:47
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.

Option to disable CF Tool

3 participants