-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
wxGUI location wizard: First page #646
wxGUI location wizard: First page #646
Conversation
|
@lindakladivova Please provide screenshots before and after. It's self-explanatory description :-) |
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 would say the asterisk should go right after the label. Since there is GridBagSizer used, you may need to shift the edit fields one column to the right to get the asterisk there so that everything is aligned. Alternatively, the edit fields could be moved below the label like we have in forms.
| @@ -179,6 +179,11 @@ def __init__(self, wizard, parent, grassdatabase): | |||
| grass.legal_name, | |||
| self._nameValidationFailed)) | |||
| self.tlocTitle = self.MakeTextCtrl(size=(400, -1)) | |||
|
|
|||
| # text for required options | |||
| self.required_txt = self.MakeStaticText("*", size=(-1, -1)) | |||
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 don't think the required_txt needs to be attribute of the class (remove self).
| self.tlocation.SetFocus() | ||
| self.tlocation.SetValidator( | ||
| GenericValidator( | ||
| grass.legal_name, | ||
| self._nameValidationFailed)) | ||
| self.tlocTitle = self.MakeTextCtrl(size=(400, -1)) | ||
|
|
||
| # text for required options | ||
| self.required_txt = self.MakeLabel("*") |
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.
As I mentioned, don't use self here if it's used only locally within the scope of the method, if you make it an attribute of the class it looks like it's being used elsewhere too, which is confusing.
| self.required_txt.SetToolTip(_("This option is required")) | ||
|
|
||
| # text for optional options | ||
| self.optional_txt = self.MakeLabel("(optional)") |
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.
Make it translatable: _("optional")
| self.optional_txt = self.MakeLabel("(optional)") | ||
| italics = wx.Font(10, wx.DEFAULT, wx.ITALIC, wx.NORMAL) | ||
| self.optional_txt.SetFont(italics) | ||
| self.optional_txt.SetForegroundColour("gray") |
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 would recommend here using system colors instead of 'gray': wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT) because people have different window styles.
| @@ -171,14 +162,26 @@ def __init__(self, wizard, parent, grassdatabase): | |||
| self.locTitle = '' | |||
|
|
|||
| # text controls | |||
| self.tgisdbase = self.MakeStaticText(grassdatabase, size=(-1, -1)) | |||
| self.tlocation = self.MakeTextCtrl("newLocation", size=(300, -1)) | |||
| self.tgisdbase = self.MakeTextCtrl(grassdatabase, size=(400, -1), style = wx.TE_READONLY | wx.TRANSPARENT_WINDOW) | |||
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.
If you look at the code checks, the flake8 code quality check is failing on your PR because of spaces around =. It should be:
..., style=wx.TE_READONLY | wx.TRANSPARENT_WINDOW
see PEP8 for reference.
…change button added and page title and Location Name changed.
|
Looks good! Just one other small change, I noticed the summary page still has Location Title, so it would be good to change that to Description to sync the labels. |



Location wizard location name marked as required and the Project Location renamed to Location Name.
Sorry I do not have before. I have the one after :-) :

Here's the screenshot of the second version:

Here's the screenshot of the third version:

(The layout was a bit changed and also the Description was marked as optional. GIS data directory is still non-editable but made through wx.TE_READONLY method.)
Here's the screenshot of the fourth version:

I more like the TextCtrl than StaticText for Location Database. I find it more logical because the window is editable. What do you think?
The fifth version with StaticText:
