Skip to content

Commit c885498

Browse files
committed
Clarify title insertion feature
1 parent 8a4da24 commit c885498

File tree

7 files changed

+235
-32
lines changed

7 files changed

+235
-32
lines changed

datalab/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ class ViewSection(conf.Section, metaclass=conf.SectionMeta):
201201
# - "right": right
202202
plot_toolbar_position = conf.Option()
203203

204+
# Ignore information message when inserting object title as annotation label:
205+
ignore_title_insertion_msg = conf.Option()
206+
204207
# String formatting for shape legends
205208
sig_format = conf.Option()
206209
ima_format = conf.Option()

datalab/gui/actionhandler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,12 @@ def create_first_actions(self):
692692
toolbar_pos=-1,
693693
)
694694
self.new_action(
695-
_("Add object title to plot"),
695+
_("Insert object title as annotation label"),
696696
separator=True,
697697
triggered=self.panel.add_label_with_title,
698-
tip=_("Add object title as a label to the plot"),
698+
tip=_(
699+
"Add the selected object's title as a label to the plot annotations"
700+
),
699701
)
700702
self.new_action(
701703
_("Copy titles to clipboard"),

datalab/gui/panel/base.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,4 +1957,19 @@ def add_label_with_title(self, title: str | None = None) -> None:
19571957
objs = self.objview.get_sel_objects(include_groups=True)
19581958
for obj in objs:
19591959
create_adapter_from_object(obj).add_label_with_title(title=title)
1960+
if not Conf.view.ignore_title_insertion_msg.get(False):
1961+
answer = QW.QMessageBox.information(
1962+
self,
1963+
_("Annotation added"),
1964+
_(
1965+
"The label has been added as an annotation. "
1966+
"You can edit or remove it using the annotation editing window."
1967+
"<br><br>"
1968+
"Choosing to ignore this message will prevent it "
1969+
"from being displayed again."
1970+
),
1971+
QW.QMessageBox.Ok | QW.QMessageBox.Ignore,
1972+
)
1973+
if answer == QW.QMessageBox.Ignore:
1974+
Conf.view.ignore_title_insertion_msg.set(True)
19601975
self.refresh_plot("selected", True, False)

datalab/gui/settings.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,14 @@ class ViewSettings(gds.DataSet):
233233
("right", _("Right (of plot)"), "libre-gui-arrow-right.svg"),
234234
),
235235
)
236+
ignore_title_insertion_msg = gds.BoolItem(
237+
"",
238+
_("Ignore title insertion message"),
239+
help=_(
240+
"Ignore information message when inserting object title as annotation label"
241+
),
242+
default=False,
243+
)
236244
_g0 = gds.EndGroup("")
237245

238246
g1 = gds.BeginGroup(_("Signal"))

datalab/locale/fr/LC_MESSAGES/datalab.po

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: datalab\n"
88
"Report-Msgid-Bugs-To: p.raybaut@codra.fr\n"
9-
"POT-Creation-Date: 2025-09-12 13:45+0200\n"
9+
"POT-Creation-Date: 2025-09-13 18:49+0200\n"
1010
"PO-Revision-Date: 2025-05-22 15:46+0200\n"
1111
"Last-Translator: Christophe Debonnel <c.debonnel@codra.fr>\n"
1212
"Language: fr\n"
@@ -137,10 +137,12 @@ msgstr "Supprimer les métadonnées"
137137
msgid "Delete all that is contained in object metadata"
138138
msgstr "Supprimer toutes les métadonnées liées à l'objet"
139139

140-
msgid "Add object title to plot"
141-
msgstr "Ajouter le titre de l'objet au graphique"
140+
#, fuzzy
141+
msgid "Insert object title as annotation label"
142+
msgstr "Ajouter le titre de l'objet comme étiquette au graphique"
142143

143-
msgid "Add object title as a label to the plot"
144+
#, fuzzy
145+
msgid "Add the selected object's title as a label to the plot annotations"
144146
msgstr "Ajouter le titre de l'objet comme étiquette au graphique"
145147

146148
msgid "Copy titles to clipboard"
@@ -974,6 +976,13 @@ msgstr "Tous les objets associés aux résultats doivent avoir les mêmes ROIs p
974976
msgid "Are you sure you want to delete all results of the selected object(s)?"
975977
msgstr "Êtes-vous sûr de vouloir supprimer tous les résultats des objets sélectionnés ?"
976978

979+
msgid "Annotation added"
980+
msgstr "Annotation ajoutée"
981+
982+
#, fuzzy
983+
msgid "The label has been added as an annotation. You can edit or remove it using the annotation editing window.<br><br>Choosing to ignore this message will prevent it from being displayed again."
984+
msgstr "L'étiquette a été ajoutée comme annotation. Vous pouvez la modifier ou la supprimer en utilisant la fenêtre d'édition des annotations.<br><br>Vous pouvez désactiver ce message dans les préférences ou en cliquant sur 'Ignorer' ci-dessous."
985+
977986
msgid "Macro panel"
978987
msgstr "Panneau des macros"
979988

@@ -1878,6 +1887,12 @@ msgstr "Gauche (à gauche du graphique)"
18781887
msgid "Right (of plot)"
18791888
msgstr "Droite (à droite du graphique)"
18801889

1890+
msgid "Ignore title insertion message"
1891+
msgstr "Ignorer le message d'insertion du titre"
1892+
1893+
msgid "Ignore information message when inserting object title as annotation label"
1894+
msgstr "Ignorer le message d'information lors de l'insertion du titre de l'objet en tant qu'étiquette d'annotation"
1895+
18811896
msgid "Signal"
18821897
msgstr "Signal"
18831898

doc/locale/fr/LC_MESSAGES/features/general/plugins.po

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: DataLab \n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-07-08 14:49+0200\n"
11+
"POT-Creation-Date: 2025-09-13 18:41+0200\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -227,9 +227,6 @@ msgstr "titre du nouveau signal"
227227
msgid "size of the new signal (default: None, get from current signal)"
228228
msgstr "taille du nouveau signal (par défaut : None, obtenue à partir du signal actuel)"
229229

230-
msgid "hide signal type parameter (default: True)"
231-
msgstr "masquer le paramètre de type de signal (par défaut : True)"
232-
233230
msgid "Returns"
234231
msgstr "Retourne"
235232

@@ -280,3 +277,4 @@ msgstr "Instancier et obtenir les plugins disponibles"
280277

281278
msgid "List of available plugins (as instances)"
282279
msgstr "Liste des plugins disponibles (en tant qu'instances)"
280+

0 commit comments

Comments
 (0)