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

wxGUI location wizard: First page #646

Conversation

lindakarlovska
Copy link
Contributor

@lindakarlovska lindakarlovska commented May 18, 2020

Location wizard location name marked as required and the Project Location renamed to Location Name.

@lindakladivova Please provide screenshots before and after. It's self-explanatory description :-)

Sorry I do not have before. I have the one after :-) :
Screenshot from 2020-05-18 15-28-09

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.

Here's the screenshot of the second version:
Screenshot from 2020-05-19 10-06-21

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.)
Screenshot from 2020-05-19 15-04-43

Here's the screenshot of the fourth version:
Screenshot from 2020-05-20 11-08-53
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:
Screenshot from 2020-05-20 12-09-40

@landam landam added enhancement New feature or request gsoc Reserved for Google Summer of Code student(s) GUI wxGUI related labels May 18, 2020
@landam
Copy link
Member

landam commented May 18, 2020

@lindakladivova Please provide screenshots before and after. It's self-explanatory description :-)

@landam landam requested a review from petrasovaa May 18, 2020 20:08
Copy link
Contributor

@petrasovaa petrasovaa left a 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))
Copy link
Contributor

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).

@petrasovaa petrasovaa marked this pull request as draft May 19, 2020 18:11
@petrasovaa petrasovaa changed the title Wx gui location wizard location name marked as required wxGUI location wizard: location name marked as required May 19, 2020
@lindakarlovska lindakarlovska marked this pull request as ready for review May 19, 2020 20:17
@petrasovaa
Copy link
Contributor

We thought about it more and I think we should redo the DB part. The readonly textctrl is I think confusing (visually you can't see it's readonly at least on gtk). I think we can use statictext as before and move it below, it shouldn't be the first thing. Here is a poor drawing of what you could do. Notice also change in page title and Location Name could be just Name. The Change button is just if we realize we need to enable users to change the database (would be aligned with the asterisk).
IMG_20200519_225401111

I think you could also go ahead and remove the checkboxes (that's in the roadmap).

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("*")
Copy link
Contributor

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)")
Copy link
Contributor

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")
Copy link
Contributor

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)
Copy link
Contributor

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.

lindakladivova added 2 commits May 20, 2020 11:00
@lindakarlovska
Copy link
Contributor Author

We thought about it more and I think we should redo the DB part. The readonly textctrl is I think confusing (visually you can't see it's readonly at least on gtk). I think we can use statictext as before and move it below, it shouldn't be the first thing. Here is a poor drawing of what you could do. Notice also change in page title and Location Name could be just Name. The Change button is just if we realize we need to enable users to change the database (would be aligned with the asterisk).
IMG_20200519_225401111

I think you could also go ahead and remove the checkboxes (that's in the roadmap).

Another version:
I also removed check boxes.
Screenshot from 2020-05-20 11-08-53

@petrasovaa
Copy link
Contributor

I also removed check boxes.
Screenshot from 2020-05-20 11-08-53

I think we should use only StaticText for the DB to communicate clearly that user doesn't need to edit it.

@lindakarlovska
Copy link
Contributor Author

I also removed check boxes.
Screenshot from 2020-05-20 11-08-53

I think we should use only StaticText for the DB to communicate clearly that user doesn't need to edit it.

Ok. I have changed that:
Screenshot from 2020-05-20 12-09-40

@lindakarlovska lindakarlovska changed the title wxGUI location wizard: location name marked as required wxGUI location wizard: First page May 20, 2020
@petrasovaa
Copy link
Contributor

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.

@landam landam added this to the 8.0.0/7.10 milestone May 22, 2020
@petrasovaa petrasovaa merged commit 177fc47 into OSGeo:master May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gsoc Reserved for Google Summer of Code student(s) GUI wxGUI related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants