fix: avoid deprecated Page.dialog
usage
cf. https://flet.dev/docs/controls/alertdialog
This commit is contained in:
parent
ab3c3737bb
commit
34390e4320
|
@ -122,15 +122,16 @@ class WuttaFeedback(ft.Container):
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.mypage.dialog and self.mypage.dialog.open and self.mypage.dialog is not self.dlg:
|
# # TODO: leaving this for reference just in case..but hoping
|
||||||
self.mypage.dialog.open = False
|
# the latest flet does not require this hack?
|
||||||
self.mypage.update()
|
|
||||||
# cf. https://github.com/flet-dev/flet/issues/1670
|
|
||||||
time.sleep(0.1)
|
|
||||||
|
|
||||||
self.mypage.dialog = self.dlg
|
# if self.mypage.dialog and self.mypage.dialog.open and self.mypage.dialog is not self.dlg:
|
||||||
self.dlg.open = True
|
# self.mypage.dialog.open = False
|
||||||
self.mypage.update()
|
# self.mypage.update()
|
||||||
|
# # cf. https://github.com/flet-dev/flet/issues/1670
|
||||||
|
# time.sleep(0.1)
|
||||||
|
|
||||||
|
self.mypage.open(self.dlg)
|
||||||
|
|
||||||
def keypress(self, key):
|
def keypress(self, key):
|
||||||
if key == '⏎':
|
if key == '⏎':
|
||||||
|
|
|
@ -245,9 +245,7 @@ WuttaPOS. If not, see <http://www.gnu.org/licenses/>.
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
self.page.dialog = self.dlg
|
self.page.open(self.dlg)
|
||||||
self.dlg.open = True
|
|
||||||
self.page.update()
|
|
||||||
|
|
||||||
def test_error_click(self, e):
|
def test_error_click(self, e):
|
||||||
|
|
||||||
|
|
|
@ -240,9 +240,7 @@ class POSView(WuttaView):
|
||||||
on_select=select, on_cancel=cancel),
|
on_select=select, on_cancel=cancel),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.page.dialog = dlg
|
self.page.open(dlg)
|
||||||
dlg.open = True
|
|
||||||
self.page.update()
|
|
||||||
|
|
||||||
def customer_lookup(self, value=None, user=None):
|
def customer_lookup(self, value=None, user=None):
|
||||||
|
|
||||||
|
@ -267,9 +265,7 @@ class POSView(WuttaView):
|
||||||
on_select=select, on_cancel=cancel),
|
on_select=select, on_cancel=cancel),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.page.dialog = dlg
|
self.page.open(dlg)
|
||||||
dlg.open = True
|
|
||||||
self.page.update()
|
|
||||||
|
|
||||||
def customer_info(self):
|
def customer_info(self):
|
||||||
clientele = self.app.get_clientele_handler()
|
clientele = self.app.get_clientele_handler()
|
||||||
|
@ -337,9 +333,7 @@ class POSView(WuttaView):
|
||||||
# actions_alignment=ft.MainAxisAlignment.END,
|
# actions_alignment=ft.MainAxisAlignment.END,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.page.dialog = dlg
|
self.page.open(dlg)
|
||||||
dlg.open = True
|
|
||||||
self.page.update()
|
|
||||||
|
|
||||||
def customer_prompt(self):
|
def customer_prompt(self):
|
||||||
|
|
||||||
|
@ -425,9 +419,7 @@ class POSView(WuttaView):
|
||||||
on_click=cancel),
|
on_click=cancel),
|
||||||
])
|
])
|
||||||
|
|
||||||
self.page.dialog = dlg
|
self.page.open(dlg)
|
||||||
dlg.open = True
|
|
||||||
self.page.update()
|
|
||||||
|
|
||||||
def remove_customer_prompt(self):
|
def remove_customer_prompt(self):
|
||||||
|
|
||||||
|
@ -472,9 +464,7 @@ class POSView(WuttaView):
|
||||||
on_click=cancel),
|
on_click=cancel),
|
||||||
])
|
])
|
||||||
|
|
||||||
self.page.dialog = dlg
|
self.page.open(dlg)
|
||||||
dlg.open = True
|
|
||||||
self.page.update()
|
|
||||||
|
|
||||||
def remove_customer(self, user):
|
def remove_customer(self, user):
|
||||||
session = self.app.make_session()
|
session = self.app.make_session()
|
||||||
|
@ -938,9 +928,7 @@ class POSView(WuttaView):
|
||||||
on_click=cancel),
|
on_click=cancel),
|
||||||
])
|
])
|
||||||
|
|
||||||
self.page.dialog = dlg
|
self.page.open(dlg)
|
||||||
dlg.open = True
|
|
||||||
self.page.update()
|
|
||||||
|
|
||||||
def suspend_transaction(self, user):
|
def suspend_transaction(self, user):
|
||||||
session = self.app.make_session()
|
session = self.app.make_session()
|
||||||
|
@ -1003,9 +991,7 @@ class POSView(WuttaView):
|
||||||
on_select=select, on_cancel=cancel),
|
on_select=select, on_cancel=cancel),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.page.dialog = dlg
|
self.page.open(dlg)
|
||||||
dlg.open = True
|
|
||||||
self.page.update()
|
|
||||||
|
|
||||||
def get_current_user(self, session):
|
def get_current_user(self, session):
|
||||||
uuid = self.page.session.get('user_uuid')
|
uuid = self.page.session.get('user_uuid')
|
||||||
|
@ -1139,9 +1125,7 @@ class POSView(WuttaView):
|
||||||
content=WuttaDepartmentLookup(self.config, on_select=select, on_cancel=cancel),
|
content=WuttaDepartmentLookup(self.config, on_select=select, on_cancel=cancel),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.page.dialog = dlg
|
self.page.open(dlg)
|
||||||
dlg.open = True
|
|
||||||
self.page.update()
|
|
||||||
|
|
||||||
def adjust_price_click(self, e):
|
def adjust_price_click(self, e):
|
||||||
|
|
||||||
|
@ -1308,9 +1292,7 @@ class POSView(WuttaView):
|
||||||
actions_alignment=ft.MainAxisAlignment.END,
|
actions_alignment=ft.MainAxisAlignment.END,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.page.dialog = dlg
|
self.page.open(dlg)
|
||||||
dlg.open = True
|
|
||||||
self.page.update()
|
|
||||||
|
|
||||||
def toggle_training_mode(self, user):
|
def toggle_training_mode(self, user):
|
||||||
was_training = self.page.session.get('training')
|
was_training = self.page.session.get('training')
|
||||||
|
@ -1372,9 +1354,7 @@ class POSView(WuttaView):
|
||||||
on_click=cancel),
|
on_click=cancel),
|
||||||
])
|
])
|
||||||
|
|
||||||
self.page.dialog = dlg
|
self.page.open(dlg)
|
||||||
dlg.open = True
|
|
||||||
self.page.update()
|
|
||||||
|
|
||||||
def nosale_click(self, e):
|
def nosale_click(self, e):
|
||||||
session = self.app.make_session()
|
session = self.app.make_session()
|
||||||
|
@ -1497,9 +1477,7 @@ class POSView(WuttaView):
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
self.page.dialog = dlg
|
self.page.open(dlg)
|
||||||
dlg.open = True
|
|
||||||
self.page.update()
|
|
||||||
|
|
||||||
def void_click(self, e):
|
def void_click(self, e):
|
||||||
session = self.app.make_session()
|
session = self.app.make_session()
|
||||||
|
@ -1580,9 +1558,7 @@ class POSView(WuttaView):
|
||||||
on_click=cancel),
|
on_click=cancel),
|
||||||
])
|
])
|
||||||
|
|
||||||
self.page.dialog = dlg
|
self.page.open(dlg)
|
||||||
dlg.open = True
|
|
||||||
self.page.update()
|
|
||||||
|
|
||||||
def void_transaction(self, user):
|
def void_transaction(self, user):
|
||||||
session = self.app.make_session()
|
session = self.app.make_session()
|
||||||
|
|
Loading…
Reference in a new issue