Skip to content

Commit 4638ed7

Browse files
committed
v5.0.1
1 parent a7b76c1 commit 4638ed7

6 files changed

Lines changed: 54 additions & 1 deletion

File tree

src/songpressPlusPlus/MyPreferencesDialog.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ def _make_flag_bmp(lang_code):
198198
self.hideIntroChordCB.SetValue(getattr(self.pref, 'hideIntroChord', False))
199199
self.hideBridgeCB.SetValue(getattr(self.pref, 'hideBridge', False))
200200
self.hideGridCB.SetValue(getattr(self.pref, 'hideGrid', False))
201+
self.hideTempoCB.SetValue(getattr(self.pref, 'hideTempo', False))
202+
self.hideTimeCB.SetValue(getattr(self.pref, 'hideTime', False))
201203

202204
# Viewer guida rapida
203205
viewer = getattr(self.pref, 'guideViewer', 'markdown')
@@ -1321,6 +1323,8 @@ def OnOk(self, evt):
13211323
self.pref.hideIntroChord = self.hideIntroChordCB.GetValue()
13221324
self.pref.hideBridge = self.hideBridgeCB.GetValue()
13231325
self.pref.hideGrid = self.hideGridCB.GetValue()
1326+
self.pref.hideTempo = self.hideTempoCB.GetValue()
1327+
self.pref.hideTime = self.hideTimeCB.GetValue()
13241328
# Applica subito sul previewCanvas se disponibile
13251329
if self._previewCanvas is not None:
13261330
self._previewCanvas.SetShowPageIndicator(self.pref.showPageIndicator)

src/songpressPlusPlus/Preferences.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,13 +595,17 @@ def _rb(key, default):
595595
self.hideIntroChord = _rb('hideIntroChord', False)
596596
self.hideBridge = _rb('hideBridge', False)
597597
self.hideGrid = _rb('hideGrid', False)
598+
self.hideTempo = _rb('hideTempo', False)
599+
self.hideTime = _rb('hideTime', False)
598600
self.config.SetPath('/')
599601

600602
def _SaveNoChordHide(self):
601603
self.config.SetPath('/Format')
602604
self.config.Write('hideIntroChord', '1' if getattr(self, 'hideIntroChord', False) else '0')
603605
self.config.Write('hideBridge', '1' if getattr(self, 'hideBridge', False) else '0')
604606
self.config.Write('hideGrid', '1' if getattr(self, 'hideGrid', False) else '0')
607+
self.config.Write('hideTempo', '1' if getattr(self, 'hideTempo', False) else '0')
608+
self.config.Write('hideTime', '1' if getattr(self, 'hideTime', False) else '0')
605609
self.config.SetPath('/')
606610

607611
def SetChorusLabel(self, c):

src/songpressPlusPlus/PreferencesDialog.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,24 @@ def _load_btn_icon(filename):
700700
)
701701
grpNoChords.Add(self.hideGridCB, 0, wx.LEFT | wx.RIGHT | wx.BOTTOM, 5)
702702

703+
self.hideTempoCB = wx.CheckBox(
704+
self.songpressPanel, wx.ID_ANY,
705+
_(u"Tempo {tempo_m}\\{tempo_s}\\{tempo_sp}\\{tempo_c}\\{tempo_cp}")
706+
)
707+
self.hideTempoCB.SetToolTip(
708+
_(u"Hide {tempo_m}, {tempo_s}, {tempo_sp}, {tempo_c}, {tempo_cp} directives when no chords are shown.")
709+
)
710+
grpNoChords.Add(self.hideTempoCB, 0, wx.LEFT | wx.RIGHT | wx.BOTTOM, 5)
711+
712+
self.hideTimeCB = wx.CheckBox(
713+
self.songpressPanel, wx.ID_ANY,
714+
_(u"Time signature {time}")
715+
)
716+
self.hideTimeCB.SetToolTip(
717+
_(u"Hide {time:...} directives when no chords are shown.")
718+
)
719+
grpNoChords.Add(self.hideTimeCB, 0, wx.LEFT | wx.RIGHT | wx.BOTTOM, 5)
720+
703721
bSizerSongpress.Add(grpNoChords, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM, 8)
704722

705723
self.songpressPanel.SetSizer(bSizerSongpress)

src/songpressPlusPlus/SongpressFrame.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4009,6 +4009,8 @@ def _strip_nochords_blocks(self, text):
40094009
hideIntroChord : {start_chord} ... {end_chord}
40104010
hideBridge : {start_bridge} / {start_of_bridge} ... {end_bridge}
40114011
hideGrid : {start_of_grid} / {sog} / {grid} ... {end_of_grid}
4012+
hideTempo : {tempo_m} / {tempo_s} / {tempo_sp} / {tempo_c} / {tempo_cp}
4013+
hideTime : {time}
40124014
"""
40134015
import re
40144016

@@ -4026,7 +4028,14 @@ def _strip_nochords_blocks(self, text):
40264028
open_tags.update(('start_of_grid', 'sog', 'grid'))
40274029
close_tags.add('end_of_grid')
40284030

4029-
if not open_tags:
4031+
# Tag singoli (direttive non-paired) da rimuovere riga per riga
4032+
single_tags = set()
4033+
if getattr(self.pref, 'hideTempo', False):
4034+
single_tags.update(('tempo_m', 'tempo_s', 'tempo_sp', 'tempo_c', 'tempo_cp'))
4035+
if getattr(self.pref, 'hideTime', False):
4036+
single_tags.add('time')
4037+
4038+
if not open_tags and not single_tags:
40304039
return text
40314040

40324041
# Regex che riconosce qualsiasi direttiva ChordPro: {tag} o {tag:label}
@@ -4045,6 +4054,8 @@ def _strip_nochords_blocks(self, text):
40454054
inside = True
40464055
depth = 1
40474056
# la riga di apertura viene scartata
4057+
elif tag in single_tags:
4058+
pass # riga con direttiva singola viene scartata
40484059
else:
40494060
result.append(line)
40504061
else:
572 Bytes
Binary file not shown.

src/songpressPlusPlus/locale/it/LC_MESSAGES/PreferencesDialog.po

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,3 +721,19 @@ msgstr "Griglia {start_of_grid}\\{end_of_grid}"
721721
#: PreferencesDialog.py songpress tab — hide grid tooltip
722722
msgid "Hide {start_of_grid}…{end_of_grid} blocks when no chords are shown."
723723
msgstr "Nasconde i blocchi {start_of_grid}…{end_of_grid} quando gli accordi sono disabilitati."
724+
725+
#: PreferencesDialog.py songpress tab — hide tempo checkbox
726+
msgid "Tempo {tempo_m}\\{tempo_s}\\{tempo_sp}\\{tempo_c}\\{tempo_cp}"
727+
msgstr "Tempo {tempo_m}\\{tempo_s}\\{tempo_sp}\\{tempo_c}\\{tempo_cp}"
728+
729+
#: PreferencesDialog.py songpress tab — hide tempo tooltip
730+
msgid "Hide {tempo_m}, {tempo_s}, {tempo_sp}, {tempo_c}, {tempo_cp} directives when no chords are shown."
731+
msgstr "Nasconde le direttive {tempo_m}, {tempo_s}, {tempo_sp}, {tempo_c}, {tempo_cp} quando gli accordi sono disabilitati."
732+
733+
#: PreferencesDialog.py songpress tab — hide time checkbox
734+
msgid "Time signature {time}"
735+
msgstr "Indicazione di tempo {time}"
736+
737+
#: PreferencesDialog.py songpress tab — hide time tooltip
738+
msgid "Hide {time:...} directives when no chords are shown."
739+
msgstr "Nasconde le direttive {time:...} quando gli accordi sono disabilitati."

0 commit comments

Comments
 (0)