~expander => ~spacer
Andrew P.
9 years ago
284 | 284 | </packing> |
285 | 285 | </child> |
286 | 286 | <child> |
287 | <object class="GtkRadioButton" id="expander_choice"> | |
287 | <object class="GtkRadioButton" id="spacer_choice"> | |
288 | 288 | <property name="visible">True</property> |
289 | 289 | <property name="can_focus">True</property> |
290 | 290 | <property name="receives_default">False</property> |
297 | 297 | <property name="can_focus">False</property> |
298 | 298 | <property name="halign">start</property> |
299 | 299 | <property name="hexpand">True</property> |
300 | <property name="label" translatable="yes" context="indicators-dialog">Expander</property> | |
300 | <property name="label" translatable="yes" context="indicators-dialog">Spacer</property> | |
301 | 301 | <attributes> |
302 | 302 | <attribute name="weight" value="semibold"/> |
303 | 303 | </attributes> |
63 | 63 | 'clock-format': (OptionEntry.ClockFormatEntry, 'clock_format', |
64 | 64 | '%a, %H:%M'), |
65 | 65 | 'indicators': (OptionEntry.IndicatorsEntry, 'indicators', |
66 | '~host;~expander;~clock;~expander;~language;~session;~a11y;~power'), | |
66 | '~host;~spacer;~clock;~spacer;~language;~session;~a11y;~power'), | |
67 | 67 | # Position |
68 | 68 | 'position': (OptionEntry.PositionEntry, 'position', '50%,center'), |
69 | 69 | # Misc |
31 | 31 | |
32 | 32 | BUILDER_WIDGETS = ('short_choice', 'short_value', 'short_model', |
33 | 33 | 'path_choice', 'path_value', |
34 | 'expander_choice', 'separator_choice', | |
34 | 'spacer_choice', 'separator_choice', | |
35 | 35 | 'add_button', 'ok_button', 'infobar', 'message') |
36 | 36 | |
37 | 37 | def __new__(cls, check_callback=None, add_callback=None): |
68 | 68 | return self._short_value.props.text |
69 | 69 | elif self._path_choice.props.active: |
70 | 70 | return self._path_value.get_filename() |
71 | elif self._expander_choice.props.active: | |
72 | return '~expander'; | |
71 | elif self._spacer_choice.props.active: | |
72 | return '~spacer'; | |
73 | 73 | else: |
74 | 74 | return '~separator'; |
75 | 75 |
359 | 359 | class IndicatorsEntry(BaseEntry): |
360 | 360 | ROW = ModelRowEnum('NAME', 'TOOLTIP', 'EDITABLE', 'HAS_STATE', 'STATE') |
361 | 361 | NAMES_DELIMITER = ';' |
362 | DEFAULT_TOOLTIPS = {'~expander': C_('option-entry|indicators', 'Expander'), | |
362 | DEFAULT_TOOLTIPS = {'~spacer': C_('option-entry|indicators', 'Expander'), | |
363 | 363 | '~separator': C_('option-entry|indicators', 'Separator')} |
364 | 364 | |
365 | 365 | def __init__(self, widgets): |
442 | 442 | ''' Returns True if name is valid, error message or False otherwise ''' |
443 | 443 | if not name: |
444 | 444 | return False |
445 | elif name not in ('~expander', '~separator'): | |
445 | elif name not in ('~spacer', '~separator'): | |
446 | 446 | if any(row[self.ROW.NAME] == name for row in self._model): |
447 | 447 | return C_('option-entry|indicators', |
448 | 448 | 'Indicator "{indicator}" is already in the list')\ |
459 | 459 | tooltip = self.DEFAULT_TOOLTIPS.get(name, |
460 | 460 | C_('option-entry|indicators', 'Indicator: {name}') |
461 | 461 | .format(name=name)) |
462 | editable = name not in ('~expander', '~separator') | |
462 | editable = name not in ('~spacer', '~separator') | |
463 | 463 | return self.ROW(NAME=name, TOOLTIP=tooltip, EDITABLE=editable, |
464 | 464 | HAS_STATE=False, STATE=False) |
465 | 465 |