andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

Add: Allow first-letter keypresses, not just Alt+keypress, to click buttons #174

Closed bjones1 closed 10 years ago

bjones1 commented 10 years ago

...on the save files dialog box.

Fixes #168.

andreikop commented 10 years ago

Bryan, have you tried to use QShotcut instead of event filter? If it works, code would be simpler.

From FileBrowser:

        self._upShortcut = QShortcut( QKeySequence( "BackSpace" ), self )
        self._upShortcut.setContext( Qt.WidgetShortcut )
        self._upShortcut.activated.connect(self.moveUp)

Could you please write a test for this functionality?

bjones1 commented 10 years ago

Neat, I'll try that out -- I wasn't familiar with QShortcut.

andreikop commented 10 years ago

Currently users will see Alt+letter hints, but they unlikely to know that letter without Alt works. The dialog is rarely used, I don't want to add hints to the documentation.

Except this, Enki codebase is already 13 LOC. I wouldn't like it to become huge and slow.

How important this feature is for you? Maybe we could leave the dialog as is?

bjones1 commented 10 years ago

We can leave as is. It's just a convenience / speedup. It QShortcut works, though, this does seem a minimal addition to the codebase. I'm still working on preview sync stuff, so I haven't tried it yet.

The other nice thing: this follows standard Qt operation -- the QMessageBox static methods (yes/no/cancel) all allow press y/n instead of Alt+Y/N as well.

andreikop commented 10 years ago

Yes, QShortcut will add just a few lines of code, so it's fine

bjones1 commented 10 years ago

Done -- this works nicely; great suggestion! Would you take a look?

andreikop commented 10 years ago

Cool!