Project

Profile

Help

Revision 9083fa1b

ID9083fa1b341d2b6a5f5228017e62bf486e176401
Parent 3541bd46
Child 1eaa501a

Added by Vincent Le Goff over 3 years ago

Add the setting to go to the end of the output on pressing tab

View differences:

settings/options.conf
1
# Text-to-speech configuration
1
# Accessibility
2
[accessibility]
3
    tab_end = True
4

  
5
# Text-to-speech configuration
2 6
[TTS]
3 7
    on = True
4 8
    outside = True
src/config.py
240 240
                language = option('en', 'fr', default='{lang}')
241 241
                encoding = string(default="iso8859_15")
242 242

  
243
            [accessibility]
244
                tab_end = boolean(default=true)
245

  
243 246
            [TTS]
244 247
                on = boolean(default=True)
245 248
                outside = boolean(default=True)
src/translations/en/ui/dialog.yml
33 33
    missing_action: >
34 34
        The action field is empty.  Please specify the actions
35 35
        associated with this macro.
36
tab_end: Go to the end of output when pressing tab
src/translations/fr/ui/dialog.yml
34 34
        \ red\xE9marrer le programme pour voir ces modifications.\n"
35 35
restart: "Red\xE9marrage"
36 36
shortcut: Raccourci
37
tab_end: Descend en bas du contenu quand TAB est pressé
src/ui/dialogs/preferences.py
238 238
        sizer = wx.GridBagSizer(15, 15)
239 239
        self.SetSizer(sizer)
240 240

  
241
        # Tabbing
242
        self.tab_end = wx.CheckBox(self, label=t("ui.dialog.tab_end"))
243
        self.tab_end.SetValue(settings["options.accessibility.tab_end"])
244

  
241 245
        # TTS preferendces
242 246
        self.TTS_on = wx.CheckBox(self, label=t("ui.dialog.TTS.on"))
243 247
        self.TTS_on.SetValue(settings["options.TTS.on"])
......
245 249
        self.TTS_outside.SetValue(settings["options.TTS.outside"])
246 250

  
247 251
        # Append to the sizer
248
        sizer.Add(self.TTS_on, pos=(0, 0))
249
        sizer.Add(self.TTS_outside, pos=(0, 1))
252
        sizer.Add(self.tab_end, pos=(0, 0))
253
        sizer.Add(self.TTS_on, pos=(0, 1))
254
        sizer.Add(self.TTS_outside, pos=(0, 2))
250 255

  
251 256

  
252 257
class PreferencesTabs(wx.Notebook):
......
307 312
        old_language = settings["options.general.language"]
308 313
        settings["options.general.language"] = new_language
309 314
        settings["options.general.encoding"] = encoding
315
        tab_end = accessibility.tab_end.GetValue()
316
        settings["options.accessibility.tab_end"] = tab_end
310 317
        settings["options.TTS.on"] = accessibility.TTS_on.GetValue()
311 318
        settings["options.TTS.outside"] = accessibility.TTS_outside.GetValue()
312 319
        settings["options"].write()
src/ui/window.py
258 258
                    self.input.SetInsertionPoint(len(message) + 1)
259 259
        elif e.GetEventObject() == self.input:
260 260
            if key == wx.WXK_TAB:
261
                pass
261
                if self.engine.settings["options.accessibility.tab_end"]:
262
                    message = self.output.GetValue()
263
                    self.output.SetInsertionPoint(-1)
262 264

  
263 265
        if skip:
264 266
            e.Skip()
......
289 291
        message = message.decode(encoding, "replace")
290 292
        self.input.Clear()
291 293
        self.input.SetValue(message)
292
        self.input.SetInsertionPoint(len(message) + 1)
294
        self.input.SetInsertionPoint(-1)
293 295

  
294 296
    def HistoryGoDown(self):
295 297
        """Go down in the history."""
......
306 308
        message = message.decode(encoding, "replace")
307 309
        self.input.Clear()
308 310
        self.input.SetValue(message)
309
        self.input.SetInsertionPoint(len(message) + 1)
311
        self.input.SetInsertionPoint(-1)

Also available in: Unified diff