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

The Big Restructure of Toga [WIP] #185

Merged
merged 176 commits into from Sep 23, 2017

Conversation

Projects
None yet
5 participants
@Ocupe
Collaborator

Ocupe commented Jun 25, 2017

This is PR is an attempt to restructure Toga to use a factory pattern instead of inheritance. The reason for this is to make Toga easier to test.

Goal

The goal is to push this PR to become the next official Toga 0.3 release. I'm going to continue the port of toga.cocoa and toga.iOS to the new form. If someone wants to jump in and help to port other platforms, your more than welcome! I'm willing to help and explain when ever needed :)

@freakboy3742

Ocupe and others added some commits Jun 25, 2017

init commit of restructured toga.core
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
init commit of restructured toga.cocoa
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
init commit of restructured toga.iOS
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
init commit of restructured tests
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
fixes to get cocoa app to work
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
fixes to get iOS app to work
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
renamed self._creator to self._interface
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
Cleanup of refactored branch.
Now supports tutorial 1.
Tutorial 0-2 Working on macOS.
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
Tutorial 3 working on macOS (WebView ported).
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
ported MultilineTextInput
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
ported ProgressBar (cocoa)
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
ported Selection (cocoa)
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
ported Switch (cocoa)
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
ported Slider (cocoa), fixed label
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
basic impl check structure
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
added ast test if class has required functions
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
Merged master into restruc_toga to get the newest code.
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
Added the structure for a dummy backend.
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
Implementation checks now use the dummy backend as ref. Restructure o…
…f Tests - tests are now on a platform level.

Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
base implementation check classes now have a base class by themselves.
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
Renamed TestBaseClass to ImplCheckBase + docs
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
Simplified cocoa.window show method.
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
@Ry10p

This comment has been minimized.

Show comment
Hide comment
@Ry10p

Ry10p Jul 8, 2017

@Ocupe

Hey! I am very new to contributions, and I am working on the toga-gtk widgets.

Could you please tell me how to start creating new ones for toga-gtk?

A little direction is all I'm looking for. Thanks so much in advance!

the directions i was given to start the project was
"The biggest task is to port widgets. The Cocoa backend is the most complete Toga backend; so there are widgets defined on the Cocoa backend that haven't been implemented on Gtk. So - implement them :-)"

pybee/briefcase#52

Sent from my Samsung SM-G920V using FastHub

Ry10p commented Jul 8, 2017

@Ocupe

Hey! I am very new to contributions, and I am working on the toga-gtk widgets.

Could you please tell me how to start creating new ones for toga-gtk?

A little direction is all I'm looking for. Thanks so much in advance!

the directions i was given to start the project was
"The biggest task is to port widgets. The Cocoa backend is the most complete Toga backend; so there are widgets defined on the Cocoa backend that haven't been implemented on Gtk. So - implement them :-)"

pybee/briefcase#52

Sent from my Samsung SM-G920V using FastHub

@Ocupe

This comment has been minimized.

Show comment
Hide comment
@Ocupe

Ocupe Jul 9, 2017

Collaborator

Hey @Ry10p,
great to see that you jumped into the GTK backend :)
I'm not familiar with GTK so my advice is abstract but I hope still helpful to get you started.

I guess you want to add a widget that already exist in toga-core to toga-gtk, right?
If this is the case, you should familiarise yourself with the way other widgets are implemented in toga-gtk. But I guess you already did this.

Next step would be to pick a widget, from the cocoa backend that you want to implement and look though the GTK docs and find a equivalent. After that you have to spend some quality time with the GTK docs to understand how you can interact with your backend (how do I instantiate the widget, what function do I have to call to set a label ...).

Most of the widgets share a common structure so use already implemented GTK widgets as a reference and use already implemented toga-cocoa widgets as blueprint to see how the interface for your new widget should look like.

If you have more questions don't hesitate to ask.

Collaborator

Ocupe commented Jul 9, 2017

Hey @Ry10p,
great to see that you jumped into the GTK backend :)
I'm not familiar with GTK so my advice is abstract but I hope still helpful to get you started.

I guess you want to add a widget that already exist in toga-core to toga-gtk, right?
If this is the case, you should familiarise yourself with the way other widgets are implemented in toga-gtk. But I guess you already did this.

Next step would be to pick a widget, from the cocoa backend that you want to implement and look though the GTK docs and find a equivalent. After that you have to spend some quality time with the GTK docs to understand how you can interact with your backend (how do I instantiate the widget, what function do I have to call to set a label ...).

Most of the widgets share a common structure so use already implemented GTK widgets as a reference and use already implemented toga-cocoa widgets as blueprint to see how the interface for your new widget should look like.

If you have more questions don't hesitate to ask.

@Ry10p

This comment has been minimized.

Show comment
Hide comment
@Ry10p

Ry10p Jul 9, 2017

@Ocupe
Thank you so much!
I want to do do the best job possible, so I really do thank you for your guidance.
I will let you know if I run into a road block.

Thanks again!
-Ryan Carl

Ry10p commented Jul 9, 2017

@Ocupe
Thank you so much!
I want to do do the best job possible, so I really do thank you for your guidance.
I will let you know if I run into a road block.

Thanks again!
-Ryan Carl

freakboy3742 and others added some commits Sep 17, 2017

Ocupe
Added placeholder functionality to gtk MultilineTextInput.
Signed-off-by: Ocupe <m@ocupe.org>
Ocupe
Fixed readonly for gtk MultilineTextInput.
Signed-off-by: Ocupe <m@ocupe.org>
Removed print's and added docs.
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
add_constraints not required for gtk
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
Updated dummy backend to make cocoa tests pass.
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
Moved enabled to interface level and changed implementation for iOS, …
…cocoa and gtk.

Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
Ocupe
Fixed gtk enabled property.
Signed-off-by: Ocupe <m@ocupe.org>
Cleanup of not needed enabled functions.
- removed not needed 'enabled' functionality on iOS, cocoa.
- updated dummy backend to reflect changes.
- updated core tests

Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
small fix on Tree widget and tweaking number so make it look nicer :)
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
updated Tree in toga-dummy backend
Signed-off-by: Jonas Schell <jonasschell@ocupe.org>
@freakboy3742

This comment has been minimized.

Show comment
Hide comment
@freakboy3742

freakboy3742 Sep 23, 2017

Member

Ok. This malarkey has gone on long enough. Time to MERGE!! :-)

Member

freakboy3742 commented Sep 23, 2017

Ok. This malarkey has gone on long enough. Time to MERGE!! :-)

@freakboy3742 freakboy3742 merged commit fb3702e into pybee:master Sep 23, 2017

6 of 11 checks passed

beekeeper:2/implementations:android Android implementation compliance check failed! Click for details.
Details
beekeeper:2/implementations:django Django implementation compliance check failed! Click for details.
Details
beekeeper:2/implementations:gtk GTK+ implementation compliance check failed! Click for details.
Details
beekeeper:2/implementations:iOS iOS implementation compliance check failed! Click for details.
Details
beekeeper:2/implementations:winforms Winforms implementation compliance check failed! Click for details.
Details
beekeeper:0/beefore:eslint JavaScript lint checks passed.
Details
beekeeper:0/beefore:pycodestyle Python lint checks passed.
Details
beekeeper:1/core:py3.4 Python 3.4 Core API tests passed.
Details
beekeeper:1/core:py3.5 Python 3.5 Core API tests passed.
Details
beekeeper:1/core:py3.6 Python 3.6 Core API tests passed.
Details
beekeeper:2/implementations:cocoa macOS Cocoa implementation compliance check passed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment