Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple history back/forward navigation #1165

Merged
merged 1 commit into from
Jun 15, 2023

Conversation

alfar
Copy link
Contributor

@alfar alfar commented May 13, 2023

Like the title says, I implemented a simple history that keeps track of what places you've visited. This was in response to #1041.

It works pretty much like the history of a web-browser, so if you go back some steps and then navigate to a new place, it cuts off your forward history and adds the new place to the end.

I'm pretty new to python programming, so I wasn't sure if there's a library I was supposed to use for the Signals, but I tried to make it look/feel like the signals from Qt so it wouldn't stick out too much.

I'm not 100% sure of the hot keys. ctrl+< and ctrl+> works for me because I have a Danish keyboard layout. I reckon it should work for an English keyboard as well. Main reason I decided against backspace/shift-backspace is that if you end up in a text field, you'll remove letters instead of navigating. Likewise, alt+left/alt+right seems to be used by the tree components to navigate around there, so half the time, my history actions would get eaten.

Any feedback would be appreciated.

@JPhB
Copy link

JPhB commented Jun 12, 2023

I'd like to use it in version 7.0. How do I do that, not knowing anything about Python?

@alfar
Copy link
Contributor Author

alfar commented Jun 12, 2023

I'd like to use it in version 7.0. How do I do that, not knowing anything about Python?

Well, I would think that it's not version 7.0 anymore if you add code to it...

https://github.com/olivierkes/manuskript/wiki has a section explaining how to run Manuskript from code on various operating systems. You could grab my version from https://github.com/alfar/manuskript and try running that, but it's based on the latest version of the source code, probably somewhere after version 0.15.0 (which seems to be the latest release)

You'd have to fork my code and cherry-pick my commit into your fork of the older version and then probably fiddle a ton to make it play together. I'm not saying you can't, just wondering if it's that important to use a specific version?

Of course, I'm new to this project, so I don't know if there's something magical and wonderful (or stable) about version 7.0 :)

@JPhB
Copy link

JPhB commented Jun 12, 2023

Thanks for responding. Is your version available on Windows? When I follow the link you included and try to download Manuskript (https://www.theologeek.ch/manuskript/download), I get this error:
Fatal error: __autoload() is no longer supported, use spl_autoload_register() instead in /home/clients/90412ec2d8e55d60c960a48d035ee4d5/web/manuskript/wp-includes/compat.php on line 502

@alfar
Copy link
Contributor Author

alfar commented Jun 12, 2023

I'm coding on a Windows machine, seems to be working ok. You'll need to download the source from https://github.com/alfar/manuskript and then run it in the way described on the other link.
Good luck :)

@TheShadowOfHassen
Copy link
Contributor

You should probably update to the latest version if you still run. 0.7...

Also the download error has happened before: #1175 It apparently is an issue.

@TheJackiMonster
Copy link
Collaborator

I've tested it and it works fine. I don't have any issues with the key bindings but maybe we can have some configuration for the key bindings anyway to make sure it works for everyone.

Anyway good job and thanks for the contribution.

@TheJackiMonster TheJackiMonster merged commit 4ebbf5e into olivierkes:develop Jun 15, 2023
@TheJackiMonster TheJackiMonster added this to the 0.16.0 milestone Jun 15, 2023
@TheJackiMonster
Copy link
Collaborator

@alfar One small note: I didn't notice it because the code was running fine on my system. But we use Python 3.9 on the automatic testing system and potentially even an older version when shipping towards Windows to have maximum compatibility with older versions of Windows. So match and case syntax does not work yet on all systems. I've pushed a fix though.

@alfar
Copy link
Contributor Author

alfar commented Jun 15, 2023

@alfar One small note: I didn't notice it because the code was running fine on my system. But we use Python 3.9 on the automatic testing system and potentially even an older version when shipping towards Windows to have maximum compatibility with older versions of Windows. So match and case syntax does not work yet on all systems. I've pushed a fix though.

Oh, I'm sorry, didn't realize. Thanks for fixing it - hope it wasn't too much of a hassle. :)

@TheJackiMonster
Copy link
Collaborator

@alfar One small note: I didn't notice it because the code was running fine on my system. But we use Python 3.9 on the automatic testing system and potentially even an older version when shipping towards Windows to have maximum compatibility with older versions of Windows. So match and case syntax does not work yet on all systems. I've pushed a fix though.

Oh, I'm sorry, didn't realize. Thanks for fixing it - hope it wasn't too much of a hassle. :)

Nah, I replaced it with some if and elif branching. Not as fast theoretically but it should be fine for navigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants