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

Add support for user-defined New, Save, Save As and Save All commands #2688

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
53d1a5b
Update documentation and examples for document API.
freakboy3742 Jun 25, 2024
d793d60
Update core and core tests to match documentation.
freakboy3742 Jun 27, 2024
f543a52
Add document type registration to example document app.
freakboy3742 Jun 28, 2024
2d377f9
Add document API tests for macOS.
freakboy3742 Jun 29, 2024
8e46ad4
Update document tests for iOS and Android.
freakboy3742 Jun 29, 2024
5d57a38
Initial attempt at GTK and Winforms document API tests.
freakboy3742 Jun 29, 2024
eb65ee9
Use an automated approach to window cleanup.
freakboy3742 Jun 29, 2024
e1dcd2c
Minor cleanups and test fixes.
freakboy3742 Jun 29, 2024
8dc24e3
Mark GTK and Winforms as using default command line handling.
freakboy3742 Jun 29, 2024
0e85f43
Add error handling to GTK/Winforms document handling.
freakboy3742 Jun 29, 2024
34129cb
Add Open menu item for GTK and Winforms.
freakboy3742 Jun 29, 2024
ea2e6e5
Create an empty document on GTK and Winforms startup.
freakboy3742 Jun 29, 2024
0e3d025
Remove need for Document to have an implementation.
freakboy3742 Jul 1, 2024
b332f4e
Add documentation and core implemenation for new/save/save as/save all.
freakboy3742 Jul 2, 2024
04d2c4a
Add cocoa implementation of new/save/save as/save all and testbed tests.
freakboy3742 Jul 2, 2024
ccf5aa8
Add GTK and Winforms implementation and tests.
freakboy3742 Jul 2, 2024
633721d
Add second doctype registration for coverage.
freakboy3742 Jul 2, 2024
118b93e
Merge branch 'main' into document-api
freakboy3742 Jul 15, 2024
6e459f5
Merge branch 'document-api' into document-api-extensions
freakboy3742 Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions android/src/toga_android/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ def onPrepareOptionsMenu(self, menu):
class App:
# Android apps exit when the last window is closed
CLOSE_ON_LAST_WINDOW = True
# Android doesn't have command line handling;
# but saying it does shortcuts the default handling
HANDLES_COMMAND_LINE = True

def __init__(self, interface):
self.interface = interface
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions changes/2209.feature.2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The API for Documents and document types has been finalized. Document handling behavior is now controlled by declaring document types as part of your ``toga.App`` definition.
1 change: 1 addition & 0 deletions changes/2209.feature.3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
File management menu items (such as New, Open and Save) can now be overridden to install default menu items.
11 changes: 11 additions & 0 deletions changes/2209.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The API for Documents and Document-based apps has been significantly modified. Unfortunately, these changes are not backwards compatible; any existing Document-based app will require modification.

The ``DocumentApp`` base class is no longer required. Apps can subclass ``App``, providing the same arguments as before.

The API for ``Document`` subclasses has also changed:

* A path is no longer provided as an argument to the Document constructor;

* The ``document_type`` is now specified as a class property; and

* The ``can_close()`` handler is no longer honored. It should be converted into a normal ``on_close`` handler and explicitly installed on the document's ``main_window``.
Loading
Loading