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/g.gui.gcp: fix launch g.gui.gcp #824

Merged
merged 1 commit into from Jul 24, 2020

Conversation

tmszi
Copy link
Member

@tmszi tmszi commented Jul 22, 2020

Move back wx.GridBagSizer sizer declaration into TitledPage base class, also required for wxGUI g.gui.gcp wizard pages.

To reproduce:

  1. Launch g.gui.gcp

Error message:

Traceback (most recent call last):
  File "/usr/lib64/grass79/scripts/g.gui.gcp", line 71, in <module>
    main()
  File "/usr/lib64/grass79/scripts/g.gui.gcp", line 66, in main
    wizard = GCPWizard(parent=None, giface=StandaloneGrassInterface())
  File "/usr/lib64/grass79/gui/wxpython/gcp/manager.py", line 153, in __init__
    self.startpage = LocationPage(self.wizard, self)
  File "/usr/lib64/grass79/gui/wxpython/gcp/manager.py", line 370, in __init__
    self.sizer.Add(self.rb_maptype,
AttributeError: 'LocationPage' object has no attribute 'sizer'

This commit remove wx.GridBagSizer sizer declaration from base class TitledPage.

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 didn't realize the TitledPage was used elsewhere. The point of the change was to remove the GridBagSizer from the base class TitledPage because for some wizard pages different sizer is more advantageous, so I wanted to let them define the appropriate sizer.
Instead of putting the GridBagSizer back in there, I suggest creating a new class in location wizard, something like GridBagSizerTitledPage(TitledPage) that just adds the GridBagSizer there. Then change the classes for pages which still use that sizer. For the other GUI parts which use it, I would just change the import to from location_wizard.wizard import GridBagSizerTitledPage as TitledPage. This would apply to rlisetup, photo2image, image2target and gcp parts.

…ne 'wx.GridBagSizer'), as subclass of the 'TitledPage' class
@tmszi
Copy link
Member Author

tmszi commented Jul 23, 2020

I didn't realize the TitledPage was used elsewhere. The point of the change was to remove the GridBagSizer from the base class TitledPage because for some wizard pages different sizer is more advantageous, so I wanted to let them define the appropriate sizer.
Instead of putting the GridBagSizer back in there, I suggest creating a new class in location wizard, something like GridBagSizerTitledPage(TitledPage) that just adds the GridBagSizer there. Then change the classes for pages which still use that sizer. For the other GUI parts which use it, I would just change the import to from location_wizard.wizard import GridBagSizerTitledPage as TitledPage. This would apply to rlisetup, photo2image, image2target and gcp parts.

Thanks for the explanation, I thought similarly. I've already fixed it.

@petrasovaa petrasovaa self-requested a review July 24, 2020 03:09
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.

Thanks!

@petrasovaa petrasovaa merged commit 57cb19e into OSGeo:master Jul 24, 2020
@tmszi tmszi deleted the fix_launch_wxgui_gcp branch July 28, 2020 07:13
@neteler neteler added this to the 8.0.0 milestone Dec 9, 2021
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

3 participants