Skip to content

Commit ea464d4

Browse files
author
shrey
committed
rename remote to central and change tooltip
1 parent a8e4bb8 commit ea464d4

File tree

7 files changed

+32
-30
lines changed

7 files changed

+32
-30
lines changed

datashuttle/configs/canonical_configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def get_tui_config_defaults() -> Dict:
242242
"bypass_validation": False,
243243
"overwrite_existing_files": "never",
244244
"dry_run": False,
245-
"suggest_next_sub_ses_remote": False,
245+
"suggest_next_sub_ses_central": False,
246246
}
247247
}
248248

datashuttle/datashuttle_class.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ def _update_settings_with_new_canonical_keys(self, settings: Dict):
15501550
for key in [
15511551
"overwrite_existing_files",
15521552
"dry_run",
1553-
"suggest_next_sub_ses_remote",
1553+
"suggest_next_sub_ses_central",
15541554
]:
15551555
if key not in settings["tui"]:
15561556
settings["tui"][key] = canonical_tui_configs["tui"][key]

datashuttle/tui/css/tui_menu.tcss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ ConfirmAndAwaitTransferPopup {
445445

446446
/* Suggesting Screen --------------------------------------------------------------------- */
447447

448-
SearchingRemoteForNextSubSesPopup {
448+
SearchingCentralForNextSubSesPopup {
449449
align: center middle;
450450
}
451451

datashuttle/tui/screens/create_folder_settings.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ def compose(self) -> ComposeResult:
8686
"""
8787

8888
bypass_validation = self.interface.tui_settings["bypass_validation"]
89-
suggest_next_sub_ses_remote = self.interface.tui_settings[
90-
"suggest_next_sub_ses_remote"
89+
suggest_next_sub_ses_central = self.interface.tui_settings[
90+
"suggest_next_sub_ses_central"
9191
]
9292

9393
yield Container(
@@ -104,9 +104,9 @@ def compose(self) -> ComposeResult:
104104
),
105105
Container(
106106
Checkbox(
107-
"Search Remote For Suggestions",
108-
value=suggest_next_sub_ses_remote,
109-
id="suggest_next_sub_ses_remote",
107+
"Search Central For Suggestions",
108+
value=suggest_next_sub_ses_central,
109+
id="suggest_next_sub_ses_central",
110110
),
111111
Checkbox(
112112
"Bypass validation",
@@ -157,7 +157,7 @@ def on_mount(self) -> None:
157157
"#create_folders_settings_toplevel_select",
158158
"#create_folders_settings_bypass_validation_checkbox",
159159
"#template_settings_validation_on_checkbox",
160-
"#suggest_next_sub_ses_remote",
160+
"#suggest_next_sub_ses_central",
161161
]:
162162
self.query_one(id).tooltip = get_tooltip(id)
163163

@@ -248,9 +248,9 @@ def on_checkbox_changed(self, event: Checkbox.Changed) -> None:
248248
self.query_one("#template_inner_container").disabled = (
249249
disable_container
250250
)
251-
elif event.checkbox.id == "suggest_next_sub_ses_remote":
251+
elif event.checkbox.id == "suggest_next_sub_ses_central":
252252
self.interface.save_tui_settings(
253-
is_on, "suggest_next_sub_ses_remote"
253+
is_on, "suggest_next_sub_ses_central"
254254
)
255255

256256
def on_radio_set_changed(self, event: RadioSet.Changed) -> None:

datashuttle/tui/screens/modal_dialogs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from textual.worker import Worker
1111

1212
from datashuttle.tui.app import TuiApp
13-
from datashuttle.utils.custom_types import InterfaceOutput
13+
from datashuttle.utils.custom_types import InterfaceOutput, Prefix
1414

1515
from pathlib import Path
1616

@@ -137,11 +137,11 @@ async def handle_transfer_and_update_ui_when_complete(self) -> None:
137137
self.app.show_modal_error_dialog(output)
138138

139139

140-
class SearchingRemoteForNextSubSesPopup(ModalScreen):
140+
class SearchingCentralForNextSubSesPopup(ModalScreen):
141141

142142
def __init__(self, sub_or_ses: Prefix) -> None:
143143
super().__init__()
144-
self.message = f"Searching remote for next {sub_or_ses}"
144+
self.message = f"Searching central for next {sub_or_ses}"
145145

146146
def compose(self) -> ComposeResult:
147147
yield Container(

datashuttle/tui/tabs/create_folders.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
DisplayedDatatypesScreen,
3434
)
3535
from datashuttle.tui.screens.modal_dialogs import (
36-
SearchingRemoteForNextSubSesPopup,
36+
SearchingCentralForNextSubSesPopup,
3737
)
3838
from datashuttle.tui.tooltips import get_tooltip
3939
from datashuttle.tui.utils.tui_decorators import require_double_click
@@ -51,8 +51,8 @@ def __init__(self, mainwindow: TuiApp, interface: Interface) -> None:
5151
)
5252
self.mainwindow = mainwindow
5353
self.interface = interface
54-
self.searching_remote_popup: (
55-
SearchingRemoteForNextSubSesPopup | None
54+
self.searching_central_popup_widget: (
55+
SearchingCentralForNextSubSesPopup | None
5656
) = None
5757

5858
self.prev_click_time = 0.0
@@ -166,7 +166,7 @@ def on_clickable_input_clicked(
166166
self.fill_input_with_template(prefix, input_id)
167167
else:
168168
include_central = self.interface.get_tui_settings()[
169-
"suggest_next_sub_ses_remote"
169+
"suggest_next_sub_ses_central"
170170
]
171171

172172
self.suggest_next_sub_ses_with_popup(
@@ -372,17 +372,19 @@ async def fill_suggestion_and_dismiss_popup(
372372
prefix, input_id, include_central
373373
)
374374
await worker.wait()
375-
if self.searching_remote_popup:
376-
self.searching_remote_popup.dismiss()
377-
self.searching_remote_popup = None
375+
if self.searching_central_popup_widget:
376+
self.searching_central_popup_widget.dismiss()
377+
self.searching_central_popup_widget = None
378378

379379
def suggest_next_sub_ses_with_popup(
380380
self, prefix: Prefix, input_id: str, include_central: bool
381381
):
382382
if include_central:
383-
searching_remote_popup = SearchingRemoteForNextSubSesPopup(prefix)
384-
self.searching_remote_popup = searching_remote_popup
385-
self.mainwindow.push_screen(searching_remote_popup)
383+
searching_central_popup = SearchingCentralForNextSubSesPopup(
384+
prefix
385+
)
386+
self.searching_central_popup_widget = searching_central_popup
387+
self.mainwindow.push_screen(searching_central_popup)
386388

387389
asyncio.create_task(
388390
self.fill_suggestion_and_dismiss_popup(
@@ -450,10 +452,10 @@ def update_directorytree_root(self, new_root_path: Path) -> None:
450452
def dismiss_popup_and_show_modal_error_dialog_from_thread(
451453
self, message: str
452454
) -> None:
453-
if self.searching_remote_popup:
455+
if self.searching_central_popup_widget:
454456
self.mainwindow.call_from_thread(
455-
self.searching_remote_popup.dismiss
457+
self.searching_central_popup_widget.dismiss
456458
)
457-
self.searching_remote_popup = None
459+
self.searching_central_popup_widget = None
458460

459461
self.mainwindow.show_modal_error_dialog_from_main_thread(message)

datashuttle/tui/tooltips.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ def get_tooltip(id: str) -> str:
127127
elif id == "#create_folders_settings_toplevel_select":
128128
tooltip = "The top-level-folder to create folders in."
129129

130-
elif id == "#suggest_next_sub_ses_remote":
130+
elif id == "#suggest_next_sub_ses_central":
131131
tooltip = (
132-
"Search the remote project folder for folder suggestions. "
133-
"Slow compared to a local search."
132+
"Search the central project folder when suggesting the next subject or session."
133+
"May be slower compared than searching local only."
134134
)
135135
# bypass validation checkbox
136136
elif id == "#create_folders_settings_bypass_validation_checkbox":

0 commit comments

Comments
 (0)