Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd7e729

Browse files
committed
Squashed commit of the following:
commit 76c4ec7 Author: Damien Elmes <[email protected]> Date: Fri Feb 21 18:29:41 2025 +0700 Add actions-processing based on qt-misc-processing commit a7c5376 Author: Damien Elmes <[email protected]> Date: Fri Feb 21 18:21:28 2025 +0700 Update translations commit 00cc1b4 Author: GithubAnon0000 <[email protected]> Date: Fri Feb 21 10:14:15 2025 +0000 Increase font size for accessibility (ankitects#3832) Apparently no font size should be lower than 12px, see https://www.boia.org/blog/accessibility-tips-let-users-control-font-size. With the current 55%, I get a computed font size of 8.25px though. Considering the text shows the helpful message "Press ⁨Enter⁩ to accept, ⁨Shift+Enter⁩ for new line.", I think we should add a minimum font size. commit 8ec139f Author: llama <[email protected]> Date: Fri Feb 21 17:39:11 2025 +0800 Debounce mathjax rendering to avoid stalling (ankitects#3827) * move change-timer to editable * debounce mathjax rendering commit e373b0e Author: mumtazrifai <[email protected]> Date: Fri Feb 21 04:38:04 2025 -0500 Use default flag name when flag is renamed to empty string (ankitects#3826) * Add function to restore the default name of a flag * Call function to restore default flag name if flag renamed to empty string * Update _load_flags to use the default_flag_names dict * Add name to contributors file * Add trailing comma to pass tests * Update to follow python style guide * Update about.py * Revert "Update _load_flags to use the default_flag_names dict" This reverts commit caa8fea. * Use require_refresh() instead of storing default flag names commit 2727cf3 Author: Damien Elmes <[email protected]> Date: Fri Feb 21 10:33:57 2025 +0700 Update to Rust 1.85 Edition update to follow later
1 parent f65df90 commit cd7e729

File tree

26 files changed

+42
-29
lines changed

26 files changed

+42
-29
lines changed

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ wackbyte <[email protected]>
213213
GithubAnon0000 <[email protected]>
214214
Mike Hardy <[email protected]>
215215
Danika_Dakika <https://github.com/Danika-Dakika>
216+
Mumtaz Hajjo Alrifai <[email protected]>
216217

217218
********************
218219

ftl/core/actions.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ actions-previous-card-info = Previous Card Info
7070
# input is required before it can be performed. E.g. "Export..." vs. "Delete".
7171
actions-with-ellipsis = { $action }...
7272
actions-fullscreen-unsupported = Full screen mode is not supported for your video driver. Try switching to a different one from the preferences screen.
73-
7473
actions-flag-number = Flag { $number }
7574
7675
## The same translation may used for two independent actions:
@@ -93,3 +92,4 @@ actions-nothing-to-redo = Nothing to redo
9392
actions-auto-advance = Auto Advance
9493
actions-auto-advance-activated = Auto Advance enabled
9594
actions-auto-advance-deactivated = Auto Advance disabled
95+
actions-processing = Processing...

ftl/src/string/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ fn ftl_file_from_key(old_key: &str) -> String {
8484
"deck-config",
8585
"empty-cards",
8686
"media-check",
87+
"qt-misc",
8788
] {
8889
if old_key.starts_with(&format!("{prefix}-")) {
8990
return format!("{prefix}.ftl");

qt/aqt/about.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ def on_dialog_destroyed() -> None:
214214
"Gregory Abrasaldo",
215215
"Danika_Dakika",
216216
"Marcelo Vasconcelos",
217+
"Mumtaz Hajjo Alrifai",
217218
)
218219
)
219220

qt/aqt/browser/sidebar/tree.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,9 @@ def _on_search(self, index: QModelIndex) -> None:
453453

454454
def _on_rename(self, item: SidebarItem, text: str) -> bool:
455455
new_name = text.replace('"', "")
456-
if new_name and new_name != item.name:
456+
if not new_name and item.item_type == SidebarItemType.FLAG:
457+
self.restore_default_flag_name(item)
458+
elif new_name and new_name != item.name:
457459
if item.item_type == SidebarItemType.DECK:
458460
self.rename_deck(item, new_name)
459461
elif item.item_type == SidebarItemType.SAVED_SEARCH:
@@ -1089,6 +1091,10 @@ def rename_flag(self, item: SidebarItem, new_name: str) -> None:
10891091
item.name = new_name
10901092
self.mw.flags.rename_flag(item.id, new_name)
10911093

1094+
def restore_default_flag_name(self, item: SidebarItem) -> None:
1095+
self.mw.flags.restore_default_flag_name(item.id)
1096+
item.name = self.mw.flags.get_flag(item.id).label
1097+
10921098
# Decks
10931099
###########################
10941100

qt/aqt/flags.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ def rename_flag(self, flag_index: int, new_name: str) -> None:
5555
self.mw.col.set_config("flagLabels", labels)
5656
gui_hooks.flag_label_did_change()
5757

58+
def restore_default_flag_name(self, flag_index: int) -> None:
59+
labels = self.mw.col.get_config("flagLabels", {})
60+
if str(flag_index) not in labels:
61+
return
62+
del labels[str(flag_index)]
63+
self.mw.col.set_config("flagLabels", labels)
64+
self.require_refresh()
65+
gui_hooks.flag_label_did_change()
66+
5867
def require_refresh(self) -> None:
5968
"Discard cached labels."
6069
self._flags = []

rslib/src/backend/card_rendering.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ impl BackendCardRenderingService for Backend {
3434
request.speed,
3535
&request.text,
3636
)
37-
.map(Into::into)
3837
}
3938
}

rslib/src/backend/config.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ impl crate::services::ConfigService for Collection {
7777
) -> Result<()> {
7878
let val: Value = serde_json::from_slice(&input.value_json)?;
7979
self.transact_no_undo(|col| col.set_config(input.key.as_str(), &val).map(|_| ()))
80-
.map(Into::into)
8180
}
8281

8382
fn remove_config(

rslib/src/backend/import_export.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ impl BackendImportExportService for Backend {
1818
let mut guard = self.lock_open_collection()?;
1919

2020
let col_inner = guard.take().unwrap();
21-
col_inner
22-
.export_colpkg(input.out_path, input.include_media, input.legacy)
23-
.map(Into::into)
21+
col_inner.export_colpkg(input.out_path, input.include_media, input.legacy)
2422
}
2523

2624
fn import_collection_package(
@@ -36,6 +34,5 @@ impl BackendImportExportService for Backend {
3634
Path::new(&input.media_db),
3735
self.new_progress_handler(),
3836
)
39-
.map(Into::into)
4037
}
4138
}

rslib/src/backend/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl TryFrom<anki_proto::sync::SyncAuth> for SyncAuth {
9999
impl crate::services::BackendSyncService for Backend {
100100
fn sync_media(&self, input: anki_proto::sync::SyncAuth) -> Result<()> {
101101
let auth = input.try_into()?;
102-
self.sync_media_in_background(auth, None).map(Into::into)
102+
self.sync_media_in_background(auth, None)
103103
}
104104

105105
fn media_sync_status(&self) -> Result<MediaSyncStatusResponse> {

0 commit comments

Comments
 (0)