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