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
Hidden setting to override the text editor. #246
base: master
Are you sure you want to change the base?
Conversation
3878fce
to
5012a08
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was using dconf write /org/gtimelog/editor '"open -a TextEdit.app %s"'
on MacOS (after installing dconf
via MacPorts) and it worked nicely even without recompiling anything and when running gtimelog as a real MacOS app as described in minddistrict/gtimelog-macosx#1.
Thank you very much.
On the other hand calling gsettings get org.gtimelog editor
afterwards told me that the schema org.gtimelog
is not there, so maybe mentioning the dconf
way in the readme would be helpful for future MacOS users.
Not just Mac, when the schema is not installed into a system-wide location, you cannot use gsettings on it without first exporting GSETTINGS_SCHEMA_DIR=src/gtimelog/data/. dconf-editor is the more user-friendly alternative. Does it run on Mac OS? |
Should I add the check? Then people will complain that they set the setting (with dconf) but it doesn't work at all. That's actually an argument towards not documenting the Maybe gtimelog itself should add an mtime check and recompile the schema in src/gtimelog/data if the timestamp shows that it is outdated. Yay for reinventing GNU Make? Anyway I value developer convenience, being one myself. The hardest problem in computer science is deciding what needs to be done. I am very good at enumerating possible approaches and then failing to pick one. |
@mgedmin Sorry for letting you wait for so long for an answer. The Probably the most convenient way for the users would be to have an option in the preferences dialog, even though it is the one which requires the most changes. |
Note that people who run gtimelog straight from Git will need to manually run ``make`` to recompile the gsettings schema, or gtimelog will segfault when you press Ctrl+E. Also note that using `gsettings` is a pain when the schema is not installed globally, but you can use dconf write /org/gtimelog/editor '"gvim %s"' and then tweak it with dconf-editor. Error handling is missing: if you set editor to gvim and gvim is not installed, you'll see a Python traceback on the console. Application.prepare_args() is a separate static method so I could write unit tests for it, but I haven't done so. Closes #113.
5012a08
to
50e3f4b
Compare
Rebased to resolve merge conflicts. I want to add some error handling before I merge this. |
The error is only visible in report mode.
Current status: error reporting doesn't really work:
I need to update the .ui file to add an info bar to the regular view, then make sure the error message shows in both info bars? Or somehow reparent the infobar widget when switching modes? |
Note that people who run gtimelog straight from Git will need to manually run
make
to recompile the gsettings schema, or gtimelog will segfault when you press Ctrl+E. Maybe I can add a check to see if the key exists before attempting to load it?Also note that using
gsettings
is a pain when the schema is not installed globally, but you can useand then tweak it with dconf-editor.
Error handling is missing: if you set editor to gvim and gvim is not installed, you'll see a Python traceback on the console.
Application.prepare_args() is a separate static method so I could write unit tests for it, but I haven't done so. Instead I have experimented with values like
gnome-terminal -e "vim %s"
to test the , and it seems to work fine (gnome-terminal opens a new tab in my existing instance with Vim running inside, which is a bit startling).Closes #113.