Skip to content

Commit 78f19d3

Browse files
committed
Merge branch 'main' into status_icons
2 parents 2dd8255 + 37525ec commit 78f19d3

File tree

119 files changed

+3780
-1440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+3780
-1440
lines changed

android/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
requires = [
3-
"setuptools==71.1.0",
3+
"setuptools==73.0.1",
44
"setuptools_scm==8.1.0",
55
"setuptools_dynamic_dependencies @ git+https://github.com/beeware/setuptools_dynamic_dependencies",
66
]

android/src/toga_android/app.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import asyncio
2-
import sys
32
import warnings
43

54
from android.content import Context
@@ -11,9 +10,8 @@
1110
from org.beeware.android import IPythonApp, MainActivity
1211

1312
import toga
14-
from toga.command import Command, Group, Separator
13+
from toga.command import Group, Separator
1514
from toga.dialogs import InfoDialog
16-
from toga.handlers import simple_handler
1715

1816
from .libs import events
1917
from .screens import Screen as ScreenImpl
@@ -186,6 +184,9 @@ def onPrepareOptionsMenu(self, menu):
186184
class App:
187185
# Android apps exit when the last window is closed
188186
CLOSE_ON_LAST_WINDOW = True
187+
# Android doesn't have command line handling;
188+
# but saying it does shortcuts the default handling
189+
HANDLES_COMMAND_LINE = True
189190

190191
def __init__(self, interface):
191192
self.interface = interface
@@ -210,16 +211,8 @@ def create(self):
210211
# Commands and menus
211212
######################################################################
212213

213-
def create_app_commands(self):
214-
self.interface.commands.add(
215-
# About should be the last item in the menu, in a section on its own.
216-
Command(
217-
simple_handler(self.interface.about),
218-
f"About {self.interface.formal_name}",
219-
section=sys.maxsize,
220-
id=Command.ABOUT,
221-
),
222-
)
214+
def create_standard_commands(self):
215+
pass
223216

224217
def create_menus(self):
225218
# Menu items are configured as part of onPrepareOptionsMenu; trigger that
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,38 @@
1+
import sys
2+
13
from org.beeware.android import MainActivity
24

5+
from toga import Command as StandardCommand
6+
37

48
class Command:
59
def __init__(self, interface):
610
self.interface = interface
711
self.native = []
812

13+
@classmethod
14+
def standard(cls, app, id):
15+
# ---- Help menu ----------------------------------
16+
if id == StandardCommand.ABOUT:
17+
return {
18+
"text": f"About {app.formal_name}",
19+
"section": sys.maxsize,
20+
}
21+
# ---- Undefined commands--------------------------
22+
elif id in {
23+
StandardCommand.EXIT,
24+
StandardCommand.NEW,
25+
StandardCommand.OPEN,
26+
StandardCommand.PREFERENCES,
27+
StandardCommand.SAVE,
28+
StandardCommand.SAVE_AS,
29+
StandardCommand.SAVE_ALL,
30+
StandardCommand.VISIT_HOMEPAGE,
31+
}:
32+
# These are valid commands, but they're not defined on Android.
33+
return None
34+
35+
raise ValueError(f"Unknown standard command {id!r}")
36+
937
def set_enabled(self, value):
1038
MainActivity.singletonThis.invalidateOptionsMenu()
File renamed without changes.

changes/2209.feature.2.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

changes/2209.removal.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
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.
2+
3+
The ``DocumentApp`` base class is no longer required. Apps can subclass ``App`` directly, passing the document types as a ``list`` of ``Document`` classes, rather than a mapping of extension to document type.
4+
5+
The API for ``Document`` subclasses has also changed:
6+
7+
* A path is no longer provided as an argument to the Document constructor;
8+
9+
* The ``document_type`` is now specified as a class property called ``description``; and
10+
11+
* Extensions are now defined as a class property of the ``Document``; and
12+
13+
* The ``can_close()`` handler is no longer honored. Documents now track if they are modified, and have a default ``on_close`` handler that uses the modification status of a document to control whether a document can close. Invoking ``touch()`` on document will mark a document as modified. This modification flag is cleared by saving the document.

changes/2478.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The Divider widget was implemented on iOS.

changes/2739.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updated sphinx from 7.3.7 to 8.0.2 in /core.

changes/2752.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The WebView can now be loaded when using Python from the Windows Store.

changes/2771.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Testbed CI was temporarily reverted to use briefcase 0.3.19.

0 commit comments

Comments
 (0)