Skip to content

Commit

Permalink
File Area: Fix Open Files - Opening Non-text Files - Do not show this…
Browse files Browse the repository at this point in the history
… again
  • Loading branch information
BLKSerene committed Oct 30, 2024
1 parent d9a412f commit 1968128
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

### 📌 Bugfixes
- File Area: Fix Open Files - Encoding
- File Area: Fix Open Files - Opening Non-text Files - Do not show this again
- Utils: Fix Wordless's Japanese kanji tokenizer

## [3.5.0](https://github.com/BLKSerene/Wordless/releases/tag/3.5.0) - 07/01/2024
Expand Down
12 changes: 6 additions & 6 deletions wordless/wl_file_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,17 +799,17 @@ def __init__(self, main):
self
)

self.checkbox_dont_show_this_again = QCheckBox(self.tr('Do not show this again'), self)
self.checkbox_do_not_show_this_again = QCheckBox(self.tr('Do not show this again'), self)
self.button_proceed = QPushButton(self.tr('Proceed'), self)
self.button_abort = QPushButton(self.tr('Abort'), self)

self.checkbox_dont_show_this_again.stateChanged.connect(self.dont_show_this_again_changed)
self.checkbox_do_not_show_this_again.stateChanged.connect(self.do_not_show_this_again_changed)
self.button_proceed.clicked.connect(self.accept)
self.button_abort.clicked.connect(self.reject)

self.layout_info.addWidget(self.label_opening_non_text_files, 0, 0)

self.layout_buttons.addWidget(self.checkbox_dont_show_this_again, 0, 0)
self.layout_buttons.addWidget(self.checkbox_do_not_show_this_again, 0, 0)
self.layout_buttons.addWidget(self.button_proceed, 0, 2)
self.layout_buttons.addWidget(self.button_abort, 0, 3)

Expand All @@ -820,12 +820,12 @@ def __init__(self, main):
def load_settings(self):
settings = copy.deepcopy(self.main.settings_custom['files']['misc_settings'])

self.checkbox_dont_show_this_again.setChecked(settings['display_warning_when_opening_nontext_files'])
self.checkbox_do_not_show_this_again.setChecked(not settings['display_warning_when_opening_nontext_files'])

def dont_show_this_again_changed(self):
def do_not_show_this_again_changed(self):
settings = self.main.settings_custom['files']['misc_settings']

settings['display_warning_when_opening_nontext_files'] = self.checkbox_dont_show_this_again.isChecked()
settings['display_warning_when_opening_nontext_files'] = not self.checkbox_do_not_show_this_again.isChecked()

# Reference: https://github.com/python-openxml/python-docx/issues/40#issuecomment-1793226714
def iter_block_items(blkcntnr):
Expand Down

0 comments on commit 1968128

Please sign in to comment.