astro-pi / python-sense-emu

An emulator for the Raspberry Pi Sense HAT
https://sense-emu.readthedocs.io/
Other
40 stars 25 forks source link

Overwrite example dialogue #6

Closed davidhoness closed 8 years ago

davidhoness commented 8 years ago

Can the wording of this dialogue box be changed to be more intuitive? I would prefer to have buttons saying Open and Revert instead of No and Yes.

The text could then be something like:

File %FILE% already exists, you can open it or revert to the original?

Feel free to word-smith this a bit if necessary.

waveform80 commented 8 years ago

Yes ... unfortunately if I do that I can't use a standard GtkMessageDialog, and so far all my attempts to make a GtkDialog look like a GtkMessageDialog have failed (the icon looks different, the fonts are wrong, etc.)

waveform80 commented 8 years ago

Must admit I'm not entirely convinced by the copy-to-home-dir first functionality. Firstly it's contradictory to the advertised action ("Open example"), and secondly it means the user never gets to explicitly select the filename (and directory) to save the file under which may lead to complications with them opening it later. Personally I think it'd be better to have it simply open the installation's read-only copy and leave the user to use File / Save As to explicitly save their own copy. There are a couple of drawbacks with my preference though:

  1. A check should be performed to make sure the user isn't root (or more precisely that they can't write to the installation's examples). There are occasionally good reasons to run as root on a Pi, and there's a danger the user could accidentally save edits to the "original" examples if they are. A warning dialog should probably pop up to warn them prior to opening idle in this case.
  2. It'd be ideal if idle's Save As... dialog opened in the user's home dir to save them having to navigate there from the long installation path. Unfortunately idle ignores the working directory and just uses the open file's owning directory as the default instead.

In other words, I don't think there's a universally good solution here - happy to go with whatever you prefer.

davidhoness commented 8 years ago

Hmm. I'll give this some thought and get back to you.

davidhoness commented 8 years ago

Okay, so I reckon we should go with option 1 and have the examples only modifiable by root to enforce the Save As dialogue if running as the pi user - but then either display a warning if they're running as root or just omit the Open example menu item under File?